diff --git "a/modin-project__modin-6298/docstore.json" "b/modin-project__modin-6298/docstore.json" new file mode 100644--- /dev/null +++ "b/modin-project__modin-6298/docstore.json" @@ -0,0 +1 @@ +{"docstore/metadata": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/__init__.py__": {"doc_hash": "35dff55293c7948978baed25badf81dd54c7f68789fd699c9120b5be94e5636a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_np_BaseTimeGroupBy.setup.self_df_self_groupby_col": {"doc_hash": "eb2181c8c349e50e482130b55bae1a616fffc2628b9c65b56d57225353316011"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByMultiColumn_TimeGroupByMultiColumn.time_groupby_agg_mean.execute_self_df_groupby_b": {"doc_hash": "24fec0029223e83a79d42d23bb754ed6c5491b5b74b0e3735b98f5e557e1840a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByDefaultAggregations_TimeGroupByDefaultAggregations.time_groupby_mean.execute_self_df_groupby_b": {"doc_hash": "53f88103db1f65b54373c9e4c0d26fc40e3dbcc5f0bcd7d366448c6e14acb4b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByDictionaryAggregation_TimeGroupByDictionaryAggregation.time_groupby_dict_agg.execute_self_df_groupby_b": {"doc_hash": "add1556322706e7593d342a3da4510835f69e94e1e17a11c99309df4341da32c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeJoin_TimeJoin.time_join.execute_self_df1_join_sel": {"doc_hash": "43361922651e0524c9ffbf12798b49e06689eb571f727b6ca11307b373129267"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeJoinStringIndex_TimeJoinStringIndex.time_join_dataframe_index_single_key_small.execute_self_df_join_self": {"doc_hash": "db2bd485bb924c085666a62146bfa8234aaffddfb2282e05ba836dd116f32d9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMergeDefault_TimeMergeDefault.time_merge.execute_IMPL_merge_self_d": {"doc_hash": "0c6551415d2fca5e2a21f3f508bfceba14d1ceff9fd7f019a13871bf068d73d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMerge_TimeMerge.time_merge_dataframe_empty_left.execute_IMPL_merge_self_d": {"doc_hash": "488816a444f2b339049c2cada566d317a73bc57bdba43efaee8b63621043c015"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMergeCategoricals_TimeMergeCategoricals.time_merge_categoricals.execute_IMPL_merge_self_l": {"doc_hash": "2f540d30e8b5ccb182d3fd4fb83b6f28830c32de370c7797d4d2089307d532c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeConcat_TimeConcat.time_concat.execute_": {"doc_hash": "cd75fd0a3d459887658137f78ca51e9e5b622fcdce74a6a1471df76bc2b8df3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeBinaryOp_TimeBinaryOp.time_binary_op.execute_self_op_self_df2_": {"doc_hash": "1ae8c235e8f6ec147cc3fad41b8c600871d3d7435fce984a6765a6c77d6cc71f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeBinaryOpSeries_TimeBinaryOpSeries.time_binary_op_series.execute_self_op_self_seri": {"doc_hash": "8e1b3382cec763202461f72e42fd8c36af234279d419423dfbcef5536bfacad1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseTimeSetItem_BaseTimeSetItem.setup.if_not_is_equal_indices_.self.item.index.reversed_self_item_index_": {"doc_hash": "9983fda7a9b949336719c2a02bdfff55f4b15cc8addb65b39acffb283e19882c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeSetItem_TimeInsert.time_insert_raw.execute_self_df_": {"doc_hash": "4e90af30ccad9a540f12676eb01efe2769428c9162b331106af3b7537c0d7c19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeArithmetic_TimeArithmetic.time_transpose.execute_self_df_transpose": {"doc_hash": "8ad1451432a8826f5e6b255a8befbdcb13aa12e20a83fbacd2b2acb6770540da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeSortValues_TimeSortValues.time_sort_values.execute_self_df_sort_valu": {"doc_hash": "76c08d171d4ee18109ec8840431e1690e97c080a4407bb24cb97465eb60c6051"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDrop_TimeDrop.time_drop.execute_self_df_drop_self": {"doc_hash": "60fbfdeccc7fe41f438dee228fcf5cfb077ee7c0e15ed375ac94ff44217a6360"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeHead_TimeHead.time_head.execute_self_df_head_self": {"doc_hash": "a9bb43f0056d560fd90217644a98d4e48fb16f6c446c1eb9de0546fa88176f1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeTail_TimeExplode.time_explode.execute_self_df_explode_": {"doc_hash": "df2da7d3c99dedc7941d4b3c2bb05184106a7609147af435168b11edba7d8540"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaSeries_TimeFillnaSeries.time_fillna_inplace.execute_self_series_": {"doc_hash": "66f2e2e35c0643a5ea64771ca7d836894bd01fb1504cb395dd2a0dff9dc1baaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaDataFrame_TimeFillnaDataFrame.time_fillna_inplace.execute_self_df_": {"doc_hash": "4ad13ff8955008a5268618e158a5ef7623cd2432868b4ad0c4a20f139bd71a33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseTimeValueCounts_TimeValueCountsFrame.time_value_counts.execute_self_df_value_cou": {"doc_hash": "ee8f45ac233dbbfd7fc9bf7ce4d661db5c0cf82e2394629ca03795fab33ed64c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeValueCountsSeries_TimeValueCountsSeries.time_value_counts.execute_self_df_value_cou": {"doc_hash": "404278ef58a6e06f977a8a84b14f1bcd3e47c87e05b415c72b7b75ba5e2b4f2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexing_TimeIndexing.time_loc.execute_self_df_loc_self_": {"doc_hash": "c094991a4349d12b65c9a314ec6247417679c5389fe9599706aa990e2f0438df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingColumns_TimeIndexingColumns.time___getitem__.execute_self_df_self_labe": {"doc_hash": "c75f211355c8062fd4b57d81ba329ba8ac0a4c17213b58db8b30b03513ebf22f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMultiIndexing_TimeMultiIndexing.time_multiindex_loc.execute_": {"doc_hash": "f1e5b20a0adf8076e47feffff63c2b3e39f494c4fa11042e434fe6861afe9ccc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeResetIndex_TimeResetIndex.time_reset_index.execute_self_df_reset_ind": {"doc_hash": "11a4da8c1cfcc7a17ff603005167798eb31e283cd4b76506395fcf082fb1eb62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeAstype_TimeAstype.time_astype.execute_self_df_astype_se": {"doc_hash": "935d5d632a6d716a10516aa7a7a9264af275d1195ab85563f5547eab70081357"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDescribe_TimeProperties.time_index.return.self_df_index": {"doc_hash": "b2f8d384c92aad3ab6869afa71b1796d1be452b9d036570f88040820987eb8eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingNumericSeries_TimeIndexingNumericSeries.setup.execute_self_data_": {"doc_hash": "f3289432ab9d9eddf875faca684e03c5005f967c9084d9dcf32a2c8faafd922f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingNumericSeries.time_getitem_scalar_TimeIndexingNumericSeries.time_loc_slice.execute_self_data_loc_s": {"doc_hash": "e50bcae41aaa5801243e3557639677c6058137853ce7c8d58261537311384041"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindex_TimeReindex.setup.execute_self_s_subset_no_": {"doc_hash": "8a073241588d5a0f4c828117ed999d5cfeadf0bbf8a91aef8cc0c70611a6be1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindex.time_reindex_dates_TimeReindex.time_reindex_multiindex_no_cache_dates.execute_self_s2_subset_re": {"doc_hash": "cd0b297e5dd7a4da36f9e846b5c0342259516e0f114f531c92cb4e128107df84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindexMethod_TimeReindexMethod.time_reindex_method.execute_self_ts_reindex_s": {"doc_hash": "c2efd56aa8fe8dd96ae9bfd47155d93eadb191f5effebb2d098fe91f55a98025"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaMethodSeries_TimeFillnaMethodSeries.time_float_32.execute_self_ts_float32_f": {"doc_hash": "489796ee07619c761daaf1809e1665b7cc61f55cd08073372ddacbb764443ae1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaMethodDataframe_TimeFillnaMethodDataframe.time_float_32.execute_self_df_ts_float3": {"doc_hash": "a4eb232d4d24310f4818bc328474af835ca3da076d279d1a9b925f39d2eceedf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeLevelAlign_TimeLevelAlign.time_reindex_level.execute_self_df2_reindex_": {"doc_hash": "f8688b8e4261e9d7df611a2aee71223e78e3ae7f3f4aff3684cb40f4d70f233d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDropDuplicatesDataframe_TimeDropDuplicatesDataframe.time_drop_dups_inplace.execute_self_df_": {"doc_hash": "29a2a993265214eb41326a4d0471b5e78dad0bb251657d3f72722546293b68f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDropDuplicatesSeries_TimeDatetimeAccessor.time_timedelta_seconds.execute_self_series_dt_se": {"doc_hash": "abf040832e450ef1823aa86df4420c742c57bf5605721f40cf7fa4c26b1374c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseCategories_TimeMaskBool.time_frame_mask.execute_self_df_mask_self": {"doc_hash": "cad3c116b55a3e90f0e4769d56d1504545e8ed070e7459f0929ba71da1407fe0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIsnull_": {"doc_hash": "3cc18c3729fcf2ae7cc7b4d7d1214bd3888f767cad605a360fdeefc3c781868d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/__init__.py__": {"doc_hash": "0d4929b6a45d303ea3293c43d175d041b470ed9a1130ba3592d6729348429621"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_generate_dataframe_from_benchmarks_import_": {"doc_hash": "a4e062b7b26628e41fc0663ac7fde72776472f930aa586133a23eaf0966b0de8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeJoin_TimeJoin.time_join.execute_self_df1_join_sel": {"doc_hash": "3ba74f2a368bb8c94c639c0504a7f944a093f129ca0d273b32d4267ffccb5705"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeMerge_TimeMerge.time_merge.execute_": {"doc_hash": "26f03a7fb9bf312c1ee2631046970bd45978177a05dc5a0265b802966a83383c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeBinaryOpDataFrame_TimeBinaryOpSeries.time_mul_series.execute_self_op_self_seri": {"doc_hash": "89dc0f8e34a73ebf8eb6ef2c77401098d114395a387fe531b48f6829bc0abfc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeArithmetic_TimeArithmetic.time_mean.execute_self_df_mean_": {"doc_hash": "a970927ee0811a3d22613bc03091e81d5e240acb1533db70424aa04be3162aaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeSortValues_TimeSortValues.time_sort_values.execute_self_df_sort_valu": {"doc_hash": "446182154d4e0829d1b19d37e08e509fb4a1a6e3e2f77e46357bc37460f7c890"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeDrop_TimeDrop.time_drop.execute_self_df_drop_self": {"doc_hash": "98572b505ffa95389570fe21ef55cf78cf1477d9d6d5e8d3fe888ee9ec57e6be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeHead_TimeHead.time_head.execute_self_df_head_self": {"doc_hash": "fd578fb4825da18360b6ad94c9ba2a50f5a678a67bb7fe0ff4bbef2efc66b935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeFillna_TimeFillna.create_fillna_value.return.value": {"doc_hash": "8cd5be26c1306b96410a25fcabe0cf2a295c9c5ce2e677f1f80a02b8047347f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_BaseTimeValueCounts_TimeIndexingColumns.params._": {"doc_hash": "31fa991cc9de835af538fe2abdfae36e3ef1b1cd6dc012b01e2f96fa5a9a5aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeResetIndex_TimeResetIndex.time_reset_index.execute_self_df_reset_ind": {"doc_hash": "8907bcef89116a03852bac298ee05ea84a07054bd70d4c99d7f398b14f839bf4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeAstype_TimeAstype.create_astype_arg.return.astype_arg": {"doc_hash": "01abdfd35cffe4298bb436b7e475c509aa0c0ce9d7594e21f8b04ef421eda629"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeDescribe_TimeProperties.time_index.return.self_df_index": {"doc_hash": "eeaa7a3b79a7a2c322156c58355f3f62a3cab8ff5cced1fe28871f01fcb03c9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_BaseTimeGroupBy_TimeGroupByDefaultAggregations.time_groupby_sum.execute_self_df_groupby_b": {"doc_hash": "b8695d2cb034c7b4ee637586839db0d511b67e8addb883e01e3a460ad75a6de1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeGroupByMultiColumn_": {"doc_hash": "8b6fab2947bd959b8758638d27d3c7aa61e1ae13d151d77445b21f113e1f4e08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/io.py_generate_dataframe_": {"doc_hash": "7aee72b28de095f085ff27dd496fb581ef3f09e16d1ba53b90ea258f7f81bd99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/utils.py__": {"doc_hash": "6f7b313316d9995f2b6ab00b324e60c98daa63cfd693a38f141f989589d88b2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/__init__.py__": {"doc_hash": "3ba26877e63f84d97de2fab832a48f9bf46e6e3063a9b32b32ca8d0a0da403d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_np_BaseReadCsv.setup.self.shape_id.get_shape_id_shape_": {"doc_hash": "dfed0aa4b4389ddd8b626a488b825d18f201f05ed4147a47517045e6ba0f7ff2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvSkiprows_TimeReadCsvSkiprows.time_skiprows.execute_IMPL_read_csv_tes": {"doc_hash": "1a0a80e25ceaa3b57fe65beb0ff63dfe728a8aa4afe5d6a6580131e4fbb5c413"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvTrueFalseValues_TimeReadCsvTrueFalseValues.time_true_false_values.execute_": {"doc_hash": "30fd9a77a663aaef12d353ac521a017adf4cda22962b18af15ec61524c82d041"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype_TimeReadCsvNamesDtype._add_timestamp_columns.return.df": {"doc_hash": "4f716019f68b5c945bb66ac877fedd1a688324620e7601b0c24a1d356642ccb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype.setup_cache_TimeReadCsvNamesDtype.setup_cache.return.cache": {"doc_hash": "4d96255da9a9e411906675c8fd1009cf852399fa82a5ec12aedc860361e1d6e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype.setup_": {"doc_hash": "7f911c3e24806c7bd7489472da91db943581a14289389cd81160908860a133ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/parquet.py_ASV_USE_IMPL_": {"doc_hash": "a384b5d6bf47fd5fc10d02ecc8694185ac4c6264916acc797e1f1870da59c8be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/__init__.py__": {"doc_hash": "0c26b858c80050aa14767fdb27e1f4456bcb619c89eaecddc6ceaa00652704c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/scalability_benchmarks.py_pd_TimeFromPandas.time_from_pandas.execute_from_pandas_self_": {"doc_hash": "95c3be948b922ac91caad8db7907cf103ea4ff828a198721e7f9c781ec88dad2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/scalability_benchmarks.py_TimeToPandas_": {"doc_hash": "2f96df7cc1ebede7a573d7ec690476ae90f1371802c0099b9c1ee9eb4c0ab3a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/__init__.py_ASV_USE_IMPL_": {"doc_hash": "071f251bfad603872e9803fe343a242873e912767aaba460f2d733b65ed9bb47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_logging_IMPL.POSSIBLE_IMPL_ASV_USE_IMP": {"doc_hash": "d5053c79a24b243a0612f5d57b0c9a084d1f85e4d3499ea013dde602eea8a764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_translator_groupby_ngroups_dataframes_cache.dict_": {"doc_hash": "8742b7e34e5ee7d8a0bdf011349cd82495a199f132efa18e6e9c475d324503b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_nan_data_gen_nan_data.return.data": {"doc_hash": "923d5e0c97a2b3e1dd0a1d07ddf4adb8da10a9c31fb252cfb14deee0cc06cc65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_int_data_gen_int_data.return.data": {"doc_hash": "abf6c423025565610068eec012b49f7b79a949a7b9027625a518a9a7d6b1b43a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_str_int_data_gen_str_int_data.return.data": {"doc_hash": "402c8fafa0790683656044730606bd6bbc3969255762f07e8a59769f28645605"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_true_false_int_data_gen_true_false_int_data.return.data": {"doc_hash": "de8e4783722a41aa65727f8c0f6d4c44cb671920d8fec17f0cf5a38209700c28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_data_gen_data.return.data": {"doc_hash": "ea5b3028ace1f0d4fef6c8dd20c6078a6c1aff5a5d0cc4879a4e18a7d34d875a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_generate_dataframe_generate_dataframe.return.df": {"doc_hash": "b0a151285c9c0dcbdee567c149d0050c1401ca602c507b524334e2d2db577500"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_random_string_random_booleans.return.list_np_random_choice_Tr": {"doc_hash": "395f880c4e24deeaebfc6cacb10bcf3cc9f06cc8fb9a6d2e886441270a186121"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_trigger_import_trigger_import.for_df_in_dfs_.None_1": {"doc_hash": "7230f7847435792f7d30157c647569bef56fdfb346d704967d5181bbfd36267e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_execute_execute.if_ASV_USE_IMPL_modin.elif_ASV_USE_IMPL_pan.pass": {"doc_hash": "ef0aef02490419e8f944108908971a429699f659e5bf97746330003725506357"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_get_shape_id_prepare_io_data.return.test_filenames": {"doc_hash": "1d677be88266a80e43fddb692de471124de1ceeb4ebe71bf7fd0e052fef7de98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_prepare_io_data_parquet_": {"doc_hash": "539483a1c3e290336ac13465338086781066cd2c9e5c86a671461f0a2e4b779d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/compatibility.py_os_": {"doc_hash": "0f0daeb185bf1c3473bc352ffd1cd171629c78cb27d2bd30d0db5441a024c961"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_os_GROUPBY_NGROUPS.DEFAULT_GROUPBY_NGROUPS_A": {"doc_hash": "92a41b13bb90ee83a36314817d84d8c423ce88c1d8c7e6a230501434695f9f2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py__DEFAULT_CONFIG_T_DEFAULT_CONFIG._": {"doc_hash": "c458ab725a858ef21c4c7d0d4159a3004f37edd2b814ccc1d5912bd43aac024e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_DEFAULT_CONFIG_MergeCate_CONFIG_FROM_FILE.None": {"doc_hash": "129b27997ef1fd6beaaa90607b04cde8fec39749959dc4f535f95c4f08a3d23a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_get_benchmark_shapes_": {"doc_hash": "a3d788645c3af2d4b97d9f4659584d879648ffd1678c140766cf1205c56eeafc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/__init__.py__": {"doc_hash": "ca4c5b9258f3c2e76184a2140092bc345953d97a4fef983ae7799e5418fece71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/test_utils.py_pytest_test_get_benchmark_shapes.with_patch_builtins_open.assert_result_1_get_b": {"doc_hash": "bc7e2cabd400535f0aa5b90b69c27c081e2f9b9a368239a4edd3e662ec2f3e65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/test_utils.py_test_get_benchmark_shapes_default_": {"doc_hash": "096352f53cee94f6ca958ed32b95f46f4ee1d5e63f78395c553072462967c0d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/ci/teamcity/build-docker.py_os_": {"doc_hash": "67a0b162f7f193935fab3029b795f01866d1dd09ea327b33247aeed32b6ab0e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/ci/teamcity/comment_on_pr.py___": {"doc_hash": "28979b07fa5679c0253ade16d882cad3b328ade5f2a755852764f57321a3c0e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/docs/conf.py__coding_utf_8___The_name_of_the_Pygment": {"doc_hash": "1319d8d93618a2bdd4c5048e5a7ef01c7fe2f9a7bffcd6ee67f69153d940309b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/docs/conf.py_pygments_style_": {"doc_hash": "612f3e89e8051f646ef79129602db2bdcb582c33a48e908bd20cda2d50f358cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/experimental_cloud.py_logging_": {"doc_hash": "2a64880a22d78d6db4b77b476536bcb92a208166e605770dba855c43fa831fed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/h2o-runner.py_pd_": {"doc_hash": "b61b66546f8c911bf8f9c4b0d254c76e6931b256048170af63ad577e106c4637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/taxi-runner.py_sys_": {"doc_hash": "4036cfbb78188e55c853d5140f4bff19d22dfc75cd90cc7c56a673e35942b5b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_sys_read.return.df": {"doc_hash": "94b33b9758d4e4240ce1287eecf707c46793131aec956db7dc8c04e17490af58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_etl_cod.return.1_residuals_total_": {"doc_hash": "0bee8916d115bd9b230a29ad771cd48a390dfa0dcf31ff4b75bd708cbee16188"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_ml_ml.return.ml_scores": {"doc_hash": "2f80b9f539d175fb5c3ebe4aac784c67d18272e502dbb291e2f616e5d10452c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_main_": {"doc_hash": "7929bed76887d8dd3a6987f1553d4f0d50bbeb71440708161d961bac1399fac8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_sys_read.return.df": {"doc_hash": "5643a3985e7835ddaa8707222e6524b345d4d4dffaa5946b677966bd0abc486d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q1_hdk_q3_sql.return.query_sql_trips_df_": {"doc_hash": "755d1e12f3a1d0696ba268da3b20787e5eeb7a663e616c2bb39024ea54445cfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q4_hdk_q4_hdk.return.q4_pandas_output": {"doc_hash": "c9054981aefbc400f44777d2e6889bd11e147a701528285b1a86a08ea006527f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q4_sql_q4_sql.return.query_sql_trips_df_": {"doc_hash": "f79dcbc94ac16ca5218469d63c70b1437bfa993cf077e82674dc6dc349b669e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_validate_validate.df_equals_hdk_result_sql": {"doc_hash": "d693f1d4fc19f01c1ad69b62316032a0c72c3c0e2604bc03763d9c6a3bfaf102"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_main_": {"doc_hash": "df4fcc004fb83c9e189669773816f64e33e297a0077c400ea418ee8ebd56702a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_sys_create_dtypes.return.dtypes_meta_dtypes": {"doc_hash": "a84f3b79e644ca483124f9b93687807e3daad13d544715786e6a0f4718183d88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_trigger_read_op_all_etl.return._train_final_test_final_": {"doc_hash": "7afdf87fcc6eb77bdc416d6f79374dc9cedbc6b15334ede9eff87d24740987f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_split_step_split_step.return.X_train_y_train_X_test_": {"doc_hash": "9219a7f996f9067c66d8b21ff0fc2d61abbc2c8148f6a643a7769f2823b55944"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_multi_weighted_logloss_multi_weighted_logloss.return.loss": {"doc_hash": "7ec2d46cb1ceff7f02881856c0bb45d5b5ad1db4e32d3bafff5af8b9c0f8ce8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_xgb_multi_weighted_logloss_read.return.dfs": {"doc_hash": "16337f0b0756f19592f6881b656ce0d1ff32b43714cb941c22e219ea2ad15667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_etl_etl.return.df_meta": {"doc_hash": "d44b5dd77da9b5e11817e96ac9db7a171ff62953d41d6bb449253e131291490e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_ml_ml.return.cpu_loss": {"doc_hash": "8509031552fc2f2a402d3ddc88011ec1e7c196ffee165cd0a073befc4f1da943"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_main_": {"doc_hash": "be211e503b6e04ac7a116cdd1dcfda256e427fb7f9f3f2e8779fd4853ce5bc21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/utils.py_sys_": {"doc_hash": "219a27f79d86b2d9d26c1e0b27d07a9d2e6ed3f989ead8922b0940e29b7e61cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_sys_read.return.df": {"doc_hash": "19674995f03f91ab25d86515450f669d460034841ceb36a3a18f8cd0f5158c90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_etl_cod.return.1_residuals_total_": {"doc_hash": "131211e866172c876bfdd4d4cb5d1936579d3d9ab805f49ae9e9e233bc97c0af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_ml_ml.return.ml_scores": {"doc_hash": "4b01a027586b59df8aa3537dd92a11cb1351d72a73e7a37568d191ab0332abfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_measure_": {"doc_hash": "614835ed870860f65976f8aed981c96cc7a83f7ca46fe8e3d7703514a36a0f56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_sys_read.return.pd_read_csv_": {"doc_hash": "89b423327d27e1501210393e16a1b5b09a5533724c35e27db72b1604d66a4084"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_q1_q3.return.transformed_groupby_": {"doc_hash": "4d55a103d14647ce775cc9ea2b285db5c98d70dd3e2a07768213108c1d9f40e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_q4_measure.return.res": {"doc_hash": "a0e64a8cd21d92e12261fa34d70c49ac43069e5ce36212bbf37e3673477dc0bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_main_": {"doc_hash": "089884dd2c6768052aa3293d4259d5cd3f73d0e7178fd6063a96d1ea5211e582"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_sys_create_dtypes.return.dtypes_meta_dtypes": {"doc_hash": "52abc0f84a1ec00b083f8bd721ff150c3105d99ff1009b610a834b218683e7af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_ravel_column_names_all_etl.return._train_final_test_final_": {"doc_hash": "6b439518443d2d123b75dcfbfce7eee7211199598156183910e8101ead65e806"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_split_step_split_step.return.X_train_y_train_X_test_": {"doc_hash": "2d92f48e14ad801702323697eb238817d3a0ecfece9fd5e5f4f9b82d39e1cdc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_multi_weighted_logloss_multi_weighted_logloss.return.loss": {"doc_hash": "5daa9fe30208fdb6bf111487ab856b6c64ce09d3dfa5572db6fa9d25c16ea702"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_xgb_multi_weighted_logloss_read.return.dfs": {"doc_hash": "5350932f2949feceefd718538c6862370006223a9754224cf773b631438e27e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_etl_etl.return.df_meta": {"doc_hash": "c62e47436271c62dbc2a1ebf3dcbbed11013a2d44ce624bd6849067654949ad0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_ml_ml.return.cpu_loss": {"doc_hash": "0cbdc7d7bddd9ad79a72a8b59a3636ce8cf6eb84996bffcd0a34ff42bb311542"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_main_": {"doc_hash": "699347314d5b6f52931789443e48e0a610c1291b44524634cbbf5fb45150d3fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py_os_test_exercise_1._execute_notebook_modifie": {"doc_hash": "88a434532c4a2d20eca7daa85644c6fdf792673347a24f5fc4aa9d6b9068961a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py__this_notebook_works_as_": {"doc_hash": "16ab7bd12d1cc195fbe39e0ce4242ef5adaa11382cef801e360da1f85ce3cd6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte": {"doc_hash": "e43699a0a06b3f5e80ba3a9a4b4da3d3543ff72177c44feaf8c67ed628390c7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie": {"doc_hash": "381b184e807fa7d89cf29524c2b1233736e0b5c5eecce51bca343395a860b61a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie": {"doc_hash": "bb0b15f2557e8d22eb0400717c83d9961cee3ee48ce501e2d7810bfcc9b44c79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_None_15_test_exercise_3.__execute_notebook_modif": {"doc_hash": "841021e909eb5d882a0499e284c554afc2b321ff0f412d6aa1422740bf5e1efb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_None_17_": {"doc_hash": "d06e628f3b7e1b49838e79b2d0ae7ae9df7e29c3b080fbbcb26ee0cdd1739507"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte": {"doc_hash": "3663b137f8cf8b5f463319388a31a3de19e0b81410f15f1d673365dd7410aaa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie": {"doc_hash": "bd066c4d54abe343d810b8349c1d257765e30b39c1071a388f6cf6601cd18ff7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie": {"doc_hash": "a3f1575e35dbe361dfcc5bf066d6313d5b4e9ad3b81d1b223c23b295043fc2ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_None_15_test_exercise_3.__execute_notebook_modif": {"doc_hash": "7a4aae938a0317909186bbc18ae65e13b99866fd396a3376cc30114a3ee736c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_None_17_": {"doc_hash": "6140216fdec6b073938a7929671d8a21cdd08907a67f4e09294c5725da310bc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/setup_kernel.py_sys_": {"doc_hash": "e45cfe4d113bf03f685c2b43ff2650b9b7a6a4c49751c12d1e549a377ab5fdda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte": {"doc_hash": "7d4441941c93697e919afd9a8c2ae0652f6d31c5164d8ab24ab510a7e299b2b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie": {"doc_hash": "899688140fe992650947a213d7db3955449590cd723258e16e6f9e8b0733f5a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie": {"doc_hash": "dcfbdef5be3c1f1fd21da2245d5fb50dcfb98d6a795bf2aa7aec330ff293ac40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_None_18_test_exercise_3.__execute_notebook_modif": {"doc_hash": "6cc71ce8532d34673c37a53d921201196a1bb2c13e857d363e39d890e880a0cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_None_20_": {"doc_hash": "067cedc64ead6682791c19c1ee5f284331d31996946967a0c02556c3d5322d18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py_nbformat__execute_notebook.ep_preprocess_nb_": {"doc_hash": "b8e853c1f4ce434aeef677dba14af234bf8efb45a2634686420bcc29d5bc4501"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py__find_code_cell_idx__find_code_cell_idx.return.import_cell_idx_0_": {"doc_hash": "fc738bc837928deb7d859d8408ed360a0ae0eeef002a30e3d2f2e891e2e9ee29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py__replace_str_": {"doc_hash": "064089424920d7a3d0948cf5c65e1490f3b7c10da2c76fa01ef2659ea2e84a7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__init__.py_from_typing_import_Any_O_None_1": {"doc_hash": "2bc39496f87762acba6dc275b2d38e87a25812954d0d8d670a8ad3d697010b3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__init__.py_set_execution_": {"doc_hash": "425f92c67a02f41e8a4240d64ab0549ab97728a120b28f95e2bdbf6b8284b038"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__main__.py_argparse_": {"doc_hash": "462580138c6348c55ec2309c7ec4953c20792712e0e0fb249511d090390b5517"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py__This_file_helps_to_comp_VcsPieces.Dict_str_Any_": {"doc_hash": "005dfa0ba18b886a88fb255ee447b486a18716689e51addc38f83e1ed4bfabc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_get_keywords_get_keywords.return.keywords": {"doc_hash": "8f3acccaf5cf18e630b6e9e16de99c8dff35559d7fbae5850dee25443116ad38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_VersioneerConfig_register_vcs_handler.return.decorate": {"doc_hash": "09542c0071c5c6fbb0a77a837fc1a54ca111bc5a94ff452b996690f23898f64e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_run_command_run_command.return.stdout_p_returncode": {"doc_hash": "109905d25b25bd1ef2134d5399099ba7c646f45d1f104f8d7ada99e2d23533db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_versions_from_parentdir_versions_from_parentdir.raise_NotThisMethod_root": {"doc_hash": "deb52398ba0a0619097e7f00ed137328691bdb6671c74770cef8c7e045707192"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_get_keywords_git_get_keywords.return.keywords": {"doc_hash": "3bc45b04502020d1ec92e2c17c7e815a140258ca4b027b0c8f4c49b5f6bedbaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_versions_from_keywords_git_versions_from_keywords.return._": {"doc_hash": "2475c88001f7ceb3e3bddbcda382082a360b601fd4008236ef09bdd4fc8b1701"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_pieces_from_vcs_git_pieces_from_vcs._now_we_have_TAG_NUM_gHE": {"doc_hash": "0059a6868d3fc3ef7e645939c85c986ff0c26cd80c73c55a518e7138c1d9f0cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_pieces_from_vcs.if_in_git_describe__git_pieces_from_vcs.return.pieces": {"doc_hash": "a6c6aec3a52e1b7e02fe74a3416266c729b281200812b592271175b0c625f3a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_plus_or_dot_render_pep440.return.rendered": {"doc_hash": "f56558bb77fb4341755ea63ebae12dfe78c1685cf9da2c1bcc29b3de81234461"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_pre_render_pep440_pre.return.rendered": {"doc_hash": "a02e30031f744b0a0dab03ceb6adfc9db100c6dd806d09cbf1c4468574b1e04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_post_render_pep440_post.return.rendered": {"doc_hash": "fb87939b501aef168724f468a1c123bef1b771bc9c043eb22169ba9f232e8ec6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_old_render_pep440_old.return.rendered": {"doc_hash": "a6a42572e6c40ef06662b83fe73a2f9b044fa304b588d37b7204a433383da1f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_git_describe_render_git_describe.return.rendered": {"doc_hash": "05c17fb1d247f4328426ffd605ea00d5ed9459aa6f48ba67e651adebb94997d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_git_describe_long_render_git_describe_long.return.rendered": {"doc_hash": "381e72938fc839999b63c1df69f8027edb213e2762ae01ff0bf9943f5469e4ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_render.return._": {"doc_hash": "92ac81a4502dd36ec032b5698c2a0692bde5480a80a81bddf56bc48b51636f7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_get_versions_": {"doc_hash": "1d5bedb336064fde1792eda7b9c599705c794b6627636c11c636cb63d32c2991"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/__init__.py_Parameter_": {"doc_hash": "7603ea40ece3d7d8cd05ca189e9faf2a67dbbc7f8260f79e3f3c2037a42e83d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/__main__.py_from_textwrap_import_dede_": {"doc_hash": "fe2b1fdc1c4c6f0a805574f81354b5f5f2396cc6607ceacb9efd92523f643eb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_os_IsDebug.varname._MODIN_DEBUG_": {"doc_hash": "e3927dcdb1c240d58a626e658928fcdeb467d88650c2b77076e217fe86332075"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_Engine_Engine.add_option.return.choice": {"doc_hash": "7d57d4160ce02aec451e20631f14667c6605ccd41962e1cfe84f2b7a3d61db5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_StorageFormat_Memory.varname._MODIN_MEMORY_": {"doc_hash": "0c0e22919d2f0017f973947ec7a784be3182182e4665bde798bbfece7b2700c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_NPartitions_NPartitions._get_default.if_StorageFormat_get_.else_.return.CpuCount_get_": {"doc_hash": "2d8ff68d79670f37bb224ac09acdfb91436e200b368db7a8d98c81c687057dc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_SocksProxy_AsvDataSizeConfig.default.None": {"doc_hash": "b5b854a8c13c4a9f4bd81aa0a7584c382dca3afbdb8f42e47c2cb1006d3a0575"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_ProgressBar_ProgressBar.put.super_put_value_": {"doc_hash": "372f07e56d64f470ed06f4fa2364a73c07ebfb99fe5ab63ccc05d0c7f7eafd2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_BenchmarkMode_BenchmarkMode.put.super_put_value_": {"doc_hash": "aab7981a99a8754042dce889e97e5ef7eda4549ffe271b7de72c0bbe7e34337b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogMode_LogMode.enable_api_only.cls_put_enable_api_only_": {"doc_hash": "3e8dd29c62896c4bf596c841217386650344f77f41ad9e5a65387e12a1d54c06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogMemoryInterval_LogMemoryInterval.get.return.log_memory_interval": {"doc_hash": "060399e09640eb334b3346dd36ee9e050517d682f0f2aab7a7e1782de1f044fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogFileSize_LogFileSize.get.return.log_file_size": {"doc_hash": "2e2deb4280705cbf5cbedaf28c4ce32de2453b24a0dd26e731e227337e48b507"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_PersistentPickle_HdkLaunchParameters.default._": {"doc_hash": "26154f023c20e35b2a9af55d8dadbb879dee113900b99c1815a441ac3feaaf1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_HdkLaunchParameters.get_OmnisciLaunchParameters.varname._MODIN_OMNISCI_LAUNCH_PAR": {"doc_hash": "d16afdb9345e659165af35c1c3debfaa95d234009afbd9f2509c723012c8b49d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_MinPartitionSize_MinPartitionSize.get.return.min_partition_size": {"doc_hash": "98ddc79a3e0bcb15022b188b5f86051845245229d14d560b0183254e1e775cf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_TestReadFromSqlServer_ExperimentalNumPyAPI.default.False": {"doc_hash": "f56188a4f3d9230cf609fab1620a735ba5349b44a9b8fb64e62aa7fb822be871"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_ExperimentalGroupbyImpl_ExperimentalGroupbyImpl.default.False": {"doc_hash": "05501b965fb52b4b2199badecf62fed2b87150681030f6729c6436e00450b2f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_CIAWSSecretAccessKey_ReadSqlEngine.choices._Pandas_Connectorx_": {"doc_hash": "f0cdfd6deab8178cb585bd6585cf5d850119c85616d061dc97bc611d2c34d4c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py__check_vars_": {"doc_hash": "d69398907b259d9670e403baecef9511228e439a5c7ea90a68493e06d6b940d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_from_collections_import_d_TypeDescriptor.help": {"doc_hash": "1815519542f2166aaa7efeb568009038ede6308c6c7aa95455d24e5d41a42ae2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_ExactStr_ValueSource.GOT_FROM_CFG_SOURCE.2": {"doc_hash": "f55d2e428bb1c8dd527c3e91516e39994330651baea49eacf049895999af120e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter_Parameter.get_help.raise_NotImplementedError": {"doc_hash": "b01885571f49dc6eb2f3479b62cce5c6f7aa8689dec5eaaeea7c6757f380f5d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.__init_subclass___Parameter.__init_subclass__.super___init_subclass__": {"doc_hash": "c131b304b3302539c89e16ea964a7a7cfd51538eac86406c3189e01a26811a45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.subscribe_Parameter.get_value_source.return.cls__value_source": {"doc_hash": "0b2d2a2d812bc77389aa4e702df51d76a698b6fdd0f44292c01d1a7abbcb56a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.get_Parameter.get.return.cls__value": {"doc_hash": "b5ab7ee723ae1d88eeca87ba80e3a0e941b2f285cdf9fc7382e5611775261ec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.put_Parameter.once.if_onvalue_cls_get_.else_.cls__once_onvalue_append": {"doc_hash": "deccf3c30ca065c8c5974220e5c2841618b5b8e1208fbdecbfb6722058d072e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter._put_nocallback_Parameter._check_callbacks.for_callback_in_cls__once.callback_cls_": {"doc_hash": "35b25f34126b157732e33debe30fe6ee2ac88e1d3cece11e73c3a53446a2ca42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.add_option_": {"doc_hash": "754ab79fc6e652622a58c18f078d5047ac700057a6b589dfa3795797ca64dbcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/__init__.py__": {"doc_hash": "b88bf38e2252f7e88b7d5e3f930cda0766f724d31a59a546a02ca99e908307ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_envvars.py_os_test_custom_help.assert_custom_var_in_ma": {"doc_hash": "a445a69729d8d6aaa704492f3307396965ffaccc47f226b00570ee9d02555699"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_envvars.py_test_hdk_envvar_": {"doc_hash": "e7af794d520729be9169b6f84bda59b3b2231388d181419dde6a6e6fa1efa8c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_from_collections_import_d_test_equals.None_1": {"doc_hash": "1e48d9956b60c61b7d478db78eff12b353d5ec41ff969a6c8a6ae72e09889575"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_test_triggers_test_triggers.for_name_val_in_expected.assert_results_name_v": {"doc_hash": "2e5abb975d9ffa2ea217ec61e81f57cedb601b5e8e4c4c8ac587b94f6ab05be2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_test_validation_": {"doc_hash": "b1b7a0cfc62b10f2485b06713e24c33dbe33b3561b968854a7da2986c0db734d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_boto3_from_modin_pandas_test_ut": {"doc_hash": "f346d1e5e1eeb9b8144ff4768bb2ae6e0eec5ed598c5562e5d72b30ad190c2da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_addoption_pytest_addoption.None_2": {"doc_hash": "ce25eb12b25c11b106598a960fe1b2280710a64b93e7e800616d98a9aabca1f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_Patcher_set_experimental_env.IsExperimental_put_mode_": {"doc_hash": "0f90e744b6ad6609e20b2c74a592eb0be1891861ba66458bd318e60e748c6b11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_simulate_cloud_simulate_cloud.with_create_cluster_loca.with_Patcher_.yield": {"doc_hash": "876c760157f31f2b1469c3e73b4462181f1bea393230a223459a7158851b2d4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_enforce_config_enforce_config.PatchedEnv.__check_var.if_name_upper_startswit.if_pkg_name_startswith_mo.assert_any_": {"doc_hash": "a8ebd8f3db9f5bea5a6fea2fbd6ffd73429351cb9275813d6c1f4db35b8bc42d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_enforce_config.PatchedEnv.__getitem___BASE_EXECUTION_NAME._BaseOnPython_": {"doc_hash": "6e49ca59929f299fe2546b0a5226a1b4bd5fe7b7fabc44a21249d5efedd92604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestQC_set_base_execution.modin_set_execution_engin": {"doc_hash": "21e88ea29830325b1195ea78e462a0f01a6dc0cd47206771931258b72a3824a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_get_unique_base_execution_get_unique_base_execution.try_.except_AttributeError_.pass": {"doc_hash": "a6aec8727f7071432864ddd42110fd0a752bfa9810dbe54df27477dc29c7e7f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_configure_pytest_configure.if_execution_BASE_EXEC.else_.modin_set_execution_engin": {"doc_hash": "b8d25062302650c4f4c4a540a20fe4b5e790785710134c71c07b647e5dd3bef6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_runtest_call__doc_pytest_fixture._": {"doc_hash": "ee3c01590660ca844b760cc6dfe2d8ff73be874f2c377db207681b82fc8db490"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestReadCSVFixture_TestReadCSVFixture.teardown_test_files_filen": {"doc_hash": "eb1670cecaa745e6bdc1ab734586bf6c3b9cf76a336a53bb54ad1a420b634caf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_csv_file_for_file_type_in_json_.globals_fixture___name_": {"doc_hash": "f4f824cee28a579b6e22e38a602f16a5f49685bd1e7675c9c0629c9ed0173eb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_parquet_file_make_parquet_file.for_path_in_filenames_.if_os_path_exists_path_.if_os_path_isdir_path_.else_.os_remove_path_": {"doc_hash": "a6f6d4f1964c5c148b6e63678f53fa4a7c7fc9dff22b20219f93dcb1edde94b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_sql_connection_make_sql_connection.yield__sql_connection": {"doc_hash": "c048595e3cc8bfebc6c4f9cce2730890ea5e3f84e5f6241c38972277fc19a6a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestReadGlobCSVFixture_TestReadGlobCSVFixture.teardown_test_files_filen": {"doc_hash": "c7f80089a4470aaa60b35df57da62029c3c3b6cbe1565a916fbf60dffe0edf99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_get_generated_doc_urls_ray_client_server.None": {"doc_hash": "6618eeab451108fc3476f88e075323f77e317d16e115355cedd9cccbaab325df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_sessionstart_pytest_sessionfinish.if_TestRayClient_get_.if_ray_client_server_.ray_client_server_stop_0_": {"doc_hash": "cc9776f59b80f84d124e64f63f484a9e4b075ee127d56c55629eb8c380d3d55b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_storage_options_s3_storage_options.return._client_kwargs_endpo": {"doc_hash": "cb9f3a69a8c5a345616540ceaf614fce96175a04f3ef24509043c17a02fec2c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_base_s3_base.with_pandas__testing_ensu.if_GithubCI_get_.else_.with_subprocess_Popen_.proc_terminate_": {"doc_hash": "89bc6b50ff2615072ebf9f752cff3d2b77b2e076729ef59b9cb93fd1a1d86334"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_resource_": {"doc_hash": "632c726c93cebfe8170ad1f410bbe4e179c0c21de453a1ce708d2f57e873a92f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/__init__.py__": {"doc_hash": "a6a790b73a038561c3e422fe11d5d9954ea37c4532917bc9d1215fe0745d872d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/__init__.py__": {"doc_hash": "d6e8ee859e83a85d75b53e826b33f4b4bf1002ccd05f5255c67db73265f28cbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/__init__.py_Operator_": {"doc_hash": "cb6241b1ff0e571c3ca7177b5afd48f0388693dd5488893f4b1a785a7a208201"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_np_coerce_int_to_float64.if_dtype_in_np_sctypes_i.else_.return.dtype": {"doc_hash": "4c149139f79b3171795ed9397f487e645d66fd5a89282df7cfc54ba7c02ed1b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_maybe_compute_dtypes_common_cast_maybe_compute_dtypes_common_cast.return.dtypes": {"doc_hash": "dc5a3f17e4d3348f9c2ab1cbbbbe3aeb472bb5bc0dfeb6043df7f96c05368d0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_maybe_build_dtypes_series_maybe_build_dtypes_series.return.dtypes": {"doc_hash": "0dc6259ff8881b3fff3a8f0b5c831aefe2d5966bee8f985a1bc5ff261877ed36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_try_compute_new_dtypes_try_compute_new_dtypes.return.dtypes": {"doc_hash": "b30ee298ea11cbbc60f76a45ed4801565333af18e75b7f0899234eec73708c50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary_Binary.register._": {"doc_hash": "a8b1fc010c422b5967c1355c7b5890a2a1570bb903c2f6937a3f0a6230068ef4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary.register.caller_Binary.register.caller.shape_hint.None": {"doc_hash": "411f2d98c685a936b4ee17f330a3c5e5b3c95ff6cb0aef9f547082bd8046462c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary.register.caller.None_2_": {"doc_hash": "eff65c62aa18caa8423efffec543ce1696900580e09ab4dc1510eefb46a75ad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/__init__.py_DataFrameDefault_": {"doc_hash": "4a141feaffca50c71320a47a96d4e8b465a4c7949e0e68945e25847389453bdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/binary.py_DefaultMethod_": {"doc_hash": "f5359201b810f8641753e96a96c60a515c59262f8b7a1a0e872dfd1c566235d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/cat.py_SeriesDefault_": {"doc_hash": "5bbe1df0cbfe1077cd587d23ec9c0429db5f8a8d566eafabb01e2c629c32b2cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/dataframe.py_DefaultMethod_": {"doc_hash": "87d6ecbd7f525b0b71a3a9f45c3de3d4ec7007de87a7828c24928b2fb6af393a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/datetime.py_SeriesDefault_": {"doc_hash": "91af731eafabcdb68beca10c7ca335bdd47cb8739a694da8d47131a11202a9b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_from_modin_core_dataframe_ObjTypeDeterminer.__getattr__.return.func": {"doc_hash": "e31f9adc131558830099f59437c090eb22ae0a82914254d26213462f345821ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod_DefaultMethod.register.if_type_fn_property_.fn.cls_build_property_wrappe": {"doc_hash": "209e46b82f92631901131f6c386a5009badf7ac76e152c67f4150178cfe0c31d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.register.applyier_DefaultMethod.register.return.cls_build_wrapper_applyie": {"doc_hash": "74638e2e4c0fd32b0c1257dca2f76507016c83f4a8bfdb74ea6181e29a9d9e79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.build_wrapper_DefaultMethod.build_wrapper.return.args_cast": {"doc_hash": "3a21b9a73cbaabc6bb65e16dd66d4bf1db9e5bdb5614ab08b456bfd9adea958b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.build_property_wrapper_DefaultMethod.build_default_to_pandas.return.wrapper": {"doc_hash": "ab0cfec3d96586aea1c09890cf5a7acbea16a4adb99bdcdcc7c3bd22c9a9a97d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.frame_wrapper_": {"doc_hash": "48674e8d6ef9b9a78ec563bf28dca2949cf6fb254b778946832f92f9480b8d7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_DefaultMethod_GroupBy._call_groupby.return.df_groupby_args_kwarg": {"doc_hash": "1255eea233e9907504200774ace671381a7318aa5762c59cbbb566eec5c31b74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.validate_by_GroupBy.validate_by.return.by": {"doc_hash": "f0dacb3c4e0570a942c541c9e0115eebbf5df8d3fe31abb8476d1dbd66ed2fe9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.inplace_applyier_builder_GroupBy.inplace_applyier_builder.return.inplace_applyier": {"doc_hash": "377b9ad28f9f0f775e254aa31f9920879f523d9e912f5124f45c1b1a09fa7965"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.get_func_GroupBy.get_func.if_agg_func_in_kwargs_.else_.return.cls_inplace_applyier_buil": {"doc_hash": "2a45095affc993097b78343b4cb890e555059844b9bb2608ca8c2030844e9e87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.build_aggregate_method_GroupBy.build_aggregate_method.return.fn": {"doc_hash": "e3a3f47fb3799fa022e97a6a6e000f5f769e95e983bac6f50cc625816c4c949d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.build_groupby_reduce_method_GroupBy.build_groupby_reduce_method.return.fn": {"doc_hash": "23ae342f93cfd0d8b19ae599cbc3863648abf4d2c624d323cce7ff018376c94a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.is_aggregate_GroupBy.build_groupby.return.cls_build_groupby_reduce_": {"doc_hash": "1a326501209acd2bd4fd983765a515c778d0d0515a3eed40068ddb8b38d78c56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index_for_dataframe_GroupBy.handle_as_index_for_dataframe.return.result": {"doc_hash": "bb761304854e2ab53d880f4538c336eda54e5a28fb3146dbc9736f4b0eeb9515"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index_GroupBy.handle_as_index._": {"doc_hash": "b1370b7d698173b1c2475efa4f24ad3fc690ca60f3e4b160b789c68ad71eb9e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index.if_by_length_is_None__GroupBy.handle_as_index.cols_to_drop._": {"doc_hash": "0f154812656f22380ab327ee553bfe6ae71b22d5e5c46c985e477cf153839bc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index.if_not_keep_index_levels__GroupBy.handle_as_index.return.reset_index_drop_lvls_t": {"doc_hash": "2420bc4b1a924541fb96c6d2135f00b76e1cc3bebabe786e6536f9cfa63f8266"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_SeriesGroupBy_SeriesGroupBy._call_groupby.return.df_groupby_args_kwarg": {"doc_hash": "e666c0f91b71aaa3601b840f1c31a0f0d23d7b7669476f4935e142ebd40449f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault_GroupByDefault.register.return.super_register_": {"doc_hash": "46760ccc3b9b6e8ef876d98a8f812985ea1cd06922c9290e2c31fc9cd102685d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault._This_specifies_a_panda_GroupByDefault._aggregation_methods_dict._": {"doc_hash": "d9990fe8bcac06cd7c84361a1e610ca3c83ed3e669545383281e9181b73e3fe7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault.get_aggregation_method_": {"doc_hash": "29f0a8f5f0b7c83e8be99f4179900ecf1cd2ba0d498f2272d09c8cee597e5b22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/resample.py_DefaultMethod_Resampler.build_resample.return.fn": {"doc_hash": "b23205cf5fae344cc20a7982bf22bbc54620e7f76676b21caad227f62a6bf973"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/resample.py_ResampleDefault_": {"doc_hash": "f7d347e182acea22f0036e081746bc9224c44cb8d4c6528184b69d1504562ef5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_DefaultMethod_RollingDefault._build_rolling.return.fn": {"doc_hash": "2c1cb6cdaaf3d25f59b9b281c990fa806ba94433f8537254f5fda784f6922bc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_RollingDefault.register_RollingDefault.register.return.super_register_": {"doc_hash": "343caff6a774d6f998fd5ceb5d7bec7fc60ba92ec0ceccc53a159ad011a25d61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_ExpandingDefault_ExpandingDefault._build_expanding.return.fn": {"doc_hash": "1be0e1676035e155ad411cd0f4da3b87a4cc9f1d3600c5d909c91287d515881a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_ExpandingDefault.register_": {"doc_hash": "20294ea7633afe0cfca55e9f47e9abdc160b0b302993ebcc7e7a4b7249a3265f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/series.py_DefaultMethod_": {"doc_hash": "51f991719976196ad1355a73424bff0011e97884d9ae550bc6ca26943a117355"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/str.py_SeriesDefault_": {"doc_hash": "cdf9c99a2a1100ceb927ddcacf22970f02d388982de4038444375c677588cc85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/fold.py_Operator_": {"doc_hash": "ecf86d6c83fce756803870be39811ed8ff355eab70442748db1b1211be176746"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_pandas_GroupByReduce._GROUPBY_REDUCE_IMPL_FLAG.___groupby_reduce_impl_fu": {"doc_hash": "e1ab5256d1935859071bb03a6f954dcd64d7fe3d99faf64a5e851e16109292b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.register_GroupByReduce.register.return.lambda_args_kwargs_c": {"doc_hash": "1ebcdc90544fde7f3074eb6b6397ca60dbe773b929033985eefe47cbd9679015"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.register_implementation_GroupByReduce.register_implementation.setattr_reduce_func_cls_": {"doc_hash": "327e61c7c0b026012e06e612a8ac34c900b5adc3d67ec739f9e57df477c20e59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.map_GroupByReduce.map.return.pandas_DataFrame_result_": {"doc_hash": "facae25057bef81e8cb5a78857c59a2c50540371ecc5ebe9d4aa10e1f6ea5527"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.get_callable_GroupByReduce.get_callable.return.cls__build_callable_for_d": {"doc_hash": "3ba3ac64d2781e54ab20efd99ab9a75385e06be9223aded45f67a9d59b62b0f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce._build_callable_for_dict_GroupByReduce._build_callable_for_dict.result_columns_3.pandas_Index_result_colum": {"doc_hash": "38b76b2624a1dafeec26c3b6c7df0281ea2e8bdd41a36f4256f3055567f54364"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce._build_callable_for_dict.aggregate_on_dict_GroupByReduce._build_callable_for_dict.return.aggregate_on_dict": {"doc_hash": "d5076127fcfd4faa2059937536502a512dd74ad21ae0e13622f421f0845fe204"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.is_registered_implementation_GroupByReduce.build_map_reduce_functions.if_hasattr_by__modin_fr.by.None": {"doc_hash": "e5772e18ff06284deafcb18203fe00ddf33f70ed4e162e63300b886b865cc970"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.build_map_reduce_functions._map_GroupByReduce.build_map_reduce_functions._map.return.result": {"doc_hash": "33bc6736014709ae8b1cf32d318d737abfbf6c4920b06b2be184e872cabb5ff7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.build_map_reduce_functions._reduce_": {"doc_hash": "e4f4bc0b507b78ee1a28560ede58d40c62d168b7631fa3f3ce28eebede1c4f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/map.py_Operator_": {"doc_hash": "fcf8da2c6813c13e628b513d2bb9ac7f74cf477f015e295bac6160894b671da6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/operator.py_from_typing_import_Option_": {"doc_hash": "9b28f8bd248aa7c9923c0849280191cef672b72d773458e3b3777417137fd8c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/reduce.py_Operator_": {"doc_hash": "b6f5e22489ab8a11a4ac7f7b86fedd97a5cc61bbad1703a53119daa3dd9d8b22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/tree_reduce.py_Operator_": {"doc_hash": "2db0548eec33716b80db28ea17a9eec342aa294b8cc7fcb6a5fc37fb4a65371c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/__init__.py__": {"doc_hash": "aeac70a414cc2ca4f99ec8495cb855cafee8e73611b4ca91cf15398a71345292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/__init__.py__": {"doc_hash": "7ef6b901c731f55ad6d0dc86d4d3e54e0bdb13b247e2f7eb926b1797ab28baed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_from_abc_import_ABC_abst_ModinDataframe.take_2d_labels_or_positional.pass": {"doc_hash": "5987d4da1c2b4e61e6ba6eeeb3c3b292c9583b1b0d94bf04137dc541d25ce61d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.filter_by_types_ModinDataframe.map.pass": {"doc_hash": "757a6d6720d0129c82e045653da04f4ac741417963d5c03639c2754a38e56a30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.filter_ModinDataframe.filter.pass": {"doc_hash": "ced32405a11f43d515b61911ef4b4287a6ba7bacb5dc8da8d252af5c2fefd974"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.explode_ModinDataframe.explode.pass": {"doc_hash": "21b3025ceeed0a704e277af66f7755190b95919194d2c6ea3ce217a1fdb0bb34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.window_ModinDataframe.window.pass": {"doc_hash": "6fab7e9c84676f28882e39e401e2192c5e8d5435832dc24d239eadc78c856ed8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.groupby_ModinDataframe.groupby.pass": {"doc_hash": "8f4bb105d6e7ea84ecdb44df55742d1848a3f7faab3c60cbd8bc6035ceb9f67c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.reduce_ModinDataframe.reduce.pass": {"doc_hash": "fe7a4b72c4c8155e92bfbec3f0e6c5d9f3cac0ee50b6b2cf34906f7add6b9422"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.tree_reduce_ModinDataframe.tree_reduce.pass": {"doc_hash": "17dd941aeae998f266c86728760782b8b5fd9ea90f9f0101ddab8b4dcf24652e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.infer_types_ModinDataframe.join.pass": {"doc_hash": "a8625d68092a481dd907e3fa7ba0b6a43601d7f8c53213d142e6f3c050328eb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.concat_ModinDataframe.concat.pass": {"doc_hash": "811b3868881dcf93f7762c156fcf948ed78064cca1eb20310e73c6be887d6d6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.transpose_ModinDataframe.transpose.pass": {"doc_hash": "96df96bf57ed2ada1f1dbed09644abc98065502f9076d6a7227cb774ebc94ff1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.to_labels_ModinDataframe.to_labels.pass": {"doc_hash": "fe98d057678562332d626563a6d2d93113087a962fb34952e8025be05ab15b50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.from_labels_ModinDataframe.from_labels.pass": {"doc_hash": "97a32a9a8ecad64ef1a92f727f37d54b552ecc70e0decb2a93efb6b85e86d84d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.rename_ModinDataframe.rename.pass": {"doc_hash": "2587d5e2ab163e8ae3ed9e54bf3b3eb11ae489e420489c00baa8ba7c148504b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.sort_by_": {"doc_hash": "3e30caee5e44514c7f37b8e69f3133597d9827a6e7d02d40fb55e3732f0f57e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/utils.py_pandas_JoinType.OUTER._outer_": {"doc_hash": "c50bcc2cb1e6e44aca850a39efea4fd36c0d621ba007e27845fdd11b73f73a77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/utils.py_join_columns_": {"doc_hash": "e91b6f8e4bf983ed6937caa49be37c93a2bfae378bf85b161b522d156461bb51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/__init__.py__": {"doc_hash": "813f28ca1db57a1266d68e15a0d57438cc77e4fa268303512919148a9e817f07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/__init__.py__": {"doc_hash": "75731848a275c72c22e1794d31ecb6695a92620a123c78336784438dd22a3a61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_from_abc_import_ABC_abst_CategoricalDescription.categories": {"doc_hash": "f6f6ebc3b51e6be72791a9dc0599965dc8819834a965a8f4ea42c10029e07df5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer_ProtocolBuffer.ptr.pass": {"doc_hash": "6c046b568a52310cf9959a094a98f6e1f229e3b9bfb3b242fdece5e86d007685"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer.__dlpack___ProtocolBuffer.__dlpack__.pass": {"doc_hash": "520afaa9ac706f40712c37b57c0903fae3f968f6a7a59ec54e2fd438482a4b14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer.__dlpack_device___ProtocolBuffer.__dlpack_device__.pass": {"doc_hash": "8c6bd7cb56a95d04cf666e1dfea9b6945583af54fa1d8be9d7d9871c978f4831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn_ProtocolColumn.offset.pass": {"doc_hash": "d65a7851e1353405089f2fe6ff1a3bd5947281b27f44364224a96aef50501af9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.dtype_ProtocolColumn.dtype.pass": {"doc_hash": "fce6c0218ecfe6871d5f1fb36970e05fb15d60ffb8f2dc5fed62ab344e2ba2d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.describe_categorical_ProtocolColumn.describe_categorical.pass": {"doc_hash": "c17750c90993c8ba7fee9564e8b788fe39278224f752a5313239ea9eeb40330e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.describe_null_ProtocolColumn.describe_null.pass": {"doc_hash": "b14e15da62e2ab5a0f59e15927bf844979992f8b1d464df0b0a8a4c3b7357420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.null_count_ProtocolColumn.num_chunks.pass": {"doc_hash": "6cb6b88a9a6c788f519b81dbf2ae520c19e09202bcb82da0f0932820aa3cb34c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.get_chunks_ProtocolColumn.get_chunks.pass": {"doc_hash": "5f6ba4ed67ba0121c03cc24a857c5c3af56cbb90cea5584a13df4f58f34b9edd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.get_buffers_ProtocolColumn.get_buffers.pass": {"doc_hash": "84ea1e0ee2681b89b5ebe000e3daca86f77bf182b40785b2a9450959ea296826"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe_ProtocolDataframe._version_of_the_protocol": {"doc_hash": "0555d72c2590bc9ab7ca65b98838aca7c81c742ff2fcc9b6025168c5937f60aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.__dataframe___ProtocolDataframe.__dataframe__.pass": {"doc_hash": "d6adfeea7cbe8644a4176300f96854de2ac7d403f59c01ed255f706f920f208d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.metadata_ProtocolDataframe.metadata.pass": {"doc_hash": "7a5ca259db220a3e3c583f4bd828e89f015f88ad673204013af538c5d38b8c10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.num_columns_ProtocolDataframe.select_columns_by_name.pass": {"doc_hash": "28b7c38a47e6270e4935aa0edb08e41bc6b190cd07df365163d4e9501ccfb8f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.get_chunks_": {"doc_hash": "c7eb65be15b22d9b58e3a43bb8fde53c3785dbd592197d976a5b6cf280f1de7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_enum_DTypeKind.CATEGORICAL.23": {"doc_hash": "ec6d975001d5354ab48850009f85f6a37d986d76c827bfb10b10726522edf405"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_ColumnNullType_DlpackDeviceType.ROCM.10": {"doc_hash": "951f85a3a225be9b150d7bdf5442084e7359a6e9614694d46739380125706ac0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_ArrowCTypes_Endianness.NA._": {"doc_hash": "ee30e3f6ce881efcc9024afa3eb8edab6a57ad04fcd8ca9ead85e713e1bb8bd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_pandas_dtype_to_arrow_c_pandas_dtype_to_arrow_c.raise_NotImplementedError": {"doc_hash": "b995b481e85273d113389f59f3225d5b2b4cebe9273ae8a6f73832bbcca8f703"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_raise_copy_alert_": {"doc_hash": "0e767aa21a1c1935aaefe40268f8a6596bee9f958a1179430469d77772922104"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/__init__.py__": {"doc_hash": "f8574ff27e7e815b0c8455264d7328077bdcac63950fdf62714f56cacd0796df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_from_abc_import_ABC_abst_BaseDataframeAxisPartition.apply.pass": {"doc_hash": "0f68baf8075afc4cf14a1b27fac33d06b1abdd8c2e73213234200a97899f091d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition._Child_classes_must_have_BaseDataframeAxisPartition._wrap_partitions.if_extract_metadata_.else_.return._self_partition_type_obje": {"doc_hash": "c9ffb9910c2343c77aa3d8746108c42270c28a88653f4ae58a28a239a9de3c88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition.force_materialization_BaseDataframeAxisPartition.force_materialization._type_ignore_call_arg_": {"doc_hash": "ae32c5f8a0dbdeb6f9427cd1e6071dda02167837c51c8fe1ec644904b8b63b05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition.unwrap_": {"doc_hash": "25830b21a16db5507312fd4bbc9bd2bfb5638f9b917b6fb281c9f2e27c0dee1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/__init__.py__": {"doc_hash": "560f912d1919d5e53c59a7164bf2e26de2f52df112c781b89a01cdb68be939db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/__init__.py__": {"doc_hash": "3ac7a6692c4bcc199bb8c057110fa518d6edb9f0bf3b0157703de0f9afb3f03b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_from_collections_import_O_from_modin_utils_import_M": {"doc_hash": "4f5b0666f8989d166bd71e3519d0332974521fa7cbcf070d0b87fe4a3ce24abf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe_PandasDataframe.__init__.self__filter_empties_comp": {"doc_hash": "69d9f4cd82739aac8340b4a5bce859c217ff8548c9a11b1f93a8a8d7a8705f9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._validate_axes_lengths_PandasDataframe._validate_axes_lengths.if_self__column_widths_ca.ErrorMessage_catch_bugs_a": {"doc_hash": "a81db1122bd5a1985e962de70beeafd8a15e99784efa2e20a79a9834c97a5315"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.row_lengths_PandasDataframe.row_lengths.return.self__row_lengths_cache": {"doc_hash": "6eb9530989ee1358c48017dccc82e42d7b63a29f01b010ad9d77ad028bd98b1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.column_widths_PandasDataframe.column_widths.return.self__column_widths_cache": {"doc_hash": "917b89c103c01774f571d80e21475cbe7cb5a7e443abc7f81541836561b5c3f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._axes_lengths_PandasDataframe.copy_dtypes_cache.return.dtypes_cache": {"doc_hash": "caf388611a3510299a59d71931102568be41d0703fc30b07179b0e9ad96baace"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._maybe_update_proxies_PandasDataframe._maybe_update_proxies.if_isinstance_dtypes_pan.for_key_value_in_dtypes_.if_isinstance_value_Lazy.dtypes_key_value__upda": {"doc_hash": "c93e3334d8e3686f4d6b9500d96e287d80685d65f88707f1726f827037fefb67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.set_dtypes_cache_PandasDataframe.dtypes.return.dtypes": {"doc_hash": "ac92167515ec284d3dd37514f78f36a5bd76ee90d020f174c1f489810fe7d667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_dtypes_PandasDataframe._compute_dtypes.return.dtypes": {"doc_hash": "184a3cc398af7316acddcc4b324864f5036c3ee33df260fd2261b730a3d575e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._index_cache_PandasDataframe.has_materialized_columns.return.self_has_columns_cache_an": {"doc_hash": "12212bc2bff614646cf876bf0c40abf8395db35964312bd81d38fa8eebf10a59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._validate_set_axis_PandasDataframe._validate_set_axis.return.new_labels": {"doc_hash": "fc12ec886b5d03778f8b8ebb296ae39091152b2d50fed5a88d44532d0c05cb1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_index_PandasDataframe._get_columns.return.columns": {"doc_hash": "9a90f38e0955e01ec158ec73ed38782e0c627b0c2b99be80e712ef9d7a2a9e05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._set_index_PandasDataframe.get_axis.return.self_index_if_axis_0_e": {"doc_hash": "b400f7d6165a29417870e260f7896f79b89780f5e88c29259231b57455bcf0d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_axis_labels_and_lengths_PandasDataframe._compute_axis_labels_and_lengths.return.new_index_list_map_len_": {"doc_hash": "97ffcd384c1130747fed7a29a0ae72274c53b7b39ef1281515287ce3ae3e38e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._filter_empties_PandasDataframe.synchronize_labels.if_axis_is_None_.else_.self._deferred_column.True": {"doc_hash": "dbac5fdca87bd7e64c1322979dd93d74e6eb3d26047d365be90336e6c8898d9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._propagate_index_objs_PandasDataframe._propagate_index_objs.if_axis_is_None_.else_.ErrorMessage_catch_bugs_a": {"doc_hash": "50935f0fe583c82663f72431fc33580842bdd0682536f3fdd7ffec7e0aef2a7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.take_2d_labels_or_positional_PandasDataframe.take_2d_labels_or_positional.return.self__take_2d_positional_": {"doc_hash": "54c2ec603a5054f3c0ce8595b4ad260c66f89b4601f3a83cf45f4ecbabd14074"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_sorted_positions_PandasDataframe._get_new_lengths.return.new_lengths": {"doc_hash": "dfc0eadf3cdf58b1bd9b52482364e80ed30c0e7e182c5352128f20257587cef2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_new_index_obj_PandasDataframe._get_new_index_obj.return.new_idx_monotonic_idx": {"doc_hash": "e1c1f462d22b91a44da2ff873040df4f00e5906e1e14a80679abe1adc656d859"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._take_2d_positional_PandasDataframe._take_2d_positional.if_col_positions_is_not_N.else_.new_dtypes.self_copy_dtypes_cache_": {"doc_hash": "f18e4c4bf710dfbcc9df4220cb6f01b9fbb73a9b107f0706f05d8059b0507247"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._take_2d_positional.new_partitions_PandasDataframe._take_2d_positional.return.self__maybe_reorder_label": {"doc_hash": "25f9792846fc3f0fe25cf50ba7f5a11ec57367370b93ff706e90a063213f9204"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._maybe_reorder_labels_PandasDataframe._maybe_reorder_labels.return.intermediate__reorder_lab": {"doc_hash": "b93f2091550cc7a671288f43e9e6e425bc3f585fb55ce4056605957864fc3a98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels_PandasDataframe.from_labels.new_columns.new_column_names_append_s": {"doc_hash": "696f69f44326b192bd3d7728737cd7dd5237988711be8e4d27ed8cd73ea0e926"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels.from_labels_executor_PandasDataframe.from_labels.from_labels_executor.return.result": {"doc_hash": "7a6883843cf5f2b59113dd18ab65aa956be632ee414a7b299ed1617c8648275f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels.new_parts_PandasDataframe.from_labels.return.result": {"doc_hash": "18879c39be43fcfb929ace16a179413699ad10941c2e214745b65c96e5f08a0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_labels_PandasDataframe.to_labels.return.result": {"doc_hash": "f44d3917a57aaf2f4d95fdc194d4b03a5cb82737f90d91030ed5b422edce9e61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._reorder_labels_PandasDataframe._reorder_labels.return.self___constructor___": {"doc_hash": "1e81c519b310288171cbb0bc137885340f189a96f507591f79172000514106cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.copy_PandasDataframe.astype.for_i_column_in_enumerat.if_.if_dtype_np_int32_and_.else_.new_dtypes_column_new_": {"doc_hash": "7a77835f6caf94c0a30804e2e77b3164d49e9ef7aa8eaea137210cc80f626cf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.astype.astype_builder_PandasDataframe.astype.astype_builder.return.df_for_astype_astype_": {"doc_hash": "dfa9bbe8f903b6e93357136e67e68616b1258987a52e3278877a9b70f1460a2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.astype.if_use_full_axis_cast__PandasDataframe._Metadata_modification_m": {"doc_hash": "6f0b920e85823c0374548549fb5c710c354d593b850c34a56ee1823f431b8cf8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.add_prefix_PandasDataframe.add_prefix.return.self_rename_new_col_label": {"doc_hash": "b9a35eafeaf36301d778608b8b56de930cf358fbc12543c9ce354209bc0bab83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.add_suffix_PandasDataframe.add_suffix.return.self_rename_new_col_label": {"doc_hash": "08e7abb4a7c404df33e2dcc23fecb728da6ff410695bd984aaf0d250033d93af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._END_Metadata_modificati_PandasDataframe.numeric_columns.return.columns": {"doc_hash": "59ad3db0ce1edb3f18d372491c4264b08b4bdb5f993813e335ed089d7659d3f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index_PandasDataframe._get_dict_of_block_index._Fasttrack_slices": {"doc_hash": "b8b51524161b491d2ac53e88632f7789d549586d2d021b6fb1a09973c3836502"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index.None_1_PandasDataframe._get_dict_of_block_index.has_negative.np_any_negative_mask_": {"doc_hash": "f20a041e87c7abfcafc374e62c2648532799d081da6ef426c5027b0a6a95295e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index.if_has_negative__PandasDataframe._get_dict_of_block_index.return.OrderedDict_partition_ids": {"doc_hash": "63e927bdb21f00fc316ff416782c95dec93ce2ab13a552d8caac403f0d4224c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._join_index_objects_PandasDataframe._join_index_objects.if_need_indexers_and_inde.indexers._index_get_indexer_for_jo": {"doc_hash": "436d1a584188ccb289968c6dec89744cf87e2dd003a73541c7f20ad43282bf6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._join_index_objects.make_reindexer_PandasDataframe._join_index_objects.return.joined_index_make_reinde": {"doc_hash": "35b25b6b7873b16bae3b138f3df25930d8141c1ce1408a8769a55cc0f2b4ce46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._Internal_methods_PandasDataframe._build_treereduce_func._": {"doc_hash": "7c8e158ab1fe25aa5a8874e27e05e134630917f84b7dcfd5b7fcba73db27aea3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._build_treereduce_func._tree_reduce_func_PandasDataframe._build_treereduce_func.return._tree_reduce_func": {"doc_hash": "c187268745cbf9193465d2dadc1897372c632139849e99a7d66844a146a052a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_tree_reduce_metadata_PandasDataframe._compute_tree_reduce_metadata.return.result": {"doc_hash": "34069296295fa931b01241fff863c043aedaba722c20a12e7a6b10cf5f8b90c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.reduce_PandasDataframe.reduce.return.self__compute_tree_reduce": {"doc_hash": "421b0e51cba927255209ddae4068ee90047689405c09c9ebbc64345f3c0f4e70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.tree_reduce_PandasDataframe.tree_reduce.return.self__compute_tree_reduce": {"doc_hash": "4f88851a14afbeda42e79883a032a3218360af8ec9a5d4f88f1012e505663999"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.map_PandasDataframe.map.return.self___constructor___": {"doc_hash": "179d700b3c2131bda0fdb04248c60a46a0106d1570df9e292523c1d5ffe4332b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.window_PandasDataframe.window.pass": {"doc_hash": "e331fcb6a0ee46347f3358bb017e147797a96c3254eb615506a29afe09ac3860"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.fold_PandasDataframe.fold.return.self___constructor___": {"doc_hash": "e1c8a1603f395daec6aa3d242f892d27b243ff742f4c1ab4ac9560d4fb430758"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.infer_objects_PandasDataframe.infer_objects.return.self_infer_types_obj_cols": {"doc_hash": "af745948b909dc56d6f557d2b6b390fb083b3f4f557646fb7e229742f90dc423"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.infer_types_PandasDataframe.infer_types.return.self___constructor___": {"doc_hash": "620691029fcaf9c4cd298996ee6d96d57ad6d1f346281ea551eee06babe12192"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.join_PandasDataframe.join.pass": {"doc_hash": "c3becf33d9a098558aa317b6da7dc00f325827aefed5a6213bada059fb95d2a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.rename_PandasDataframe.rename.return.self___constructor___": {"doc_hash": "650d51a9d5c3a028f53f29439fbf7f4735cd012cd28f5f968b0c84eed3c1093a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.combine_and_apply_PandasDataframe.combine_and_apply.return.modin_frame_apply_full_ax": {"doc_hash": "8ec93aaab67c6b2e82c4a75d3685b9ed7f867e7c345f72e9f290219f1ea17428"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._apply_func_to_range_partitioning_PandasDataframe._apply_func_to_range_partitioning.return.self___constructor___new_": {"doc_hash": "cd8d84af05e33a05d24ecb5595a94fddccbd365aaac4f1622b4acbda4805042c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by_PandasDataframe.sort_by.if_not_isinstance_columns.columns._columns_": {"doc_hash": "8731a4e274f496f6c4c289ce71bc238608cb3d419c7c86703b11669ceb281138"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by.sort_function_PandasDataframe.sort_by.sort_function.return.df": {"doc_hash": "b7b1e504533c476f16954fc1ffea02d412ed08c7c9b708a9175c589027420b91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by._If_this_df_is_empty_we_PandasDataframe.sort_by.return.result": {"doc_hash": "c1266a2b5e5228fb1524570732ad14e6b4791504587402cba8bb50fc405e1dfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.filter_PandasDataframe.filter.return.self___constructor___": {"doc_hash": "66e7c30eb0e584c5f0a67fbd82ae9cd0ca96cafc4dbf3676a5802a15b48de1f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.filter_by_types_PandasDataframe.filter_by_types.return.self_take_2d_labels_or_po": {"doc_hash": "f5414d2c22011f97d6a341b978e58218eefb5fc3f7faca6ba92bda56f0a27cb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.explode_PandasDataframe.explode.return.self___constructor___": {"doc_hash": "ee8da2d071940c6be12633379411c4a3c18e533f1ea0a10d036300c8113a5925"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_full_axis_PandasDataframe.apply_full_axis.return.self_broadcast_apply_full": {"doc_hash": "663e74e34bba243cb4d7e94b4c622062b80853c399999eef2efb40c62bb7462f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_full_axis_select_indices_PandasDataframe.apply_full_axis_select_indices.return.self___constructor___new_": {"doc_hash": "5a22e4d52f085625ca3026452294db7b86a80880bf9acafa2274e7f92084920e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_select_indices_PandasDataframe.apply_select_indices.if_new_columns_is_None_.new_columns.self_columns_if_axis_0": {"doc_hash": "4814386f7cec4f05dc35da15d581ac65fca147880d01dea3f121137340b7387d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_select_indices.if_axis_is_not_None__PandasDataframe.apply_select_indices.if_axis_is_not_None_.else_.return.self___constructor___": {"doc_hash": "78c360ea1e5b65127c37aeb4d972ef88da5d498f208428f558306e5aa5104c56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_PandasDataframe.broadcast_apply.return.self___constructor___": {"doc_hash": "04c3fa89c63f48c0a650e90331af2222d9c6e8b5b13e3d7abbd55e3b369e19af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._prepare_frame_to_broadcast_PandasDataframe._prepare_frame_to_broadcast.return.result_dict": {"doc_hash": "67119847df9eb7159261f25f3a1e3500286a37154ca0aa7db0172ba2b63043ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.__make_init_labels_args_PandasDataframe.__make_init_labels_args.return.kw": {"doc_hash": "9200c0064ce3e757b318851e9d1bb2895b7e092605c540b2c74710cdc561c82e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_select_indices_PandasDataframe.broadcast_apply_select_indices.return.self___constructor___new_": {"doc_hash": "3043ae38ef19bd0780dbb074e1bd86904eea5aaae97c1c5591264062e17ea017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_full_axis_PandasDataframe.broadcast_apply_full_axis.apply_func_args.None": {"doc_hash": "35f409ae7d44c14312b28861516ad7a1f5166f12d60e385a011d583c316e64f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_full_axis.if_pass_axis_lengths_to_p_PandasDataframe.broadcast_apply_full_axis.return.result": {"doc_hash": "dc340613fe55d1419755641f368c97b411509bb176609769f22045db9405b2a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._copartition_PandasDataframe._copartition.None_7": {"doc_hash": "3cf53a43c87e46ced5326043ae51025e7d1ffd7b4f56736c1fedd6001ea7032f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._copartition.do_reindex_others_PandasDataframe._copartition.return._reindexed_frames_0_rei": {"doc_hash": "ef95675e3b1b123c387070c038b1e2784a5f7be4b993ab3c420aa90723a6f26c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.n_ary_op_PandasDataframe.n_ary_op.return.self___constructor___": {"doc_hash": "128e99162bdb69b4ac52336b0d7e7ea6baf5ec695e082c31ee302431962b0dd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.concat_PandasDataframe.concat.new_dtypes.None": {"doc_hash": "7e89b2ad61e4612de33b476e2c222fc1188cb198413db0eb3f98b41b23830d90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.concat.if_axis_Axis_ROW_WISE__PandasDataframe.concat.return.self___constructor___": {"doc_hash": "fc902dfed5ef65713368333d6bf2750ada5ba6bad940a9a3e5c9577daf21df7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.groupby_PandasDataframe.groupby.return.result": {"doc_hash": "3aad86f700895e26f0548cf70de469e6254a6b7b479ec9c3fd8255fee7b7a22b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.groupby_reduce_PandasDataframe.groupby_reduce.return.self___constructor___new_": {"doc_hash": "3a86b6848753558a863f43677f9fdfbb3831f2dcfe9f7d9fa201806cd14499c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_pandas_PandasDataframe.from_pandas.return.cls_": {"doc_hash": "7b112ec5a99fd15c7c864104ff0a2c0f0c5c8b13023e275862a46d3515601dfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_arrow_PandasDataframe.from_arrow.return.cls_": {"doc_hash": "81e0c92dbd7d760696c8ad512fc985ac0520a990509489dc4a3e14c88afa16b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._arrow_type_to_dtype_PandasDataframe._arrow_type_to_dtype.return.res": {"doc_hash": "5fc051fca7f59591b938d6c5686326da6f2f4b430ebb184edd738b8e92fbae38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_pandas_PandasDataframe.to_pandas.return.df": {"doc_hash": "444ce1ceff833d82b45a1ee8f3f1192f06f3621abf1bc75eef382672a628921b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_numpy_PandasDataframe.finalize.self__partition_mgr_cls_f": {"doc_hash": "a11279c07cf824b8b70f0ee257cb7eb0c7d62042702137fbd4ba22f4148b4bdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.__dataframe___PandasDataframe.__dataframe__.return.PandasProtocolDataframe_": {"doc_hash": "64f02fb82fed0061d7562c85d45cf73075a510e384747573bbb415cfe8f4d745"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_dataframe_": {"doc_hash": "6753d6a1fd534acfe5f3a4e84c1386c9b3befd10f40f3b736990c58dac8abafe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_np_build_sort_functions.return.ShuffleFunctions_": {"doc_hash": "0eb5077bfecf591806c9042b095c38f5855d01404c59da86418b04e877fb9519"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py__find_quantiles__find_quantiles.if_method_linear_.else_.try_.except_Exception_.return.np_quantile_df_quantiles": {"doc_hash": "0b9aedd417c48b94422ac44d91ed6c5f5cd66d8c5d32f2d8bb78d196e2f710f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_pick_samples_for_quantiles_pick_samples_for_quantiles.return.df_sample_frac_probabilit": {"doc_hash": "6d59e40080654c3aae1295fb44b24f86e08fea4895c279c4a1ecb12edb439291"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_pick_pivots_from_samples_for_sort_pick_pivots_from_samples_for_sort.return.np_array_": {"doc_hash": "d303f48370528efe387b327616d1e86fad371feb59bac6a9f4f87f2d0b60dbd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_split_partitions_using_pivots_for_sort_split_partitions_using_pivots_for_sort.if_is_numeric_column_.else_.if_not_ascending_.groupby_col.len_pivots_groupby_col": {"doc_hash": "7e162e412d0dd73bdb1fd2182081ea4d6c48a8f405571207ea6cf2e24ed22206"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_split_partitions_using_pivots_for_sort.if_len_non_na_rows_1__split_partitions_using_pivots_for_sort.return.tuple_groups_": {"doc_hash": "b2389791be519514dfbb6c2a5051d93cc9d010d638f8ee57d124a46aac0c2b68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_lazy_metadata_decorator_lazy_metadata_decorator._": {"doc_hash": "c77fb921d100c6efd76417db190d1522b26a7b25c840b127bf4e6a5a806a70e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_lazy_metadata_decorator.decorator_": {"doc_hash": "55a12293a6dfeaccdf61b8ac6ccb64963015f577240117db84786f553d914799"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/__init__.py__": {"doc_hash": "184240130dce0f47d73e490bb8100d42da2050e70d6d9e4e874238bca79badd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/__init__.py__": {"doc_hash": "710a3bee6cca89324fec660153a7f39bee227cdcf9f571e0dae4c429e02a36b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/buffer.py_enum_": {"doc_hash": "83c901ba757b89f4efd3ece3dadc776afbd0769c3596c1cb89f2f6947e729d99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_from_typing_import_Any_O__NO_VALIDITY_BUFFER._": {"doc_hash": "63cee9d5a41d025f0e680ab66c56c372a6ac6654a84787a5b86109696eda0f16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn_PandasProtocolColumn._cached_property": {"doc_hash": "b984b32f77e87a0b323dddc7e7afd82601f341a5bc8e926ba959734afcab58f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.dtype_PandasProtocolColumn.dtype.return.self__dtype_cache": {"doc_hash": "2e0f97ed5414ccdb461f18bac951829d31d8c324221f577bc70371edddd77016"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._dtype_from_primitive_pandas_dtype_PandasProtocolColumn._dtype_from_primitive_pandas_dtype.return._": {"doc_hash": "a7f72f91ba549a5afecbb0b8856f1738660f873ca5e46ada247c09b12e80cd1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.describe_categorical_PandasProtocolColumn.describe_categorical.return._": {"doc_hash": "abbf2d1fef4066483617aa69cc2525766a411bc4d3f133cdf1b717c4759aa2c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.describe_null_PandasProtocolColumn.describe_null.return.null_value": {"doc_hash": "fe716ca7a2ed9ba710192a049db03c1da08221274c622f5e7f33387bcde49dd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._null_count_cache_PandasProtocolColumn.num_chunks.return.self__col__partitions_sha": {"doc_hash": "869ae37af625c6d2364b7289c7bdc0a9142c6aeec60e1492fc3d91090738fed2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.get_chunks_PandasProtocolColumn.get_chunks.for_i_in_range_len_cum_ro.yield_PandasProtocolColum": {"doc_hash": "737e815b70494b9fdee6fc9ca8f58090bc4d8d660f02e7ba8b9c82eb90aa8dcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.get_buffers_PandasProtocolColumn._get_data_buffer.return.self__data_buffer_cache": {"doc_hash": "13d7b187aba7f32c8ac0b81b8a582d260cae46413b3b309e8e5f79e6d280254e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._validity_buffer_cache_PandasProtocolColumn._offsets_buffer_cache.None": {"doc_hash": "a37008e4441dd9e4f31e5c888f27a7e1772b97283f53eaceb3c31e7c75a5a378"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._get_offsets_buffer_": {"doc_hash": "622487c52ac73338d30ee72daf4818731c9471ceb4d25c25159cce15909cb818"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_collections_PandasProtocolDataframe.get_columns.for_name_in_self__df_colu.yield_PandasProtocolColum": {"doc_hash": "17e4b22115c29167d0ea3299f29055a802e2242a5bc0311742a81191029449b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_PandasProtocolDataframe.select_columns_PandasProtocolDataframe.select_columns_by_name.return.PandasProtocolDataframe_": {"doc_hash": "59d0f21a9f77ff383d49119abf8e631642a1453c7e1e3e278b13c575d016c6d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_PandasProtocolDataframe.get_chunks_": {"doc_hash": "e872d880cd92e7dd084fae9de6f6bcdeffe3f2eaf7643e358220791fe70b0e89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/exception.py_NoValidityBuffer_": {"doc_hash": "d647eb393c126e9ee2b473f315e7e2039dc5ea416934bc38ffb757a4c4efaee0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_pandas_np_types_map._": {"doc_hash": "731c336fbc7ac09428018a9d3ddf9eb7da4ab4ff61711406873d0cc3674e3f1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_from_dataframe_to_pandas_from_dataframe_to_pandas.return.pandas_df": {"doc_hash": "ea07f8eaab0957276bab040581efb498e70ed8c06367de1e786e0c28748695b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_protocol_df_chunk_to_pandas_protocol_df_chunk_to_pandas.return.pandas_df": {"doc_hash": "2229d41eaf8cfdd03cb8528fe0a4eaa3a32732faf40cbd4c574c713b85e1cfea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_unpack_protocol_column_unpack_protocol_column.if_dtype_in_.else_.raise_NotImplementedError": {"doc_hash": "9e059ea21a0eee2b171d4ecd5cf04fcc09615532a192ce3995a209a0caf07ed3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_primitive_column_to_ndarray_primitive_column_to_ndarray.return.data_buffers": {"doc_hash": "b8a8142e2c00b43566c73feb731863b0a37799c4e12973db8f9038a20c5803a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_categorical_column_to_series_categorical_column_to_series.return.data_buffers_categorie": {"doc_hash": "297480fcbe9b149f43429546b9706563002b828e3cf7aa26ac7c6a133306ac17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py__inverse_null_buf__inverse_null_buf.return.buf_0": {"doc_hash": "b6f7691a6717cf1fd3ef34444ed8a5715270f49b7dca0696c9c081fcf2e038f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_string_column_to_ndarray_string_column_to_ndarray.return.np_asarray_str_list_dtyp": {"doc_hash": "0b8faa38247936e278a258945fc401729cb82dacc614c86c4d4b95138ebe57b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_datetime_column_to_ndarray_datetime_column_to_ndarray.data.buffer_to_ndarray_": {"doc_hash": "675d31ffebb570d82f73cbb4956c1228b85dc88d73368f9a04f0fc94b66ef270"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_datetime_column_to_ndarray.parse_format_str_datetime_column_to_ndarray.return.data_buffers": {"doc_hash": "c7ad4268877af5e1661953b3b0dd48a7cf109471cc82f6f67a2780a1d2da813f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_buffer_to_ndarray_buffer_to_ndarray.if_bit_width_1_.else_.return.np_ctypeslib_as_array_": {"doc_hash": "e5d2d470c5bde8c19b23ece7b1a553ad09d371ca27d337614cfe6fa12a74edd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_bitmask_to_bool_ndarray_bitmask_to_bool_ndarray.return.bool_mask": {"doc_hash": "77837ae67ef489d018786dd0bfce8e36790c1aad6dab4947decd177e554b44e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_set_nulls_": {"doc_hash": "4a15016f06133daaed594d525b7054e27efc3c5307dff2b24d269af5a6e55a83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/__init__.py_ModinIndex_": {"doc_hash": "a3051cb4b8b240bf6d647e557f9e9c04a30aea1ea4ad2d8fd121c604da9eb57f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_pandas_ModinDtypes.__reduce__.return._self___class___self__v": {"doc_hash": "de3cc22c0fcbe124ccdf2ed8806a25597e10dcc6d0f70247197b03fabbce3dc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_ModinDtypes.__getattr___ModinDtypes.__getattr__.return.self__value___getattribut": {"doc_hash": "c04a3b0d36980484b08ae45365c91504e4aad921694cd8feef67cb06f230c213"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_ModinDtypes.copy_ModinDtypes.__contains__.return.key_in_self__value": {"doc_hash": "70698ea0a7fbac5a6d9e9b791408b34c8f40cc8e6b6fe90f8796fb7cd30f408d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype_LazyProxyCategoricalDtype.__init__.super___init___categori": {"doc_hash": "c048e70352604f3b52495ef9f2a67fa8419aad0f0e1ca5ab240db69757e3fadd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype._update_proxy_LazyProxyCategoricalDtype._update_proxy.if_self__is_materialized_.else_.return.self__build_proxy_parent_": {"doc_hash": "b91335454e5722b9f1b47700e646e5107feb00983bf7fa84c1c2694c0542cc1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype._build_proxy_LazyProxyCategoricalDtype._build_proxy.return.result": {"doc_hash": "786387c2af4499e0889fdd86d922586d82fa0081569603cc500c427ba4c9e39e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype.__reduce___": {"doc_hash": "aa7f393aa686837dc94cbdf269b2c017ba8ac281003a41f4b854715febeb8bb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_pandas_ModinIndex.is_materialized.return.isinstance_self__value_p": {"doc_hash": "dce7b0a765ffdb28cedda4480fcfdd2602c29036fa5a50c6124a3fbb1d38ad9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.get_ModinIndex.get.if_return_lengths_.else_.return.self__value": {"doc_hash": "ed48f47ec8c619ae43bdc137ef56c152c0b407fc21de262876ef5417476182e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.__len___ModinIndex.__reduce__.return._self___class___self__v": {"doc_hash": "ad72ab2a039df6be939ab6cc7438b95667843fe438f51ecb63f2c08aa607edce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.__getattr___": {"doc_hash": "37f95ee9ffe01f2e095ee01eb8231dfd691cbbc15ff9c7addc1d4c0103e1d084"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/__init__.py__": {"doc_hash": "b3be6b71b48a476564d7c2fd95d47072366334f57b31aa4da39a45b0331774a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_pandas_PandasDataframeAxisPartition.__init__.self._list_of_block_partitions.None": {"doc_hash": "f3a98363606ddc314abbe4295061780720cd62767c0e5f91721378d079e5a0f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.list_of_blocks_PandasDataframeAxisPartition.list_of_blocks.return._": {"doc_hash": "a81da958c2c0dc5dfb33f81f9bdc89471d749b35a2a463e36661afe64def099e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.list_of_block_partitions_PandasDataframeAxisPartition.list_of_block_partitions.return.self__list_of_block_parti": {"doc_hash": "22b557cce213f303e7bfae1d1a64366cee333bc984963c0c3801f1f3e97bda26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition._get_drain_func_PandasDataframeAxisPartition.drain_call_queue.self._list_of_block_partitions.drained": {"doc_hash": "d239d59d92a2adf732e60818f3d8ba6ad7e95b28da0dd3c4ea195e94e8b59b2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.force_materialization_PandasDataframeAxisPartition.force_materialization.return.materialized": {"doc_hash": "13838beffb1dc4c721c8981bbb6baf5bdc1e6fd0c208de21a37a5ec119d1ea95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.apply_PandasDataframeAxisPartition.apply.if_self_full_axis_.else_.return.result_0_": {"doc_hash": "848394856d467dee931f8ceedd82e221c086287119ade8aa08db23fde7fe41aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.split_PandasDataframeAxisPartition.split.return.self__wrap_partitions_": {"doc_hash": "0242f7710aad13f5f3b039d71e07b347ef947ca446f0fb37dd99ac6dcf3fa7b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_splitting_func_PandasDataframeAxisPartition.deploy_splitting_func.return.split_func_dataframe_f_": {"doc_hash": "6b5c48d8faf484c2704c8ce856d91ca10679f2e81e7a6b2182770a6d55a0cd0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_axis_func_PandasDataframeAxisPartition.deploy_axis_func.return.split_result_of_axis_func": {"doc_hash": "0d513f73d5356b69edb78b3cffdf02c7fb38573983a45fd254a79c6eb491af9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions_PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions.return.split_result_of_axis_func": {"doc_hash": "04b7069914ef9ea09c2dcad8a400d4c679b8d30791d2273d095fa7e27d1e20ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.drain_PandasDataframeAxisPartition.mask.return._": {"doc_hash": "90aee6abc88c2bb485b0f85345f63586ba11351a679b56bb14cc1672817aea5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.to_pandas_PandasDataframeAxisPartition.wait.pass": {"doc_hash": "21344f1a89e7c9594df32ea1b06d0c686ffaf0ff4a2780ef1cd724712ec3b2e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.add_to_apply_calls_": {"doc_hash": "e17ea97be2f09f3305f3f64828202e352ee13be96dc0f5608a3f616370c5005d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_from_abc_import_ABC_PandasDataframePartition.__constructor__.return.type_self_": {"doc_hash": "2175f2584c266ab0de602f53e6ccc1de5ae28e4ff203c08f03038a304d1d04ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.get_PandasDataframePartition.get.return.result": {"doc_hash": "9ddac1e1bf2ef490c5d1a3d2b24b494971db591349b29b12bf075287514877ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.list_of_blocks_PandasDataframePartition.apply.pass": {"doc_hash": "f8e0709f97065d9b6d3783b85851df8f8c9d81f54186ea170583090f913f588f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.add_to_apply_calls_PandasDataframePartition.add_to_apply_calls.return.self___constructor___": {"doc_hash": "bebbb02c50d33b042b5fd47a28bf4de8bfe724b18b831e8deaf05aa02caa3b54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.drain_call_queue_PandasDataframePartition.to_pandas.return.dataframe": {"doc_hash": "00cbe113efad08e629ea990e7e83bee500d647c46aa5fef0df63c323ee828e72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.to_numpy_PandasDataframePartition._iloc.return.df_iloc_row_labels_col_l": {"doc_hash": "e0b3056ada2c1e563d41d7b30d4bbdd363fc4c3b10f85d19b9ea8f61206bf108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.mask_PandasDataframePartition.mask.return.new_obj": {"doc_hash": "30a189a10ddd7e012833d98f744de6c61ca0401cb933b0c36ea248ebabb159bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.put_PandasDataframePartition.preprocess_func.pass": {"doc_hash": "7f5c97e9b0948257433552643e80bfcb97690c6ff9769bc7fe0253fa023ad5c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition._length_extraction_fn_PandasDataframePartition._width_extraction_fn.return.width_fn_pandas": {"doc_hash": "c1d6ecc159ad47e25575c8ebf2d3c8618fef67b164a451ccd83f16283d7649ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.length_PandasDataframePartition.length.return.self__length_cache": {"doc_hash": "77ef6861cdaa0411ddcd0f3b6150124c26cd0ee4c5760fa30083f3665cbcd183"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.width_PandasDataframePartition._identity.return.self__identity_cache": {"doc_hash": "76299d37da45c9c3ae6e22e846314fe7bc583b4eb96e277dd10024bcc21a6263"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.split_PandasDataframePartition.split.return._self___constructor___out": {"doc_hash": "ba3e7dfefa7db326b44008b6645ccdb3e64753c38c67dc6d09e036778749d782"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.empty_": {"doc_hash": "3470d7cac011345f3a96ac02c2d1d07b0341affda00b09f5ca0141dec21e32b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_from_abc_import_ABC_wait_computations_if_benchmark_mode.return.wait": {"doc_hash": "6a0950495172372493e7bb777bb7ee7255b15cf119c777a9f3280a844d176045"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager_PandasDataframePartitionManager.preprocess_func.return.cls__partition_class_prep": {"doc_hash": "613dc358e8906764d54444c4e6531c756c39d802dbc10f2a42e718047476c70f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._END_Abstract_Methods_PandasDataframePartitionManager.column_partitions.return._": {"doc_hash": "6c6c743322451a81680319ee8cd1acf93003c0bf38659fe1c7f59d7c6a332f18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.row_partitions_PandasDataframePartitionManager.row_partitions.return._cls__row_partition_class": {"doc_hash": "7ace4dc651bb1ad53a6196f4a8ff0354a7d96f7c5004feae69d3d892d57bb283"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.axis_partition_PandasDataframePartitionManager.axis_partition.return._": {"doc_hash": "03774cdb814a7db662b85f34acdddbc3b5cc0dfbf1bdbb5eff681860acb85410"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.groupby_reduce_PandasDataframePartitionManager.groupby_reduce.return.cls_map_axis_partitions_": {"doc_hash": "a0ce33e0eb81b8fa97fbcda8b07f987aa84b9aa523733ea4f2eb721edf853446"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_apply_select_indices_PandasDataframePartitionManager.broadcast_apply_select_indices.return.new_partitions": {"doc_hash": "eb1ac7e6eb4f526696ad807b698464b97e908ca6aa3bcf39500ca68ff6f95ff4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_apply_PandasDataframePartitionManager.broadcast_apply.return.np_array_": {"doc_hash": "32d89c686bd909704db37894255e6900a47fb31e17f4efbf2734a81dbd22b3f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_axis_partitions_PandasDataframePartitionManager.broadcast_axis_partitions._For_mapping_across_the_": {"doc_hash": "18cac262fb4a1b56f2a71a5f4baf9e56a7eefd2d71712410d59a7ee3ffe47c9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_axis_partitions._may_want_to_line_to_par_PandasDataframePartitionManager.broadcast_axis_partitions.return.result_blocks_T_if_not_ax": {"doc_hash": "2b0113efb8a3dae12627785be97c1fd7c23c7497f33f4bc1d00d7cd91c22ff29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.map_partitions_PandasDataframePartitionManager.map_partitions.return.np_array_": {"doc_hash": "0e23bbe70d6f863b24f0c55525b48ab2e5565968b25e03f0ded0438e34ca54d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.lazy_map_partitions_PandasDataframePartitionManager.lazy_map_partitions.return.np_array_": {"doc_hash": "2672b70041e27b0b08fa21796299e99763b7df659d45d265f0e9d97f639614ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.map_axis_partitions_PandasDataframePartitionManager.map_axis_partitions.return.cls_broadcast_axis_partit": {"doc_hash": "a0221b53d1bc672d56a9c4790462d6e34230888b1b35a518e13c464e70d48a52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.concat_PandasDataframePartitionManager.concat.if_axis_0_.else_.return.result_None": {"doc_hash": "1090a132fbfdecbacd7312d01be6d0913462d96dd234aa375f3e16e85f3cca0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.to_pandas_PandasDataframePartitionManager.to_pandas.if_len_df_rows_0_.else_.return.concatenate_df_rows_": {"doc_hash": "5aac3aa67e644127afa1cf5d67456711f853c377b1594db8eaaf807a88c51b19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.to_numpy_PandasDataframePartitionManager.to_numpy.return.np_block_": {"doc_hash": "1b37cc7826e41a441f056ebc41898aba05aac17da71a80adf27f62727b1eead1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.from_pandas_PandasDataframePartitionManager.from_pandas.if_not_return_dims_.else_.return.np_array_parts_row_leng": {"doc_hash": "83c9f031f52ac68f34eef721a03bded5aa3c8f6e0b2e36ec84d4f30865ee3e08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.from_arrow_PandasDataframePartitionManager.from_arrow.return.cls_from_pandas_at_to_pan": {"doc_hash": "0ec784df788800684953a618a7feab31307263c73b89c329c39c4103adf3a5e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.get_objects_from_partitions_PandasDataframePartitionManager.get_objects_from_partitions.return._partition_get_for_part": {"doc_hash": "865ad2a56f1f029a846eaba98f691a43abe963aa57a853d28901233d3550c856"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.wait_partitions_PandasDataframePartitionManager.wait_partitions.for_partition_in_partitio.partition_wait_": {"doc_hash": "3cb02ea2668edfda76364e8b7804eb1e8c7e10e8a04539493f925cd502ae8683"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.get_indices_PandasDataframePartitionManager.get_indices.return.total_idx_new_idx": {"doc_hash": "50c935cf8e9ba5d7ffb6996347af43dcbe3de9bb45e38157dcb08256b0d67a2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast_PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast.return._": {"doc_hash": "f01d2199d9ce02dd2307e992ef8ee7cef2d8bc1285bcf566d1058a93b9fa964c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._apply_func_to_list_of_partitions_PandasDataframePartitionManager._apply_func_to_list_of_partitions.return._obj_apply_preprocessed_f": {"doc_hash": "aff070e5f9ef0b459d073d4029653c18d0f28c78da7cb274ab37774afdacb2f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_PandasDataframePartitionManager.apply_func_to_select_indices._accept_a_keyword_argume": {"doc_hash": "ad34a0f925fa807549b281af5824ef7f141a35c85b96d6bd65aad80fc15d9548"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices.if_dict_func_is_not_None__PandasDataframePartitionManager.apply_func_to_select_indices.return.result_T_if_not_axis_else": {"doc_hash": "3b8e852b11930c71e7fa5345bceaa88845c27d8b9f0fb193cc51594e4ccd7e38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis._accept_a_keyword_argume": {"doc_hash": "c7bd8b8935d6504dc9a22ecce0dde191e7c24a66d2b6c458469725912779bc8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis.if_dict_func_is_not_None__PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis.return.result_T_if_not_axis_else": {"doc_hash": "eccb9ef3ffc1609ad9d028cf8069d534f295f8724342555cdb65c5d4c01301f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis_PandasDataframePartitionManager.apply_func_to_indices_both_axis.if_col_widths_is_None_.col_widths._None_len_col_partitio": {"doc_hash": "e627d6897966e68a5671cec220845580957e0c0b6458326bbeeaf8da25e8cce1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis.compute_part_size_PandasDataframePartitionManager.apply_func_to_indices_both_axis.compute_part_size.return.len_indexer_": {"doc_hash": "e5c6adb177979b6a8520058ec0f2f67f3b9e7c13f59bf36693a6b769ddb7a965"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis.for_row_idx_row_values_i_PandasDataframePartitionManager.apply_func_to_indices_both_axis.return.partition_copy": {"doc_hash": "559d2cabc1544d0729162adb1e9461a6b8746a47a3ac0682b893feaa93e38d62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.n_ary_operation_PandasDataframePartitionManager.n_ary_operation.func.cls_preprocess_func_func_": {"doc_hash": "b3b239dab2838145bbc94880691b6fd69817d6053e7fb94296e04988ad1c70c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.n_ary_operation.get_right_block_PandasDataframePartitionManager.finalize._part_drain_call_queue_": {"doc_hash": "a7c7b1a25ea8309d0711e6359a485aed466cc672a12cd5c67366b8beb2aabde6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.rebalance_partitions_PandasDataframePartitionManager.rebalance_partitions.ideal_partition_size.compute_chunksize_": {"doc_hash": "d29ae5022a2f5939588bbd4fe73aacd576c6912c475a6d41624bf40dcff67d7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.rebalance_partitions.for___in_range_ideal_num__PandasDataframePartitionManager.rebalance_partitions.return.new_partitions_lengths": {"doc_hash": "d893736591fe9b490471b46b736d988ef154d52bfceb853bb7e2f36705ad4a88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.shuffle_partitions_": {"doc_hash": "e3cc4a9c870d910003020d0ca3a6b7b1c50006b52351178e2addc1408b6fcad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/utils.py_pandas_": {"doc_hash": "4118cda1ab894c5db413448208222d74c1a85e1c73e533713b67b72a2abd4eed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/__init__.py__": {"doc_hash": "8a4e429c7cb5b6272fcc3e372ade62b69c228af17329a9fca7f8d942b9e1b0bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/__init__.py__": {"doc_hash": "5b5ebd288c3664d98bb36179519020c239375b2235393cd3cc64d9908e5cf08e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/__init__.py_DaskWrapper_": {"doc_hash": "2b169e56132db630b6f44abe76c9f746e85e8c8c72e5b56f63923fa38c15bcd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_from_collections_import_U__deploy_dask_func.return.func_args_kwargs_": {"doc_hash": "696a26895ab98d5b113b5b33f6c254c951141fb9cac49c05da2b92f2402c68e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper_DaskWrapper.deploy.return.remote_task_future": {"doc_hash": "c8f6ec73184a8f5ab840e8117d79af210551d1cd89ec0c92cd3ff2863365212f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper.materialize_DaskWrapper.put.return.client_scatter_data_kw": {"doc_hash": "e50dcb5245db3237f1f782c8c9498f770d8d9d9bf78881b48ca90e8cb7b27585"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper.wait_": {"doc_hash": "e28efcfbaf875011502a9e4f6c322fdaf4bfe3cd7e816de42d3ca855829b02a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/utils.py_os_": {"doc_hash": "8441f742b9465330ca2c6fb810178805ea0733688668f86ea077221579d0d6d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/__init__.py__": {"doc_hash": "8857f7e7a3f24277fc045d49494905ee32fd36481d687ec7de440b1d0ff27819"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/__init__.py__": {"doc_hash": "a56da47bec4adb8d1514de3eedd326b0baeb9186fdf0156a267a9731206ed670"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/dataframe/__init__.py_PandasOnDaskDataframe_": {"doc_hash": "e0f69d9fc0a0e7c65c2423dbb8f421f0b8ae9a9c4b3ba65a8679b0ff0aa9c92d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/dataframe/dataframe.py_from_modin_core_dataframe_": {"doc_hash": "b6afc7083fbef1f6db0ef4e494dd5e0f5544b91551515982b9737546bda8db80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/__init__.py_PandasOnDaskIO_": {"doc_hash": "21dcb519b65dac3cf074a53030931b6b51e0052563ebeb898cbf04aa9a89d344"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py_from_modin_core_io_import_None_6": {"doc_hash": "7344b0d114a1726f82c2122cc624151190eb0f4add1128133817dc16cded7f05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py_PandasOnDaskIO_": {"doc_hash": "7806d9e39584e37b731646ea3f62d9e492eee1132e0b5405ae7c048794376cf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/__init__.py_PandasOnDaskDataframePartition_": {"doc_hash": "ebace6423b7b80a8a91062e242b7edf27e9692799083165edd3dcc33e3ee4731"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_from_distributed_import_F_PandasOnDaskDataframePartition.__init__.self__is_debug_log_and_l": {"doc_hash": "cc9acd6319dfe356de54a4664f24a6b1498ad3be36821c0b70264a8f6dd6f075"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.apply_PandasOnDaskDataframePartition.apply.return.self___constructor___futu": {"doc_hash": "8aba5602c2397e7b03cf3d3b74f5ace16b4a19723ea72b1d8ccfadc80db6dbbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.drain_call_queue_PandasOnDaskDataframePartition.wait.DaskWrapper_wait_self__da": {"doc_hash": "42fec9889be3303dd95c035f48a97581f07b02a6f2fa9ccfb4fcc00430fcedc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.mask_PandasOnDaskDataframePartition.mask.return.new_obj": {"doc_hash": "9d8c629d69f1a107e202177ece683862c7659fdd71d15f38d969f953946ca32b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.__copy___PandasOnDaskDataframePartition.preprocess_func.return.DaskWrapper_put_func_has": {"doc_hash": "b6f660663028a066d37af7d5df58751225bec1a9e0f6b9a6acd65675f11576fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.length_PandasOnDaskDataframePartition.length.return.self__length_cache": {"doc_hash": "d4733e05cf4baa322b17b0d4cb4730be78e42924ba8935150d31f2af20feca6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.width_PandasOnDaskDataframePartition.ip.return.self__ip_cache": {"doc_hash": "0218c62f899ad29577f96d5b76bf3a473128f9f485f2371a1345e2ee01da812f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_apply_func_apply_func.return.result_get_ip_": {"doc_hash": "f31f1246122a9fd2e98609881d83fdcdc01b4470cb5c0eab9bad8cef16911662"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_apply_list_of_funcs_": {"doc_hash": "be62dec39cd00f97c92acf8d7a4b79ad227c95aa1a6245efe05d9aafbd436fa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition_manager.py_from_modin_core_dataframe_": {"doc_hash": "bac3857f270a821bad7ed70d2c0cad6b0dac074c568f5e6d2bcd31e7b29296d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_from_distributed_import_F_PandasOnDaskDataframeVirtualPartition.list_of_ips.return.result": {"doc_hash": "238d1adb686e46aa55911d3c16ca39fb657a53b2ef0430d2e39e4f6ed764b116"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_splitting_func_PandasOnDaskDataframeVirtualPartition.deploy_splitting_func.return.DaskWrapper_deploy_": {"doc_hash": "7890a8dfc21f5d7322fb0fe0781eee028b313d6bf248c0eac9c020299deaef15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_axis_func_PandasOnDaskDataframeVirtualPartition.deploy_axis_func.return.DaskWrapper_deploy_": {"doc_hash": "94341bde0e4c1c8f9a2a8b4657ec31ab0ad85070dfd05586828cb452b886ce0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnDaskDataframeRowPartition.axis.1": {"doc_hash": "1b406bba33c929c26fa13c4ed4ab1340c2185902ea0c04dd925461cef8e3f785"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py__deploy_dask_func_": {"doc_hash": "2be729f08e73804129393889ceea47c8ea1f7e80c2910afca449e319117e7801"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/__init__.py__": {"doc_hash": "a806e7af4180e909abc3798c91fdc3df1f71575bf3e68b9b5dd78f6335912b5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/__init__.py_factories_": {"doc_hash": "c3f6986b1071c0a11fa4e0ba8e797896f33bd45c85e6350d33f7f5e569a67f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_from_modin_config_import__StubIoEngine.__getattr__.return.stub": {"doc_hash": "29d61818c98809b0b61d51b94e7450d99fa508bc4280e2193d844996c8f3b1cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_StubFactory_StubFactory.set_failing_name.return.cls": {"doc_hash": "cbbb57d1b5d0bb92f7d3898e401cc57a3a8d8127f0c1a960234148bf715b775f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher_FactoryDispatcher.get_factory.return.cls___factory": {"doc_hash": "99561a7a150e6907303b20787ffcf5fc095955b1be71c6cd0f6f6833484092c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher._update_factory_FactoryDispatcher._update_factory.try_.else_.cls___factory_prepare_": {"doc_hash": "f66d32996b1c73cd259ac78bae72bf3557eddcd743423ab5793d37b78df4919b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher.from_pandas_FactoryDispatcher.read_sql.return.cls_get_factory__read_s": {"doc_hash": "34bf00c4b9849e4ef8259d116851ee0f2839a0d34c34e2859385af964290ad5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher.read_fwf_": {"doc_hash": "6c47702e17ee054271f6412a1f6e63d6c02750b297c6e5c6edad497da3df57cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_warnings_NotRealFactory.pass": {"doc_hash": "8e0ccfd2d0b0be49bc777ffed06fc0b4fcc3dcbf3aacf5b7ba7cb0fe3d88d3dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory_BaseFactory.get_info.return.FactoryInfo_": {"doc_hash": "f2ee797d362e8c041c1d794219cd497c6b6fb22c4be54cd92a1d0507b505e71e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory.prepare_BaseFactory._read_excel.return.cls_io_cls_read_excel_k": {"doc_hash": "60eeaf0846214c19dd6e08d17ba5a4e01f6673d5346e0d4d90c6422e6244f5eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory._read_hdf_BaseFactory._to_sql.return.cls_io_cls_to_sql_args_": {"doc_hash": "4b4a2196e9e594b3ac0f6af90672514bdaeb20d73e1d88e22749e45c9c8118a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory._to_pickle_BaseFactory._to_parquet.return.cls_io_cls_to_parquet_ar": {"doc_hash": "d1015baebb6859ca0e5a0efbe983d20a5f2bb16c0a360b0014effaf6811e77b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_CudfOnRayFactory_PandasOnDaskFactory.prepare.cls.io_cls.PandasOnDaskIO": {"doc_hash": "8e23a50ccb1186b782e3c77992759033d4e702e9eb13ab42122ea98c53de0332"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory_ExperimentalBaseFactory._read_sql.return.cls_io_cls_read_sql_kwa": {"doc_hash": "e530987769cbe337466a97548a54326007a8ce19db782cb23628a16969c8dd40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory._read_csv_glob_ExperimentalBaseFactory._read_custom_text.return.cls_io_cls_read_custom_te": {"doc_hash": "994ca75e7f72cfd4ad3fd758b5aab653a40b42cf93cbb8b58554c3b99e176a80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory._to_pickle_distributed_ExperimentalBaseFactory._to_pickle_distributed.return.cls_io_cls_to_pickle_dist": {"doc_hash": "e14ade75e83108fc13bfbf6415b995a611384c56c5288ddbb2b087362f5a9917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnRayFactory_ExperimentalPandasOnRayFactory.prepare.cls.io_cls.ExperimentalPandasOnRayIO": {"doc_hash": "a3fa67ac0869824d7f9e66d5d444c79d27d460cf656c7ab2f05d9aeb23ea157b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnDaskFactory_ExperimentalPandasOnDaskFactory.prepare.cls.io_cls.ExperimentalPandasOnDaskI": {"doc_hash": "7887c2576d3dc543149ef031165309fddf24adabbc83bb310dc7c1ca45fffaae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnPythonFactory_ExperimentalPyarrowOnRayFactory.prepare.cls.io_cls.PyarrowOnRayIO": {"doc_hash": "ae61417c91e7c2cff61db80f484a26ddccdf8eca18b4d2ec785b47a3bb1a8c3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalRemoteFactory_ExperimentalRemoteFactory.prepare.cls.io_cls.WrappedIO_get_connection_": {"doc_hash": "8a3a275aa8cded4aa5293e660029fa2835d9066f39cdb8a720aea84135ebd744"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnCloudrayFactory_ExperimentalHdkOnCloudnativeFactory.wrapped_factory.ExperimentalHdkOnNativeFa": {"doc_hash": "fc272015640d993fce30e150c740766825460081fdc090baa9cba3188266ad81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_PandasOnUnidistFactory_PandasOnUnidistFactory.prepare.cls.io_cls.PandasOnUnidistIO": {"doc_hash": "c57451e1bbed507cea8743561059424c2818f4fdd2858a6a3b5e42b367dd3ab3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnUnidistFactory_": {"doc_hash": "257746a09c9d9007b1ea2d7adc5fca7ec780d901e72847ba8b5781b27b6d3700"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/__init__.py__": {"doc_hash": "1fec0ee79d4f16cf73c7d5654c4ef693b0c46588fe95701c0e8484ed376c5643"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/test_dispatcher.py_pytest_test_set_execution.with__switch_execution_B.assert_FactoryDispatcher_": {"doc_hash": "decb21e2d744fccda5305177b9194f2c06ab7b91c4a0d0ccf65cef7e62f7610f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/test_dispatcher.py_test_add_option_": {"doc_hash": "e678df611b3008f3c9991abac241a0ded22497c7d4ffecce9b007a442df9baec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_os_call_progress_bar.if_progress_bars_pbar_id_.progress_bars_pbar_id_cl": {"doc_hash": "e32ef6500872eee27589a0a8f67b4ffd65051d57748227478969543bf4b0b342"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_display_time_updates__show_time_updates.while_p_bar_total_p_bar.if_p_bar_total_p_bar_n_.p_bar_refresh_": {"doc_hash": "57a348542002f941fa324686f4195d57a6f6fce1a7795b02bf0edfb7d6e3ba82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_progress_bar_wrapper_": {"doc_hash": "a1a3d71f54ff2900201997e35c0090753d50e1d23dbc3a4ed19b3a846dc06815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/__init__.py__": {"doc_hash": "eeb654df95ccaa317032287c71bb7a44de0a33bef074582d96b72158270d105f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/__init__.py_PythonWrapper_": {"doc_hash": "2c244ca0f755b3923af8fb0ea559a0cdaed72151206e342064b563c442e85cfd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/engine_wrapper.py_PythonWrapper_PythonWrapper.deploy.return.func_args_kwargs_": {"doc_hash": "a9189f25f6c617a81d59bb6aa4299384080003905d7e07d1696a95603e40c709"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/engine_wrapper.py_PythonWrapper.materialize_": {"doc_hash": "0edf6825acde3c0971c0e5cbfcbd10035a13372a8c7c70714f7466e1f4281a30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/__init__.py__": {"doc_hash": "4b6afdac36b6e6d902cc4c30c7048433e8086deaae497d7a6219f0fc94ecf358"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/__init__.py__": {"doc_hash": "d079446af1d9e65cf98dd285f5346570f10a2088d5c8a5b0cbc2d120985f3ed8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/dataframe/__init__.py__": {"doc_hash": "e77bf83ea27bbc70b124400952670054eaca3f1346f09d32e0c572aef215cd0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/dataframe/dataframe.py_from_modin_core_dataframe_": {"doc_hash": "6f08e6c76e49269ebd1a44fb1f182484429b1cbc3f25eba25eaadadbc16c77f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/io/__init__.py_PandasOnPythonIO_": {"doc_hash": "655e9b8617aff4f2798224f5de6df65136e3ef1881f49f486a82468ca4ccf1e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/io/io.py_from_modin_core_io_import_": {"doc_hash": "a77a36088df8082e17439191ce417ffa508a024ec7fd9322c95512a4720eb731"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/__init__.py_PandasOnPythonDataframePartition_": {"doc_hash": "4308641e301d7a3ae4d9f39f64283b508bdcf8c6c8aa7895b168c51bb74a793a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_from_modin_core_dataframe_PandasOnPythonDataframePartition.get.return.self__data_copy_if_hasa": {"doc_hash": "afcc5603b3cd4f310251150670cf9b2ad010c08b7d0fb31a5153965b426ba5ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_PandasOnPythonDataframePartition.apply_PandasOnPythonDataframePartition.apply.return.self___constructor___func": {"doc_hash": "f4347c2ef94d4d8d0cf1f8f8d84997c7108951e57f4ba4b8888f00210b640420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_PandasOnPythonDataframePartition.drain_call_queue_": {"doc_hash": "0f6e3d30ac23b8341ee6a4e49ea08a6ca7a2b5cf9a22cc4deb49fa365270e063"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition_manager.py_from_modin_core_dataframe_": {"doc_hash": "b15165a9a15ea5a461753d9a2e493e074cc788544274922da8598b5189d9446a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/virtual_partition.py_pandas_": {"doc_hash": "91a359e78529658416857eff16a5be6cd0a7f770a91ab28a88e8a6e75baefd40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/__init__.py__": {"doc_hash": "6b84f933400946fc1a6dff9caeb101d05ec51a0efa73917717a2189e08af0de8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/__init__.py_RayWrapper_": {"doc_hash": "075322d9913f400d28b31950ea582fc85e96768b0b73fe5bc8268d93a647027d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_asyncio__deploy_ray_func.return.func_args_kwargs_": {"doc_hash": "dd3b7699a2d3a20ba7a8a5b963a81bbeab97d363b5f8520ea67fde7f86a3423c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper_RayWrapper.deploy.return._deploy_ray_func_options_": {"doc_hash": "dc8ed2ee02cb53abb4edab9346afe1fd41cf64ff34ffedc80cc7d51cbc419140"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper.materialize_RayWrapper.put.return.ray_put_data_kwargs_": {"doc_hash": "d626ad8fef72b1b5511136894fbbfd2072f61211041a9dc4bedbc7cbc48fbce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper.wait_RayWrapper.wait.ray_wait_unique_ids_num_": {"doc_hash": "1eff5632b680d3e841959353362250a35bc907ffec44daf86b7db7ec1fecd412"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_SignalActor_": {"doc_hash": "46882e6c8e76655533ea4dbf9c6de8cb1e7c2f6fabd56e9c0f56c57ea534fb6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_os_if_version_parse_ray___ve.ObjectIDType._ray_ObjectRef_ClientObj": {"doc_hash": "d1e5cf4508ad3c6b2519445922b7d223be86eb0317f14e6a539f6dfca947646e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray_initialize_ray.is_cluster.override_is_cluster_or_Is": {"doc_hash": "c8000383629967357d1ecc28a3a8a3a161bc2456df5c360bef60fec1a5ba9395"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray.if_not_ray_is_initialized_initialize_ray.num_gpus.int_ray_cluster_resources": {"doc_hash": "67bd4a7c7a8bf75e9647b80fdd35802196da82c2de4729757c09d0c4385c789e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray.if_StorageFormat_get__initialize_ray.if__RAY_IGNORE_UNHANDLED_.os_environ__RAY_IGNORE_UN": {"doc_hash": "43ae5a10cf899a0599547773347304fe3459b44b624c21904d97bee0bedc7ea7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py__get_object_store_memory__get_object_store_memory.return.object_store_memory": {"doc_hash": "4283d1a39c3d3566beef5cf63870e7bdba8f948a0664d4f9968db5182b40b14d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_deserialize_": {"doc_hash": "8bc6ae22f484d3d631772af6bdea4367b32c706a1ed0745a73685bf45723f227"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/__init__.py__": {"doc_hash": "7f7be80fdb3f0c4491e1c80ab0af5d0972f76a0e083c613b404c49a7e8946711"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/io/__init__.py_RayIO_": {"doc_hash": "68f7a98b0c22c08465e40ffc15eee8142958e6a5c0947949099198aa6a2ff308"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/io/io.py_from_modin_core_io_import_": {"doc_hash": "e44d4a4d2fc0225fdab58bf604e3befdf7677212bc006ec4403efadae84652ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/partitioning/__init__.py_GenericRayDataframePartitionManager_": {"doc_hash": "ab034220196fc82a295e397bb03f6d31aa4125dce8109a50b8e4b0932e1a70f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/partitioning/partition_manager.py_np_": {"doc_hash": "dd2a0ef827a085f62fa827e62e9f9a5c5a58f93fefcbee3a85737942b6cddf39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/__init__.py__": {"doc_hash": "b863fa8bef82104c1771c64805ac67f2afd0f4d9541cea30c864736dd80d834e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/__init__.py__": {"doc_hash": "b2766e5e3ea464365251d8ed081d0023837f46df987cd2f1949399337a271c99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/__init__.py_cuDFOnRayDataframe_": {"doc_hash": "b2f8ce97a49e7dc0025792fb1e89907cd66923dbb48fbe63f5da017784aa996c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_from_typing_import_List__cuDFOnRayDataframe._partition_mgr_cls.cuDFOnRayDataframePartiti": {"doc_hash": "b27cbb7b53b900470e69b82c547d131ef729948ed26e27182c114854c1ab5c06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels_cuDFOnRayDataframe.synchronize_labels.cum_col_widths.np_cumsum_0_self_colu": {"doc_hash": "191b51a5082bf62f400e77685bab1b594ad9f79880840cfb5b59c7377d2a3b6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels.apply_idx_objs_cuDFOnRayDataframe.synchronize_labels.apply_idx_objs.if_axis_0_.else_.return.df_rename_index_idx_colu": {"doc_hash": "3baf59aa459340d58eb648147e12181d905d63a5f8aed6c5e171f521972ebc93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels.keys_cuDFOnRayDataframe.synchronize_labels.self._partitions.np_array_": {"doc_hash": "fb95e98ee00ead85b537ae7cf539747f507d09d8918a8fb1eb5b9468d11504f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.take_2d_labels_or_positional_cuDFOnRayDataframe.take_2d_labels_or_positional.if_col_labels_is_not_None.col_positions.self_columns_get_indexer_": {"doc_hash": "f01b271e4ac8d071e0ce0476e8f39bd30fdc3c92fdf0e1c854a08d4939378bdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.take_2d_labels_or_positional.if_col_positions_is_not_N_": {"doc_hash": "0ce128ccd945318147325c31afead41b8c12212fb7928e0d363b0c265f2ef8ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/__init__.py_cuDFOnRayIO_": {"doc_hash": "a6ecec17ef9ca8034b5936d5800ef174a780f35f8790494d7454f7160c7ffbe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/io.py_from_modin_core_io_import_": {"doc_hash": "1f9d8c2ab337ce89d317dfae2e81769aff4f172fd3099cdd72748d8abc730d93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/__init__.py_cuDFCSVDispatcher_": {"doc_hash": "2bd761ca5da4fd45511cbd3197b422e71e8b6d4a31178ceffe0103713ca08ea2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py_np_cuDFCSVDispatcher.build_partition.return.np_array_": {"doc_hash": "4748319357493132ad0adfc56625d84ff46fa21d0c5f891e46eb09a91185f51a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py_cuDFCSVDispatcher._launch_tasks_": {"doc_hash": "588791c7290cc5d19f054c5ae6cb361780480ea80a9d1e92eb046f0f6d68ad2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/__init__.py_GPUManager_": {"doc_hash": "245dfe7ec85a85012c50b1c6de958295740247c954d502c5ae616f623d2a30a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cudf_cuDFOnRayDataframeAxisPartition.instance_type.cudf_DataFrame": {"doc_hash": "495aa920641ab97d9c286f3c479a821e5693ebb10df4126ebd25829e7a704ee2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cuDFOnRayDataframeColumnPartition_cuDFOnRayDataframeColumnPartition.reduce.return.result": {"doc_hash": "6aa038d4c5803dfcda811f194a0ba05780c2b6d7a19e7c8810d0aa2bc0ac615b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cuDFOnRayDataframeRowPartition_": {"doc_hash": "40756c707efcabc643ec5dd6fe1946231c47c4f900f5dbeef45dadd76d0761ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_ray_GPUManager.apply_non_persistent.return.result": {"doc_hash": "552ad2c6d4bf058cc0f1577d1a4df05e58c87e0289e09c30b90411bdd400a508"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.apply_GPUManager.apply.return.self_store_new_df_result_": {"doc_hash": "492ad5f59b36bd87cb1e5342d9aae4cf70f8fd2c026372f0c19a6770e5a58611"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.reduce_GPUManager.reduce.return.self_store_new_df_result_": {"doc_hash": "c2b09993715bb9c6ef7018fa4c5fb181b7393a403a980f6743e04a30ba6164ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.store_new_df_GPUManager.get_oid.return.self_cudf_dataframe_dict_": {"doc_hash": "1d95c3ff5b272fc97b5b0babbd52d346269883ab8dc5f75f658fb0d1d7ad1b26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.put_": {"doc_hash": "a766da65a42dfc9610572da9ec47fa116e40975ae84cc47bb2f6019feaf13627"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_ray_cuDFOnRayDataframePartition.__copy__.return.self___constructor___": {"doc_hash": "673a92f81c8b55528d1842ef1002c0969de94f14e7e0669da3438d9f832a5e5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.put_cuDFOnRayDataframePartition.put.return.gpu_manager_put_remote_pa": {"doc_hash": "a97243864f6ad760aeb5ce8d2fe3a3e432375b09cde2580b043f724fe4955cac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.apply_cuDFOnRayDataframePartition.apply.return.self_gpu_manager_apply_re": {"doc_hash": "d3e96f9efe135011d5682e31322e30fc08f3ba76c08e84b81f57afeb54844570"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition._TODO_Check_the_need_of_cuDFOnRayDataframePartition.apply_result_not_dataframe.return.self_gpu_manager_apply_re": {"doc_hash": "1eff0a8c04755778a38015941e26072cca8788de54feddfa0dcc6d7cb026d698"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.add_to_apply_calls_cuDFOnRayDataframePartition.add_to_apply_calls.return.self___constructor___": {"doc_hash": "98e0394fecaf5b9947277493c2b0693a99574b55d99b6b4c9e0aab7395dc6236"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.preprocess_func_cuDFOnRayDataframePartition.length.return.self__length_cache": {"doc_hash": "2e7c48ae599e316202fd17cce65dbf930eb5f224ddfc1816a758f2d00b8e42a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.width_cuDFOnRayDataframePartition.width.return.self__width_cache": {"doc_hash": "61e7a636661418ec52721ab65f3995f4be07260961e52f2d3ad7d15adf17fd76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.mask_cuDFOnRayDataframePartition.mask.return.self_gpu_manager_apply_re": {"doc_hash": "8f10aeab56b7514cc9625476a2b1ffcf73f987b17f2f4438bc933a509e943e7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.get_gpu_manager_cuDFOnRayDataframePartition.to_pandas.return.RayWrapper_materialize_": {"doc_hash": "f892dc0b449492c9a518e6ad66a9998ef5cf95f2f0306595022ecc39308cb813"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.to_numpy_cuDFOnRayDataframePartition.to_numpy.return.self_gpu_manager_apply_re": {"doc_hash": "b77ae16ef5b645655679bdf1f384da4c4c806aff7f840292290528c8e4d2e16c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.free_": {"doc_hash": "52a79744cf0d65ec04828baed4188fce14b814d0e98ce89fe20b2738cb027e65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_np_GPU_MANAGERS._": {"doc_hash": "7a8fe05ecc832b190dbdb9f55964a14248dc4f6e75208d5f383f1838ad6f7afa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py__TODO_Check_the_need_fo_func.return.apply_func_": {"doc_hash": "3fc7c15267dd634da95709f26fa8fe3b6da5fd653106778ff2e696063a36aadd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager_cuDFOnRayDataframePartitionManager._get_gpu_managers.return.GPU_MANAGERS": {"doc_hash": "dccd9b90f2ccf68f30e2ff777118985b2f86cd3b8c51ef30921f5bedb6f3efe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager.from_pandas_cuDFOnRayDataframePartitionManager.from_pandas.if_not_return_dims_.else_.return.parts_row_lengths_col_w": {"doc_hash": "6768108a878f6d728ea02572dcf3493acf6ae8cbae8446b84beeeb0a9e496473"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager.lazy_map_partitions_cuDFOnRayDataframePartitionManager.lazy_map_partitions.return.cls__create_partitions_ke": {"doc_hash": "41511ac85349e14b2dc74cece0c0b37affe38ece0a8a54bb8b7d05b8d7bd5385"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager._apply_func_to_list_of_partitions_": {"doc_hash": "e6497eca31071f3bcbb5d8acf0bf68264e5a2176831f3cacf7c39d8e13c926bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/__init__.py__": {"doc_hash": "a978b0ed21836bba2408c9ccb3aef15912e5b6cb08a400bc9644800f64b1deeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/dataframe/__init__.py_PandasOnRayDataframe_": {"doc_hash": "59373c2112d5aebf7335cd44fa7bbc6e541e4a3e7041b9e2db217304382c1464"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/dataframe/dataframe.py_PandasOnRayDataframePartitionManager_": {"doc_hash": "11f2825dd65c94edd473ed22cc6e25e01db89c4528e1830e960a2efbb83ba8d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/__init__.py_PandasOnRayIO_": {"doc_hash": "4fc7659de0f462d51ba9fdb33ff789e3bf34e336128a17a4f6074baabbf812d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_io_PandasOnRayDataframePartition": {"doc_hash": "bbe303c72433b96650f732c5b8a3ecd69354d75d9c0bc4fde1c321fc9358307c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO_PandasOnRayIO.None_4": {"doc_hash": "ef703b94cb5fe6114ed6741dd49c49a52756f5710c2217ba576128a3d1fe92bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO._to_csv_check_support_PandasOnRayIO._to_csv_check_support.return.True": {"doc_hash": "6a5a77c3292dc944a57f7618ee09d28c9e8fe5cb256e77112b3d29b8a9827705"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv_PandasOnRayIO.to_csv.signals.SignalActor_remote_len_qc": {"doc_hash": "cf4ab28024f88ca8ae016ac14ba62deb331e5b45300d16396adf4f0c810f7e1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv.func_PandasOnRayIO.to_csv.func.return.pandas_DataFrame_": {"doc_hash": "aa04370b411f2c955aa0116d5a640ebce10c083a9b8ed30848989996ba1b34b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv._signaling_that_the_part_": {"doc_hash": "b9989f85bdf8228cbf03a2d676910859d6cc11ddcf7eea2106bccc0e63446306"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/__init__.py_PandasOnRayDataframePartition_": {"doc_hash": "dba86c25dcb2d8b271320b2b12d2ee0c771dbc3525041bfb306c209523f1a0ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_ray_PandasOnRayDataframePartition.__init__.self__is_debug_log_and_l": {"doc_hash": "3b339988ff71ae3830334f79729c426ef57a8bede6df0a0303f0a0d3472f9cea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.apply_PandasOnRayDataframePartition.apply.return.self___constructor___resu": {"doc_hash": "64b48f10af98fee8b2c0fbc6ecf6d00a00804b0b8895fbca9b4bc02b3f514b4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.drain_call_queue_PandasOnRayDataframePartition.drain_call_queue.if_not_isinstance_self__w.self._width_cache.new_width": {"doc_hash": "3657bd775d2b1c9b62f5b03464ea04e019085995e7ce1c9556060d3918e7e69d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.wait_PandasOnRayDataframePartition._iloc.execution_wrapper_put_Pan": {"doc_hash": "1c2a3bcd4e5cfdadc7ebf5c9256055fec410b40f36f93a70f4f86e2066339f25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.mask_PandasOnRayDataframePartition.mask.return.new_obj": {"doc_hash": "5dac7e0e8b91d7e1db9a4d0673ba279b14ce39a61257bd81ed5040c2b2a72b50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.put_PandasOnRayDataframePartition.preprocess_func.return.cls_execution_wrapper_put": {"doc_hash": "8f031023f288c43132d159c4b3ddb4aad78a199cc112210a9b9fdcfb46970805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.length_PandasOnRayDataframePartition.length.return.self__length_cache": {"doc_hash": "b7dc1f1cdf5237d1449bd90f209a9ebb2271ef7928b5425ed901f94993c09021"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.width_PandasOnRayDataframePartition.width.return.self__width_cache": {"doc_hash": "9a91b575307082cc65cd1cefd34a88d90b82b0cb747abdc30cc0023109ed9edb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.ip__get_index_and_columns.return.len_df_index_len_df_col": {"doc_hash": "b0a9173f9fea6b81814c7b7638037125903e9dba9f88867c8f4551993292f498"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py__apply_func__apply_func.return._": {"doc_hash": "0c82d8db8aa5df1fe3d7e2fe402d8cf9517111ad8409b381e013b033e836208f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py__apply_list_of_funcs_": {"doc_hash": "fe5a037c4e1ac6b9a941646b465098aafbd742ab7987e30af2492461f19490c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py_from_modin_core_execution_PandasOnRayDataframePartitionManager.wait_partitions.RayWrapper_wait_": {"doc_hash": "4a725bca029ea9697dddc27d6a10ab5379442092f867b9f00c54d0125c690d6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py__make_wrapped_method_": {"doc_hash": "319244955925a257901f02fcf8df51067237a9c6b9f985c35e1f223d23fb9503"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_pandas_PandasOnRayDataframeVirtualPartition.list_of_ips.return.result": {"doc_hash": "aa1f7534137904b1d89e97ce96a2b52db321e8190ac52cb1cddf63744e447939"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_splitting_func_PandasOnRayDataframeVirtualPartition.deploy_splitting_func.return._deploy_ray_func_options_": {"doc_hash": "de15402269fd2c2b75fa8016f114a905322adf47f09653ca8f8b2a788fb1b452"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_axis_func_PandasOnRayDataframeVirtualPartition.deploy_axis_func.return._deploy_ray_func_options_": {"doc_hash": "e8dd225285f295ff2ba3ec5afcb68d3bc1925198cc5a325f7efc96a0435e8daf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnRayDataframeRowPartition.axis.1": {"doc_hash": "e1f8fbc10c8809cc7702d4cabaa1a2133a7595320ed5c1531dcd61468ac2c169"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py__deploy_ray_func_": {"doc_hash": "5ca80b45a31daba9f00e97aa19693534bb976e8e6f540dd9798735afe531e3fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/__init__.py__": {"doc_hash": "10a46d05535ef10d92a69bcd4f06df743ce2d1d54ac4076200467fa3bff835bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/__init__.py_UnidistWrapper_": {"doc_hash": "511c855488093580deae551b2a536da88bc11ad10f10afe021013741a78f3858"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_asyncio__deploy_unidist_func.return.func_args_kwargs_": {"doc_hash": "6d025d22175fce2085da435c5a6b10ee71f4c167c1602846e548165693343934"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper_UnidistWrapper.deploy.return._deploy_unidist_func_opti": {"doc_hash": "3b2fcc2e457e0fd0dd6798deea043775345be612ca60d540e46d5dd391f2ee1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper.materialize_UnidistWrapper.put.return.unidist_put_data_": {"doc_hash": "1eeea70271c4dffa4b0617a54dda5d85b74832d742c13101ee6d0974c5fd43d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper.wait_UnidistWrapper.wait.unidist_wait_unique_ids_": {"doc_hash": "598ee36c0d5e416b2a1a40275869583a66da6982ffd494b42fc02aaf317174f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_SignalActor_": {"doc_hash": "8804dfbf61d5eab92fa9d1406ea06dded6c6bdf2e3a868fa39e93882c742daba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/utils.py_unidist_initialize_unidist.modin_cfg_NPartitions__pu": {"doc_hash": "eb90015319c700d6c1d41bfb217d75d61b182bdfe6574d91c3ccde16aa870457"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/utils.py_deserialize_": {"doc_hash": "8a02b99b5e58852a58bc63370d4c259baa76e186acc14417fb68d5dde4f4a878"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/__init__.py__": {"doc_hash": "71c35cc5061b0fdf64a8d1baab66ccfc80060eb6dddeddf1bc151463f26a22c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/io/__init__.py_UnidistIO_": {"doc_hash": "7f54b43022d833fb87d33ed19d26c9c11f4bd8ec643912294051e0e08c77c783"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/io/io.py_from_modin_core_io_import_": {"doc_hash": "e5358af88cd784fa2ea7a8ffcce473298820ebeafc90802af316b1a43f3fcbb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/partitioning/__init__.py_GenericUnidistDataframePartitionManager_": {"doc_hash": "0b87374b90a27dcc9397f8df782e4defd3dff38f4e0e939157e655f86c2055ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/partitioning/partition_manager.py_np_": {"doc_hash": "d9708c86cd48f8b1e0ae1b175f2d6d75391abd805dc1ff7b093c4f36a33478a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/__init__.py__": {"doc_hash": "2183de1dbecd49e8ef835d4bcc7c9cef90414e57457baeb8d78bc31a1996ba44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/__init__.py__": {"doc_hash": "f01f6273da7288c116f069dab98b2adffe06a41218ff6c315661f424df867881"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/__init__.py_PandasOnUnidistDataframe_": {"doc_hash": "727fb85637c74f7a078ed4cf556e6fdbed903137e53f77836ee7ec7a0fc7490c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/dataframe.py_PandasOnUnidistDataframePartitionManager_": {"doc_hash": "566300cc15e9b8c9ed3af3c82e8548d045aa78c4cf4f56b5ae77e5eabfa43a95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py_PandasOnUnidistIO_": {"doc_hash": "b1703d8376c3cd7b9bdcd2dac8c8566ce43b1596f7879c1eb910a0f1d703d12e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_io_PandasOnUnidistDataframePartition": {"doc_hash": "38581b03b34278766660281fd53503d19399c41042c2a564713c642820bd8b54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO_PandasOnUnidistIO.None_4": {"doc_hash": "7143c8da2eb3e58c0ea84d3ea427667edcc90616a4ad6c22f62df1db74577d21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO._to_csv_check_support_PandasOnUnidistIO._to_csv_check_support.return.True": {"doc_hash": "c7d316b4caab2f153e6ceddbb50c35757680c958f5194a0e95c64cd307283abf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv_PandasOnUnidistIO.to_csv.signals.SignalActor_remote_len_qc": {"doc_hash": "eb161a5455de5a02953e069fee9b1f6a469ffbdf4e2c53d7cedd3ad3c09a4fcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv.func_PandasOnUnidistIO.to_csv.func.return.pandas_DataFrame_": {"doc_hash": "b5212dd9a5f8873d744e6d72156d12bf8f09fabafcccc1a307b9dbf6a4a79bd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv._signaling_that_the_part_": {"doc_hash": "346a53a1e0f83fb11cc2a7d13a603b073ce358e96e95ff457bbea48fa7dbb3bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/__init__.py_PandasOnUnidistDataframePartition_": {"doc_hash": "58fe511ca65d4fa6bde86e1ac93e0ebe39814aa9ba1bfb1ece11d0c2010b0792"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_unidist_PandasOnUnidistDataframePartition.__init__.self__is_debug_log_and_l": {"doc_hash": "76afd4784956bb6ccd1d2e5d25c80e48ea971d890354ff41f48860fd234aef93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.apply_PandasOnUnidistDataframePartition.apply.return.self___constructor___resu": {"doc_hash": "bb53dd840a0da463fc5d9fa47ea3a52e0fc2c3d2e1e5d2f0b081d6551afcc898"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.drain_call_queue_PandasOnUnidistDataframePartition.drain_call_queue.if_not_isinstance_self__w.self._width_cache.new_width": {"doc_hash": "179af505fabc2238ca32dd761a2fefd43b818a9964c34da2724a74a9a679291e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.wait_PandasOnUnidistDataframePartition.mask.return.new_obj": {"doc_hash": "206c50469a9f91a4d83f22431af5337f1df7f37b665b2986b577280ac688e295"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.put_PandasOnUnidistDataframePartition.preprocess_func.return.cls_execution_wrapper_put": {"doc_hash": "8677cd0a6991ad5439a1dcc74a4f66080298d11722c74f1b80756e3f2fc22fb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.length_PandasOnUnidistDataframePartition.length.return.self__length_cache": {"doc_hash": "a4577bf2872d03376dae26e75986945f00d473961c58502becb702dd574ee2d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.width_PandasOnUnidistDataframePartition.width.return.self__width_cache": {"doc_hash": "327eb746fa2419ab832badb752e9139f0bbf47076d696e548729dc30262d8345"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.ip__get_index_and_columns_size.return.len_df_index_len_df_col": {"doc_hash": "cc467bb23b029e5a6614cdebeff6151d8b59ccd646dc4790326d6e0adab7e4d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py__apply_func__apply_func.return._": {"doc_hash": "1e870e887c803f07c64706d76d103677b35810f90cf4a084c86bd4709f767786"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py__apply_list_of_funcs_": {"doc_hash": "df3807460e2ac3fd477756eeb6b0449e9a0b35a4e621645441b6dc1ca2720a83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py_from_modin_core_execution_PandasOnUnidistDataframePartitionManager.wait_partitions.UnidistWrapper_wait_": {"doc_hash": "f0e44cfcec407a757e9ffb5b4b52969f9fa51eccca8561e55cb407a6c50e1b1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py__make_wrapped_method_": {"doc_hash": "9af4befda5165ecec05f27bb7edfa005dd18909b8460a196e8118d452dd72d96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_pandas_PandasOnUnidistDataframeVirtualPartition._get_drain_func.return.cls__DRAIN_FUNC": {"doc_hash": "f8ae5cd852c379c4450e3251dee255093cbb154a25289f1acf6e72ea293fa560"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.list_of_ips_PandasOnUnidistDataframeVirtualPartition.list_of_ips.return.result": {"doc_hash": "17c4b9e9b7da380ebba4a09be5ee7c23a982b8cf9852f4be0470abaa2e67e495"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func_PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func.return._deploy_unidist_func_opti": {"doc_hash": "45b6267aefab1ba811ef80445a0b67c8a900b2221ca7fa3a2f57354fdb3e7cba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_axis_func_PandasOnUnidistDataframeVirtualPartition.deploy_axis_func.return._deploy_unidist_func_opti": {"doc_hash": "b7c1ae6c7191ad184fc6300bc26a4156f50363eecf36672428b0ff9b0538f1f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnUnidistDataframeRowPartition.axis.1": {"doc_hash": "d21c061aa0b350f9c7a3493251925d978832de36cdeeece169beb56aa58f046b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py__deploy_unidist_func_": {"doc_hash": "bade99fcaf272ad80255f66b04fe7172be64b7299ee2b882974228394ca70a23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/__init__.py_BaseIO_": {"doc_hash": "ceb3499cc1e3cee25263509cf41b94bb40688165b6d494b108e03dd950c88730"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/__init__.py__": {"doc_hash": "68eedd52b1ba9d992230c0b80f71f9374631e32c4b3dbb1a6a8e3cffb8632b2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_np_ColumnStoreDispatcher.call_deploy.return.np_array_": {"doc_hash": "9ce3c72a20fdee627b6a5365c6f723612d38fb0162bedbc857fcec32682875fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_partition_ColumnStoreDispatcher.build_partition.return.np_array_": {"doc_hash": "992cb6543dac0866e01ccec3f25bc68f1ca2010005ccfcce2420759bd738bbd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_index_ColumnStoreDispatcher.build_index.return.index_row_lengths": {"doc_hash": "8151c493212b176bd0aabadcf1a253dbc00cf6ed042327f06cf735f3b2087064"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_columns_ColumnStoreDispatcher.build_columns.return.col_partitions_column_wi": {"doc_hash": "9818ed7bfbc65d6f5b26bd31860b1cf2c9cbc518be1c5ea1b146ee431cf9c7ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_dtypes_ColumnStoreDispatcher.build_dtypes.return.dtypes": {"doc_hash": "5e42d3d18991da4c12da9278ce427ee71e991ae0d880786ebd8997add04505b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_query_compiler_": {"doc_hash": "272677f45d9f6bca56a577682d97744f340bdc75d8d485d969c4d18ad858239e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/feather_dispatcher.py_from_modin_core_io_column_": {"doc_hash": "0b349e6dfc5f469dcd91b425baf39928f23765d70f52cb91d614403769803485"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/hdf_dispatcher.py_pandas_HDFDispatcher._validate_hdf_format.return.format": {"doc_hash": "5b90624f5a66ec0b7615e16a5096adebe564b443fbf2af63a87c4cc8b312e9cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/hdf_dispatcher.py_HDFDispatcher._read_": {"doc_hash": "143cf77bb9c5eba7ce6e9863cc96202b7deade495fbe66dfa560234d8476efdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_os_ColumnStoreDataset.fs.return.self__fs": {"doc_hash": "998094958a4f1ad029ac4e3a694c183bf2f461bf87030dec84cc82818185ad6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ColumnStoreDataset.fs_path_ColumnStoreDataset.to_pandas_dataframe.raise_NotImplementedError": {"doc_hash": "c4c16f97c46b95817a02b673ad9f28c7a4c7e5bd769ed10891484c96e3d50659"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ColumnStoreDataset._get_files_ColumnStoreDataset._get_files.return.fs_files": {"doc_hash": "aefe99aa8050218bc77d1ec07847e927afcac231355fb3983d90c9210e922200"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_PyArrowDataset_PyArrowDataset.row_groups_per_file.return.self__row_groups_per_file": {"doc_hash": "688ef60ff6b438258676f31b7e5c81e1bb142a37a0126be468370c0a47bdf399"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_PyArrowDataset.files_PyArrowDataset.to_pandas_dataframe.return.read_table_": {"doc_hash": "8e819cc85b3530285a45d3273d8f33733fd12b0457135ccb9ad9b163319141c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_FastParquetDataset_FastParquetDataset.row_groups_per_file.return.self__row_groups_per_file": {"doc_hash": "2225c3ff98d9dd16d37bbdd93681f36380f97ae410dd7f8e91ba0ff400ca242e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_FastParquetDataset.files_FastParquetDataset._get_fastparquet_files.return.files": {"doc_hash": "f9af4921c9cd1152db032bccfd77cb594b1562b5eb4400ecd7c0e62e51b674bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher_ParquetDispatcher.get_dataset.if_engine_auto_.else_.raise_ValueError_engine_": {"doc_hash": "60df317481587daf0ad1376305a9749884f00f94dd734b281cee8138a8a3c3d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.call_deploy_ParquetDispatcher.call_deploy.return.all_partitions": {"doc_hash": "5bdde261620c2683d2cf9bf0e0ffe78de3b135db415631df27aced9d86e6d844"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_partition_ParquetDispatcher.build_partition.return.np_array_": {"doc_hash": "6b2d570828b569f03f726fb5663a5d32588dc6d3f95bc674f0bd02368a1c24ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_index_ParquetDispatcher.build_index.return.complete_index_range_ind": {"doc_hash": "6badda7f0b0d37a745fa6ccd0fb687447dad292ca1f4b2a7d27a354ea464572d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_query_compiler_ParquetDispatcher.build_query_compiler.return.cls_query_compiler_cls_fr": {"doc_hash": "26c74d71c42f2f526f5a1b9c3c64c4f891e8b95d65bc4c53e5fe0a901095cc59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher._read_ParquetDispatcher._read.return.cls_build_query_compiler_": {"doc_hash": "fd1d1edba233ccac8d26cda37534b15edaa3647496e7c42fb30ea91a693cf25c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher._to_parquet_check_support_ParquetDispatcher._to_parquet_check_support.return.True": {"doc_hash": "981b63a91f2c079a4ab70d98b9015b9e355874be2408f99196a75b75cedd645b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.write_ParquetDispatcher.write.fs_mkdirs_url_exist_ok_T": {"doc_hash": "84f444eb1274dee60170dedb6dc2e28c167cc29e461f7ccdd05b0e3babba510c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.write.func_": {"doc_hash": "8fc36f341bc482fd0778fb402f979eaf603b3131a3b1451e6b5bddd5dc06ce2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_os_OpenFile.__init__.self.kwargs.kwargs": {"doc_hash": "cccc3f9d3bb7c5c3bf831a0d13d94514f5a4716c323b12962b0c5b17731136c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_OpenFile.__enter___OpenFile.__exit__.self_file_close_": {"doc_hash": "4d652980aafca4e8ea11181f5231b605c2cd2f66b78d9a05b84a241834bd80c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher_FileDispatcher.read.return.query_compiler": {"doc_hash": "ba495a710cc8f96c28683616fcd8167811d27d0cffb3917e10cc18dfa677e716"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher._read_FileDispatcher.get_path.if_is_fsspec_url_file_pat.else_.return.os_path_abspath_file_path": {"doc_hash": "8a8316a82ccd61a8ddac5973c3e1a8ce725b91dd40ea349d448e08d674dd261d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.file_size_FileDispatcher.file_size.return.size": {"doc_hash": "5c09c062ae4196b63cedc89881bcc4b3cdffe3932b527f7d720b421f5b02b91d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.file_exists_FileDispatcher.file_exists.return.exists": {"doc_hash": "325621f1458ab5415b40ce372ea6e041d4faa0df246815ac6dbc59a11a5a7835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.deploy_FileDispatcher.materialize.raise_NotImplementedError": {"doc_hash": "449004729677b0f82377da4eada4580f6a174441e66cdb59a21429c8f6102b88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.build_partition_": {"doc_hash": "91c7e97c25efa677db9cbd43802cb67a56c8c85fe0ac3d72a8b5d7e616952134"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_from_collections_import_O__doc_returns_qc_or_parser._BaseQueryCompiler_or_T": {"doc_hash": "bacabd724142c80d69adf4773bb7378022924014563fdb4d29e8f96a3b4e1ebe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO_BaseIO.from_dataframe.return.cls_query_compiler_cls_fr": {"doc_hash": "ec6cc893bef480f98cae3cc49f87b679f92273114f3621e01df0fd94d0f853e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_parquet_BaseIO.read_parquet.return.cls_from_pandas_pandas_re": {"doc_hash": "696d71a5f7b372729e284b950153e32adb9e5e4339276626b0aec902eafa3def"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_csv_BaseIO.read_json.return.cls_from_pandas_pandas_re": {"doc_hash": "fed770d564ebde0c9c38c3864cc74858ef6c606e3340a7a9f6db8f16d00f88b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_gbq_BaseIO.read_gbq.return.cls_from_pandas_": {"doc_hash": "ef38e4c8569d59e772341045a4bc36518f2eb7011db1e5b3c7562c7e2b04aa1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_html_BaseIO.read_html.return._cls_from_pandas_df_for_": {"doc_hash": "c571fecdc139a8885ab3b992ae1dc0da736c13c5e6e75e0fa185c2f84fb4d590"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_clipboard_BaseIO.read_clipboard.return.cls_from_pandas_pandas_re": {"doc_hash": "f28a72d98e2bc489bd0f20977d5b1f0450f946cdd2402479a57794d8cd7112dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_excel_BaseIO.read_excel.if_isinstance_intermediat.else_.return.cls_from_pandas_intermedi": {"doc_hash": "21bad1c68f9af028f6b83499ea233610e3a489351ec78f713936ee61e12d306f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_hdf_BaseIO.read_hdf.return.cls_from_pandas_df_": {"doc_hash": "7f13a955cdeb9827d39783c47bfdf4813442af9b2ff299f3a4c99cfa4d4187bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_feather_BaseIO.read_feather.return.cls_from_pandas_": {"doc_hash": "f35242da4693ecfe15c2f7dbb47f8283839feea80ccdf905ec7a335165de2b3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_stata_BaseIO.read_stata.return.cls_from_pandas_pandas_re": {"doc_hash": "84f8a95ec42ef9c43378a0aec970d705889b5a233712ecb31237c338f909be9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sas_BaseIO.read_sas.return.cls_from_pandas_": {"doc_hash": "aa45a71bb8e04b9fcaf9fe84fb05f84f8c7f9f4b9a602b44041d9bb4fe86e091"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_pickle_BaseIO.read_pickle.return.cls_from_pandas_": {"doc_hash": "60ad6b889a23eb537a8b5ff9eadeff5a2e629afbe679168dc84942f4ef7a5689"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_BaseIO.read_sql.return._cls_from_pandas_df_for_": {"doc_hash": "b74a3efcbf8bc7a6357eff61850d40fa36fa8fdad0a4fe7dda517581e23a81df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_fwf_BaseIO.read_fwf.return.pd_obj": {"doc_hash": "9261fa48937e741fe3743a2376d1dce15067c612f20281e4f50f7c72972c7fba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_table_BaseIO.read_sql_table.return.cls_from_pandas_": {"doc_hash": "d4e368c6948840b8b28792fecd78cc1b1d317d1ddc71eeffc1ed9b9a0d233c0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_query_BaseIO.read_sql_query.return.cls_from_pandas_": {"doc_hash": "e0c26d85f047df7d457926ad6a69bce35dac1113965f1cc08fc2e9a56a0f0ba7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_spss_BaseIO.read_spss.return.cls_from_pandas_": {"doc_hash": "1709e828b360d29170f10e78c9eb34fc827a64f33c6889fed731badde667a8bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_sql_BaseIO.to_sql.df_to_sql_": {"doc_hash": "0c9280e5d2b33e61b47cbf5727e43ebde1edd97842ff616d206ee7d5267c3dc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_pickle_BaseIO.to_pickle.return.pandas_to_pickle_": {"doc_hash": "e003da3c6a18993b44c6341dcb2a8a9a36b7500698e448bdb636f2ddafe81a97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_csv_BaseIO.to_csv.return.obj_to_csv_kwargs_": {"doc_hash": "c409bf941e517299ac159fa54a9b70e269ac2e70ca1414dcc476ef5119b1ca14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_parquet_": {"doc_hash": "e8b995e34950a17df323fe39bfe7a9a64746d8906c7316297f37c699fb9afc2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/sql/__init__.py__": {"doc_hash": "c5d948af8e60292dacc80751b2b8480d26ae196aed19136aad1b16a432d8dc1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/sql/sql_dispatcher.py_math_SQLDispatcher._read.return.cls_query_compiler_cls_ne": {"doc_hash": "244b4c64350924be02993214e41cfdebf411350c074294f78caaa720566d62fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/__init__.py__": {"doc_hash": "7608153fa936479691f0fd045126d7718b2ddc9a9c59fc6aa79624814e6a7c7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/csv_dispatcher.py_from_modin_core_io_text_t_": {"doc_hash": "bee01fabf9f8b3113235a19f7ea2e95d444d49f90a8e721b981cf68172b6146c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/excel_dispatcher.py_pandas_ExcelDispatcher._read._preserve_original_kwarg": {"doc_hash": "f52fddf0b8c25d1e67f8270b26cd0313cc3e5412b56918ac7efb8c760641f77c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/excel_dispatcher.py_ExcelDispatcher._read.with_ZipFile_io_as_z__ExcelDispatcher._read.with_ZipFile_io_as_z_.while_f_tell_total_by.if_b_sheetData_in_chu.break": {"doc_hash": "df8119ebf8b541998e4ce41f8a51955f8819abbcc086959bbe1b254a1476272d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/excel_dispatcher.py_ExcelDispatcher._read._Compute_the_index_based_": {"doc_hash": "1ffebac8bef0fa1e886543769f15211900dd1db1bd710be1cc769bffe2ed8b3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/fwf_dispatcher.py_from_typing_import_Option_": {"doc_hash": "0cd2c727bb21bf14ddd224c9932461af3abf26a9ffb5dd04e85b7cb870951124"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/json_dispatcher.py_from_modin_core_io_file_d_": {"doc_hash": "c7cc4924047c4bf7c2b8ea5c47b6e82837362ef7b17cfdeecca9bad6d64714c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_warnings_IndexColType.Union_int_str_bool_Seq": {"doc_hash": "4a6c4b179443a2947ee4568a330f783b24f223d05e4d922b3601edf6e3392227"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher_TextFileDispatcher.get_path_or_buffer.return.filepath_or_buffer": {"doc_hash": "32df66029091fbfb4de0b2f12a764bdc53ed33bebc27df04598ba480bb8d4fe0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.build_partition_TextFileDispatcher.build_partition.return.np_array_": {"doc_hash": "979b7eb1a975d0e1e7532d5331ebbf7eff8b0c634885929f6bf4dc3a2d350555"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.pathlib_or_pypath_TextFileDispatcher.pathlib_or_pypath.return.False": {"doc_hash": "c0c589e79193209e471dc05a5ec9822dd8866e81f06f0607887f6c19a027ca2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.offset_TextFileDispatcher.offset.return.outside_quotes": {"doc_hash": "e70d16966a909aece767a92a50322f16c30065625e030e0d5517c9c76555805c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.partitioned_file_TextFileDispatcher.partitioned_file.start.f_tell_": {"doc_hash": "efa81d5cf43e643a4046c8c2834e638ee53ea2f057aaa4aff3fcee7cec4ed9f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.partitioned_file.if_nrows__TextFileDispatcher.partitioned_file.return.result_pd_df_metadata": {"doc_hash": "c0247db6a9fb6d13296d6aee7615c67d90cd5daf5a502b36c0c52088c317e656"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read_rows_TextFileDispatcher._read_rows.return.outside_quotes_rows_read": {"doc_hash": "7ca07a3e270669466a17c26ee944bb93c65987a0fcddd66dc8ca7184ca46bb57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.compute_newline_TextFileDispatcher.compute_newline.return.newline_quotechar": {"doc_hash": "7095d2942cccb2acf6abef44d3c0b56760b1d88e1355de4ee9a76c7703093e1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.__read_helper_functions_TextFileDispatcher.rows_skipper_builder.return.skipper": {"doc_hash": "990a9076c961eb6cb64645c1c2efacfeaeb172dcfaa08731ef122c534d3b6bb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_header_size_TextFileDispatcher._define_header_size.return.header_size": {"doc_hash": "2ca11bb9bece76152550f79a58808907862a227a5923590adbc1ab899acd4fb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_metadata_TextFileDispatcher._define_metadata.return.column_widths_num_splits": {"doc_hash": "17bff968aa3574b3d0819f0c0c854ee2376df12c7432503f83ddd7163a0fbba1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._parse_func_TextFileDispatcher._launch_tasks.return.partition_ids_index_ids_": {"doc_hash": "79bbd0f30e3b183b39d1912facdd86f166900ff226658a143dacebc3ae584c1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.check_parameters_support_TextFileDispatcher.check_parameters_support.return._True_None_": {"doc_hash": "ad42d850f951af5824f9481ca8c5454d4a0d463cda70092c5f6c66b8fd58097c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._validate_usecols_arg_TextFileDispatcher._validate_usecols_arg.return.usecols_None": {"doc_hash": "6d6d8b92c96f46f79b22b2ef363b6c40c3309164fa15b364403804070f2d5ae2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._manage_skiprows_parameter_TextFileDispatcher._manage_skiprows_parameter._": {"doc_hash": "71a1871771abfb67e1ad314c5c10e69d0034570adff1a1fde6d7d9ed7f1ceaf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._manage_skiprows_parameter.pre_reading_TextFileDispatcher._manage_skiprows_parameter.return.skiprows_md_pre_reading_": {"doc_hash": "3e9a4fc56f2400cd3c248494f78630d4943821fc2655943cb4c3f0901b6c931f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_index_TextFileDispatcher._define_index.return.new_index_row_lengths": {"doc_hash": "ba3ec8ce925f1d6879fb6a27e81d5b96b1743bb9ddd97c37186842a2f98808d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._get_new_qc_TextFileDispatcher._get_new_qc.return.new_query_compiler": {"doc_hash": "c5bbadc5afd986595cafabf10f651028858d129b1a5a86f0dc8b77b27a546850"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read_TextFileDispatcher._read.read_callback_kw.dict_kwargs_nrows_1_ski": {"doc_hash": "00f3c7bd285b92758e253291854e3cc2343126f21936d2ebecec43ea36b4e1aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read.if_not_can_compute_metada_TextFileDispatcher._read.return.new_query_compiler": {"doc_hash": "2bd1f3b3fcc7c5fc2dd2081ad368d5f6ee42d13da01e4247087cfb6c386deda0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._get_skip_mask_TextFileDispatcher._get_skip_mask.return.mask": {"doc_hash": "8b2e21164a5217f01b8f059a1e02b7ebbc7c1c4fd32dd289851335db522119eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._uses_inferred_column_names_": {"doc_hash": "e5d48885af2ca53206b9fa0673ea051d38b7ddc30ea0addcf5f506e5694082d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/utils.py_io_": {"doc_hash": "1f464d282c525447b3961c60abd4796b2be0bdeee2f9e1368a03265d7ac9c5fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/__init__.py_BaseQueryCompiler_": {"doc_hash": "65a983782239f48fcd545e42b49eff8c2ae7cad2d948bc2410f88c37c17acbdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/__init__.py_BaseQueryCompiler_": {"doc_hash": "1b149f0edd9600c3de836211437277e3477c59af62cc9ce6749088ee1349c2ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_from_functools_import_par_add_one_column_warning.append_to_docstring__one_": {"doc_hash": "035c606722a6683a0903325afc4313de49d968caac3991f62e1991ed0fb0a6c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_add_deprecation_warning_add_refer_to.return.append_to_docstring_note_": {"doc_hash": "3aa70f7cb41c67615019c496603531b81ffedf288d067633fda147d8f1f78b99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_qc_method_doc_qc_method.return.decorator": {"doc_hash": "9605ca414c69476086d85343a5a1db3cfebfbdc8b986769e97d024c89367949f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_binary_method_doc_binary_method.return.doc_qc_method_": {"doc_hash": "f324b0979b53d72f82fad44ca1861c295082026bd75c0cf9107286b289afc330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_reduce_agg_doc_reduce_agg.return.doc_qc_method_": {"doc_hash": "86995ca140f1aaeda55f4f602a8f01d9895588f508653d3273c486f2205735cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_cum_agg_doc_resample.partial_": {"doc_hash": "c145b6c2562f1a27fe9d63782a640d6a8eb37034be46946930e6f7732b43b260"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_reduce_doc_resample_reduce.return.doc_resample_": {"doc_hash": "327812eb1e7f82784b49dfcb11d02e5377ae18ba1711ad94666602ea2ca18123"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_agg_doc_resample_agg.return.doc_resample_": {"doc_hash": "a52faf2522489f714b6c4dbad594ec9e18d05421b0ff6df04f88579b6de8d8c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_fillna_doc_resample_fillna.return.doc_resample_": {"doc_hash": "941c477646321f1340bb85b3a61f970a96221b35009c635705b710554d086963"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_dt_doc_str_method.partial_": {"doc_hash": "1143c243ea4d1bdee023e3ec71ee3e086be8c67defb1c0f992400ca0ef8c082f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_window_method_doc_window_method.return.doc_qc_method_": {"doc_hash": "86e8585f36b2de9b9d5532c15f8595a7739af904fec6bdff0226f6208733fe16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_groupby_method_": {"doc_hash": "833f1f4ab0f59f986b07667de043f414400e453351d64c7508cc5f3fdfb9f025"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_abc__set_axis.return.axis_setter": {"doc_hash": "b8b6afa9885bf26191a580531da1852261d9ec6b43172af60d4f7f7f35a6165e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py__FIXME_many_of_the_Base_BaseQueryCompiler.__wrap_in_qc.None_1.else_.return.obj": {"doc_hash": "30148b28e00c623a420ede0ff4e3db17e3a104f954e916674ad0389098f5db5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.default_to_pandas_BaseQueryCompiler.from_dataframe.pass": {"doc_hash": "9573d5821dece052e38ce8fd02b960529a133124b8c7b4070732efca3a4075c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler._END_Dataframe_exchange__BaseQueryCompiler.dot.return.BinaryDefault_register_ap": {"doc_hash": "0c527544e8f2935742962a1e43f40f8680c75dc3e1cf914f461dcf9c1308b7bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.ne_BaseQueryCompiler.rdivmod.return.SeriesDefault_register_pa": {"doc_hash": "4978868aa128cbe6e4a99fde7a0bca86294efbaa9b4af7e1b8ab9ccffb353888"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rfloordiv_BaseQueryCompiler.merge.return.DataFrameDefault_register": {"doc_hash": "d095dbf1ed9839d269d00c56bd802d715df0d3993ce3d56144bbc7ca92292154"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.merge_ordered_BaseQueryCompiler.merge_asof._Now_merged_right_label": {"doc_hash": "fb5decdeee561ce9173ec05685741cc74f21f91a9ec8cb685d78dab181293226"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.merge_asof._3_Re_index_right_using_BaseQueryCompiler.pct_change.return.DataFrameDefault_register": {"doc_hash": "f41c310aabeeffc1b09f86cb697411768fc637c3d14b860453b663bab5fbdf84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.to_datetime_BaseQueryCompiler.to_numeric.return.SeriesDefault_register_pa": {"doc_hash": "d05a65dcfb8b349e5813bf38b51e840580d7e4a3c97205b587e482c256205f08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.to_timedelta_BaseQueryCompiler.idxmin.return.DataFrameDefault_register": {"doc_hash": "ca9e183439d4833627826a2b71ab4a9df6af221654c2c59e771edef1255d041b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.last_valid_index_BaseQueryCompiler.quantile_for_single_value.return.DataFrameDefault_register": {"doc_hash": "49f2a39123b41af4c9447666cce5943b49d6262bfefd11157d166c0c45d634d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.skew_BaseQueryCompiler.query.return.DataFrameDefault_register": {"doc_hash": "62e0b95dc67082fe88ad502540bce38ae5b9cf5dbbfb9377288694de514d03c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rank_BaseQueryCompiler._Abstract_drop": {"doc_hash": "a0eff12b589781947e632c61e7daf8d2a4de89eb04167d7364d3626a45a28dc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.drop_BaseQueryCompiler._logic_can_get_a_bit_con": {"doc_hash": "2e85140ed142d4e884f4db326c357cceb028d9429b560d68d32b29b81acdbb5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.apply_BaseQueryCompiler.groupby_sum.return.GroupByDefault_register_p": {"doc_hash": "aeac8fd95a4a1f3f4943cce29ded0038092bff0714542a30cd3986076d84d6c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_size_BaseQueryCompiler.groupby_sem.return.self_groupby_agg_": {"doc_hash": "1ffae48684433e8ff6ab868b6b677eed8e3966fbbeb79eb5c29447fa5ae2ca6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_rank_BaseQueryCompiler.groupby_tail.return.self_groupby_agg_": {"doc_hash": "e02df3aedfb7736ae394676bb2878d7608790ce32b64426abc49b6d37e34af39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_nth_BaseQueryCompiler.groupby_ngroup.return.self_groupby_agg_": {"doc_hash": "a4cb467e45f1a8ee692186574234a4e0fd849069dc7b1eb09b9d2a3e44c96db5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_nlargest_BaseQueryCompiler.take_2d_labels.return.self_take_2d_positional_r": {"doc_hash": "0887b6af2a795cdc825a2c745b8f485c972b20c8867c2b150f7f99ba1d217e71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.get_positions_from_labels_BaseQueryCompiler._END___delitem__": {"doc_hash": "020acc34dd2171d2fc931eb209bc05d4c90b5d014e6e605bdfc831f4506f64ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.has_multiindex_BaseQueryCompiler.dt_unit.return.DateTimeDefault_register_": {"doc_hash": "4a47c79d2f745fcfc1fd3509f2733b8754b288f673d22ddf3ec5a876f5925f39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.dt_as_unit_BaseQueryCompiler.dt_asfreq.return.DateTimeDefault_register_": {"doc_hash": "4a0b8b11fa2fd1fab5454acfcbe76cf002e59d25dd8d0f0feee8a9a23dd6ddf1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.dt_to_period_BaseQueryCompiler.resample_asfreq.return.ResampleDefault_register_": {"doc_hash": "4f760b46b4ee2ee4de9a5b239370421a6955c7c29b27a1c054f34aeae9b6adf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.resample_bfill_BaseQueryCompiler.resample_interpolate.return.ResampleDefault_register_": {"doc_hash": "d3563342588485170d8b7288a83f188022de0b50bbaa36d03491ed8891dacbc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.resample_last_BaseQueryCompiler.str_contains.return.StrDefault_register_panda": {"doc_hash": "8fbd672de4c10b361e53618a01a957d0dc6c238e494e0457347ae03741370811"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.str_count_BaseQueryCompiler.str_replace.return.StrDefault_register_panda": {"doc_hash": "ffd01b3ec6dc1a5a4e1c0f9640a1a91ceead1df464779cc44765629b958bcaab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.str_rfind_BaseQueryCompiler.rolling_corr.return.RollingDefault_register_p": {"doc_hash": "beff1c34296b4915024c210b55d46d195f005db13b2ebe817cee293b9f747c34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rolling_count_BaseQueryCompiler.rolling_cov.return.RollingDefault_register_p": {"doc_hash": "84c4cab873c18ad32960392bc2fd28cc0d71eabccb7cd83d1f752c91d9a2a264"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rolling_kurt_BaseQueryCompiler.expanding_median.return.ExpandingDefault_register": {"doc_hash": "5b88080efe5f4bf98e7772cb392094168f194db435ef5f172f9af3d8a40632dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.expanding_var_BaseQueryCompiler.expanding_corr.return.ExpandingDefault_register": {"doc_hash": "fde3ce4923f5a26f7b193e2bcf5789c3e96e9228bc4966494d83d4ae2f80ba3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.expanding_cov_BaseQueryCompiler.compare.return.DataFrameDefault_register": {"doc_hash": "9f82122a387c02de0158e1fad58f74766ba499938c4bfd3b57ac2ea7063623ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.repartition_": {"doc_hash": "f143a8c2aa6192d89a079076126e3b08c0d261ceb23ece987cc9fa2d574d7143"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/__init__.py_cuDFQueryCompiler_": {"doc_hash": "40570560a6868e4027665e60d175d145b93a6a70179e4d52731efcc09a2f1fc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_from_collections_import_O_from_modin_error_message_": {"doc_hash": "00bf35b2a04954b5c19a346cb08438dbfa921ba15ecac316175fb5ef00ef01d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py__split_result_for_readers__split_result_for_readers.return.splits": {"doc_hash": "7ee5efda02d9f46db5b3cae38e861daa78167fc0e047555b7ad2a3d2920cec6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_find_common_type_cat_find_common_type_cat.if_all_isinstance_t_pand.else_.return.find_common_type_types_": {"doc_hash": "2b81164cc8e1e61af59733ee672613707c0648fb30aa60d72a3d37409d0992f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_cuDFParser_cuDFParser.infer_compression.infer_compression": {"doc_hash": "236d88cc28f9d3333f0a023329f9f2d060ff8f22dec272ae4199063c38799a89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_cuDFCSVParser_": {"doc_hash": "8a1609505e9bafee62142751e7b280f9f0982953c0c430935049d50645fc92fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/query_compiler.py_np_cuDFQueryCompiler.transpose.return.self___constructor___self": {"doc_hash": "3c827cc6dca29909609204aaa293619623ec0156e291fa3f32ebccb09992a2e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/query_compiler.py_cuDFQueryCompiler.write_items_": {"doc_hash": "7f0b9f97cb8d1f8441bb2ee74dbcf8ad2b3973ccbea683f094e36eb53645686e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/__init__.py_PandasQueryCompiler_": {"doc_hash": "46cface5e19523050cc5b00a69aa62e04b8f4bb2bf81eafc28e59e7ece8526cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_pandas_CorrCovBuilder.build_corr_method.return.corr_method": {"doc_hash": "5006e088c961067429447989806e6e11526fc19f152723ddc77619c2acad1a73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_CorrCovBuilder.build_cov_method_CorrCovBuilder.build_cov_method.raise_NotImplementedError": {"doc_hash": "01d1d3b4b3d1734d54a6c31be2904890d603df0f3a8bdb623dd275b920aedf32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_CorrCovBuilder._build_map_reduce_methods_CorrCovBuilder._build_map_reduce_methods.return.lambda_df__CorrCovKernel": {"doc_hash": "781235f7161f19399021bc19620d651f551318e504ff2755c615527cad59f6da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels__CorrCovKernels.map.return.aggregations": {"doc_hash": "4a9d9493749e46cb1c87f488749450f83b0840d27e06591634a8826960ced87f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_non_nan_aggs__CorrCovKernels._compute_non_nan_aggs.return.sums_sums_of_squares_co": {"doc_hash": "afd1cc25ca62257526f6afc2a7f134e1f03486722f4769b57353ad5d20d4d25c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_nan_aggs__CorrCovKernels._compute_nan_aggs._TODO_is_it_possible_to": {"doc_hash": "3f18f22cc60042fe825826dc00b00b1f920c4153eb16ba8b0682d503b0fd6d1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_nan_aggs.for_i_col_in_enumerate_c__CorrCovKernels._compute_nan_aggs.return.sums_sums_of_squares_co": {"doc_hash": "309d1b6b64b7b87a13ec706bb7be0763b9dc8b928b07677fb2b37a65467ab762"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels.reduce__CorrCovKernels.reduce.if_has_nans_.else_.return.cls__build_corr_table_non": {"doc_hash": "96e94e50aa1196b41a20e2f0c2934db012faf965422afec6ac2df745a4e9a517"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.parts_with_nans.total_agg_values_na_ag": {"doc_hash": "01d181f60700a8fd00c0392be62134b1f27bc76843bb377391e0be03df6a5a30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.parts_without_nans__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.return.total_agg": {"doc_hash": "5214d7fc95060ba827d6b059ce5db0c260d6132a7744845351501e49361459b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._build_corr_table_nan__CorrCovKernels._build_corr_table_nan.return.res": {"doc_hash": "29c2ed8e97ebb4fdab6d2ff4131d7280033b86f83a715f4cb1a19305a516caa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._build_corr_table_non_nan_": {"doc_hash": "91ba28437724267d200cc659ebac704f99252e47da7e645e3a2a1191f7de215e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_pandas_GroupbyReduceImpl.get_impl.try_.except_KeyError_.raise_KeyError_f_Have_no_": {"doc_hash": "d481a608de718a2a8b3168d9faefb8634198b8d4171dc3b53d4ea5c6467d385d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.has_impl_for_GroupbyReduceImpl.has_impl_for.return.True": {"doc_hash": "7eb73a9df73d8e36095be8538bce2060e8a671b969d280d79964efecd691211f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_skew_impl_GroupbyReduceImpl._build_skew_impl.skew_map.return.pandas_concat_": {"doc_hash": "040f3b43b50e4c8193539f24097cfc875227578cc72593ff1e7be4075581de8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_skew_impl.skew_reduce_GroupbyReduceImpl._build_skew_impl.return._": {"doc_hash": "69d99c9c8fad14ad78bfc4d81cec203d6f39ece0c25af01f8be54244d2bcd8e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_mean_impl_GroupbyReduceImpl._build_mean_impl.return._": {"doc_hash": "edee45accb631ccaf1836117ad7ce4602dca096fa3d198598b08a7fffe83d7c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._groupby_reduce_impls_": {"doc_hash": "6ba0cc1e23f95e08f682a9470cc8a98fcf2c2c522dbb98ac04ba372e3d7765b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_os__doc_parse_parameters_common2._n_join_": {"doc_hash": "7fd91bf2110f7cd1793b9a9052e086ae9c2751038bbb815f3bac887e2b0b9a09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py__split_result_for_readers__split_result_for_readers.return.splits": {"doc_hash": "ce46b7e9f0f932d6c8631adad7a1bd9646070390bb8dc8e3e68961866ea13c01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_find_common_type_cat_find_common_type_cat.if_all_isinstance_t_pand.else_.return.find_common_type_list_typ": {"doc_hash": "e0d0ad774be155446516ab217065ed4d83a40ddb3089b03ba0d79cdab2e2dd25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser_PandasParser.generic_parse.return._split_result_for_readers": {"doc_hash": "130dccd5fa28ae142bb18217d1fbc2a77bafc7537244671bbf30a6422b546dfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.get_dtypes_PandasParser.get_dtypes.return.frame_dtypes": {"doc_hash": "cfb2f9b1e6f354b41dc7cd2e3ff8030da699835dcb601ee698d5a3fcb343fd3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.single_worker_read_PandasParser.single_worker_read.return.cls_query_compiler_cls_fr": {"doc_hash": "9d050facd7acbf701798438b356dc9e7c5498b6b09aa6b57e600f7a5c1ee7c3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.get_types_mapper_PandasParser.infer_compression.infer_compression": {"doc_hash": "56891e5dfee8f47bc64cdf4757e3a36ad5a47f92ffda9a83150e0149af05d007"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasCSVParser_PandasCSVParser.read_callback.return.pandas_read_csv_args_": {"doc_hash": "22bceff1133f60e99352065278a21a4dd1a32f8979d669801d7bfe8b0822e97d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasCSVGlobParser_PandasCSVGlobParser.parse.return._split_result_for_readers": {"doc_hash": "9c759d832d35bae973301b586342a8664b7dc8ba8385021489de57b226b9a254"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_ExperimentalPandasPickleParser_ExperimentalCustomTextParser.parse.return.PandasParser_generic_pars": {"doc_hash": "1cbc3df1958fbaa267a2e19c3b3d97cfb589cac24b84f07bc3d6ee11cfdc205c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasFWFParser_PandasFWFParser.read_callback.return.pandas_read_fwf_args_": {"doc_hash": "82c91d3fa0618e921d9800ca5a38326d66050b33c7a76050ddbf2c3883ebbefe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser_PandasExcelParser.get_sheet_data.return._": {"doc_hash": "ee22dc588d48c5c3ed669b5c9ba9be473ed75086afce6032b7779283c832d82b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser._convert_cell_PandasExcelParser.need_rich_text_param.return.version_parse_openpyxl___": {"doc_hash": "9d114326a18c541b58a3a66879f5159b8bbe57e3f0052b16684ae4536a4b0d9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse_PandasExcelParser.parse.with_ZipFile_fname_as_z_.with_z_open_xl_worksheet.bytes_data.file_read_end_start_": {"doc_hash": "2fc370cfbc19f0be400a52aaaa838453aa2acddd09a6765d626ac2d8e57c10d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse.update_row_nums_PandasExcelParser.parse.update_row_nums.return.re_sub_": {"doc_hash": "ffb617ca21c409898336b114f86926ac2f353c4c7f03ba4e1197a5fdfc3dc90d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse.bytes_data_PandasExcelParser.parse.return._split_result_for_readers": {"doc_hash": "e2b1f001eeb72de9c6816c53c93f1d49a327de6a78c782ff09eb59192f17071d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasJSONParser_PandasJSONParser.parse.return._split_result_for_readers": {"doc_hash": "cac45bee92354a7cf04c614fa59fd6295f2fff65290027c804d4d51a2caa0f24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_ParquetFileToRead_PandasParquetParser._read_row_group_chunk.if_engine_pyarrow_.else_.raise_ValueError_": {"doc_hash": "5b4fb34c28f4193d0416c90a93fa14b391d253816f3f796bdc2d8ed1dabb8713"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParquetParser.parse_PandasParquetParser.parse.return.df_df_index_len_df_": {"doc_hash": "9564b63b85fc9de762167b00ce6c18173a0d07179a3ce2e609f43d136b46d189"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasHDFParser_PandasHDFParser.parse.return._split_result_for_readers": {"doc_hash": "5800b54c36eea03e4370519225c38e9015e488ccb213cddb88476fc3d1ac1d1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasFeatherParser_PandasFeatherParser.parse.return._split_result_for_readers": {"doc_hash": "c751d98ed0629ba935bc5608500e480dfdc0f99ded1b0f8cfb29fadad7145867"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasSQLParser_": {"doc_hash": "ec8f0912f12f02b2c1ddf17381f85a055d53c9863c0cc7ba53820d61d95ae57d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_re__get_axis.if_axis_0_.else_.return.lambda_self_self__modin_": {"doc_hash": "64c6e33d5112ba18eada5b82722f8a5a700723889a12ddec1dcc1d242ba4b85e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__set_axis__set_axis.return.set_axis": {"doc_hash": "13b7477b9c78c6dcc4125d8a89191c2732cc407003045d435ee1b5208d2a1dac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__str_map__str_map.return.str_op_builder": {"doc_hash": "1ca001b2fa15e26ade4067c2686f3d8cb2bbf27d595f335516edc2f74a988180"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__dt_prop_map__dt_prop_map.return.dt_op_builder": {"doc_hash": "cd6f7cc9b7a40c6914f865a0c70afb91c04549f8075207eca952846dd186d9b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__dt_func_map__dt_func_map.return.dt_op_builder": {"doc_hash": "8469cab1abe8e4c48c27a5427442c119143a62baee882099a4ff6ef3aa80198a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_copy_df_for_func_copy_df_for_func.return.caller": {"doc_hash": "54c61d5244117884c5840d274071feed77bb0d601b989c94b3e6898ab287c54d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler_PandasQueryCompiler._future_TODO_devin_pet": {"doc_hash": "88f48536e2d3b431af24b2fdad5011343331984718fe857736c44aa8f07be9be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.concat_PandasQueryCompiler.concat.return.result": {"doc_hash": "b20ea72accdf7be1b83c4f72b0fcac04aacab6a392edb873e7acd885301eb0e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Append_Concat_Join_PandasQueryCompiler._Needed_for_numpy_API": {"doc_hash": "2dc8553dac8699a58b40ad4f39c50f10fec744c94768d54c2a85bfa9e5fa81ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._logical_and_PandasQueryCompiler._logical_xor.Binary_register_": {"doc_hash": "14105caaa594ee571a0ae8d1dab87d8a727ea2a2505435469d634f3a81e2dcfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.where_PandasQueryCompiler.where.return.self___constructor___new_": {"doc_hash": "a96c779d71768f846b97bf282be228f7128dc26119a4e1a655312c1fbdf9764c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.merge_PandasQueryCompiler.merge.if_how_in_left_inner.else_.return.self_default_to_pandas_pa": {"doc_hash": "232447798a797c47ff612339aee03e0b40f0f83f59076ea99a7fe94df105940e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.join_PandasQueryCompiler.join.if_how_in_left_inner.else_.return.self_default_to_pandas_pa": {"doc_hash": "b98e9325eb5ff8983fbd7be2fe55a7abe541d9b6d22c753f45c442f0b753b6a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Inter_Data_operatio_PandasQueryCompiler.reindex.return.self___constructor___new_": {"doc_hash": "9493d80c71eeafaab010fda49415af35e702b181e6fe45356aa439c84580756f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.reset_index_PandasQueryCompiler.reset_index.if_level_is_not_None_.elif_not_drop_.uniq_sorted_level.list_range_self_index_nle": {"doc_hash": "a1e193ed14baa73463de3c2a9f811d79af29a2fce937d0b1c88e4c0fe2162a54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.reset_index.if_not_drop__PandasQueryCompiler.reset_index.return.new_self": {"doc_hash": "aaf44da41105e76519a62acc16ce410ba96f1aa0a63bbd969c8e4b58f1405161"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.set_index_from_columns_PandasQueryCompiler.set_index_from_columns.return.self___constructor___resu": {"doc_hash": "756e3c57dca83c8b8f677f62632b8bc9dfac89ab7c011562fb9e48733b35f36d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Reindex_reset_index_PandasQueryCompiler._memory_usage_without_index.TreeReduce_register_": {"doc_hash": "7d92999b0e2c87729e1728d576740b2b5ee5ce57f20be3da45f469ec938ad50a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.memory_usage_PandasQueryCompiler.memory_usage.return._": {"doc_hash": "b309575d5a57cb9bc26c3dc113553d9addac545e5eba8bbbba6258184b1959d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.max_PandasQueryCompiler.min.return.TreeReduce_register_map_f": {"doc_hash": "4616a76205a337a4ffd5f65bc7dca5c585e305d9a9326b42ed661e317e6ca6d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mean_PandasQueryCompiler.mean.map_fn.return.result_if_axis_else_resul": {"doc_hash": "44cb990f0ae3764eb5aca23179fcd98b3e3ce5669024825976ebc579eff2f3c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mean.reduce_fn_PandasQueryCompiler.mean.return.TreeReduce_register_": {"doc_hash": "2c04e34d96317510392993293d991592721d698562762ea60fc28ce54bc4c252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_TreeReduce_operatio_PandasQueryCompiler.quantile_for_single_value.Reduce_register_pandas_Da": {"doc_hash": "78a84832ae391ff424e2ddc413632f3801535d25bdad8416f8463f13d919d432"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.to_datetime_PandasQueryCompiler._END_Reduce_operations": {"doc_hash": "7036e6c0c695d9512e83e71bdffeaa09ded3dd2d986bb094eebc6aed0c0eb701"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._resample_func_PandasQueryCompiler._resample_func._": {"doc_hash": "f804ba9358a7539d6a63b195d5836c2a4f83422949ce70abf16d117bb97a1040"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._resample_func.map_func_PandasQueryCompiler._resample_func.return.self___constructor___new_": {"doc_hash": "06ebeb36057e26e9573f5d1530cf91feca30731c1a3f4004e4948f456ca0d2fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_get_group_PandasQueryCompiler.resample_asfreq.return.self__resample_func_resam": {"doc_hash": "7c7f57c33353e8d8aae811a9ea0e4c35d37d611d57f450114e6335599e4e0f8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_interpolate_PandasQueryCompiler.resample_interpolate.return.self__resample_func_": {"doc_hash": "d3b53e19ce1e4f6d0b02b5668a568f3b8af85e4d67e1d8e0b6247532174effd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_count_PandasQueryCompiler.resample_quantile.return.self__resample_func_resam": {"doc_hash": "c204e0e6dc59156cab6e62306f952e7b2f1b2b7b933dda98f0777f2d229d5b1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_aggregate_PandasQueryCompiler.expanding_count.Fold_register_": {"doc_hash": "f55298c6f2c3a66d4c04c8951902c186fbcf4d67a3f6a46053049f6f3358e1fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_cov_PandasQueryCompiler.expanding_cov.return.Fold_register_": {"doc_hash": "b48252e7ff873325289661f983f96991dc0fcb30e284d87b88afe959024b1885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_corr_PandasQueryCompiler.expanding_corr.return.Fold_register_": {"doc_hash": "f0addb77686118d8dee7c42ec8e873d50402cc1954dfe5cddff0e40fd6d66df5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_quantile_PandasQueryCompiler.rolling_min.Fold_register_": {"doc_hash": "88a4c12fdc8c3680783474309605fe005c7e2634f97f769f34d565fff228543f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_max_PandasQueryCompiler.rolling_rank.Fold_register_": {"doc_hash": "c2aca0e250fe376851da6a10fedd030e6503b69db2e6f8613a1ccf8dcf295e96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_corr_PandasQueryCompiler.rolling_corr.if_len_self_columns_1_.else_.return.Fold_register_": {"doc_hash": "cb654085995944ff9ea0d453476a8a87a7361253418834fd84e95cc4c1c007e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_cov_PandasQueryCompiler.rolling_cov.if_len_self_columns_1_.else_.return.Fold_register_": {"doc_hash": "9ac32934cef8deec692c445e0e42d3b1311a10030d73eeb93f017bc08358f420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_aggregate_PandasQueryCompiler.unstack.map_func.return.pandas_DataFrame_df_unsta": {"doc_hash": "9f976658b1ec69002c7b24d870ee5fbaf535592f3936f9e04e63803833b6b967"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.is_tree_like_or_1d_PandasQueryCompiler.unstack.is_tree_like_or_1d.return.len_self_index_len_sel": {"doc_hash": "d13e981e239847026760d79c99010fb25b82d92a2733b13f3fa496487d5ea4ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.is_tree_like_or_1d_index_PandasQueryCompiler.unstack.result.self___constructor___new_": {"doc_hash": "ef1c1e7bf9df2a7f78d64e9877cf6acd219a209cefffe974a04042d94f9bdf7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.compute_index_PandasQueryCompiler.unstack.compute_index.return.pandas_MultiIndex_from_pr": {"doc_hash": "60f942aafdf9796e3397c273b16b49f16c07cc18394a0f9283dfdc5de3bf1bb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.if_is_all_multi_list_and__PandasQueryCompiler.unstack.return.result": {"doc_hash": "3d32e2f46371bc948bb4095ea0ebd12514fe19e4dfb2798e1c6caa7f5c9a7beb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.stack_PandasQueryCompiler._These_operations_are_op": {"doc_hash": "8c03da5e5de3916a7d6939330c8aeaf70d7c7b018ee1f7d28fde146d40a4a1a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.isin_PandasQueryCompiler.isin.return.Map_register_isin_func_s": {"doc_hash": "44c113d6171122ee6dbe44c75752f24062c5efa9dea81d50d8481000095ac830"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.abs_PandasQueryCompiler.str_capitalize.Map_register__str_map_ca": {"doc_hash": "7727524314ff52cefd759dbb115f6e47626061999009f23bdcbfa2f551144980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.str_center_PandasQueryCompiler._str_rpartition.Map_register_": {"doc_hash": "0a6542fafef87980fbbdbeb8b377b94dedf234b3b61e60e30188efb4c8ae7200"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.str_rpartition_PandasQueryCompiler.dt_year.Map_register__dt_prop_map": {"doc_hash": "481d75d85ab9de8ebfe4b8ff64354a42d745b004e278c9bdb3c01160c6574260"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dt_month_PandasQueryCompiler.dt_nanoseconds.Map_register__dt_prop_map": {"doc_hash": "6f98def46371f9c5b24edc2b4c3e5b218833f9d34504520f1d46afa6aec2749d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dt_qyear_PandasQueryCompiler._Column_Row_partitions_r": {"doc_hash": "3ee9df51825b03e9c33d3ff53ccebb46a01274af977fe592568c8d59236d525e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.first_valid_index_PandasQueryCompiler.first_valid_index.return.self_index_first_result_": {"doc_hash": "57127fdab5778f30a3a09fa28acb85fb87a63a94de318d8c8be3d41f690038a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.last_valid_index_PandasQueryCompiler._END_Column_Row_partitio": {"doc_hash": "75ac5a45977ba166b67656de29a6cf2cd4b99d88a5675ef2f62c4d898d6bc9f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.describe_PandasQueryCompiler.describe.return.self___constructor___": {"doc_hash": "639ef5a7c0d5b85215a777d46e48fa20c7bb5b29632cd5cad5bfdd6aaf39df9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.None_65_PandasQueryCompiler.diff.return.self__diff_fold_axis_axis": {"doc_hash": "ce44b4cfaea2656600902fd31c25f88c3a0a3a1240f3a416b8dc76c5197e15c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.clip_PandasQueryCompiler.cov.return.self__nancorr_min_periods": {"doc_hash": "0f8639b73da2d40c140d396245c6cc6d348c9011ef5133b91eafd57383f5fa21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nancorr_PandasQueryCompiler._nancorr.if_min_periods_is_None_.min_periods.1": {"doc_hash": "ff733341f90063c514f64b64c0cde76327083edd87b0adfff6e1484c1ded063a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nancorr.map_func_PandasQueryCompiler._nancorr.return.transponed_self___constru": {"doc_hash": "563512c5e46dc430be2553e7ed180a18fb39bec7159e86deec5152937a2a9524"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dot_PandasQueryCompiler.dot.return.self___constructor___new_": {"doc_hash": "42cf67d42bbd6d6fc2486af4bdda55b741b7c0b6b163ebfbd184c5213b71c338"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nsort_PandasQueryCompiler._nsort.return.self___constructor___new_": {"doc_hash": "d368be0da96401ecb332b30cbc0b8bd85bc3609457ebaa02698001a4ca54deaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.nsmallest_PandasQueryCompiler.eval.return.self___constructor___new_": {"doc_hash": "bb96151a9ee253813ab6cb0fa0bb5bfaecf515d3230ec77d2cccaebb4cd12990"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mode_PandasQueryCompiler.mode.return.self___constructor___new_": {"doc_hash": "8c59e54a2a1d34f30f9bc17bbfae41cae699d049eca2c22201dd88ab075c7dde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.fillna_PandasQueryCompiler.fillna.return.self___constructor___new_": {"doc_hash": "ab272c19f1b43bec29f649b924f184cdb26695d3ef24102712ac0d04f42629e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.quantile_for_list_of_values_PandasQueryCompiler.quantile_for_list_of_values.return.result_transpose_if_axi": {"doc_hash": "49315712cd8b93bd4e1b8af1623a81471834b7d7c59b3cb874c81d934077dd5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.query_PandasQueryCompiler.rank.return.self___constructor___new_": {"doc_hash": "e4de800aaa9dcaf6ce59560206ae5a934d24f06bfb78fce4614fb48b9b3c1189"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.sort_index_PandasQueryCompiler.sort_index.return.self___constructor___new_": {"doc_hash": "a1f8e82c2ffbfc7a6e0814a3e4cc52a854f6a7b5d9eb6104596d545486fa524e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt_PandasQueryCompiler.melt.if_len_id_vars_0_.else_.to_broadcast.None": {"doc_hash": "34f441e8e4427252614739c02b0b7b466675d19850c2ae1399601fa5162530eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt.applyier_PandasQueryCompiler.melt.applyier.return.df_melt_": {"doc_hash": "f857411773612ea7717af3cda7f7d84fea59125195ea6f1ced009fb5b12afa93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt._we_have_no_able_to_calc_PandasQueryCompiler.___setitem___methods": {"doc_hash": "c7062b4650001b00a125108bc2c97e3c69f677f3ff6f7837feb5b647860ab588"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.setitem_bool_PandasQueryCompiler.setitem_bool.return.self___constructor___new_": {"doc_hash": "a824e85f9053b29b43acb06b9e616083139cd11784f3ec55c03e71d67873d654"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END___setitem___methods_PandasQueryCompiler.getitem_array.if_is_bool_indexer_key_.else_.return.self_getitem_column_array": {"doc_hash": "da6e3550176fe278f714978b7ae5972a6c1895d80b112d36f21ed8fe48f16b3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.getitem_column_array_PandasQueryCompiler.setitem.return.self__setitem_axis_axis_": {"doc_hash": "5f779a9b288e52fe03f312519ec791c8a9cc414e668891476aa7bd701335e084"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem_PandasQueryCompiler._setitem._": {"doc_hash": "6ed0cbed6fa8faf0e0b51261b2d2b1d1c9bcba5850a5a227bffd2d232ef11d07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem.setitem_builder_PandasQueryCompiler._setitem.setitem_builder.return.df": {"doc_hash": "9b1c3268228e0436bd0d9cea9a6fb39f61203180a125e86f8634437ef68647f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem.if_isinstance_value_type_PandasQueryCompiler._setitem.return.self___constructor___new_": {"doc_hash": "ff0e253d5a0de09eaa5e140ab8a6412136e9841abe91b092f70fe7bda2df2324"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END___getitem___methods_PandasQueryCompiler._END_Drop_Dropna": {"doc_hash": "16ffd12f43f278c71cd03bd70b785cc49e35aa725511a038b9ba279837985dfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.duplicated_PandasQueryCompiler.duplicated.return.self___constructor___new_": {"doc_hash": "05b2c26e7cdbe2e4030e5bb9eb199de06ffe77706767f5b1633c8cc100e3dd1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._Insert_PandasQueryCompiler.insert.return.self___constructor___new_": {"doc_hash": "c24cecdc3057f702891f6bc09a43c62ad7692119c26ba77f65cbc853a621e5a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Insert_PandasQueryCompiler.apply.if_isinstance_func_dict_.else_.return.self__callable_func_func_": {"doc_hash": "a5709e8e8415c24bcd94b2a6188cd1ed3d6ad36cf4d830f6114775e88b6ff868"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.apply_on_series_PandasQueryCompiler.apply_on_series.return.self___constructor___": {"doc_hash": "1f71435e78729f6b8a58a7489e00d2ae662063afaeee58731758843d2e83d9a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._dict_func_PandasQueryCompiler._dict_func.return.self___constructor___": {"doc_hash": "4a1755e1623d87ba7b714635aff35747db5735e4b7edee0b089f09ae5acb590f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._list_like_func_PandasQueryCompiler._list_like_func.return.self___constructor___new_": {"doc_hash": "a174d4f56f9d4161181630887475e7c536825e472b2621c02b1a0feb6155bc40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._callable_func_PandasQueryCompiler._after_the_shuffle_ther": {"doc_hash": "ee053e642eed85ca610f339a40afe4141126576c84d4abff6e76bd5510e04952"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_internal_columns_PandasQueryCompiler._groupby_internal_columns.return.by_internal_by": {"doc_hash": "546189689c7a71a7ba2936a361d30c4c7d16a850d5e7968e854ad1ca9b0e1f5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_all_PandasQueryCompiler.groupby_nth.return.result": {"doc_hash": "20900d6dcce9e270e8a193cbc811696480ffa69c3401d87b4cbfc2b0102f3335"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_mean_PandasQueryCompiler.groupby_mean.return.result": {"doc_hash": "009da7baf19f725fd8387d3de2c98245a1c88146b402dcbaa3e6db4c170ec165"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_size_PandasQueryCompiler.groupby_size.return.result": {"doc_hash": "2628c48af68eb2df428863f60bc9f009e4ba14abe473a733742e3a6e5b3c7c24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_dict_reduce_PandasQueryCompiler.groupby_dtypes.return.self_groupby_agg_": {"doc_hash": "e54d2377a83476564c9a06f6be0e5b83855bead283e705a6b714cf1f2d6546f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_shuffle_PandasQueryCompiler._groupby_shuffle.return.result_qc": {"doc_hash": "debdac0ea1a3ed699aec710df1579563f71c18c7fd46e24733478388af8aeaaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_corr_PandasQueryCompiler.groupby_corr.return.super_groupby_agg_": {"doc_hash": "d15643f123757e85390351de759ddfc975dce13982ca6a54a8ef96770fce93e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_cov_PandasQueryCompiler.groupby_cov.return.super_groupby_agg_": {"doc_hash": "61de430836a371669dd934f67697add33bac0415e6a6316003ab799de5022023"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg_PandasQueryCompiler.groupby_agg.not_broadcastable_by._o_for_o_in_by_if_not_isi": {"doc_hash": "004f8635d3f4a669b0f9f2cd0d84e76fcc0045f50e31109b4e94e00c15dffbcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.groupby_agg_builder_PandasQueryCompiler.groupby_agg.groupby_agg_builder.if_level_is_not_None_and_.else_.by_length.len_by_": {"doc_hash": "6a89500f9aff70d47277987e227c5f5febb7f44ab88c83b9aaba3112da6725ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.groupby_agg_builder.compute_groupby_PandasQueryCompiler.groupby_agg.groupby_agg_builder.try_.except_ValueError_KeyEr.return.compute_groupby_df_copy_": {"doc_hash": "c8bb292038b5ec27c16cd655ed40177f38dbaebc7db11c75b350878b772b1cb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.if_isinstance_original_ag_PandasQueryCompiler._END_Manual_Partitioning": {"doc_hash": "f834efddf5975d5a27de743016139f5a3789b5a8d77454ce35bee3c7e7762a17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_PandasQueryCompiler.pivot.return.unstacked": {"doc_hash": "f2367b49a840ade48112894bf0c6e5eb3b0a8be919d28ce2ada84159a49275bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_table_PandasQueryCompiler.pivot_table.if_len_values_0_.len_values.len_self_columns_drop_uni": {"doc_hash": "c3976f1a9216cbfaf26837fe8ea587448e16a57236399543536cab465eb7b824"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_table.applyier_PandasQueryCompiler._Get_dummies": {"doc_hash": "6016684b6cb6380ab344710b7d90eedd8f80fd3a781b6a45b6537c03a50aa9df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.get_dummies_PandasQueryCompiler.get_dummies.return.self___constructor___new_": {"doc_hash": "3406a2c46c7eecb7b212f054999dfd217f55326e4d231d71a87db304a1d23d33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Get_dummies_PandasQueryCompiler.write_items.return.self___constructor___new_": {"doc_hash": "a2119c845eb6488b119e755eac1ce5c7007f1e9cff144bc7137b02e3b2f84cf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.sort_rows_by_column_values_PandasQueryCompiler.sort_columns_by_row_values.return.self_reindex_axis_1_labe": {"doc_hash": "824c56b8eb3f00bf44d2c351b11a98b05f7138d03a8f1835cc241c2ec1c4bc43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._Cat_operations_": {"doc_hash": "30f404e05bf497e9c51dc5a9e9a69a2d0fec90703f74d7588ab90a266cfad406"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_re_compute_chunksize.return.max_chunksize_min_block_": {"doc_hash": "fe21726cf941286d7b100d2f2e696918487325098c3574cdb6f55088fd4703f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_split_result_of_axis_func_pandas_split_result_of_axis_func_pandas.return._": {"doc_hash": "d0d03badd6167b9731421c4b162ac019f0337f2784fe57f5023f7b1422e63bce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_get_length_list_get_length_list.return._": {"doc_hash": "c89777f15e1666e6c04b59a026977ec98ac1b01f37a87e696222b96e66eaff58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_length_fn_pandas_get_group_names.return._names_get_1_i_i_for_": {"doc_hash": "ca01e36994a4d2c1f4f937725fb3463c9a725bf131876f6e6099efa5ce92f790"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_merge_partitioning_": {"doc_hash": "d2dd08962cb94ee4380b44de50f1a2bd8a447b164fd61a580ad1b9b98e6e9f7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_from_typing_import_Any_S_ModinDatabaseConnection.__init__.self._dialect_is_microsoft_sql_cache.None": {"doc_hash": "5f2e362360dd328e7ed0602518d64d03c5844e6486a9c54b1b06c9758fd53a6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection._dialect_is_microsoft_sql_ModinDatabaseConnection._dialect_is_microsoft_sql.return.self__dialect_is_microsof": {"doc_hash": "2e0b614776bed18bf35488fc1a6cd57a7cb26674a5a7b0e1593016e5c7e01001"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.get_connection_ModinDatabaseConnection.get_connection.raise_UnsupportedDatabase": {"doc_hash": "a27b66a265e5966b6cce96bdd6ba2064d8da69020897a79ddbf426cca7e7c9ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.get_string_ModinDatabaseConnection.row_count_query.return.f_SELECT_COUNT_FROM_": {"doc_hash": "a40be2a20ead3e64b14890a312cf13cd1e6f84f9d7961c9e8773f8e98cdbb920"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.partition_query_": {"doc_hash": "4e2dffb071d2624fa0431bd145f894a0a03d88f3b85761682d21ab9fa5c46e46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/__init__.py__": {"doc_hash": "a85feff529326125fdfcc76f5692396880890685a15241aa9847bfcfc998116c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/__init__.py__": {"doc_hash": "ce31de6827e3d060ef42414c928ae0d6fbf846a165cb3d664c4f34f1dbca97c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/__init__.py_unwrap_partitions_": {"doc_hash": "1320117a963745471dd7563438b1e125920072b28c2655caa737cc9626d67ff7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_typing_import_Option_if_TYPE_CHECKING_.else_.PartitionUnionType.Any": {"doc_hash": "12450d04423a0b8116521439da4233b09071de422650f16b8749562ff474f96f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_unwrap_partitions_unwrap_partitions.if_axis_is_None_.else_.return._": {"doc_hash": "f1bca3dfcedc20fc819b2f663f70f4b99410078c26917044faeb134707194d91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_partitions_from_partitions._axis_None_convert_2": {"doc_hash": "98b0cb063700f05dba50bc6164e73bf09094363af9af1dd357ee69068409fd11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_partitions.if_axis_is_None__": {"doc_hash": "89e77e5b8ed081ae512c6aa906b229f36a2f253c83aba92c02a7a5c3d98ee6a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_from_typing_import_NoRetu_ErrorMessage.single_warning.cls_printed_warnings_add_": {"doc_hash": "b785536c0d103da481d829cb1155dab6659fa3246d377cf3dd4c16dd835ff872"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.default_to_pandas_ErrorMessage.default_to_pandas.warnings_warn_message_": {"doc_hash": "cc4892aba5343fbb2889cc26fabb0e5092f8f364043edb784e58e1110942f226"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.catch_bugs_and_request_email_ErrorMessage.catch_bugs_and_request_email.if_failure_condition_.raise_Exception_": {"doc_hash": "6296c31c9ca8d3d4fed25f8c4fea33bbef10d311645fb75dccd88d4dd8feab42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.non_verified_udf_": {"doc_hash": "394a925d2818b59a223343e51410583f191f349d9a8fab99b4e81dd6425c21f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/__init__.py__": {"doc_hash": "6169f6df5f15ee6d288e57dbd221a2020d6b1b9c7372aae43e2fcc0e6fddf76c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/__init__.py_PandasQueryPipeline_": {"doc_hash": "8e1aef69379c6fecc1150aa8e161f8a7967f2c4ed46e2ffe7c02ea1634bc752a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_from_typing_import_Callab_PandasQuery.__init__.self.operators.None": {"doc_hash": "8141eb632344ccf1da95ed7e7eca7d21b3d6e225cda15f42b3cbf9387aa4b465"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline_PandasQueryPipeline.__init__.self.is_output_id_specified._": {"doc_hash": "27cfd4955878cd326665d75467c1868d3ec529bb32fe8398dfbdafe021168781"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.update_df_PandasQueryPipeline.update_df.self.df.df": {"doc_hash": "311c1942653e3e54eedcadd0928ae544cafc7f930c2a2ab471479415b147a45b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.add_query_PandasQueryPipeline.add_query.None_2.self.query_list._": {"doc_hash": "c1b72dcdf3cd47af8d44d2098f3700245bdec136294308569562f532c4870ce2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline._complete_nodes_PandasQueryPipeline._complete_nodes.return.partitions": {"doc_hash": "7dfbb96deb6294a2a5ba90d84ebdb91f8520dab66aeb4e55ed484bf72b4eb85b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.compute_batch_PandasQueryPipeline.compute_batch.None_4.else_.id_df_iter.enumerate_outs_": {"doc_hash": "d69fd8c838f05daf95e9bc82acfd10bbd7e689f8b01632ae87598da41a5e71dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.compute_batch.for_id_df_in_id_df_iter__": {"doc_hash": "d346f6eb4e6f86f3e301d55cafa5eb7f60f8b70813b2cb96d04092359c456073"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_pytest_TestPipelineRayEngine.test_warnings.assert_output_Emp": {"doc_hash": "6467b5579758b73cd3e50c9929d45b22f174eb1c1243542e25e299d0ce983be0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_pipeline_simple_TestPipelineRayEngine.test_pipeline_simple.assert_": {"doc_hash": "0690308ec84e02e6f9bbefc1a9f981c5838b7583039f5829439e0341d9921a16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_update_df_TestPipelineRayEngine.test_update_df.df_equals_df_1_3_": {"doc_hash": "7b15c54d2c4e1bf9c54c80b982676f231bbf83fc873d3f50d07f167502cd19e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_multiple_outputs_TestPipelineRayEngine.test_multiple_outputs._Third_output_computed_c": {"doc_hash": "3c8b6b0147cf654758592afa8553c28e5cb02c60da0b6ca0e0fa290559867eac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_output_id_TestPipelineRayEngine.test_output_id.None_2": {"doc_hash": "b56f5c8b55ba09ad037145cd491dc25bfbcea98aa989a025bddc1681eac5dbfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_output_id_multiple_outputs_TestPipelineRayEngine.test_output_id_multiple_outputs._Third_output_computed_c": {"doc_hash": "f561663e811ee04ef2b003eaee12f318486b795a1c2209cf2978e2f5d1ca32e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_TestPipelineRayEngine.test_postprocessing.None_5": {"doc_hash": "cd7f5d476a71985c9095ee621b54e82a5cb61909efb63738f4c3192c3fc33419"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_output_id_TestPipelineRayEngine.test_postprocessing_with_output_id.assert_len_new_dfs_3_": {"doc_hash": "ff04628f58a85ee1bb93c7e4a7586bd5a5c9783ba82a8082d73acd05ebb1e0f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_output_id_passed_TestPipelineRayEngine.test_postprocessing_with_output_id_passed.None_5": {"doc_hash": "8f6bf904bc1daec7f7f186f750f650af377dfb0d92b2b57c64988138ddb09d8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_partition_id_TestPipelineRayEngine.test_postprocessing_with_partition_id.None_3": {"doc_hash": "a3a635023ce3301bc9e70d001da8d50d5654123996be7e7fd12d954313a9d994"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_all_metadata_TestPipelineRayEngine.test_postprocessing_with_all_metadata.None_3": {"doc_hash": "95e1cef1a4d79b8267719cf1bacf63ad0ae42613b6d7a3b0c9c1d2e78fe6a8df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_repartition_after_TestPipelineRayEngine.test_repartition_after.with_pytest_raises_.pipeline_compute_batch_": {"doc_hash": "5344b9601e2256de59cb7321a1a2e9aa3b31c12f9b164849354de91af55075fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_fan_out_TestPipelineRayEngine.test_fan_out.with_pytest_raises_.pipeline_compute_batch_": {"doc_hash": "597044f044059ebabd57ef1ef978637848b02eaea655d8c79e1a0ab05cc9b885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_pipeline_complex_TestPipelineRayEngine.test_pipeline_complex.None_1.remove_f_i_csv_": {"doc_hash": "0387fc9d168f674924b8603c19ad14537f531eec0dc6ebe77748ccbd9f5678c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_test_pipeline_unsupported_engine_": {"doc_hash": "1cb16a152ed2d1aede588610a94eda43209514467ab43962d09b2ff53657ea35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/__init__.py_ClusterError_": {"doc_hash": "4f1b895573d855fa9fbd4abb78055de1f2cc710ae29decc54e21570ac548e04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/base.py_from_typing_import_NamedT_": {"doc_hash": "b51e9369389756875ee0f7fe38eb8ac610b71ac225e633bcc832c6e85878e443"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_os_Provider.default_worker_type.return.self___DEFAULT_WORKER_sel": {"doc_hash": "cfc43d3ec9881b7a0bdbc3ceabd5685f7d562b0ce07462d5ceb2d9c9298ad7be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster_BaseCluster.__init__.self.connection.None": {"doc_hash": "87803c5f20bffbd842669b7e4b09b5be6bf9726f234292a6619129e53f0c95b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster.spawn_BaseCluster.spawn.if_wait_.if_self_connection_is_Non.self.connection.self_Connector_": {"doc_hash": "523c3c12ba60e4073d6274b8822b97b66365a090a93aba71ab31fa103f678a99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster.destroy_BaseCluster._somewhere_in_the_innard": {"doc_hash": "1e75a04e443b13da3441852752bec58b4c39e098be7de7380a49c11d4f6aa58c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_create_create._": {"doc_hash": "c6fd57b2eede1dab1cd05e762c3abe9ba0121d148d0549699b8c248f7bba6e7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_create.if_not_isinstance_provide_": {"doc_hash": "05973839d248211cd03b6489f90deabfb9ac9134ff730853234310f3cf79e54b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_subprocess_Connection._get_service.return.WrappingService": {"doc_hash": "bb8898fab5db8d16ded9096d24a25a209a3ee0a177e2422698e715dbb93ad08f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection.__try_connect_Connection.__try_connect.try_.except_ConnectionRefused.if_self_proc_poll_is_no.raise_ClusterError_": {"doc_hash": "cd8ef23c3cbc33472433f441212e9e62b2b6e069207a78faea92f7f09a08faa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection.activate_Connection.__del__.self_stop_": {"doc_hash": "08da8403e68e194414fc4497ecb058100f0e8361fe509aee7f51e082a935f5bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection._build_sshcmd_Connection._build_sshcmd.return.cmdline": {"doc_hash": "e69e915630214fcfde1f139d3245ea8e5e36ba29a079fa4df54ede842f02994a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection._redirect_": {"doc_hash": "caa9620714869a002f46f56868b6c090dea6906ff8581b54ae9d998613c63891"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/hdk.py_warnings_": {"doc_hash": "eeee9460fe4c61ff1631d6f9aa988eb9df933d5f128c15695e0c51020eaee4b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_subprocess_LocalWrappingConnection._init_deliver.super__init_deliver_": {"doc_hash": "8fff00f9dd85d9d0ec2384b0c5f22a449b0d93cdd33923d6c9aabb0efd49f97c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_LocalWrappingService__UNUSED.object_": {"doc_hash": "013312a382c1cd2ad0b51e2839196e0f06cb3144aef4038bc7ac28d84290f087"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_LocalCluster_": {"doc_hash": "351b54d35632ea430e27aa65f15cfed714695ffe847b50a8d620d293675a18da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_sys__LOCAL_ATTRS.frozenset_": {"doc_hash": "d5e995846f772986dc76473ed94e729b0e6c0069c07d491ecf86c0347ca77a81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_RemoteMeta_RemoteMeta.__signature__.return.inspect_signature_types_M": {"doc_hash": "97d34f3f5afb02114369c540ff2a7160a0f739a0ba365b024a5f6cca009b48b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_RemoteMeta.__getattribute____KNOWN_DUALS._": {"doc_hash": "67b9abb6ca47ebe0d6cb27aa756c4557842f06271748289b5d00d3e39b8e31be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_make_wrapped_class_make_wrapped_class.result.RemoteMeta_local_cls___na": {"doc_hash": "d9e93a93ec2fed438436f3eb995da377aae7fb1f49a4394a00e4376a7e91abb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_make_wrapped_class.make_new_": {"doc_hash": "7867d1a397ad0ced2a5a1c8fe93cdcb60db0938805457bdf0c32439f3e761f47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_threading__Immediate.join.pass": {"doc_hash": "7a7a3064f5fa1de621d9501ec499fe823aaa378c2c9f822fd0b299333cc64d5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster_RayCluster.__run_thread.if_wait_.if_exc_.raise_exc": {"doc_hash": "393c7e833de90bb2b2a8850d1bba39bf620c17c93d178d47c9d014278b14f105"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__make_config_RayCluster.__make_config.return.bootstrap_config_config_": {"doc_hash": "376436924aada7f10d0746424621b408c301d0c324bc5f19ca39f91663c3ea85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster._conda_requirements_RayCluster._conda_requirements.return.reqs_with_quotes": {"doc_hash": "51afc9372268748844ef07e947f83697a7475e2c896c7327ac40a976f9baccce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster._update_conda_requirements_RayCluster.__save_config.return.entry": {"doc_hash": "2d577331048e1e22b6ef79a7003c8af40e39d1f23a2dd4bf9fce319006898359"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__do_spawn_RayCluster.__do_spawn.try_.except_BaseException_as_e.if_not_self_spawner_silen.sys_stderr_write_f_Cannot": {"doc_hash": "7473c81b0cbf0069b6bac363a7c7c2da8cdaccf9071c21602c34ff9338d377f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__do_destroy_RayCluster._get_main_python.return._miniconda_envs_modin_b": {"doc_hash": "61a8322520fe10d6b729b448b8073adfb01482fa0b1871d2f55f70f29950a8c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.wrap_cmd_": {"doc_hash": "62479faa97bee4018cf57edac609b62a7b3acae26c3e776534c09dd98fbdfa15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_patches.py_numpy_": {"doc_hash": "456d67d16b2fe4d2a3a3b999b22f7dda6a6ee9afd7d1bb6504156b151d398d2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_types__pickled_array.return.pickle_dumps_obj___array_": {"doc_hash": "acf68d445c75030a2d7325f281e59836bb9c4fd1cae966348f020a6ed9e13051"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection_WrappingConnection.__wrap.return.bytes_pickle_dumps_local_": {"doc_hash": "3a7df6251d5d57446058b1c241705f9f62a033ebcc6e36beacff422bf67d9690"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.deliver_WrappingConnection.deliver.return.tuple_delivered_args_de": {"doc_hash": "5095bd77645858f11d18a04faf82e52b30e67a592297d1b956bc6b87cd1b37ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.obtain_WrappingConnection.obtain_tuple.return.self__remote_tuplize_remo": {"doc_hash": "84ce0dbc4cfc82701d90f79ede3d03410e394afcfbaf41d88653fa182f3d1929"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.sync_request_WrappingConnection.sync_request.return.super_sync_request_hand": {"doc_hash": "c881e817b33fa95e65542d2ccb9532132ea942f4a44ccfdb577987e4a1c806e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.async_request_WrappingConnection.async_request.return.super_async_request_han": {"doc_hash": "578f1a9fe5f487a2cf38af282296cfe67aa65917f90d986dfd67c31e3367f9c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.__patched_netref_WrappingConnection.__patched_netref.return.result": {"doc_hash": "0ba179bfb49d9f1855ff4754426eecec8b51f2b5752f1d6520dc8fa04e1871d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection._netref_factory_WrappingConnection._netref_factory.return.wrapping_cls_from_remote_": {"doc_hash": "f6df88b2ec57c8b4706f474a908e5c9037d6d96eb59d20e0835da4e74cfec551"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection._box_WrappingConnection._init_deliver.self._remote_pickled_array.remote_proxy__pickled_arr": {"doc_hash": "b246684fd6ef6b87ccf48543c735216dd7afaf878b1ff28ffd60090f3106aee3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingService__NO_OVERRIDE._": {"doc_hash": "e1e9a7114ff7163c6f352aaab844067f6c2e59e609e1b3c258c5a782f6388f67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls_make_proxy_cls._": {"doc_hash": "15e36d24e49ba3447f57c1f82b4e291c0250d4c5bfa09c475422dad8cf70799a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.ProxyMeta_make_proxy_cls.ProxyMeta.__repr__.return.f_proxy_for_origin_cls_": {"doc_hash": "34887ab74aee670bc68a63a761cdfda482cec68e0cc01167f373b53f45fdb2bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.ProxyMeta.__prepare___make_proxy_cls.ProxyMeta.__prepare__.return.namespace": {"doc_hash": "3c549fb614c9902c0cec9d8c8c2e324edfc93b4d400c137575bfa2b36bb220a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper_make_proxy_cls.Wrapper.from_remote_end.return.cls___remote_end___remote": {"doc_hash": "247fab601b096a0300c9e88f80538cbffd195ea43b4bdf1d655eeec25eccf9b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper.__getattribute___make_proxy_cls.Wrapper.__getattribute__.return.getattr_dct___remote_end": {"doc_hash": "fe66fb1237bb22e1c029825bb73b125087eba421e475920758dc1b94575f6520"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper.if_override___setattr____make_proxy_cls.return.Wrapper": {"doc_hash": "bbef8241fcaec4f6d12a6fa5b1961794f82563b33f1ae659cb7cc0bb522b4698"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py__deliveringWrapper__deliveringWrapper.return.make_proxy_cls_": {"doc_hash": "ea0620f6013eeb8e51caf8183596bd9f1ec13c33aa1e53f8322b0b213be6cd96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py__prepare_loc_mixin__prepare_loc_mixin.return.DeliveringMixin": {"doc_hash": "8a920f7958b0658f5093299d11ded28d46891262e104e648531770ebf7c3150f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_dataframe_wrapper_make_dataframe_wrapper.ObtainingItems._deliveringWrapper_Series": {"doc_hash": "a0c034487d8d48890aefe0208e420bc3fcd8f2c169ad498363913c289324695c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_dataframe_wrapper.DataFrameOverrides_make_dataframe_wrapper.return.DeliveringDataFrame": {"doc_hash": "b27de7dc44aae838770cce4fc370c31245d64afb95ead968e2494207b79e82c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_base_dataset_wrapper_": {"doc_hash": "10cbee3966f34b47edbdafb5677ca107549828c4017ce23c4023778c6a643c19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/__init__.py__": {"doc_hash": "87f2103824fb20d7a0d4aad6f8cb5c11933af3884195f37321f9913dc5151ce0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/test_cloud.py_mock_test_create_or_update_cluster.with_mock_patch_.make_ray_cluster__spawn": {"doc_hash": "f6279aba11d4f171a6c7de14bce78f15d4c0c317e3f0ab4a0d62f2e7167dbea5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/test_cloud.py_test_update_conda_requirements_": {"doc_hash": "fab3596e0548a50a0724cdde566a9b389b61f6073ba24525c5679e868682eb0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/__init__.py__": {"doc_hash": "8cfb0bae1011de2880be6f2420763c311f08a94b4e00c9577b8a34fe17522fb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_from_rpyc_core_import_con_read_log.return.items": {"doc_hash": "e95ac8d99d63d017d395c2cf46b83cd57e1a6e265302d37005979acf82183252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_get_syncs_getattrs._p_for_p_in_pairs_if_p_0_": {"doc_hash": "f59716f0c232a1f7d77beaad06bd03c521b40b3ee41bc36472aecb8e54427266"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py__unbox__unbox.raise_ValueError_invalid": {"doc_hash": "2c5f8568a47e64b469a8daef1c52f74a16ff897ce3298c7a2e466dfb3a9209ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_from_getattr_send_from_call_send.return.obj_args_kw": {"doc_hash": "6f70429c62a9d505ed8190c7c7b3b1122826c69bdd3b95da5954d29c48179fc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py__parse_msg__parse_msg.return.from_getattr_recv_m_s_": {"doc_hash": "1765b1f9420e2f850f103afc4dd4b6bcc6ebda28771c3853beaeb40192b046c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_remote_": {"doc_hash": "2bc98ad7059318299b334674986518af414d44d3afa2346bbd05a5184cac2abd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_threading__Logger.__exit__.with_self_conn_logLock_.self_conn_logfiles_remove": {"doc_hash": "0b6720db4d91b1a2eb25bb450d347bf0fda47eb980b1018e4a9367f6a9baa6a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection_TracingWrappingConnection.__to_text.return.str_cls___stringify_args_": {"doc_hash": "2e57ce0212c26c505340f3080183ddee28f78458aab54945ccf5a80fa1235ddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection._send_TracingWrappingConnection._send.return.super__send_msg_seq_a": {"doc_hash": "675e043c5defc77dad152077f960412894c3cc80624cc9d6644b7b546dd6b4df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection._dispatch_": {"doc_hash": "f973a1340e0c941f231d67c2e0abfba12a47c531ea94ff6cdf14c597b7a99c87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/__init__.py__": {"doc_hash": "86eb207a23417c36e8e5208f00dc2225aadb662d42a6d188b90a8455f2a0aa53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/__init__.py__": {"doc_hash": "1c0ff120052bee4b2243fc8ecdaabcf0100661d3067b082a6c881dce47729b18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/__init__.py__": {"doc_hash": "b41af805e99d8b84f5744989f714cfe09a1563e43345dde7163b9fcd6d064c7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/__init__.py__": {"doc_hash": "965ed3d5360790d0af8805c0ec1eb7c0db605c27bda3b2cc6040fd0a5e30128d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/__init__.py__": {"doc_hash": "ea14f1838596c456924e6c8082e292119b4f4ee4fc30b47a3b854a594b7aba38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/__init__.py_ExperimentalPandasOnDaskIO_": {"doc_hash": "7b19c82f6b2929d0d29a7186a0f5f0c8d76376bf02e35d80ec7f55291406ad29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py_from_modin_core_storage_f_None_6": {"doc_hash": "360d08a273c81686e9999f382d4657aec497807615e1a26e4ff4752d91755c43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py_ExperimentalPandasOnDaskIO_": {"doc_hash": "e44de0cea6a572192559ac043505ce496ad5d1e7611be771ea6b9564b36f5e9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/__init__.py__": {"doc_hash": "7e9c52f6a46727a8c7e3cdb50b3f491b86c720a3ef729cc32e3e97031219a2ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/__init__.py__": {"doc_hash": "9f83b3039e0f3462a68a9ca2adeab10289dcad9681703c4d7b1f2596b81ac4e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/__init__.py__": {"doc_hash": "ec22ea56e9daa506b2f2ec1bab8e7672dc66cf507d0e5be25ec8881a4e30c1d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_abc_BaseDbWorker._genName.return.name": {"doc_hash": "5b83030ae389737498a963af6326ea19ac9bc12d9e9ded311b1885fac197dadc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.cast_to_compatible_types_BaseDbWorker.cast_to_compatible_types.return.table": {"doc_hash": "12a007aca5bf2c1118c972e2c8c62fa7a5a2259d1213171e562d07ee02942082"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.compute_fragment_size_BaseDbWorker.compute_fragment_size.return.fragment_size": {"doc_hash": "5393fe0993e94dc74d75e9e4448ddab5720058dcdace733aafaa32a8f413c6b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.import_arrow_table_": {"doc_hash": "218aabef1c36283cfba11548d0cf332bfc721776fd382ac894d1c6b4a259590b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_abc_CalciteInputRefExpr.__repr__.return.f_input_self_input_": {"doc_hash": "b34f98521119454da930a6a116b014c9ca09f42ea943b9828d9dcd6eea127802"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteInputIdxExpr_CalciteInputIdxExpr.__repr__.return.f_input_idx_self_input_": {"doc_hash": "0083d7067a7e096f4b6e6805739e3873677be2b7df832fff5459664877339c1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteBaseNode_CalciteBaseNode.reset_id.cls__next_id_0_0": {"doc_hash": "fd5554c91646f3d52f100f02f5c9300186a87e95c2f4936ad28ddfbab5aa63d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteScanNode_CalciteScanNode.__init__.self.inputs._": {"doc_hash": "883c2d8219a8427a29d6501a67c48a0ff8ff3286629a3c549b1a2dbb761ac371"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteProjectionNode_CalciteFilterNode.__init__.self.condition.condition": {"doc_hash": "99fa79a465fdff80ca72bcab3d256948fc1c99d3e4d4d6c269c9de7ab366312e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteAggregateNode_CalciteAggregateNode.__init__.self.aggs.aggs": {"doc_hash": "0ee0f440fcce098bb7cb0e2bd2f336dfe5710ebe9f3f702fc735710ddeed0066"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteCollation_CalciteSortNode.__init__.self.collation.collation": {"doc_hash": "a750da4c963d47235c7d15741357d90514b3963ddcbeee603a9956ebe8526b2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteJoinNode_CalciteJoinNode.__init__.self.condition.condition": {"doc_hash": "9eb740104b739c39ab5950b7306121dc3eb1461aff0b4129e774470839451cd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteUnionNode_": {"doc_hash": "5ad6a60cc47948e767958b53cf12bd8f73e209fd1147dd4881afaed05a0fecfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_ColNameCodec_from_pandas_core_dtypes_c": {"doc_hash": "f8a2fcd34279f20cc925e4ef9176efd5f7414f6d128ac8b525de15df1600f79f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder_CalciteBuilder.CompoundAggregate.gen_reduce_expr.pass": {"doc_hash": "37e89a60ab42230c76a4d9278bab6f33a77298b002ec5a5b62988a44140e9945"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate_CalciteBuilder.StdAggregate.gen_proj_exprs.return._self__quad_name_expr_": {"doc_hash": "31a09d9051bda66f5f7648818ee0a2b90103292910192b6b73aa601a6fc83a03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate.gen_agg_exprs_CalciteBuilder.StdAggregate.gen_agg_exprs.return._": {"doc_hash": "32c0a1ffaa1fd896bc118149870eb53939d9bfeec4b464f1cbe1bad1d7d9c3b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate.gen_reduce_expr_CalciteBuilder.StdAggregate.gen_reduce_expr.return._": {"doc_hash": "7c7a4c5cf4d8f8edc8d6b66b25e84fab08a09baef2531754c0b47d9b4973a345"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate_CalciteBuilder.SkewAggregate.gen_proj_exprs.return._self__quad_name_quad_ex": {"doc_hash": "5392c338ee6d7107c9dd1f8fde129154a345ade85a7af282a11fcaa230091ff2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate.gen_agg_exprs_CalciteBuilder.SkewAggregate.gen_agg_exprs.return._": {"doc_hash": "8ef3578078ae950cddea6df98762f2329a4f3b1e73b10d86c452df1e3f04c987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate.gen_reduce_expr_CalciteBuilder._compound_aggregates._std_StdAggregate_sk": {"doc_hash": "bbc74fdf6a86664d3a48e45b586c95023e0f111536916ae46c5049492ad85818"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext_CalciteBuilder.InputContext.replace_input_node.self_replacements_frame_": {"doc_hash": "488b8215326a37d1519f12793a3f33f885c37fe3db3a378c6174cbf060d04a85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext._idx_CalciteBuilder.InputContext._idx.return.frame__table_cols_index_c": {"doc_hash": "6785c775e88a95fc93e4065a6669932a4c4d93924ec0c46a4f5bb216f4d4f067"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext.ref_CalciteBuilder.InputContext.translate.return.self__maybe_copy_and_tran": {"doc_hash": "1159f4626c0c48241aeff3e9478a775496342bd949f03e3b4ded6a30564ed564"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext._maybe_copy_and_translate_expr_CalciteBuilder.InputContext._maybe_copy_and_translate_expr.return.expr": {"doc_hash": "0b8bf8bb958934c0909b8ebf6a81749bfb119cd6eb3308eace2d423e21902575"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContextMgr_CalciteBuilder.InputContextMgr.__exit__.self_builder__input_ctx_s": {"doc_hash": "2d547eaf1a8c5d27689d38a864d832f1c51b531cf146e3be50f593bd732ee662"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.type_strings_CalciteBuilder.build.return.self_res": {"doc_hash": "0f83793b043c99e3bfb1ce235f4f9e899f9ba727c6effcdd3de6e94ef4d4aec4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._add_projection_CalciteBuilder._add_projection.return.proj": {"doc_hash": "860e525b273207db64ec83d88e0647f7f8e659ec9cf180e5c6fc6f69d00c2694"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._input_ctx_CalciteBuilder._ref_idx.return.self__input_ctx_ref_idx": {"doc_hash": "5be47917d7cb5c3f500efc2c6847397d4d965e9245bccda32c3bde82e1c5c4d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._translate_CalciteBuilder._translate.return.self__input_ctx_transla": {"doc_hash": "67164888f0fc44fe3b9a5f23d862eba7d96d10fd28e26b47f9debf21c2a43ae9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._push_CalciteBuilder._input_ids.return.self__input_ctx_input_i": {"doc_hash": "42562491e5cafd3b093a90bba2fb84188849a8b76ae5a39656412210d699a81f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._to_calcite_CalciteBuilder._to_calcite.return.self_res_1_": {"doc_hash": "bcae41126b6fe9960dce29d93dbf56e7f3ba3545d065cabc1ecb24cc5b7c8831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_frame_CalciteBuilder._process_mask.self__add_projection_fram": {"doc_hash": "b944bbbc9cd99daf90098ffa10ccd145f002ca371b0133d15bcf7db820e35f11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_groupby_CalciteBuilder._process_groupby.if_op_groupby_opts_sort_.self__push_CalciteSortNod": {"doc_hash": "6c2193fac15386b0a4150bc9fc83d6afb71642d8acc67aeae1b49d138534239f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_transform_CalciteBuilder._process_union.self__push_CalciteUnionNo": {"doc_hash": "1dd8d8419238bcf275dbcf4582406fe901e3211cc50b8b39767654d5d660d07f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_sort_": {"doc_hash": "6a7592cf8d5552cd10617596b5f0f6d6917e93a5f88670e920120d589524cd36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_BaseExpr__warn_if_unsigned.if_np_issubdtype_dtype_n.ErrorMessage_single_warni": {"doc_hash": "0a9f575c2bcdb39f3e9ef5a96170a0d9d86d07553280b51de445298158172933"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer_CalciteSerializer.expect_one_of.raise_TypeError_Can_not_": {"doc_hash": "f52e17185ec653b54f37c98a213cf36fcb55c5fb6fc36e44624c62920ea7ddb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_item_CalciteSerializer.serialize_item.return.item": {"doc_hash": "7c1a628b8b35d80e228b7dadfaa481a549b70fdfb66f1c44718192c55cf120c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_node_CalciteSerializer.serialize_node.if_isinstance_.else_.raise_NotImplementedError": {"doc_hash": "471c8baa1e6fbbff6bc7a39fcc348f641087b2b2e880fc46eb9de44045cca9ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_obj_CalciteSerializer.serialize_typed_obj.return.res": {"doc_hash": "6825af4f3c15b5de7709f7e286b2e9b4e5e833aa9347a7a312ca7626bc5fed9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_expr_CalciteSerializer.serialize_expr.if_isinstance_expr_Liter.else_.raise_NotImplementedError": {"doc_hash": "fa7aa4f9898c19a3014aff014888164cf91bbe5e45b09d3fa1d3f5f969b6e376"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_literal_CalciteSerializer.serialize_literal.raise_NotImplementedError": {"doc_hash": "071e5d2032c1354a0eb78b78b91e8b5668ac6ec0c11a771641970ac4d9ab23af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.opts_for_int_type_CalciteSerializer.opts_for_int_type.try_.except_KeyError_.raise_NotImplementedError": {"doc_hash": "52e94c2658b1eb1d80c35a317b40b9f0d0c7e98857f5fbd89b0e163432487c8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_dtype_": {"doc_hash": "733be9e060e6cad49d190d7ec5b2726bea51a0af63a6411204e9ca7a00cbf588"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/__init__.py__": {"doc_hash": "3bb29ad0c103fc391d1b774e445c5679ac6ab64fec581f257fbf06f0039c4640"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_re_demangle_index_names.ColNameCodec_demangle_ind": {"doc_hash": "e08277d9c739a3d8a6fb736528022a08be24ed6013bce4383423164c6eb273ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe_HdkOnNativeDataframe._": {"doc_hash": "1158385d3d47e9f605f8f7b3c805ee39ec9a9e8520e42c6e5b2d7e18e7f3f6ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._query_compiler_cls_HdkOnNativeDataframe.__init__.self._force_execution_mode.force_execution_mode": {"doc_hash": "6a599c6f616db727b82dcd7e263ad39581be66160b99464ed852092c97b7d30b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.copy_HdkOnNativeDataframe.copy.return.self___constructor___": {"doc_hash": "26cf2c37dc4d5ac863f71e367f100a217ab513d4b3dce3d732de26b4a96b8285"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.id_str_HdkOnNativeDataframe.ref.return.InputRefExpr_self_col_s": {"doc_hash": "d07173d0b7d753d4e26cbd681594c89ad86f92b1c5be39e68285529e6cfa68da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.take_2d_labels_or_positional_HdkOnNativeDataframe.take_2d_labels_or_positional.return.base": {"doc_hash": "70dcd68d55fa46f7b4e403c3607b97f4bb6c31f11bbe379525bf385a86b70844"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._has_arrow_table_HdkOnNativeDataframe._maybe_update_proxies.if_new_parent_is_not_None.elif_self__has_arrow_tabl.super__maybe_update_pro": {"doc_hash": "dc84d8d78b2eecb4a8c9ce37e8f5d9df2e84b72231cfb539c608bdbb3cba110e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.groupby_agg_HdkOnNativeDataframe.groupby_agg.col_to_delete_template.___delete_me__name_": {"doc_hash": "31298198df26f4aff81e958b09d706650066f4a2a5cbc0df1514f6f0e97420a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.groupby_agg.generate_by_name_HdkOnNativeDataframe.groupby_agg.return.new_frame": {"doc_hash": "97fb4579f00f62343b04fd003933e0b5260839775efc6f1071cfaa8a8af112c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._groupby_head_tail_HdkOnNativeDataframe._groupby_head_tail.return.base_copy_op_TransformNod": {"doc_hash": "521d0311493e2fbd4b3133da23cce05ab97caa6b15437c2b7df406741315845e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.agg_HdkOnNativeDataframe.agg.return.self___constructor___": {"doc_hash": "be55098c6c2aae22a3189bd61da215d26ba9914af2710c520d6b0318ea9b63fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.fillna_HdkOnNativeDataframe.fillna.return.new_frame": {"doc_hash": "043cb3c1f87d9b652ff9b2a9fcdccb71913b4115f5b4e98983a4aff95a3ba071"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.dropna_HdkOnNativeDataframe.dropna.return.result": {"doc_hash": "caecbdf7062d612a435228d3a328e8ae6deaff46303a0f9acafe7567fd70d43b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.isna_HdkOnNativeDataframe.invert.return.self_copy_op_TransformNod": {"doc_hash": "8fba05f05ab82406a177381e57f65d09d1651620130cd06d649df71d6a01f390"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.dt_extract_HdkOnNativeDataframe.dt_extract.return.self___constructor___": {"doc_hash": "f63d1bfd34189e2cd39747f88e7970469052ee58ea9e1d86410b15eb25146a31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.astype_HdkOnNativeDataframe.astype.return.self___constructor___": {"doc_hash": "6fd64eefcf4dccdee8fa172c43334eb0c9c99204f11bb4f9825612ba6e180a2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._build_equi_join_condition_HdkOnNativeDataframe._index_width.return.len_self__index_cols_": {"doc_hash": "0b372be3ae1f0b61c8b2284da111120919cfbb60cd65579c0c3f1d6a2d8c9951"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._union_all_HdkOnNativeDataframe._union_all.for_frame_in_self_oth.if_.if_isinstance_frame__op_.else_.frames_append_frame_": {"doc_hash": "c084d4a9918879ec26e3565cd5e8b7e42628fef26efa9d88253a724867cd0b5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._union_all.if_len_col_name_to_dtype__HdkOnNativeDataframe._union_all.return.self___constructor___": {"doc_hash": "33db13ad6362bf601fc40813cd0dc21d238cb9b44a1a193b951ac508fe99de10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._join_by_index_HdkOnNativeDataframe._join_by_index.return.lhs": {"doc_hash": "88c6ec2f750d9ef81f002c183e5b59ac14f67aa3e06c56486199b5ca9b32cdbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._join_arrow_columns_HdkOnNativeDataframe._join_arrow_columns.return.None": {"doc_hash": "9722f5f457f606b09636ed19e83957c160dfb16124897b98bca207bbf11ac080"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.concat_HdkOnNativeDataframe.concat.return.new_frame": {"doc_hash": "9545a27cc04a578cd384c756a02c3653f4ae2288c6c3f734599dd4d94f4cdf24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.bin_op_HdkOnNativeDataframe.bin_op.if_isinstance_other_int.else_.raise_NotImplementedError": {"doc_hash": "f297f3c7ef3db709af38ca8b604a5bd83bceddd2e65e773918bf67cf7a9e9a2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.insert_HdkOnNativeDataframe.insert.return.self___constructor___": {"doc_hash": "8967ea7a905d05e583fa3d42c2e86abea046b24585f98ccf12e674607b85dd69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.cat_codes_HdkOnNativeDataframe.cat_codes.return.self___constructor___": {"doc_hash": "51430a5b9d8962f207c0e4eeff3f9171c7cb8bc21ff0f5a26c266c4132e33d09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.sort_rows_HdkOnNativeDataframe.sort_rows.if_isinstance_ascending_.else_.ascending._ascending_len_columns": {"doc_hash": "4c22b94d7f88877c3fbe9740528d468254106487612d5226a95c614d0cccfeaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.sort_rows.if_ignore_index__HdkOnNativeDataframe.sort_rows.if_ignore_index_.else_.return.base___constructor___": {"doc_hash": "ec432d041452083a9360411fecbf228b6addad3482e79ed8818b4f808ebd2df5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.filter_HdkOnNativeDataframe.filter.return.self___constructor___": {"doc_hash": "249289541864dee296aec26cbc42aa923f485274feebc358061e3030c506a578"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._maybe_materialize_rowid_HdkOnNativeDataframe._materialize_rowid.return.self___constructor___": {"doc_hash": "417caf2132c3fa3ece0607ee7cbb72980c383e132843e0633e57c538fd29dc54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._index_exprs_HdkOnNativeDataframe._find_common_projections_base.return.None": {"doc_hash": "3ccbf4340d49f9546e8a3821b6ef01704c8ae1fcc63bcadb216e574475904f72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._is_projection_HdkOnNativeDataframe._execute.return.result": {"doc_hash": "fcf9dffff97f6be02b1badf59caf3a443e49661c81d6e80558f21bc96d764245"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._materialize_HdkOnNativeDataframe._can_execute_arrow.return.True": {"doc_hash": "a02ba3745178ff6da12f3aed2a458ea0374887c3219af36b7e7eb73eea39d37a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._execute_arrow_HdkOnNativeDataframe._execute_arrow.return.result": {"doc_hash": "84f50c770ee645de2456b8819c627558de8ddf63946f54fe0fef1719ea4fe8c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._get_index_HdkOnNativeDataframe._set_index.if_isinstance_obj_pd_Dat.else_.return.self_from_arrow_index_at_": {"doc_hash": "1e984ea12b058512f0de203a39820197df24856a4dea33f47a36fb94f2bbea80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.reset_index_HdkOnNativeDataframe.reset_index.if_drop_.else_.return.self___constructor___": {"doc_hash": "fa965e4a9b4efd06e216675cd300295337b2682e6421e060a91d176d700fb6ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._reset_index_names_HdkOnNativeDataframe._get_columns.return.super_HdkOnNativeDatafram": {"doc_hash": "e38f886afc374d0b8b0e4574952bb5c1866f7adfa988296c6c322a9a85dd9686"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.__dataframe___HdkOnNativeDataframe.__dataframe__.return.HdkProtocolDataframe_": {"doc_hash": "49c8d322d621d3fe7702dbbebf6b043d6fcf68708e6d37255f717afe49bfffdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_dataframe_HdkOnNativeDataframe.from_dataframe.return.cls_from_pandas_pd_df_": {"doc_hash": "8b627a58f3d877a33410b7ebf116299fa4c9d6635ae08bd481511e5db663210f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.columns_HdkOnNativeDataframe.get_index_name.return.self__index_cols_0_": {"doc_hash": "daff47e6ec63c9456067d3828909f59f07cfbd021a3e0da9555ff523efbaeb0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.set_index_name_HdkOnNativeDataframe.set_index_name.return.self___constructor___": {"doc_hash": "b041832bb461900c92cc690c79c6e2706aa79bece4e094f0bb5cc387a3843488"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.get_index_names_HdkOnNativeDataframe.set_index_names.return.self___constructor___": {"doc_hash": "80b07dacf036131dc4bf522ed429db03eb132a9e0ac31b28848ae796f36b54b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.to_pandas_HdkOnNativeDataframe.to_pandas.return.df": {"doc_hash": "0f78c29717369315f88a08bdb94df8d24e05bc3dbaf15faea8f9bb6591e142d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._find_index_or_col_HdkOnNativeDataframe._find_index_or_col.raise_ValueError_f_Unknow": {"doc_hash": "4ba09f6244479f30e9035836332a06c5c0bd10d457a255d70281d4c7d3390dc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_pandas_HdkOnNativeDataframe.from_pandas.return.cls_": {"doc_hash": "6856b30585b982e1efa3a90caca9acf6f9f3d4c3352c4dad9394a55038d18eaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_arrow_HdkOnNativeDataframe.from_arrow.return.cls_": {"doc_hash": "c06b290933316d4064f9c315bd6d2893880ea0f3e42dfbf5664c69eca6d5206e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._is_trivial_index_": {"doc_hash": "fa13b558626c73fb08eb276850a089a9fb29ec01c418b3ff00d026c9eee83a1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_re_ColNameCodec._DECODERS._": {"doc_hash": "0edbba08d2a883bcb7b8a6ac6929dfa8f4dbd69836088253ce963ee91f34a0b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.encode_ColNameCodec.encode.try_.except_KeyError_.raise_TypeError_f_Unsuppo": {"doc_hash": "14eb01bf380cd52b33689e29d62b5b2c2d22b105a60dff76d744c6a265ba581e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.decode_ColNameCodec.decode.try_.except_KeyError_.raise_ValueError_f_Invali": {"doc_hash": "c41b9c55566386fc52bb06f98603c6c6ee30d409c2fda8ae1dfe9b4a3fc780b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.mangle_index_names_ColNameCodec.mangle_index_names.return._f_pref_i___ColNameCode": {"doc_hash": "d94d1f7e55a435d64a055f6d07f32b8d894d958af6531f7c1f7808d333ac0136"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.demangle_index_names_ColNameCodec.demangle_index_names.return._ColNameCodec_demangle_in": {"doc_hash": "1749f14b9c18310dda0c31c6f333fb3c8047610d46dcbd49ccda4bb36b8fdcfd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.demangle_index_name_ColNameCodec.demangle_index_name.return.col": {"doc_hash": "5f26a7fe4a14c7415f74b37923f6d18de9bf209953b96c434453e1019eab4991"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.concat_index_names_ColNameCodec.concat_index_names.return.names": {"doc_hash": "74c0e62919afac673733e41305bc603c0359cb7aab34e0188d1769ef4c2d5d03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_build_categorical_from_at_check_join_supported.if_join_type_not_in_inn.raise_NotImplementedError": {"doc_hash": "e796835bf3bed5867a602bbe217767ab86adfa347568e5e5aabffe20eac08835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_check_cols_to_join_check_cols_to_join.return.df_new_col_names": {"doc_hash": "144c340afc4f2449b18c964fe53843966b69c67ff8f45bab9acb15e792ec9980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index_get_data_for_join_by_index._": {"doc_hash": "98035dd51bea4c3d74b78b18a5351b0e870d9c29e70ae52770a1557a2d105e8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index.to_empty_pandas_df_get_data_for_join_by_index.to_empty_pandas_df.return.pandas_DataFrame_columns_": {"doc_hash": "7de09959b13dc80deec577a637eae0944ef74c63d798fadf6d4184699ae759a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index.new_dtypes_get_data_for_join_by_index.return.index_cols_exprs_new_dt": {"doc_hash": "cbd5f6f29189630ab72fced384efd48f5311976641be0d322fbb8e9707977913"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_to_arrow_type_get_common_arrow_type.return.pa_from_numpy_dtype_np_pr": {"doc_hash": "dbc98ba1044827a9b281f238361321803b4a010d26fc453e9b4e67985aca2252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_arrow_to_pandas_arrow_to_pandas.return.df": {"doc_hash": "8e9960cf590c0049efbf5e977d12cbaaafbe12e652df4be0a7cc80d522e396e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py__CategoricalDtypeMapper_": {"doc_hash": "69968e6d5dd666b57a73b27d1539cd8403efdac243280eb73d705d138cff45fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_abc_if_TYPE_CHECKING_.HdkOnNativeDataframe": {"doc_hash": "9738b4b982cf2c1193676f2dc939b34df4f318f7612316881ccb3ac42d2d7c42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_TransformMapper_TransformMapper.translate.return.self__op_exprs_col_": {"doc_hash": "63f82251702a85267bcf9787c0a15fe496a4c7ca9162eb15381a95018f78552b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameMapper_FrameMapper.translate.return.self__frame_ref_col_": {"doc_hash": "39edafba92c4ba1364c26447b1ce653ec3c4f3468996347c006550e056e4560a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_InputMapper_InputMapper.translate.return.ref": {"doc_hash": "2d6577d3024ad94f25418ce85cc8d34c1a437a9b08a92fecc57f5bfb4c397669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode_DFAlgNode.walk_dfs.cb_self_args_kwargs_": {"doc_hash": "555b92f3e453f9f05bf0509b103630d6ca98448c18386833ef3eabbad5b50ebb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode.collect_partitions_DFAlgNode._prints.pass": {"doc_hash": "cbf354bddc5b6afd8a0fe387756f49ab4e7f118541dd44e2658c86e97f2d4de1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode._prints_input_DFAlgNode._prints_input.return.res": {"doc_hash": "c16c2c10894b8acdd17e6e9b78368e1079913b93cd74fe93a813ea9a37a74a7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode.execute_arrow_FrameNode.execute_arrow.return.EMPTY_ARROW_TABLE": {"doc_hash": "17a3f6f1db8d299f5ad4111f075c9b604ec0b5f54ebd4933a11a80305fac698e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode.copy_FrameNode._prints.return.f_prefix_self_modin_fra": {"doc_hash": "c0ad652e48158daddfafff875e3f27aff683820a407d6c0b71dbaab0e32896f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode_MaskNode.can_execute_arrow.return.self_row_labels_is_None": {"doc_hash": "07f51919a977a829c256729c19d01b26f742f4426c66a9be0adea12c913e3f06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode.execute_arrow_MaskNode.execute_arrow.if_step_1_.else_.return.table_take_indices_": {"doc_hash": "88464e9d3e44e6bc7c818a98be61f357759341c825a5d89df90001e522ce6203"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode.copy_MaskNode._prints.return._": {"doc_hash": "e528870b649961dc5a997f7d8ebe5d04e0cb8b5fb0f68ab77a23aaf47c599d45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_GroupbyAggNode_GroupbyAggNode.copy.return.GroupbyAggNode_self_input": {"doc_hash": "7a4bbffe918f7c820cc55addc668ce5589fc6ff971adf48ab9f1c2a0162830d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_GroupbyAggNode._prints_GroupbyAggNode._prints.return._": {"doc_hash": "9c0c63bbc8171d673a2944a3234fb553c630d467e9a181166206c9021125c9f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_TransformNode_TransformNode._check_exprs.return.True": {"doc_hash": "153a8617b338f7a5a28852312d8e0845ec27a2a6b597496d0cb21c8ac4535f37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_JoinNode_JoinNode.copy.return.JoinNode_": {"doc_hash": "6beac113ef4e665b56538c980532200ad5266a69cc352fc917d8d042fe0a9556"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_JoinNode._prints_JoinNode._prints.return._": {"doc_hash": "67fb06c10a2e2e7d3d6bbce658cb3b72d60efea79a6aafc216dff0a51346b98a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode_UnionNode.require_executed_base.return.not_self_can_execute_hdk_": {"doc_hash": "50986b77b58b1785f14ab21d530fb51cbf9bfa6f51d93920071959a98540b59e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.can_execute_hdk_UnionNode.can_execute_arrow.return.True": {"doc_hash": "9acbf3ed03f07f0cfae6ae978a07d90147ffc3634c6ba4dad4115c698336bd75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.execute_arrow_UnionNode.execute_arrow.try_.except_pa_lib_ArrowInvali.return.pa_concat_tables_tables_": {"doc_hash": "ddb1cc20ea6c1e2526f8486548d7f788910feb3bd4a7422ac8092eb8a931f598"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.copy_UnionNode._prints.return.f_prefix_UnionNode_n_": {"doc_hash": "fdc7f503c34d437d9cb0382c277fffda7e54fc4d61c763346ca37a92cfa2284b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_SortNode_SortNode.copy.return.SortNode_self_input_0_s": {"doc_hash": "09d08d99a4e68a676255da06856d66358676a2a3b0b7d286fb659d693b1acbba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_SortNode._prints_SortNode._prints.return._": {"doc_hash": "9c54654a010e0f76a6e79757ad3c9a854b88ef188cd45c258a7c86fe697c810e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FilterNode_FilterNode._prints.return._": {"doc_hash": "29f75bf564d5cbeba135eefef9054721a1027abda37078f03e4af13e1b14da5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_translate_exprs_to_base_translate_exprs_to_base.return.res": {"doc_hash": "b423fcb1210c2db2fc3bb392d898858cd02b0675667a21584b6f4389dfe2cbcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_replace_frame_in_exprs_": {"doc_hash": "f197d82622b7ccf4fc918a2f307ea7f4e26c72a200c65beefde9bb2b54e587d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_abc_ColNameCodec": {"doc_hash": "4488fcc00f268a96275d625bd768ee5e7e41ba42064054e0be03efdd075fb533"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__get_common_dtype__get_common_dtype.raise_NotImplementedError": {"doc_hash": "d38d985bad0eb9c2971de1b19500c60d104feb4888d967a9a0e41d0ff7c901bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__aggs_preserving_numeric_type__agg_dtype.if_agg_in__aggs_preservin.else_.raise_NotImplementedError": {"doc_hash": "b3b8b12b6aded3b436704ef41bee12a29bb7f2da124abe00b6fbe7388b7e98ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__cmp_ops_is_logical_op.return.op_in__logical_ops": {"doc_hash": "f2d51678d149a5f56e47e74e97f5517d6cef91457940d6e0198fce73b2aff8ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr_BaseExpr.cmp.return.OpExpr_op_self_other_": {"doc_hash": "004f5458352a69c98c7d78e8da47db5e8c9270ce5b1463d044f7472e4763a045"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.cast_BaseExpr.cast.return.new_expr": {"doc_hash": "430baf683b46c2e4c259e43c6921427d9e40f2a23eacbe2c36812d110cda4548"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.is_null_BaseExpr.is_not_null.return.new_expr": {"doc_hash": "71bed83a321f671bf89138a354b46d6ae221cd5e1fe26b25bf03ac1b4407c08f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.bin_op_BaseExpr.bin_op.return.new_expr": {"doc_hash": "8b92c75fb0d05f6b3c85bb159661f51fc93a47bb7e3147b96343b78d4a72a094"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.add_BaseExpr.invert.return.OpExpr_self_self_": {"doc_hash": "de0a4552734d1759dd24911cfe96d82518ddcc71836c1610be282245faf2a62b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._cmp_op_BaseExpr._cmp_op.if_lhs_dtype_class_rhs.else_.return.build_if_then_else_": {"doc_hash": "7dedab8757f98c0d67a9a8b5acf828035572fa268df22730ad282557c1a6fc09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._get_dtype_cmp_class_BaseExpr._get_dtype_cmp_class.return._other_": {"doc_hash": "d88766c3493028c9dfd0310ad4bf499c97d3c66a347e03b58cd9d53745a53fe9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._get_bin_op_res_type_BaseExpr._get_bin_op_res_type.if_op_name_in_self_preser.else_.raise_NotImplementedError": {"doc_hash": "e1af992f64f4e1ac1889d002f62f6f28cd1cf7b8bed7602f2ac50e436f715995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.copy_BaseExpr.nested_expressions.return.expr": {"doc_hash": "74a10e416c1f27f5f7f3bfd68ba819357b6b9aef70ed5e596d603f9d77e8a597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.collect_frames_BaseExpr._currently_we_translate_": {"doc_hash": "33a2379dc87d925630b48cc27f44158774a535dad899e52b76eaf055efb561e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.translate_input_BaseExpr.translate_input.return.self__translate_input_map": {"doc_hash": "6082e54bbc9884238877ebe1886ff411b1adae51611e5d124279b7f68a6008dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._translate_input_BaseExpr.execute_arrow.raise_RuntimeError_f_Arro": {"doc_hash": "6b61b592927d4134365f4a1cdda636f2a119e44cbef00ccd5c898d309465be3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_InputRefExpr_InputRefExpr.__repr__.return.f_self_modin_frame_id_st": {"doc_hash": "40e8776e66fdf92ba6baaff4cce299111e01c52fd6caf586b4f2370cb6415d96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_LiteralExpr_LiteralExpr.__eq__.return.isinstance_obj_LiteralEx": {"doc_hash": "d1ddc331e44f52720feadc05eaae7e63d96db8e5ed6bc688adfcdc776fea235d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr_OpExpr.__init__.self._dtype.dtype": {"doc_hash": "7966fd6c6db43c46ed926d39ad605c1365c7f28a56ffc4c039a09b1a866d8033"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.set_window_opts_OpExpr.set_window_opts.self.upper_bound._": {"doc_hash": "224dc27f02dbd634533039861ae9930c42cc18ecfdf6b0d41604367b4f466bb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.copy_OpExpr.nested_expressions.return.expr": {"doc_hash": "ce2919518492277ad46d821f322273153afbb755d7406bbfe4e03298f45b3ff0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.fold_OpExpr._fold_arithm.return.operands_0_if_len_operan": {"doc_hash": "6cb028461e39845c702404bb9d42a1b8f5acc54796dd395ea61c000c2c7f813e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._fold_invert_OpExpr._fold_invert.return.self": {"doc_hash": "49a1cda09b38ac9ac38d0b6a39133fdf8f57a89f9044e4d7d972df257fb3c6f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._fold_literal_OpExpr._col.return.self_operands_0_execute_": {"doc_hash": "a6b7fa71bad6165144a0a57a694c9f2362b69321242d5da23d409bf059e60a2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._pc_OpExpr._pc.return.val": {"doc_hash": "f55d9c79523d16d0ff79f44504088c91303d752c80dc05a13141c8ec08729b8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._op_value_OpExpr._invert.try_.except_pa_ArrowNotImpleme.raise_TypeError_str_err_": {"doc_hash": "423e25123450d0dedea918a2cb4b97e318ed732c60ed61dd612522f84a141a2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_AggregateExpr_AggregateExpr.__repr__.return.f_self_agg_self_operan": {"doc_hash": "4533b2f1ecf99f2349f026e5c8fe562066731f4ef11295895299cc02149452b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_build_row_idx_filter_expr_build_row_idx_filter_expr.return.OpExpr_OR_exprs_get_d": {"doc_hash": "3ca46b2c2320fe627ae7e724f51a283f7671598a275e149be56caae6b2cb3848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_build_if_then_else_": {"doc_hash": "993e1166e0bac1cf99468bcb5f8df0b925ac547e646517b0ee2493ea8e990adc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py_pyhdk_HdkWorker.setup_engine.if_cls__executor_is_None_.cls._executor.pyhdk_Executor_cls__data_": {"doc_hash": "8c4cd203abe6b0c0fd9732e8949284ce10a5c226932208ebe11c721f4992dc96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py_HdkWorker.__init___": {"doc_hash": "05014c42335692fcf46a678fd1bf2132238331f1a90e3384221e0b25ab8fb243"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/__init__.py__": {"doc_hash": "2f902ce5a45fe754c46ccfe05e20a0beb81bedb2ef049579205e60808bdbe41e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/__init__.py__": {"doc_hash": "1a5124ebe55a9e60cbdda1d1fc03aae2a437ed4e5dbed7333229bd8df74e17f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/buffer.py_pa_": {"doc_hash": "167cef73ce3a510e0784aafa3c12392fa310c42cfd0cbfcb4ee624fe599bdd48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_pa_if_TYPE_CHECKING_.HdkProtocolDataframe": {"doc_hash": "e48a95a72b462f4516d9743d4e6149c857c708b994058b28c819abf018898185"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn_HdkProtocolColumn.offset.return.self__pyarrow_table_colum": {"doc_hash": "88f90952e2f67996e1003ee66c2788d4497d252ab23a4920031370e8c7cade6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.dtype_HdkProtocolColumn.dtype.if_pandas_api_types_is_bo.else_.return.self__dtype_from_primitiv": {"doc_hash": "c3a9c1b178371f90ecdedb195c496a2739a3b67a8205cb1af3f9d169fdeafe9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._dtype_from_pyarrow_HdkProtocolColumn._dtype_from_pyarrow.if_kind_is_not_None_.else_.return.self__dtype_from_primitiv": {"doc_hash": "e593d8b4135cf54f200ca9e9ca292ea31cdf453db53a6cca620c403febd821da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._dtype_from_primitive_numpy_HdkProtocolColumn._dtype_from_primitive_numpy.return._": {"doc_hash": "d022230b3d1818b76f37ec55cd94440966e93b1463e15c3ec1c686e6b7aec504"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.describe_categorical_HdkProtocolColumn.describe_categorical.return._": {"doc_hash": "d2eae81e22769997351039285cc8ef150822c65cbe0bc75ea3b92593bc17a86e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.describe_null_HdkProtocolColumn.get_chunks.for_chunk_in_self__col_ge.yield_HdkProtocolColumn_c": {"doc_hash": "166006cb7d12f3a38da2c0e66a4b3d51c800f2f33c243aba33320be3e47c5616"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.get_buffers_HdkProtocolColumn.get_buffers.return.result": {"doc_hash": "91ee9455e43147cdad70984c00ebb9752c1a08c0845b1f117ad84c963d58ccd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._materialize_actual_buffers_HdkProtocolColumn._materialize_actual_buffers.if_external_dtype_0_i.self__propagate_dtype_ext": {"doc_hash": "9d4eab868a0a7c65523f44fe48b40cf20267587a62f3c06996eeeaa0e4684597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_buffer_size_HdkProtocolColumn._get_buffer_size.return.result": {"doc_hash": "a66b8a1179d4efcb650a7179a28cfc7b15c3325817beacdc5d608000d86e3463"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_data_buffer_HdkProtocolColumn._get_data_buffer.return._": {"doc_hash": "50d61527d6a79421d95b9142a0d9927789bafd8675c82a885509cbce13dbb8b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_validity_buffer_HdkProtocolColumn._get_validity_buffer.return._": {"doc_hash": "25b6be53e04b4a7e76b2f54034c681da44f59f746b075f8dfb0d430d4e09f6dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_offsets_buffer_HdkProtocolColumn._get_offsets_buffer.return._": {"doc_hash": "f3aa07f5dec98c06b81ec21105de32a0ead4eca5deb7f455e1ca91cdfe0d4755"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._propagate_dtype_HdkProtocolColumn._propagate_dtype.self__cast_at_schema_to_c": {"doc_hash": "42bf46ad04231632cecf63497ece7a9ca2a6eb8163f6bfc77c77fa2cb7073d13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._cast_at_HdkProtocolColumn._cast_at.self._col.type_self__col_": {"doc_hash": "84f4dbc08c0ded86dc9e85081f8169a9f9b26f8dacb5445e4ac3024384ac3873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._combine_chunks_": {"doc_hash": "54cbb248d051d2d75adbeed985b662c77153546c3537fc2daaa4b36c474af8c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_collections_raise_copy_alert_if_materialize": {"doc_hash": "93728ea26aa24826bbc37868ea2a955b947f1bc1701f02f87b7844067013f625"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe_HdkProtocolDataframe.__chunk_slices.None": {"doc_hash": "c81e79fb709c41016cf01421ba459e7b48e7c73f66b09bfaa8670e99ee34d4cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._chunk_slices_HdkProtocolDataframe._chunk_slices.return.self___chunk_slices": {"doc_hash": "735136859bd1d8e36eb1ba09d9d5aa0f9449fb018f349de62c17ef788601533d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.__is_zero_copy_possible_HdkProtocolDataframe._is_zero_copy_possible.return.self___is_zero_copy_possi": {"doc_hash": "7fa05d545f4dc2229fc4eb08a2d64d27da9f406ebbb7ed8bf4e3d97588335c28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._is_zero_copy_arrow_op_HdkProtocolDataframe._is_zero_copy_arrow_op.return.is_zero_copy_op_and_all_": {"doc_hash": "482d9267dfda41f4314f5b1243c5c16491150bc58500eb314fd6a542c372fb65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._pyarrow_table_HdkProtocolDataframe.select_columns_by_name.return.HdkProtocolDataframe_": {"doc_hash": "a51267205bee02100496ef9183d5b5e3757306d7b4acee4dc556511223343fad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.get_chunks_HdkProtocolDataframe.get_chunks.subdivided_slices_append_": {"doc_hash": "476850ad71e51fbe33a85065b2ded2d4e68a7660af469385ae73a215b2e32017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.get_chunks.if_extra_chunks_0__HdkProtocolDataframe.get_chunks.return.self__yield_chunks_subdiv": {"doc_hash": "07376de8d6684c0d6b4df332641c40036e2d8799fb011af8fe883be79d61d349"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._yield_chunks_": {"doc_hash": "25d718dc13cdfd6840c9b886a88263817935993988a50148ad38d26891f4e97a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_pa_arrow_types_map._": {"doc_hash": "b8f12d6364d618980ad2f3f4e886e24be0194dd32c881abb02c602a764cd6d46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_arrow_dtype_to_arrow_c_arrow_dtype_to_arrow_c.if_pa_types_is_timestamp_.else_.return.pandas_dtype_to_arrow_c_n": {"doc_hash": "661a8b71332c1b8923e130c9bbcaf411e6fca73ae6b42d94c81618afdee49fc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_raise_copy_alert_if_materialize_": {"doc_hash": "10ef3a3e8911e68cb44bae7ce0c0f577bc2cb2487e6d81f8d374b88bd68a13c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/__init__.py_HdkOnNativeIO_": {"doc_hash": "874824174ee0c3568e4df0d697b222ecaa3d5e6bbea55f7982929df9d4a94369"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_from_csv_import_Dialect_ArrowEngineException._Exception_raised_in_ca": {"doc_hash": "58d97f6b62496ccfb5767265d84cdc76d81f63fbeed9dd48b62022b9af9568df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO_HdkOnNativeIO.unsupported_args._": {"doc_hash": "5c9c90250eb0a1c5bf679207da9c31eb04d57c18c53ad8aa09c973c4d0f0576e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.read_csv_HdkOnNativeIO.read_csv.try_.except_.return.super_read_csv_kwargs": {"doc_hash": "132ec5215dba9564cdf01329464285e69fb81fbe3e8556d166eb382cd37349b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._dtype_to_arrow_HdkOnNativeIO._dtype_to_arrow.if_tname_category_.else_.return.pa_from_numpy_dtype_tname": {"doc_hash": "040f01ab803f6a05e241a6155729e0f94ae17792398d6a2ce15f727da9f64316"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._prepare_pyarrow_usecols_HdkOnNativeIO.for_k_v_in_inspect_signa.if_v_default_is_not_inspe.read_csv_unsup_defaults_k": {"doc_hash": "8dd032e031f44ea5e7c9845c954fda08af4f86f6e01163fc58220fad00c29e95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._read_csv_check_support_HdkOnNativeIO._read_csv_check_support.if_parse_dates_unsupporte.return._": {"doc_hash": "e74bf7d975d3e4f663f0884301f8dfb01acdbb7732c5de113d537e462339f8dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._read_csv_check_support.if_names_and_names_lib_HdkOnNativeIO._read_csv_check_support.return.True_None": {"doc_hash": "98cea00d49467221e63399267cfe0a49c754c83348ad09cb7d8e5e9e1c8020ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._validate_read_csv_kwargs_HdkOnNativeIO._validate_read_csv_kwargs.if_on_bad_lines_not_in_.raise_ValueError_f_Argume": {"doc_hash": "d38b55b90cffed7178567ca1446cb55565a23a400a4f788733713b54dd7dca63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.to_csv_HdkOnNativeIO.to_csv.with_get_handle_.pa_csv_write_csv_at_out_": {"doc_hash": "db4acb83d336c232d99bd5c35c9866471bd04971b6adc93c363c5b6c017a341f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.read_sql_": {"doc_hash": "5f67fd7cbc96314c4bfe4c8dbe3b965d8829bae603b859ce72370cc5e7267458"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/__init__.py__": {"doc_hash": "d3bf764a852436e9bdec0973d7621512cc457acc1ffab2fa7e4c890d03a4fed8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_from_modin_error_message__re": {"doc_hash": "f4d881f38c5bf5e2763d14a1a49675e91fad92e4407bc2630cb5c9e7405880b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager.from_arrow_HdkOnNativeDataframePartitionManager.from_arrow.if_not_return_dims_.else_.return.np_array_parts_row_leng": {"doc_hash": "7f653cbb689cc2c8d6d7d3a52b3f5df5706b45448adf9b22caf5379a36bf287e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._get_unsupported_cols_HdkOnNativeDataframePartitionManager._get_unsupported_cols.if_isinstance_obj_panda.try_.else_.obj.at": {"doc_hash": "dbbf49b719042fe977cc52a3493d95fa1a9e0d71035409452367a5aa5f5c489a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._get_unsupported_cols.is_supported_dtype_HdkOnNativeDataframePartitionManager._get_unsupported_cols.return._": {"doc_hash": "8ac31608c8986be2a4b7ce2066974a24b3afc31ec44fa9e3b6e5a6b9940be168"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager.run_exec_plan_HdkOnNativeDataframePartitionManager.run_exec_plan.return.res": {"doc_hash": "6cc708604416a0e62df7ea22140217a3161e548808d9aba02a5988013134f8fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._names_from_index_cols_": {"doc_hash": "3db314ca9433d257fd0c87d5ed610d80d91db2452571067b36937aa9f1bfdcd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/__init__.py__": {"doc_hash": "d46b6159099fbdad5f81d0184ff1adec37f0627c67f0a761ee5e70185ef435e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_os_pytestmark.pytest_mark_filterwarning": {"doc_hash": "6606aa76efba4cd9fffb24f933d3150a71cb107e0c5e071add1a6442008e5205"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV_TestCSV.boston_housing_dtypes._": {"doc_hash": "fd7981668611488c527b7dfb0a0b60c8ddf9d96fc6f900da82cb70405d7038e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_usecols_csv_TestCSV.test_usecols_csv.for_kwargs_in_.eval_io_": {"doc_hash": "974b12eb3b9712c061bb208c723a0ead24afbcf528e2d481134250f5d9bb4166"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_housing_csv_TestCSV.test_housing_csv.for_kwargs_in_.eval_io_": {"doc_hash": "d145eb865d05a0efb5e84727c5f15a7109be23fa1f0e1f669219207c8bf35f55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_time_parsing_TestCSV.test_time_parsing.for_kwargs_in_.with_ForceHdkImport_rm_.None_3": {"doc_hash": "788d360d1c9e6dae545b0df96def741dc047aa46f0368b1a1cd86d5e9cf3e74b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_csv_fillna_TestCSV.test_csv_fillna.for_kwargs_in_.eval_io_": {"doc_hash": "078391f451a1174f4d3748ab83a7502af115baf12ac9815355b3c27edbe9d9f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_null_col_TestCSV.test_null_col.df_equals_ref_exp_": {"doc_hash": "3cd13a103905971d62dfd807d2bb338858d543b0dcf16f71ea2cf5d9a3ef3a5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_and_concat_TestCSV.test_read_and_concat.with_ForceHdkImport_exp_.df_equals_ref_exp_": {"doc_hash": "ccbb3f4799ab1b4760f1e3d2daf8498fbcbdbe9bed6ffb753f956430660d97f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_from_csv_TestCSV.test_sep_delimiter.eval_io_": {"doc_hash": "395217efcc913aa0afdec167a49943ae69c260e019459d76117162ccd599c8dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_float32_TestCSV._Datetime_Handling_tests": {"doc_hash": "1b32a5ec6c9ddf2fc0feb45fe6a6cbda6ec4449c1e158bb5eb234801f7a6375e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_datetime_TestCSV.test_read_csv_datetime.eval_io_": {"doc_hash": "a33dc09f8fd5bb559dd917d71928f38bbb022178adbab40f19207ddeb1fd7fee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_datetime_tz_TestCSV.test_read_csv_datetime_tz.with_ensure_clean_csv_.eval_io_": {"doc_hash": "1df835bb3bcdff19178e1c7dd0e3514a99e8503e5b60b560710217f46221b50b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_col_handling_TestCSV.test_read_csv_col_handling.eval_io_": {"doc_hash": "fc38455172b0e079a63d1a4236bf419869bc77db3062fd74c1583333c8e7a7ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_duplicate_cols_TestCSV.test_read_csv_duplicate_cols.run_and_compare_test_dat": {"doc_hash": "05873a84e39a3ab51abfeb65f2e15bc9b5b58340c04f035b2c20a6e30c75ce22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMasks_TestMasks.test_filter_str_categorical.None_1": {"doc_hash": "66e4d8bbabf9c920122ab1a462770f070cba333fb4cc4aba94228ecf0af812ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex_TestMultiIndex.test_dup_names.df_equals_pandas_df_modi": {"doc_hash": "7024facc82597bd6a562ebe050153e99f4b0fc0d667c6a0ef5ab3a0fb1ee0abb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_reset_index_TestMultiIndex.test_reset_index.eval_general_pd_pandas_": {"doc_hash": "8998a42dd3e39d64dd839c4c8254b968cb5c022aaddc9c704213f7680a951399"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_reset_index_multicolumns_TestMultiIndex.test_reset_index_multicolumns.run_and_compare_": {"doc_hash": "b9c7f78f5b60bf424ddcf62dd8467f63f90c342bfa9f07eee66c5e36dc96dec4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_set_index_name_TestMultiIndex.test_set_index_names.df_equals_pandas_df_modi": {"doc_hash": "6fbff12309a6006ee91f22af2a41b806ce4b378e9be739091d357406093a49ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_rename_TestMultiIndex.test_rename.run_and_compare_": {"doc_hash": "4f4e817453e18d1ed0dd508543216a2d38322c85a5c234b35349078dc0687b63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestFillna_TestFillna.test_fillna_bool.run_and_compare_fillna_d": {"doc_hash": "e31a4d9c731c3a2fb420e72357c0296ab66ca3ad44a16e8e56ae17413be34735"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat_TestConcat.data3._": {"doc_hash": "9d1da7201164a0706e4e0a043227edfacd1d4dfbca3d0ea76f97c9145b8d4ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_TestConcat.test_concat_with_same_df.run_and_compare_concat_d": {"doc_hash": "52426b394f19565322c037402dcd51658324558271cc8b011e0b8f351a9b7650"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_setitem_lazy_TestConcat.test_setitem_lazy.run_and_compare_applier_": {"doc_hash": "5a007ee647421686f0227b5122bf1d6823414e65ded662be7ac8ed38e9bb67b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_setitem_default_TestConcat.test_insert_default.run_and_compare_applier_": {"doc_hash": "1a9dec08cf47d157bf02aa5ef9aabc49431a43e3848741f29df5583f2b56d81e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_many_TestConcat.test_concat_many.run_and_compare_": {"doc_hash": "a9c6f042c3dc90b1f3c72fa19f84a3ddb205eec588a1ac8b900afa18347061da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_agg_TestConcat.test_concat_agg.run_and_compare_concat_d": {"doc_hash": "bb0229e7012a99effc741a5ac3b1738456390f565cdf6436e67ab648b79b3d90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_single_TestConcat.test_groupby_concat_single.run_and_compare_": {"doc_hash": "138729ec74248190559fbf35a40ba7ec0a8ee69bcb999c01e99a93753d47c7d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_join_TestConcat.test_concat_join.run_and_compare_": {"doc_hash": "bb557f9d75f7a7acab65d23d53fa1090487818bfa6215d99b7dfb24fb0cc4fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_index_name_TestConcat.test_concat_index_name.None_1": {"doc_hash": "030756c881787f71ce03be444beb7aef9bca59739f5c61ac897a9580ebba5ec5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_index_names_TestConcat.test_concat_str.run_and_compare_": {"doc_hash": "c729c519afc43d4cec0e7ceb2d9247baced6745b9e75c9ba3a388a464249c72a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_issue_5889_TestConcat.test_issue_5889.with_ensure_clean_csv_.run_and_compare_test_conc": {"doc_hash": "1840074304b69c081a1d856c1ac714d6481098cfa8052ef5302bd111edcdb611"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby_TestGroupby.test_groupby_lazy_multiindex.run_and_compare_groupby_": {"doc_hash": "dabb5626c8253165de18ad1cfb6dfe45a305e10aa07a8c8429fee0adad388a57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_lazy_squeeze_TestGroupby.test_groupby_size.run_and_compare_groupby_": {"doc_hash": "320ee34920e49c7aea1de77c92e3890f045e293bece884a3ebdd8525c26bf0ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_agg_by_col_TestGroupby._modin_issue_3461": {"doc_hash": "5fd5fc20cb2b8fedf174d3f69d63723856800412e5b1d298eaac87115efc0f0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_pure_by_TestGroupby.test_groupby_pure_by.df_equals_md_res_pd_res_": {"doc_hash": "cdca1fe589022f0a3663b4c757e0df2e23a70032090cc69531874205b96c6cf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.taxi_data_TestGroupby.test_taxi_q3.run_and_compare_taxi_q3_": {"doc_hash": "dd54457c2235d812ff032b4ae9e60ad935461463f417556f3cc09fc5802ff907"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_expr_col_TestGroupby.test_groupby_expr_col.run_and_compare_groupby_": {"doc_hash": "072b123985834cc9aca89f455020aedc5c6063331e23ae51758d58717d34ba17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_series_astype_TestGroupby.test_df_indexed_astype.run_and_compare_df_astype": {"doc_hash": "26f82cd12ac39fe865938a4dc20b870b803e3b2aee4210577844febc2213bbdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_taxi_q4_TestGroupby.test_taxi_q4.run_and_compare_taxi_q4_": {"doc_hash": "b735482795100dcd0915f08343e869cf76b3e8d60656e6389ed575f2a573b01b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.h2o_data_TestGroupby._get_h2o_df.return.df": {"doc_hash": "a87e4541f55ac9f71cbf37c1849fa7d68784615feaa7ac8a256f4860a29d7315"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q1_TestGroupby.test_h2o_q1.df_equals_ref_exp_": {"doc_hash": "df7295ff899b79699475690bf6276cc6d657d9a5eee46b6785167f9c9424faa3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q2_TestGroupby.test_h2o_q2.df_equals_ref_exp_": {"doc_hash": "a832b1dc8fa2a7f720efe4dd101e831797a0134817b3f5ab468259976059bf2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q3_TestGroupby.test_h2o_q3.df_equals_ref_exp_": {"doc_hash": "0ac47bd9593924b29d69c35978dd2c1fb9571a91e400edc31b48d1ccc6a8c1f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q4_TestGroupby.test_h2o_q4.df_equals_ref_exp_": {"doc_hash": "7bbe616169fa1ffe5be5d049d9a6bbdf1baba7e6f2855ca80aa3c8b2842039a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q5_TestGroupby.test_h2o_q5.df_equals_ref_exp_": {"doc_hash": "6d2404b9d613e674b48f7fd93961d1eb3da2c3e8b9eca8b8062a5097485f3edd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q7_TestGroupby.test_h2o_q7.df_equals_ref_exp_": {"doc_hash": "50772d088d6a78dc9133162300fa3c888fcfcc9d72483b84b47e48185bb6018a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q10_TestGroupby.test_h2o_q10.df_equals_ref_exp_": {"doc_hash": "b292529c2c2e688615073cf7a9dfefdaaa626e5564c31c418d1c8add44b16006"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.std_data_TestGroupby.std_data._": {"doc_hash": "219d085ca2f5571c5e099518f51cd54325f98b7bee07c8e62b3a7dc4317fe44e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_agg_std_TestGroupby.test_agg_std.run_and_compare_std_data": {"doc_hash": "f26b14819d45998866e6740f2a4dd9c9960ff73acc717a47cc03cea94ebf8388"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.skew_data_TestGroupby.skew_data._": {"doc_hash": "8b64a69e39e372b6e507511ad025165056fbfccedaa77c18b61f8e26d45550d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_agg_skew_TestGroupby.test_multilevel.run_and_compare_groupby_": {"doc_hash": "61f9b645ce583c34b66db290aa9b64933ea1eae4756ddf2b3383f9bee3e2c5a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_head_tail_TestGroupby.test_head_tail.try_.finally_.DoUseCalcite._value.orig_value": {"doc_hash": "327253632c5e54826253f6347159134df43f7484c2a92e32cada3002411e2e54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg_TestAgg.test_count_agg.run_and_compare_apply_da": {"doc_hash": "523740e39ac36f8b01179e96004f907d7fcd9f49ba83e630f7be6e2abfed0982"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg.test_value_counts_TestAgg.test_value_counts.run_and_compare_": {"doc_hash": "f9f77eda402baabd29f209101036a482147eb327a4f7015a4fb267ff381479e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg.test_simple_agg_no_default_TestAgg.test_nunique.run_and_compare_applier_": {"doc_hash": "c59afee37a727e46b267bc8e21fa8cae16ae0047d0c657a4b735f8526629e915"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge_TestMerge.how_values._inner_left_": {"doc_hash": "c7c10dbc6e82d98d83e99b67a2576946504eae73690c7db2ad8cf7ae17e075ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_TestMerge.test_merge.run_and_compare_": {"doc_hash": "e7edaa74fe9d4d1c087a1928659f698c6d5573dac0f91bbba47d55a777dd3d73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_non_str_column_name_TestMerge._casted_to_category_and_": {"doc_hash": "de9a3ca9d3a720e751f7f7be5b88a72639e02681574baca8088d2aa2fef52ca8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge._nan_So_we_cast_every_TestMerge._fix_category_cols.if_id3_in_df_columns_.None_1": {"doc_hash": "22a71d62fe3b6668b74a3f06b38fac69bc2ac86415a78de7251702ce7c039bdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q1_TestMerge.test_h2o_q1.df_equals_ref_exp_": {"doc_hash": "eca294e3cb7ef8b1e54ddb3c09964c7fbecbd26c54d6099edf483b2c52c5677e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q2_TestMerge.test_h2o_q2.df_equals_ref_exp_": {"doc_hash": "2bb5f3188c662f4ebd767e7d097b2764f2fb1364ac78bd0009aba5457076e091"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q3_TestMerge.test_h2o_q3.df_equals_ref_exp_": {"doc_hash": "97eaf4a4104fc5d09217077bfc1964cf00e86aac9ecc490e70f89d6f2ad8fe85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q4_TestMerge.test_h2o_q4.df_equals_ref_exp_": {"doc_hash": "a7763159889d3cd9ac250ea17079f8b3e0a050076ad20b3dcc5b05272823c7d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q5_TestMerge.test_h2o_q5.df_equals_ref_exp_": {"doc_hash": "52f99585a81de619f40eba672f907a43d42704ef595d73d257e877272bfc7510"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.dt_data1_TestMerge.right_data._c_1_2_3_4_b_": {"doc_hash": "c492e997f208d3692a30f5e117437022c7da8245c1976e5f847eea02de680799"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp_TestBinaryOp.test_add_list.run_and_compare_add_data": {"doc_hash": "c06bb62812ac139f98d7a53eeeb8fcf1f0a4db84ad19eefd0a04bd1c6f0fc5b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_add_method_columns_TestBinaryOp.test_add_method_columns.run_and_compare_add2_dat": {"doc_hash": "6764bbc412603d8c477b56015a14f07792d36d8919f9e4904528552155f6c3cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_add_columns_TestBinaryOp.test_mul_list.run_and_compare_mul_data": {"doc_hash": "009fc72e6c5d464d76290b1a6ac606a1407c84e9d769d9230c7ffbb432bb518b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mul_method_columns_TestBinaryOp.test_mul_method_columns.run_and_compare_mul2_dat": {"doc_hash": "f5cf0355646ad08dff03f99e7cc8f53c558617efa814bbd6b8c7d231f3fcca02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mul_columns_TestBinaryOp.test_mod_list.run_and_compare_mod_data": {"doc_hash": "9681f54b56c5f0a0c5f46c94b31b1860d54c2f2289ed3a78148840583a65174a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mod_method_columns_TestBinaryOp.test_mod_method_columns.run_and_compare_mod2_dat": {"doc_hash": "ac20ef749951924b1852abe9f314bba707209f53449c71fbe3342f1f1fdc59aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mod_columns_TestBinaryOp.test_truediv_list.run_and_compare_truediv_": {"doc_hash": "06a5d193048fed6a7fb8433e5f06fec22da79e5f1dcf752d84c62352860d845b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_truediv_method_columns_TestBinaryOp.test_truediv_method_columns.run_and_compare_truediv2_": {"doc_hash": "912ccfe41a5d79b15f29b24dfbbc624bc810327b1636579b12b40bf45e34a0f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_truediv_columns_TestBinaryOp.test_floordiv_list.run_and_compare_floordiv_": {"doc_hash": "5adbe8d61aab3ec7237c0cf4bd356c4b7b457508ffb2af2af57123bcd4d5a8a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_floordiv_method_columns_TestBinaryOp.test_floordiv_method_columns.run_and_compare_floordiv2": {"doc_hash": "ecbef64b432b0c42306cb9b11b3472b1669264b2e65982aab1a3df9ac8eadbc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_floordiv_columns_TestBinaryOp.test_cmp_list.run_and_compare_cmp_data": {"doc_hash": "b389396a2e54cd0ba1e9d0f7f02e224c1a3362ad89cf1b0aa5827f9a25be9a81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_cmp_cols_TestBinaryOp.test_cmp_cols.run_and_compare_cmp2_dat": {"doc_hash": "e2f685748cfa54ba87f0b59218c9f67d48af8808d2991d1fe5bac5d9fc9a08e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_cmp_mixed_types_TestBinaryOp.test_cmp_mixed_types.run_and_compare_cmp_data": {"doc_hash": "bcfdf147c36d8a66d442d8d536975c8557fca30d8070ab4a2ea76c367f05e0b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_filter_dtypes_TestBinaryOp.test_complex_filter.run_and_compare_filter_or": {"doc_hash": "268adc156fa6fcec59be10d46fb486749f1a9e42eda92a37d49661d11de0f063"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_string_bin_op_TestBinaryOp.test_string_bin_op.for_op_arg_in_bin_ops_it.run_and_compare_": {"doc_hash": "70234a9a7153674f2320e804a16c6cff1f50918acc1797771d41260de4033cc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_arithmetic_ops_TestBinaryOp.test_arithmetic_ops.for_op_in_.run_and_compare_": {"doc_hash": "4dcee53fff85ce54f8f45880f7185194291c26c8a40c01f465750e1f0c3deba0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_invert_op_TestBinaryOp.test_invert_op.run_and_compare_invert_": {"doc_hash": "9dff65a95b22094bfce63c70f9ee05179bb041cdcc4f8c377ca1f38935c5f8fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDateTime_TestDateTime.test_dt_hour.run_and_compare_dt_hour_": {"doc_hash": "34ac611272a8cd67dde6166c64117d8a1434d7be615666b10dffbf0363305e99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCategory_TestCategory.test_cat_codes.df_equals_pandas_df_exp_": {"doc_hash": "4bd1ef7edcbe6cf0c18435975976b4235c9943be42ac91e0736cd31cde8e3ecb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort_TestSort.na_position_values._first_last_": {"doc_hash": "47327783c6f8ac981386281a7c6a8e331e3e50ac3c6563e587cfcbb3f8d99fde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_TestSort.test_sort_cols.run_and_compare_": {"doc_hash": "531568c48ac196d0563ffc67aa0fa8cce8e042893f78bb3be4d80746b605454e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_asc_list_TestSort.test_sort_cols_str.run_and_compare_": {"doc_hash": "f2dbc19b748273336474750f8b796cedfdf8004cd6ddb6cf9eed0e6f81e0d84e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_nulls_TestSort.test_sort_cols_nulls.run_and_compare_": {"doc_hash": "ef7d9941baff4fe67761cad55182992f5c7c9c79a6cb9e8a56d3aaa8ca093a0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort._Issue_1767_rows_orde_TestSort.None_14": {"doc_hash": "480fff6ed96d9fb63b6dec46f193408b175d06b8b224995be06214a98cb2fa85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData_TestBadData.test_heterogenous_fillna.run_and_compare_fillna_d": {"doc_hash": "e6b58ff998039945dee610b455f7d388b00514872d00e98e0d438caf1d67f164"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_TestBadData.test_uint.with_ForceHdkImport_md_df.np_testing_assert_array_e": {"doc_hash": "ec68f81cd93e8b42d5ce01fc6313b3c275a0a3d1bf612b47adf829c305361beb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_overflow_TestBadData.test_uint_overflow.with_pytest_raises_Overfl.with_ForceHdkImport_md_df.pass": {"doc_hash": "2c559a33c5156ab90c9c9f2dced761cb3f1e1e1b5468bc8903c33cb329c90059"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_serialization_TestBadData.test_uint_serialization.assert_df_astype_np_uint6": {"doc_hash": "d1c89194940f2c818ebe9dabf6610d93960663d1b716cdb3708dd35ac62a0dc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_mean_sum_TestBadData.test_mean_sum.for_c_in_supported_codes_.for_op_in_sum_mean_.run_and_compare_test_dat": {"doc_hash": "a45a1bdd4552a90057bd2890181ebe00224f727c87aeb103195d3f92a8040b9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna_TestDropna.test_dropna.run_and_compare_applier_": {"doc_hash": "4d42579cf2feb2f5e9d20751fa6f25f5431fa78fc530f9d372c4a6911a15cf25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna.test_dropna_multiindex_TestDropna.test_dropna_multiindex.df_equals_md_res_pd_res_": {"doc_hash": "de6fbdb1ac4e6afb4074f0f10bc48ecdf4f1c347159361decdf5dc99b3344093"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna.test_dropna_groupby_TestDropna.test_dropna_groupby.run_and_compare_applier_": {"doc_hash": "db6333f55ab3cd40380b2aa8a757356bac4d9293e35fc43316b3b4ffb5707969"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestUnsupportedColumns_TestUnsupportedColumns.test_unsupported_columns.if_is_good_.else_.assert_not_obj_and_bad_co": {"doc_hash": "97c3bfe19df0e0f13265487601ea859af33241bfce3bea8e86c9d4174687f8b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor_TestConstructor.test_shape_hint_detection.None_3": {"doc_hash": "56cb45fb9b9f06be0e3ae15be5ad2583eff2661b895484bb039c5ed324b03151"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor.test_shape_hint_detection_from_arrow_TestConstructor.test_shape_hint_detection_from_arrow.None_3": {"doc_hash": "2194f3010a1776b8939d25d9e9e35e659847ed929665869d0205fb9bfa95106b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor.test_constructor_from_modin_series_TestConstructor.test_constructor_from_modin_series.None_2": {"doc_hash": "f39013f024e3b08638897bda9484210d75d04fe35e94dc34c8f2da9ffc23d153"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution_TestArrowExecution.data3._a_4_5_6_b_6_": {"doc_hash": "fab95f96076d8f876c778610b6aa8be61c88cede8677aefaa2a290271af481d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution.test_drop_rename_concat_TestArrowExecution.test_drop_rename_concat.run_and_compare_": {"doc_hash": "7d32b403d442723fd6ef1e0eebca019998606da44e2c10a5c6353fc5bcc71629"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution.test_drop_row_TestArrowExecution.test_append.run_and_compare_": {"doc_hash": "c255ead62bbebf1b71e89ec2606c31674f2e31af6699e7d8513eb3299cdc8f2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestNonStrCols_TestNonStrCols.test_set_index.df__query_compiler__modin": {"doc_hash": "f3dead9a7428650ff711003c4ab0f71bf243cef161a46d8bbc31b028e26aa336"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestLoc_TestLoc.test_iloc_bool.df_equals_mdf_pdf_": {"doc_hash": "5d0ff5df81ffd009c901bbdbe850642598024128996fc5fd9507e2bb159b830f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestLoc.test_iloc_int_TestLoc.test_iloc_issue_6037.run_and_compare_": {"doc_hash": "d2c60193c9b5ed21f648aa097c3c272344c67a0e8d0c8340684217bd14ad4530"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestStr_TestStr.test_no_cols.run_and_compare_": {"doc_hash": "18d21c1bd75920f1a21980f2b10386c770e16d716111cc3b3c69caefcc499f4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCompare_TestCompare.test_compare_float.run_and_compare_": {"doc_hash": "04d2506b70c3c15c3b4731cd49b9c740aaab8a991b92772420bfe2370cd1eb82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns_TestDuplicateColumns.test_init.run_and_compare_": {"doc_hash": "fb747bb5c2884b4f33616b755d4266a08892fb621024592ce19f3ba2d15f06c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns.test_loc_TestDuplicateColumns.test_set_columns.run_and_compare_": {"doc_hash": "09dca3c47ba077a9896ab491db8da5aa9cbd4b6c47f8f028fe454a301ae83072"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns.test_set_axis_TestDuplicateColumns.test_set_axis.None_1": {"doc_hash": "a1061b3072225a4db41a6f740bf3a3e298a60630caa92da27ab23979659530ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestFromArrow_TestFromArrow.test_dict.None_13": {"doc_hash": "563c33c01b5848eb67fe368a8cb0545e28276491b03e898ba9a67e19db72d81d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSparseArray_": {"doc_hash": "d02b9dfad2c872cdf5bd965c03109eed9c689571d34e3cc14a13fc35460a5979"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_init.py_TestInit_": {"doc_hash": "b2d2acd8d0f9c6fa5ddb377c3b344c890de5cfe62def26e30f0610a8d80f8f26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_sys_UNICODE_ALPHABET._chr_c_for_r_in_UNICODE_": {"doc_hash": "24d4a93c3724cdcfdbf84804b9c396a55a4fff09f6a93bee5f71d400d73972f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_test_encode_col_name_rnd_unicode.return._join_choice_UNICODE_AL": {"doc_hash": "7ffb73f597862dbf803dcf0d0a7dd23ed860efe65c17e7a16c766be670b68d55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_test_time_": {"doc_hash": "706576275e63de3bab207a89e36649057d370fd6dffd656a76c4162bc9392a6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_pytest_from_modin_experimental_c": {"doc_hash": "eda1dc2debfe08f9b524acd8600aef9244cc505cf29ecb7b3433ad2c877d3ed2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_eval_io_eval_io.general_eval_io_": {"doc_hash": "fe433f3471f5b9ab16457359f01620ad30eb1207a85e7fce81f8fcdf8ee25cc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_align_datetime_dtypes_align_datetime_dtypes.return.casted_dfs": {"doc_hash": "3c9c05f49692272a7db4e3896d3e808b1dbe3d5e2474aecb8daffba735cff250"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_ForceHdkImport_ForceHdkImport.__enter__.return.self": {"doc_hash": "f9f2043ed42d40207598b2f0a7672f175ed4263167b0ab164a6f5eb64e679f94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_ForceHdkImport.export_frames_ForceHdkImport.__exit__.self._imported_frames._": {"doc_hash": "8d6f6602358598502340ec64ef473d77afd32967f586dec2167a47f1fa4d3785"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_set_execution_mode_set_execution_mode.if_recursive_and_hasattr_.for_child_in_frame__op_in.set_execution_mode_child_": {"doc_hash": "8c903681f7b7dcb98f49bc4349a7ad6b36f40e701190efe6d9cd41b8db9d232c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_run_and_compare_run_and_compare.run_modin.return.exp_res": {"doc_hash": "cb450d0c09b9625614f36c1b6581fdefca8432de88cb1b473509ef9114a90149"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_run_and_compare.constructor_kwargs_": {"doc_hash": "9cf084babe5f875520e6eb4d4a30cde66348706ac50459d4ce439b082b9bea85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/__init__.py__": {"doc_hash": "748a949a3a9b0a3038a2e795a6ec8ec606feb35b98c4feef16a1c117ea5a8223"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/__init__.py__": {"doc_hash": "816d9d66fc1edc761ce73b6ffdb6f28e613618222d7d60fa451eff13c927b769"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/__init__.py__": {"doc_hash": "eae91a55aa9a8b2d5a0ea04538b788348b0505b48dc5814b4a4006870c24b40a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/__init__.py_ExperimentalPandasOnRayIO_": {"doc_hash": "4e4f9172e97803e74a284d2aa199e08eb8110601f2933a254aaa0307de940754"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py_from_modin_core_storage_f_None_6": {"doc_hash": "7e7c310b9551af3ec0c277a886d1c1146abcea6ed5fdeeedb1b1074c71159795"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py_ExperimentalPandasOnRayIO_": {"doc_hash": "9dd2967d2408e3e629d1077bd358f0c713a309c34538613063b63ca868526d05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/__init__.py__": {"doc_hash": "2656aa63e5307e47555b28eb92621b98c6b455167da03384dabe456533ecb98f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/__init__.py__": {"doc_hash": "41ec7746d890b21072ccb569e3b7329b201860bee740e187a45a3ea7e0b580ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/dataframe.py_PyarrowOnRayDataframePartitionManager_": {"doc_hash": "387b55cca0d6b2524eafe51fdab43631ae19dac442f7b801dcbc67ea4d096ead"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/__init__.py_PyarrowOnRayIO_": {"doc_hash": "d227f5efa24e5e86042b5fde91f1e776a6e7f0f74ecab3c9097667ebc6937f04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/io.py_from_modin_experimental_c_": {"doc_hash": "22a127fa5e46135c70c8c8e6eeb1ad22ecd5bc27e6398c66f130634a5c9fc6ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/__init__.py__": {"doc_hash": "2b064f8d77eeb7863cd19f407ad39a5a8534e17c8f3ef3d04d69a26cfd23a416"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_from_modin_core_dataframe_PyarrowOnRayDataframeAxisPartition.__init__.self.list_of_blocks._obj_list_of_blocks_0_fo": {"doc_hash": "a3e160821bf39ab9f6bbcd2a459a212921d3e4120337256f4f5a3044e3b55dd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_PyarrowOnRayDataframeAxisPartition.apply_PyarrowOnRayDataframeAxisPartition.apply.return._": {"doc_hash": "7142aec705d68db913aa3d3a7ddc857e722b015d728dbc375cf93cd584b0e4ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_PyarrowOnRayDataframeColumnPartition_PyarrowOnRayDataframeRowPartition.axis.1": {"doc_hash": "ecf5da04ad71e30ee6fb47eb788e44369221e6adc27a593af4a524c39dc6bfcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_concat_arrow_table_partitions_concat_arrow_table_partitions.return.table": {"doc_hash": "bbcb016b2d406174e7d677dc6002e9d7ff147a8e06d10eb10ef04ea752043b47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_split_arrow_table_result_split_arrow_table_result.if_axis_0_.else_.return._": {"doc_hash": "52e5d1628cb7548e8bef312db2c348fca191ab19b3adef9ba1b2b6c1e75ea45e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_deploy_ray_axis_func_deploy_ray_axis_func.return.split_arrow_table_result_": {"doc_hash": "250fe98d38bdd00b4e0c2b03ab9320614716555552f7b75c2a42f001651b8cd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_deploy_ray_func_between_two_axis_partitions_": {"doc_hash": "1099b3591c2e06dc25d67c64411181b8acf46e90a1ebc946b3bf9509635008f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition.py_pyarrow_": {"doc_hash": "ab6542fcad659cebbf454d8457e1e1b3bfd48bf24493d11364bd21d5f45b55f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition_manager.py_from_modin_core_execution_": {"doc_hash": "73f57ee75c5efdac4124ddd06971ea6d34f96b854fec23c54a96640e42d7915c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/__init__.py__": {"doc_hash": "8d7c5fe7a3c4cb5760b57c5c37fd2ed6222da6f5f5bca9cebe1ec148d44cf62b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/__init__.py__": {"doc_hash": "dba94cfaab294bb5af3b36701b285fbba65891455662f24a896060fe32b8a04a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/__init__.py__": {"doc_hash": "68e012425f3f6a6e022c3e91c0d88800d3a318a4ce0b2a1e8e26019080b4585c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py_ExperimentalPandasOnUnidistIO_": {"doc_hash": "095662ead3ed4bebfa093f8c6b96d83d10080aa970d18f3b136f0b15b3d9f3b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_from_modin_core_storage_f_None_6": {"doc_hash": "a5c637e83502e9a2cf3a3a34dea9688b5f713fff336a3818f53ad81b76461699"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_ExperimentalPandasOnUnidistIO_": {"doc_hash": "dace764a0ccc003c2daf24680ff7259afd2bf1756aea3cd396da918f75b061ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/__init__.py_ExperimentalCSVGlobDispatcher_": {"doc_hash": "f42d35451e8f843cfcf3ebf4a6e1d7431e34219ad92ed4862baee7a15c03a148"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/__init__.py__": {"doc_hash": "44fc26d3a906ac944d1d4252b4ebee5cebf7fcbaa13a104695a4733f8741ffd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_glob_ExperimentalPickleDispatcher._read.return.cls_query_compiler_cls_": {"doc_hash": "7df2039492997780447bbb5757c28486e0ca16c1f32085c191d2465058bfc957"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_ExperimentalPickleDispatcher.write_ExperimentalPickleDispatcher.write.if_not_.return": {"doc_hash": "d53bdf29ad99f3fae43b2039c22a23d1d1e308015eda507c74cd4dc4b06a647a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_ExperimentalPickleDispatcher.write.func_": {"doc_hash": "115b7236f35c3439d53ecdc157cdde6c8acdd0c5bea275add29f8eaadedb6bf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/__init__.py__": {"doc_hash": "16cf59646d7486cdbac11c026814c1be37451be20e137766a6d51480b3870528"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/sql_dispatcher.py_warnings_ExperimentalSQLDispatcher.preprocess_func.return.cls___read_sql_with_offse": {"doc_hash": "fbfb076e296875003e2e0fb2679b5044f87cac7136fa78b8848cea5d32c7821b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/sql_dispatcher.py_ExperimentalSQLDispatcher._read_": {"doc_hash": "7b7fff7d804f2cdccfb4bd886190173e09790041c3fba7a5131ae0f8f51d0a4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_from_collections_import_O_is_distributed.if_.else_.raise_InvalidArguments_": {"doc_hash": "d21c3058eddbc12d70e178c600b50a4c65c23caae9bcf694a86bdb39f7ae813a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_is_table_check_query.if_from_not_in_q_.raise_InvalidQuery_FROM_": {"doc_hash": "599a0cc40dd1840206265a73e2c2b75a4b8e10b6f8cbf821c419b3729d0832b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_get_query_columns_get_query_columns.return.cols": {"doc_hash": "24928281283ed4caa607b58c1dc23bf1f87e9ddb83d9c572f2826ab451c7f677"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_check_partition_column_check_partition_column.raise_InvalidPartitionCol": {"doc_hash": "2adb38b3d86911361eb67058cba4be4728d06c4425dff8d93cce67689ad32fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_get_query_info_get_query_info.return.list_cols_keys_query": {"doc_hash": "db03ddb34f547a6ca01f06438ff2106bd6e04503dde0408f5acda2be69266898"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_query_put_bounders_InvalidPartitionColumn._Exception_that_should_": {"doc_hash": "96aba6e7e84a11a55edcdef43d8d1d24511142f61d39fe44b91d740c20a8a559"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_read_sql_with_offset_": {"doc_hash": "3c1fd9aa2b0062b0da26ed339253e46ca8ea7c64e6b7de407592a63fbe48fde0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/__init__.py__": {"doc_hash": "2cb269bb61975723c7c3ce66f38cda698f8e6317a7979b20c87568f94b4c405d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_from_contextlib_import_Ex_ExperimentalCSVGlobDispatcher._read.encoding.kwargs_get_encoding_No": {"doc_hash": "904f87e2c9744a453db8098ef427d165e0985bc708dd78e4eb05c1d530d55db3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher._read.if_names_in_lib_no_defau_ExperimentalCSVGlobDispatcher._read.is_quoting.kwargs_get_quoting_": {"doc_hash": "f4006f4f319253f2c62dc77d4d57f8368795758ba33c80aa6ee3694f59781aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher._read.with_ExitStack_as_stack_ExperimentalCSVGlobDispatcher._read.return.new_query_compiler": {"doc_hash": "20c3f319864aada07964e4ffa156821c6fc7e91e8ec1c92d0cba30fc2013b961"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.file_exists_ExperimentalCSVGlobDispatcher.file_exists.return.exists_or_len_fs_glob_fil": {"doc_hash": "92ffacd07a4d51b04ecb9bc6343ac5525f9d04654801579b4a261f417548a8a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.get_path_ExperimentalCSVGlobDispatcher.get_path.return.get_file_path_fs_": {"doc_hash": "551b1d682d747e2b1a93c34f50d19c99bf0ec6ddc051c2f969262df568c8e82e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.partitioned_file_ExperimentalCSVGlobDispatcher.partitioned_file.read_rows_counter.0": {"doc_hash": "add57ba39f6800b7b32f62e170ad866b1619d2730192bbbf9f4fa36691fdda36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.partitioned_file.for_f_fname_f_size_in_z_": {"doc_hash": "56380af78b73accc39219ac1b0d71b576cdedac5069f964b9d2bd4b62b9871a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/custom_text_dispatcher.py_pandas_": {"doc_hash": "82f7bd7b775f3df166d7c6f0100ced1e0059de811695c1d1ac4815ffb8049cd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/__init__.py__": {"doc_hash": "55fd04ee5fe391c81cb6e1879f685a4148602bd1efc7cab53ff79d4d00d488aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/__init__.py_DFAlgQueryCompiler_": {"doc_hash": "ab521c008deb25319e9674cdd28b1ec97cc4eeeb4b12b7229a93a1812914d23e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_from_modin_core_storage_f_np": {"doc_hash": "a5398e5c443a66bbdfb0f76b36b3913f5e12a58bb21a8ba0c07f7574a27f2c2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_is_inoperable_is_inoperable.return.False": {"doc_hash": "1c71cac8c4e0330ff58e639066958578aee9ab385b4d19b9ed47cde3256c238c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_build_method_wrapper_build_method_wrapper.return.method_wrapper": {"doc_hash": "63fd3dc1f524d4520950678aa12c2dbb086c537a4b6060365a22bede3f931ac8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_bind_wrappers_bind_wrappers.return.cls": {"doc_hash": "474e74a415aa603e6d5cb3a0f3767cd5dad60af086191d48fd5a25e88c4f58bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.getitem_array_DFAlgQueryCompiler._Merge": {"doc_hash": "0b5449763072385ea62108800917fc360c973e2abdaea12f28ae46b136f78430"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.merge_DFAlgQueryCompiler.merge.if_left_index_is_False_an.else_.return.self_default_to_pandas_pa": {"doc_hash": "8febbf9e1fa53d448ae9e61d6e0e7524f7bab063d5c85ec5244750a78a76fd5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.take_2d_positional_DFAlgQueryCompiler.groupby_size.return.self___constructor___new_": {"doc_hash": "3867571ea659f69b05823d50c7e76c5f189cf9fc01e16dcbbe2eb9d24b9c3ba1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.groupby_sum_DFAlgQueryCompiler.groupby_count.return.self___constructor___new_": {"doc_hash": "9cee382407086ee128f731718f2691e7c0ae6dec48d3e569f4b54adcf971c74b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.groupby_agg_DFAlgQueryCompiler.groupby_agg.return.self___constructor___new_": {"doc_hash": "84670b6a3c38d1d5ec29ddeaf7d9165746222d7cc37b3a5086a4bf6e5a62f7d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.count_DFAlgQueryCompiler.nunique.return.self__agg_nunique_": {"doc_hash": "af034d4f024bddab09d0fad94c3702b0771dea3574c5e45c6acd23a190da277b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._agg_DFAlgQueryCompiler._agg.return.self___constructor___new_": {"doc_hash": "2ff51d4861325cc7eea05d40ad287a821d725d209bc5583a0a58907ad3e86c3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._get_index_DFAlgQueryCompiler._set_columns.if_self__modin_frame__has.else_.try_.except_NotImplementedErro.self._modin_frame._has_unsupported_data.True": {"doc_hash": "d29092a79da214cfc6c98651298d926692f16605e467649fcb38414298ad8593"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.fillna_DFAlgQueryCompiler.fillna.return.self___constructor___new_": {"doc_hash": "fc0c25c6543253b58997c39344632e61c637da55f2ad9fefca86ec041f4f2bb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.concat_DFAlgQueryCompiler.concat.return.self___constructor___new_": {"doc_hash": "15b049cde2ecdcf603c993ea9b2a9c2fc6f6b5846b884d34c591bb3840213259"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.drop_DFAlgQueryCompiler.drop.return.self___constructor___new_": {"doc_hash": "8444bbb7df1c30bbe4faea4f34b5ab3dceaef6bf068d9ff19b9183422581aab6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.dropna_DFAlgQueryCompiler.dropna.return.self___constructor___": {"doc_hash": "2114a074ad9bd615c4ec3dec69f6c2d0d901c6d2aaf8a79856e165c85dba00da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.isna_DFAlgQueryCompiler.dt_hour.return.self___constructor___": {"doc_hash": "754308f1c2eeb81a94023bb280d66804129782faeaf837318623b48b104b435c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._bin_op_DFAlgQueryCompiler._bin_op.return.self___constructor___new_": {"doc_hash": "420d46183619b28fa58482383baa9a35bd179596def62ab24776f2fc8de7e57c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.add_DFAlgQueryCompiler.mod.return.self__bin_op_other_mod_": {"doc_hash": "c2941832b9ab5aaa5a8989a2b66c3fa281294babc83f335bb5b03237b415e96e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.floordiv_DFAlgQueryCompiler.__or__.return.self__bool_op_other_or_": {"doc_hash": "4ee28cb91d5f53e4ff9a056ac752d1f99a411fff155ed27ade01a7cb81bc6564"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._bool_op_DFAlgQueryCompiler._bool_op.return.self__bin_op_other_op_": {"doc_hash": "22dc5722734a8a0364dc2e89d90d76668ac5396297e3e761b9eb95ea7eb92426"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.reset_index_DFAlgQueryCompiler.sort_rows_by_column_values.return.self___constructor___": {"doc_hash": "754be6957de97acd43e9fd68ad8cc4a7ed5b814cbdfc9fb19e105115f5f8b186"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.columnarize_DFAlgQueryCompiler.columnarize.return.self": {"doc_hash": "e95542b7a06ba3063ce6e8b305aa54c31fe9fc6dd258c514f272a242f5eaeb77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.is_series_like_": {"doc_hash": "6033e5e35cbc5f55683d355d908c3169b967b3b75d59ff08b7e6011602d85d4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/__init__.py_PyarrowQueryCompiler_": {"doc_hash": "8847f5e16935901103957e849e556713dac75d6896b64ad431a03e416401325d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/parsers.py_pandas_": {"doc_hash": "c01de5bd632ca34b94b2d027f0750ed4d948975860cae7d11e4ad1f3f5f55604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_pandas_FakeSeries.__init__.self.dtype.dtype": {"doc_hash": "5922b47d8b5577251e160737ef94b2cea925fba9fdf3b28364359a1a084904e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler_PyarrowQueryCompiler._": {"doc_hash": "81d79b3725d669f14cb0f8ffa8b1ffb80ad233397dabd73f25f95bbcfb4bd0b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query_PyarrowQueryCompiler.query.gen_table_expr.return.Expr_expr_expr_env_scope": {"doc_hash": "6801da88d003ff165d932cd88e5054074eae82a1239f79a1d35836da62acb029"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.unary_ops_PyarrowQueryCompiler.query.cmp_ops._": {"doc_hash": "371a979c3e626b15444d258693c672810c58e134cda2549baf86ada8a9c52d61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.build_node_PyarrowQueryCompiler.query.build_node.raise_TypeError_Unsuppor": {"doc_hash": "50bf1e94e7cb81d1e566fcd0ed00ed7fd1a5bbb5b749a013b3a3b354158fc44e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.can_be_condition_PyarrowQueryCompiler.query.filter_with_selection_vector.return.pa_Table_from_arrays_new_": {"doc_hash": "e59d31b3c43d753d58f83af2987570ebc1ad9453709a8f973d6aa3262a504860"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.gandiva_query_PyarrowQueryCompiler.query.gandiva_query.return.result": {"doc_hash": "18873d8333a79e70153119cecbe956e1b2ebd8e8f7fc061444b7a81c51682b11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.query_builder_PyarrowQueryCompiler.query.return.self___constructor___": {"doc_hash": "5a7d8eb69213b1362f69fcec022b976af888d11452bcf04a9bfd2c44f4c95c5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler._compute_index_": {"doc_hash": "db6e497d18d71a3d1f929f18ae5ddd37e0ad2abb879abc78b3125dd5b7429822"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/__init__.py__": {"doc_hash": "22333aa2d19fae417262e5995dc850911505552c87a2b5bb953c7d1ff42af832"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/test/__init__.py__": {"doc_hash": "135eb0b04aadb1a71f489a3e819d0649cf3c02c65dc5582e815ec6e4d9b70f1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/test/test_fuzzydata.py_os_": {"doc_hash": "67e0ffc35f4fe38e750e2e81116de585c2ab08e48f9b829a4ee90c3a587c06f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/__init__.py_from_modin_config_import__": {"doc_hash": "47ad3087c9da1f529f996ce60dc4a90251937964dc6fd19580ba6875d9badbc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_inspect_read_sql.return._DataFrame_query_compiler": {"doc_hash": "6a0b6703ba7e9cb54290de29ae97ddc7abeef4248ea9e283c8b7f01d84bfb847"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_read_custom_text_read_custom_text.return.DataFrame_query_compiler_": {"doc_hash": "860adbc6360d8d80315932e4a8233f033488a6ebf6323381b98640ac9f7c03f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py__CSV_and_table__make_parser_func.return.parser_func": {"doc_hash": "11cc00068f772cf203d16b558760b908dcca7ef553b97bc3a4774a50af899d47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py__read__read.return.DataFrame_query_compiler_": {"doc_hash": "863540e1a136b9619c1173b0ee9c47d77687f15d2879f9022bae98c4e9272c48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_read_csv_glob_read_pickle_distributed.return.DataFrame_query_compiler_": {"doc_hash": "b4a9e3ebe7be398afa26ed2f2090bf6077c4b84a742c865e39a81f1d1d3c4340"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_to_pickle_distributed_": {"doc_hash": "cc0daf5ae2898655cc217c3befcfd1b7858717f70d09fc0391d0197aed9b7663"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/numpy_wrap.py_sys_": {"doc_hash": "f820af971158012fc4a11c7bdbb3063fe3ff0d7fd6d7e63c6b63b08a975b9b91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/__init__.py__": {"doc_hash": "6ae39b9b21e6fb1d47a4ec207fedd206294d0b6313bb01f3bf0601078348f691"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_from_contextlib_import_nu_None_11": {"doc_hash": "8fe71dd34d6bad2ce8f6138afc05d3eee2fbaa3a025724bef786f5633c8a7a5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_from_sql_distributed_test_from_sql_distributed.df_equals_modin_df_from_t": {"doc_hash": "03821b3dbed49ff30c32b5483295293609fdc6575f537923583e78e6718bfe1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_from_sql_defaults_test_from_sql_defaults.df_equals_modin_df_from_t": {"doc_hash": "19ee64e858b0317a40a80d57dfdf3355d0a7adfeabf2cb6662ac6ef871db3935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob_TestCsvGlob.test_read_multiple_csv_nrows.df_equals_modin_df_panda": {"doc_hash": "850ff306377fbc762d7534a3e5d6e386118d9480e7981ce639b8795ed5cf06d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_csv_empty_frame_TestCsvGlob.test_read_csv_without_glob.with_pytest_warns_UserWar.with_pytest_raises_FileNo.pd_read_csv_glob_": {"doc_hash": "3a801d2cdbfecd639611565161024933e47fe99b5e74b3fe06a99e62d2f181ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_csv_glob_4373_TestCsvGlob.test_read_csv_glob_4373.df_equals_modin_df_panda": {"doc_hash": "38c81e463fb0c5563be64ddd6396afd9cc0203f755a37a68e72a58c5147a77d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_single_csv_with_parse_dates_TestCsvGlob.test_read_single_csv_with_parse_dates.try_.else_.df_equals_modin_df_panda": {"doc_hash": "abc06e2d9d236ef4557d7421fa555dcc43108e15ffa261c6d736a724e8963a16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_multiple_csv_cloud_store_test_read_multiple_csv_cloud_store.eval_general_": {"doc_hash": "41a88b20a45b4e4498fe8fb955c16fd062fc9e3aefb8350f10e6e5bff906f80e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_default_to_pickle_filename_test_read_multiple_csv_s3_storage_opts.eval_general_": {"doc_hash": "e6de953f1e721bbe0f48defe90e80b7b4c9dfb8f63e4d20d60d97587193d124c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_distributed_pickling_test_distributed_pickling.teardown_test_files_pickl": {"doc_hash": "508ca0879beecd0bcb0df06a2c22d607dfc7624402328dff4c1d09685f0c5d6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_custom_json_text_test_read_custom_json_text.if_not_AsyncReadMode_get_.df_equals_df1_df2_": {"doc_hash": "7761b2a9f1362be55017e64b2efcc14206433b74ee6fae09c72b9ece10b8f38e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_evaluated_dict_": {"doc_hash": "8d19288385a8b40cf33ef0c0208c5bad58fcf85d6570d50187980905455adba7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/__init__.py__": {"doc_hash": "9fe00bf3dfe7cc8570d2bf1962b4c227d92f133301971f949b4c453b60eb948a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/model_selection/__init__.py_train_test_split_": {"doc_hash": "d233e0495d0cd5f52a5937ee4b86158db7da2c97e934f6836ace8c7576372c7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/model_selection/train_test_split.py_train_test_split_": {"doc_hash": "9f0af46e31af05144893b6c6192d3fe01683bc4b07b9d5a7bd64e25e2deceeb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/__init__.py_try__": {"doc_hash": "2acc1cd698580305736ee7d7c65159a57078fccbad39b5a249beec5558c11dbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/general.py_from_import_pandas_as__from_dataframe.return.show_grid_": {"doc_hash": "340ab4b06844503e6238238ca2fefe9a441e420d0921a880b0e73259d013ca79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/general.py_to_dataframe_": {"doc_hash": "97e59bc770e915ded30ae13f2dd3c0c58b31e4c956588eac98a7be017d04632e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/__init__.py__": {"doc_hash": "036a1a070eca782d295b5546cc27b9b40529c90643b68081e7011244ab33bff2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/test_general.py_pandas_get_test_data.return._": {"doc_hash": "54604339af2dc440af414ce04858a186733d3a73da2b8ce36a9318ba44c41f4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/test_general.py_test_from_dataframe_": {"doc_hash": "d1a334cdf260f02c7c7338ab6f752310bcaa9f6c983046f1aeb052025c8b6d27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/__init__.py_pd_": {"doc_hash": "170e1da975aa95d316782a487ccf6ae3292c080eed8c9e10b3a0a143122f8a8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/dfsql/query.py_warnings_": {"doc_hash": "1be8bdae1f6bc53309291e9f8ae01f36dd3cd2b499104a073714a8412b8c28ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/hdk/query.py_pa_hdk_query.return.df": {"doc_hash": "b280b49a3dd650c98f60be81659634d43abb144d61a9ce8de6242ef32fac253e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/hdk/query.py__build_query_": {"doc_hash": "710ab6b3671d07897e60a752e7acd6d8848fd9bdc410d6344f0841dccddf40f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/__init__.py__": {"doc_hash": "31b11ebdf6332f08d7da7ef2461d92e3eba8db67decd89e2130e75687caf7bc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_pandas_titanic_snippet._passenger_id_survived_": {"doc_hash": "a8b91e621afc620e0005c935c39d4788cc0ebefc35ae8adeb28a9d3b5f72f232"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_test_sql_query_test_sql_query.assert_values_left_va": {"doc_hash": "2557e44b300ae79fe0e4d590a090198cc83fb4d74038fa976987302ae2a13105"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_test_sql_extension_": {"doc_hash": "c23be81ed2221d84fa3f03c3921dfc2528a1c922d466ea9f1eff3236adfa4709"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/__init__.py_DMatrix_": {"doc_hash": "7ad5696f321ba209351baa958df4aafb8b7b40dc015fdf0e883bd7ec169d6cff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/__init__.py__": {"doc_hash": "2e2cc90cfcfb35404bbe8e3e1c715238f5fdf233c28b8bfabdb1a7a5cc11ccd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_default.py_pytest_": {"doc_hash": "1aa32cabd6c222a342b3ce75b5a7261ef708ba7cbdb8f79ec13ecc9aeeeb155a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_np_check_dmatrix.try_.else_.assert_md_dm_feature_type": {"doc_hash": "5ab02867d6e3e2c8ed737136086e2b8597abd1dbf07b10f525309893ea7f1956"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_dmatrix_feature_names_and_feature_types_test_dmatrix_feature_names_and_feature_types.check_dmatrix_data_featu": {"doc_hash": "877c942531925986820d5ee7eb6361e4a85b338b76ac469d1e62e02e9fdcae49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_feature_names_test_feature_names.None_1.repr_md_booster_predict_m": {"doc_hash": "fd858815cce30952f52606c30337ddf398e41cc8b639674bab3ea7b65d7bfbfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_feature_weights_": {"doc_hash": "db4e3261ee31e44bb102087fe410db7d858ee718b280d9a58d51ff3e4d91a060"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_pytest_num_cpus.mp_cpu_count_": {"doc_hash": "9a6abf097dcbaeac7b0e92ca84583c8a695d320eab4fda3065d0ffc9901ea2ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_binary_classification_datasets_test_xgb_with_binary_classification_datasets.np_testing_assert_allclos": {"doc_hash": "74a7f4118054dc9db1d5271835985c0229932795cddefe5ed5ffd5bf0c1978d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_multiclass_classification_datasets_test_xgb_with_multiclass_classification_datasets.np_testing_assert_allclos": {"doc_hash": "66cfb1a581f734009cbd41830df55752ea85f0666f0a19ecd401a3976ea71783"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_regression_datasets_test_xgb_with_regression_datasets.np_testing_assert_allclos": {"doc_hash": "7f3086ef3f9bea7d994f1b822d821ced38d2584d0aa2ab020da0e58cc4f835a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_invalid_input_": {"doc_hash": "f6cf35e352980824186f0b9bca0a19a2f86b33a1743a050cb465599d1b8689fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/utils.py_logging_RabitContextManager.__exit__.self_rabit_tracker_join_": {"doc_hash": "367a2afa1a5c8accabb1c551494eac3ea3b6867a554c0f7947e3bea3c84e0f11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/utils.py_RabitContext_": {"doc_hash": "372e7d84cfc9a9a2f40550197e5e076f6230c0d575318dc46ce0fbf4d0dfc379"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_logging_DMatrix.feature_names.return.self__feature_names": {"doc_hash": "cc83fe7868efbf9e6e4433adf98a2ea69dfde060d1ddf073153716021ec8c9b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.feature_names_3_DMatrix.feature_names_3.self._feature_names.feature_names": {"doc_hash": "9b04299c96932823092feeb13ae26b12e0b1b2b9d9dbaeedb00e098d3bfa816a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.feature_types_DMatrix.feature_types_5.self._feature_types.feature_types": {"doc_hash": "18fca8a3d4906e33d6f1abd2975eb6f3b3d8d5ec2c094cc36d1250749af0c536"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.num_row_DMatrix.get_float_info.return.getattr_self_name_": {"doc_hash": "485c42af20740ffdb64bfdc0879cb01db05365624fb91a67bce388be9b0c401f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.set_info_DMatrix.set_info.if_feature_weights_is_not.self.feature_weights.feature_weights": {"doc_hash": "30091f3dfadb304b4f657105f82f8bab388f8040756380b84edbcb928a241b4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_Booster_Booster.__init__.super_Booster_self___in": {"doc_hash": "251f1c760c6378229ce8be3b0bf7a4381ed092332a85f531334f2703b71ba4f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_Booster.predict_Booster.predict.return.result": {"doc_hash": "24780001478a8e006a89c9ba7c19790b3ea9ebc8a7fb2b650a4c4303ef7998f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_train_": {"doc_hash": "523043cf8183247dedaa09187e336d8d0626b9c1eabb619b23f5722e8b97ec6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_time_ModinXGBoostActor.__init__.LOGGER_info_": {"doc_hash": "2da52594e9ebf4269273e8a3fa5a8eb72c097c0182d0af6ed97f2d948756897b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor._get_dmatrix_ModinXGBoostActor._get_dmatrix.return.xgb_DMatrix_X_y_nthread": {"doc_hash": "bee2579e6665c1d98b201aabd30f5abcf321111b0b14cf97bce745256fb36c6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.set_train_data_ModinXGBoostActor.set_train_data.if_add_as_eval_method_is_.self__evals_append_self_": {"doc_hash": "196f98b68899a9cefc44a0a85e0dda1ee238e4ade6fdce94020e486d5ee44734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.add_eval_data_ModinXGBoostActor.add_eval_data.self__evals_append_self_": {"doc_hash": "3b12a4a40783ffc533a15bbed6de6b430bc9954ba05b0bbba0d6c2fa0a4f6914"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.train_ModinXGBoostActor.train.with_RabitContext_self__r.return._booster_bst_history": {"doc_hash": "5a12c350924ce83867c6abf1259829c60953b9b277ffce7103139917b864a7c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_cluster_cpus__get_min_cpus_per_node.return.max_node_cpus_if_max_node": {"doc_hash": "dff9ddadc3f03488c0de54a29a2b266c3e40a040392bea2ab0adec8436402d59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_cpus_per_actor__get_cpus_per_actor.return.cpus_per_actor": {"doc_hash": "f22b44acee075aedc2b8bec74756c6ccfb4395c3b02a52c9cea2200e1eab4e86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_num_actors__get_num_actors.if_num_actors_is_None_.else_.RuntimeError_num_actors": {"doc_hash": "dd4f5cf384da413198ca943e1040ca82da2093cd74d2b2673a2a5881eb3c329e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_create_actors_create_actors.return.actors": {"doc_hash": "bf2ec3f8acf01e137391834e8d54f4887cc9c769d57dfe2c2937ac97addb8c1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__split_data_across_actors__split_data_across_actors.for_rank___actor_in_e.set_func_actor_X_parts": {"doc_hash": "2584b885c19323ae6f388dcdf34e41090dad2208c5df9eb83981f624a6961a68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__assign_row_partitions_to_actors__assign_row_partitions_to_actors.num_actors.len_actors_": {"doc_hash": "1413d945658bb6365c642bfbcc0367b5661f87112133e3f97bb95b520066fc0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__assign_row_partitions_to_actors.if_data_for_aligning_is_N__assign_row_partitions_to_actors.return.row_parts_by_ranks": {"doc_hash": "bd6446f9901020454d46f2cb9795b0153b4374c9a26d56d2e941f5e69b198995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__train__train.s_5.time_time_": {"doc_hash": "6e205ceab93f29e5e8a57fd463582ca04f53b214cf6a042501f5b462b82ae7d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__train.with_RabitContextManager___train.with_RabitContextManager_.return.result": {"doc_hash": "fdb9e4ac10d2b88b89bf462f3d445fb5d004e58552110792ea29b4ea3b60fb03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__map_predict__map_predict.return.prediction": {"doc_hash": "3f28fc355bf14302ee5c1ead9818cf7fc2fb4806c33dc520bcad1c2962038f2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__predict_": {"doc_hash": "5d1b810475937c31e2fdb37ff24d65bca4ec1d42a6cbb1bb43badef277a0681d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/__init__.py_ClassLogger_": {"doc_hash": "e12bdbd7d93916f0a7d0b051733b0c43ba4b98dc3cedb4e47ba7fc8be61e2209"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/class_logger.py_from_typing_import_Dict__": {"doc_hash": "8980f66f03aa7fc61a8c8b96613f5dbee479be55473182dcb2f77eb93f316722"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_logging_ModinFormatter.formatTime.return.s": {"doc_hash": "8cf29eecff0e1135d20575ddd6c8b04bb323114a6e6aec98e4a10b67de158c03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_bytes_int_to_str_bytes_int_to_str.return.f_n_bytes_1000_2f_P_s": {"doc_hash": "84a670a8865efcff3f7c22952e44aae6908fa8789eab35755624369c00cac7cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py__create_logger__create_logger.return.logger": {"doc_hash": "7252b3e19ff0179fb23de492e2c09106b6eb05fb3191e817dac991d0c266c8fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_configure_logging_configure_logging.__LOGGER_CONFIGURED__.True": {"doc_hash": "d32ab5390a4f9b34a11640124a540513f99c8d0400642109206265c8db7d13c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_memory_thread_memory_thread.while_True_.time_sleep_sleep_time_": {"doc_hash": "ea47e36d7cc7a3b3672dc94533f0a3c31321a894478b7d3e22375cb8b9681105"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_get_logger_": {"doc_hash": "afab86b03bd9f06afa5198b3a6d66ec2149be9977f1a28982f3a8a7bf5a274c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_from_typing_import_Any_O_disable_logging.return.func": {"doc_hash": "49f928e029bc24da475bf888a6fbcb41b33ab663821e4c49d2e4d5f8f032b31f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_enable_logging_enable_logging.assert_hasattr_Logger_lo": {"doc_hash": "a4ad2ead701890462b84c60f02ab6a62ef8d140cb34b9fb91db3653719b46963"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_enable_logging.decorator_enable_logging.decorator.stop_line.f_STOP_modin_layer_uppe": {"doc_hash": "cf7832995308e78506e3bd738af22e56d5f5d2f99b33fd7c2951c0853fd0e71f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_enable_logging.decorator.run_and_log_": {"doc_hash": "84c3594e78735084dcb9b7a67d51bf136839f8a1ee81308b50400a642dd1f734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/__init__.py_array_": {"doc_hash": "4d9f748fe55961ff8e3325b7ccbab1f8895beec476a3fd02ad3f67cd13779697"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_from_math_import_prod_check_kwargs.if_not_.raise_TypeError_": {"doc_hash": "40042c57e321ff629c968699c2531845beec21524c2ef1f438210ad1d5de3c8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_check_can_broadcast_to_output_check_can_broadcast_to_output.if_not_broadcast_ok_.raise_ValueError_": {"doc_hash": "1e7629e5ec30408a959ce92131eaf4cbc2fcc33dca17666113a545e3abc0fd30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_fix_dtypes_and_determine_return_fix_dtypes_and_determine_return.return.result": {"doc_hash": "383ec5142f1f16d93a7ce0e218306d1ffc11bd4b95d42408e01623e86aa711cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array_array.__init__.self.indexer.None": {"doc_hash": "35b77c42f0bb47cb9897464b3fff90d2da359914b14d5c2978d0623102c2a9ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__getitem___array.__setitem__.return.self_indexer___setitem___": {"doc_hash": "5f5c93ef3024aef2ed68ffcf59652ebab35b94cb33ca17dff9e2607936e1c7ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._add_sibling_array._update_inplace.old_query_compiler_free_": {"doc_hash": "9416585d878a30485f0705efcc79bdd6f8c50653e22c3372e346bd70c7e83f6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._validate_axis_array._validate_axis.return.axis": {"doc_hash": "724c550b1ccc11eae6081c67a6a4151cf3e3b86d4815b05fdb3c0a96eac31275"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_ufunc___array.__array_ufunc__.out_kwarg.kwargs_get_out_None_": {"doc_hash": "07c5763493ce0832bd7428497544f67733a1da8bd6e4d21586fb92f470fa5ca0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_ufunc__.if_out_kwarg_is_not_None__array.__array_ufunc__.return.fix_dtypes_and_determine_": {"doc_hash": "4d2f3e98a68b187573d3e07941bc607f8c708e548e51f000d2579045c9eab42c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_function___array.__array_function__.return.modin_func_args_kwarg": {"doc_hash": "d29dd953adf4f024b9fc1a382a249626cd7afe6adaa77e5dfacc487218d5f165"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.where_array.where.return.array_": {"doc_hash": "604b2eadbb00d153cf31ae35b3203dd5a07fb46a1887999d68428a3f33610057"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.max_array.max.if_truthy_where_or_out_is.else_.return.numpy_ones_like_intermedi": {"doc_hash": "4283b8d8ae414ea86cb0f4752f7b3cfe8e9fec2ed2f3a843d2bdc8622cd773aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.min_array.min.if_truthy_where_or_out_is.else_.return.numpy_ones_like_intermedi": {"doc_hash": "a7b6a9174bb4f461290fbd7829c83f283d8393b89c3495dfa721ae4d91495efd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__abs___array.__invert__.return.array__query_compiler_sel": {"doc_hash": "fe0429f88d6b877701bc6c15d60d47d25e6472ea30b2359a04102d878b7fe8b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._preprocess_binary_op_array._preprocess_binary_op.broadcast.self__ndim_other__ndim": {"doc_hash": "daf44be042bbc8843f80bc636d02e0182acc5a6b8ce8d84ec10cddfd954431f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._preprocess_binary_op.if_broadcast__array._preprocess_binary_op.if_broadcast_.else_.if_self_shape_other_sh.else_.return._": {"doc_hash": "5bd8b6dce87c085af042332d0d54332df1cbce9005477637e887753fd4c7b74a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._greater_array.__gt__.return.self__greater_x2_": {"doc_hash": "f5305012100a25e6dd06fc82ea906ecd50b5e513c651fb1b457d40ee4efaf068"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._greater_equal_array._greater_equal.return.fix_dtypes_and_determine_": {"doc_hash": "7af85d28008e05a2db477e33679f427ab79b12e2e49c430c62a1d00094e0349a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__ge___array._less.return.fix_dtypes_and_determine_": {"doc_hash": "64d04c28bf957d36de53b0e18d6ca850a2ab84dad3ac8c62af680f9c1901eaae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__lt___array._less_equal.return.fix_dtypes_and_determine_": {"doc_hash": "752b93df7db6c8cb3a790e56c3f77abbf3b32cf48333f54afc84146e5a5eb114"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__le___array._equal.return.fix_dtypes_and_determine_": {"doc_hash": "8fe97248b12c862c1dc92e3d7e14cf8b17b9866f6fa50399c913b1064e3cc28e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__eq___array.__ne__.return.self__not_equal_x2_": {"doc_hash": "388a6812c54a4df35f4ccc83ae70cc535d6a4b06a38f0f18046ef531a68d9124"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._unary_math_operator_array._unary_math_operator.return.array__query_compiler_res": {"doc_hash": "51bcd09119f165a01b5b80e900c237fb58fec485760ab96b01eaf75bbf5749e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.tanh_array.sqrt.return.self__unary_math_operator": {"doc_hash": "a5790c662245de27fcc73fa75dd448068f33bfeb81eefb4780425f6027705988"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.append_array.append.return.array__query_compiler_new": {"doc_hash": "6a3a03d5f15117a6e65c3434c44205474548b7d61647a2e40b481f618e37cd66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.hstack_array.hstack.return.array__query_compiler_new": {"doc_hash": "d64cc064438cb6034b8a07ac9db7811d58b60162047ccc6e77096046de8e39bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.split_array.split.return.arrays": {"doc_hash": "d3ed67ecbda48618d69b7229fd2bb74b34cf714e30af56e8d2df68c8fc912e99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._compute_masked_variance_array._compute_masked_variance.return.target": {"doc_hash": "e315df55c3a97dac40aa125bb2691308dccf94d2f6595c44efdf04147e697889"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.var_array.var.if_self__ndim_1_.if_keepdims_.if_truthy_where_or_out_is.else_.return.array_numpy_nan_dtype_": {"doc_hash": "117132f5754ecef13b1b854c090917d8e72447d37519f94baa6876e94f67fbd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.var.if_apply_axis_is_None__array.var.if_truthy_where_or_out_is.else_.return._": {"doc_hash": "09ca224ceea3a438bce9298f97960f5e12e3ea3635a8a7d98b11ee0ce1401b85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._compute_masked_mean_array._compute_masked_mean.return.target": {"doc_hash": "725dcf97d5ef7ad63baf044d36080176974ad60ef233ba7b7ca3ff760dd52db4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.mean_array.mean.if_self__ndim_1_.return.result_to_numpy_0_0_i": {"doc_hash": "d396a278e754a20aa9766825191a12d9ef3c15a5ce36b6b94545e5b0750980d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.mean.if_apply_axis_is_None__array.mean.if_truthy_where_or_out_is.else_.return._": {"doc_hash": "b332842193314a810ae8b5807d660dc879484c7c01f556d1d699d194cff15e1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__add___array.__radd__.return.self___add___x2_out_whe": {"doc_hash": "da3515752cb8605d7794600a4966c1d2681090a9ada4b82da11fa09b5fd2c3ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.divide_array.divide.return.fix_dtypes_and_determine_": {"doc_hash": "7793be8815597e722ea8ed407208dce87195a8fcfe6ca04e22a1a1e03c2f2da8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__truediv___array.__rtruediv__.return.fix_dtypes_and_determine_": {"doc_hash": "b983149faf20cca59af4f13db00fd50e40a8d5c45985faf6e601fc02cff0b1e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.floor_divide_array.floor_divide.return.fix_dtypes_and_determine_": {"doc_hash": "6f845496aeebe6650b6beac6c632fe414f2c3384b6df3d565a54cf3c54ebbb92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__floordiv___array.__pow__.power": {"doc_hash": "3ff49e7455e1b876aa977e5897c235d312738ba4fd8d59aa6152d72081653c7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.prod_array.prod.if_truthy_where_or_out_is.else_.return._": {"doc_hash": "7bea43351ec1215addc92c0670e20b174b29abdd3d3c63b1dfa49e4b0e636f62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.multiply_array.__rmul__.return.self_multiply_x2_out_wh": {"doc_hash": "12ea4a9dd580d1a16a25bb56be47eaa3ab5127c80f1623b9dda3d5edc755ec44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.dot_array.dot.return.fix_dtypes_and_determine_": {"doc_hash": "e641df5a5761166df01f5183d3e7336810591b7cebe94e72260a6115293afc47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__matmul___array._norm.if_axis_is_None_.else_.return.array__query_compiler_res": {"doc_hash": "6bd611d0a1a5cb36c2dbc7b326242f986b17776fb54bd0b542a204316ec552bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.remainder_array.remainder.return.fix_dtypes_and_determine_": {"doc_hash": "a31ce818ee6429ca65b74be08831367f319fb6a5617d623c714ee45f4f28b50f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__mod___array.subtract.return.fix_dtypes_and_determine_": {"doc_hash": "5033864a1e42094b2dba8fc5b3ab06b1232fb97c378630b6b2e27f671767b4fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__sub___array.__rsub__.return.fix_dtypes_and_determine_": {"doc_hash": "e07d02e1127cb3b192b535d6f08bd5c3bc9a8f44285ab2b1409cde0567bc6067"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.sum_array.sum.if_truthy_where_or_out_is.else_.return._": {"doc_hash": "f1e509f0884478e678922f498e6afa34e2e09e047b640d2add70e0edf93ce831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.all_array.all.if_truthy_where_or_out_is.else_.return.numpy_ones_like_array__qu": {"doc_hash": "33238b5a58ad684572188aebb18a2823887d1164d1ff8cec4138ff7dfb92441b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._all_array._any.any": {"doc_hash": "729279a32dd5f951b3bc2f5ed789722679420b3c2550ab5a0307f5e381f61816"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.argmax_array.argmax.return.fix_dtypes_and_determine_": {"doc_hash": "794bd73a92b68f4098bd40392f28ce61d237c6255508c4e490dc275c7c98f922"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.argmin_array.argmin.return.fix_dtypes_and_determine_": {"doc_hash": "85df6465e2e3992922bf7099e5bad5a1a850d5513ca9c70a98981a6168abd609"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._isfinite_array._logical_not.return.fix_dtypes_and_determine_": {"doc_hash": "93c89a57af0c98064db5795efa3d30ebee2d06d9b429a6036d28babaf3601ed3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._logical_binop_array._logical_binop.return.fix_dtypes_and_determine_": {"doc_hash": "58573e4440df4ba1c27c8a7cc7427fcff40c076d3960ea39d634c891069d8db6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._logical_and_array._logical_xor.return.self__logical_binop_": {"doc_hash": "9e43d159e2561d6acc44b492ae417c9a98e420f547966cafc67dc5a254db20d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.flatten_array._get_shape.return._len_self__query_compiler": {"doc_hash": "db14d458ed47838e5e3f52e3f260f66b3e47a4e204a8314fcd682b6322339e51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._set_shape_array._set_shape.if_isinstance_new_shape_.else_.raise_NotImplementedError": {"doc_hash": "6c5269f80a07170f4b2c6572666b97ab6b7af31d35bd3217242b9650ae67cdd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.shape_array.__len__.return.self_shape_0_": {"doc_hash": "8963b53cb9db38f2e9bdf08970fac7de59c9e7a1f6c72068cd37de69ebf9ce0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.astype_array.astype.return.array__query_compiler_res": {"doc_hash": "1c39ab2b2390b238e2c0a148c90b2de7126042be6425501926545e94719da682"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._build_repr_array_array._build_repr_array.return.arr": {"doc_hash": "83526b1c6bc606d8297b022a5ff4597f63deb36ad1204d5bbf5dd64856a97ec9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__repr___": {"doc_hash": "09c7b0fbf18883cba196e4e66f1d4f068b07604585a373947187c0df86d67281"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_creation.py_numpy__create_array.return.array_getattr_numpy_nump": {"doc_hash": "9fc98c27a152f6f8f1062208a6f69f456792642e0d2d99c1782c74786aa47eee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_creation.py_zeros_like_": {"doc_hash": "4f1e657e1d641047cf714ee4cbefc10c9c3af917786f493a091f4a31ce26bafa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_shaping.py_numpy_": {"doc_hash": "92290e6b56a1467512b085d9afec2095d1e5ab50b07f9e46a0025bf530aa1337"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/constants.py_from_numpy_import__": {"doc_hash": "f9e52298f5822462d6a53c4f147f1872db45f2955de0b0b264bf6fef03bbaf9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_np_broadcast_item.try_.except_ValueError_.raise_ValueError_": {"doc_hash": "571f42bdb793e9bb42fa684b6bcd037f67f7f14f4538ee2bcff10bf8b5f4a7bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_is_boolean_array_is_integer_slice.return.True": {"doc_hash": "5c35db068ad7bf4acf6c65477312ace95212cda40f3e80da418c977226503319"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_boolean_mask_to_numeric_boolean_mask_to_numeric.if_isinstance_indexer_n.else_.return.np_fromiter_": {"doc_hash": "b46f7a66fedb79bea0793a92dd934140f91a105896c8bffa77c6689e1bf4317c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py__ILOC_INT_ONLY_ERROR__compute_ndim.return.ndim": {"doc_hash": "618eecc40a6b2016fe426ff89a5120b5c28755f143e65be436d19a9b6fc6a9ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer_ArrayIndexer._get_numpy_object_from_qc_view.return.res_arr": {"doc_hash": "67194389812ed11c697f2114e2b3f370dbf030e0e05c26f35547a6c3d5a8713d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._parse_row_and_column_locators_ArrayIndexer._parse_row_and_column_locators.return.row_loc_col_loc__comput": {"doc_hash": "2ed3ea068914cb59269bc1f557c49bfe931799ff5560439d17016f08f2f3cfd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer.__getitem___ArrayIndexer.__getitem__.return.result": {"doc_hash": "d3044e5999768895c11f723ca85eaddec57e14b1086fe64090f20d6fae12ef64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._determine_setitem_axis_ArrayIndexer._determine_setitem_axis.return.axis": {"doc_hash": "fa59ffe7ab9a09898fc2bf0acc290a492a1ac9ee33d951f36aeb08d2892cdb68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._write_items_ArrayIndexer._write_items.self_arr__update_inplace_": {"doc_hash": "ab0c83b611d0b45da49ecb8dda481a8cc815c56b686d22f1abf08508a2779cb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._setitem_positional_ArrayIndexer._setitem_positional.if_axis_is_None_.else_.self__write_items_row_loo": {"doc_hash": "9d5824abcc17905a6f08e752d1d3f04671d83d9bc71c64c6645a06cf864308b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer.__setitem___ArrayIndexer.__setitem__.self__setitem_positional_": {"doc_hash": "3a053ec1dea644b7471dc7d04b9365ce5c0eaa2a5c55b0f4459835658c9663cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._compute_lookup_ArrayIndexer._compute_lookup.return.lookups": {"doc_hash": "00f049f09823ada4ca61d4cb183d3aed1eac313ddb4b82ce499cba627a0266fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._check_dtypes_": {"doc_hash": "e8cf4cfe0c5bc4c700e5af6fc17040ed6a5179435e892e6798e2934ee1105ffd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/linalg.py_numpy_": {"doc_hash": "90330cc457fe7dbeab1b57dc4b7f03dc3d0cf2926c2d0bbd26f3c5aad7e2b92c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/logic.py_numpy_": {"doc_hash": "887a7ca2a88d8e0ef3d568d58be822b2ab8887d12baa79cee7266a6b7e300f58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_numpy__dispatch_math.return.call": {"doc_hash": "9a2d5868823f5a72d0e815ca58b3c1e3cf2c4290dad8a2945367cdafb6013408"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_absolute_mean._dispatch_math_mean_": {"doc_hash": "4aae50fbec7d497ab0a752aa0802f2f3fe398282ab375e6fba43cb37ac11bb28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_var_var.return.x1_var_axis_axis_out_out": {"doc_hash": "1672189e69dccd44c2baad80897b6f45b4cb7257b3ab858ae1f567178e937332"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py__Maximum_and_minimum_are_maximum.return.numpy_maximum_": {"doc_hash": "aa6c2b9b1ceac0e810cd4884ce204fb64b6b487ca97b9cf68f79d2e75a175daf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_minimum_min.amin": {"doc_hash": "6781e01a30671d5590f78440ef8b1e48619523e83321df5c930927ded12ad749"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_sqrt_sqrt.return.x_sqrt_out_where_castin": {"doc_hash": "c6ca0cc8610fbb6494c5e3381eaa87ddcb598e39222a60571f5b678645ee9bc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_exp_exp.return.x_exp_out_where_casting": {"doc_hash": "09114dc451d110ad9741005d075a385bb39e21ace1999d1f343207d0d8412bd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_argmax_": {"doc_hash": "1b37fca20894954de9f07bb164b7cab9e6a885c46024a0f8f1ac097ca137a5d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/__init__.py__": {"doc_hash": "6632904cbbf5fadc70db29db2d2393b6aa07cf5da0765bcf6d57c14e4ac66221"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_numpy_test_repr.assert_repr_modin_arr_": {"doc_hash": "1c23524799171dae24d6dd139ae35b3ed502f8dfc68e7f5c7c54461075809f3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_shape_test_dtype.None_1": {"doc_hash": "c0fe272a3cdbd3f700bfe50d6d999b9802bba4a5538f334ffdc442bc8c832001"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_conversion_test_conversion.None_5": {"doc_hash": "86a6b06fb0b28617812753b0b8178dc8a5af0f507a5703dda75ddcfac9f21373"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_to_df_test_to_df.None_2": {"doc_hash": "d283303e6bfb27d80a1030a9001b9bc461374c9afcd9f1849f4621c615ff536b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_to_series_test_to_series.None_1": {"doc_hash": "3054208fa6f70681251cca6847060730f654c5f1f443486fe3a93e85ae910a81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_update_inplace_test_update_inplace.None_3": {"doc_hash": "2389d6ec24cae423a64e3496227decefaedb9a5beb945317f5f123c56e3a9664"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_out_broadcast_test_out_broadcast.assert_scalar_or_array_eq": {"doc_hash": "0a9e5b0fddf1b1e8271ee31f94d5ecfad3805c3af5eb57484481a61a5318e679"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_out_broadcast_error_test_out_broadcast_error.None_4.np_add_np_array_1_2_": {"doc_hash": "746cd7e0b21d852ee7b83445630fe2bd0071993ba6fca9b823d27241b08f9eb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_ufunc_test_array_ufunc._operation_that_Modin_do": {"doc_hash": "46eecba03c98b7a00a2acb91c8599b4e55822a8df4759e4fd71e460141b70bde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_function_test_array_function.assert_numpy_result_mo": {"doc_hash": "d85cee7497b09cf87dc44d48073711165a172171d0728af1ca9e5dae1e098803"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_where_test_array_where.None_4": {"doc_hash": "24b2fc2d029cc1bb2a768685c76f5dc2ebb08774b7170289bc4f0869da024a33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_flatten_test_transpose.None_2": {"doc_hash": "34b53f375f056607ac2b61e5f10ba83e45cbfc6be6c0a7c4f131ba2c702d8e2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_astype_test_astype.None_6": {"doc_hash": "d6f23e835415070a7e49f0080949e2aa4d2b0dd2fc8c2ca894b550d5f7b1282a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_set_shape_": {"doc_hash": "1f55624a63d36664ed3d2644679fa55b218875ebfa2617fed01b492439d976dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_numpy_test_basic_arithmetic_with_broadcast.if_operator_not_in___tr.else_.numpy_testing_assert_arra": {"doc_hash": "a1820d0913a0b370d4c6ae581ab27879e552fb10818dac45c31018eec43fbf92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_binary_bad_broadcast_test_binary_bad_broadcast.None_2.getattr_np_array_operand1": {"doc_hash": "abdd28f08e3274363792de21ee45b3ce38c957ba935093942a61863fec1593a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_arithmetic_test_arithmetic.for_size_textdim_in_10.numpy_testing_assert_arra": {"doc_hash": "6e7355b74c5d2676dc5c061460ad532d8bc87fcc1076723bd4e6032c9451bdbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_arithmetic_nans_and_zeros_test_arithmetic_nans_and_zeros.None_2": {"doc_hash": "980cd5af478e42940af7d3cf67a74fe982a73d032e0b05432e22803b6216320b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_scalar_arithmetic_test_scalar_arithmetic.None_7": {"doc_hash": "af5707f56aee7407e5782b3187af84786a780feebf3dd771a750705c3ea3a439"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_unary_arithmetic_test_unary_arithmetic.None_1": {"doc_hash": "61e0c6c501128daf86f0a24e2fb8786cdf4031c22185ae76bbe3b7d99bec09b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_invert_": {"doc_hash": "9b5bcb327cab5937d1d77f76811d874ee5ffd8771a4eb5894c0af007b20df43f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_numpy_test_max.None_7": {"doc_hash": "7fbff5bb8c5ca28deccb1521e8cda15d88c182a15ec230d568603f014d8c908d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_max.numpy_out_36_test_max.None_17": {"doc_hash": "389b8d833c136a7679212a5fc22ba2c5976720d512b3d3141eae9723b9c3dec8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_min_test_min.None_7": {"doc_hash": "dce3a4cd58b09b97e41cdf7ab956daa90274a4310c3dd2f86b0e6d9f12e041bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_min.numpy_out_36_test_min.None_17": {"doc_hash": "b012c47aa5fed717a011990384e83cec97e06ad9ac3bdb522706f98005b2f09c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_sum_test_sum.modin_out_37.np_array_numpy_out_": {"doc_hash": "ac18ed0ee1eefa9b6e98202a25666fd3bc5993dcb6922aa777d21fb179e92106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_sum.modin_result_38_test_sum.None_19": {"doc_hash": "c39da3740cf32e43a1e377e9a957d12385015c8d2ada6444c826e42b72dbb784"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_mean_test_mean.None_9": {"doc_hash": "3e9a6062de1fa6d3f52fd855f8020fb59034a9b9d34a35d9407ef0256189726f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_mean.None_10_test_mean.assert_modin_arr_mean_whe": {"doc_hash": "2b9cf7474a890dab57f4d2f9f7347de4bcd48ab0d0a839bfc40c0faeb17058db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_prod_test_prod.modin_out_37.np_array_numpy_out_": {"doc_hash": "7632cb0c8abec305a0671d1af0306e6b428d97647007125a4382dae4779064ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_prod.modin_result_38_": {"doc_hash": "26c84bb7ec766241236dc0e0ac51353529aa8cbef7ab4e7719f2ca9a2216415d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_creation.py_numpy_test_zeros_like.None_3": {"doc_hash": "e2751cc1f6841c814f8a162506d283f2d0f2d0fbce209d2f99f834598cc1dd17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_creation.py_test_ones_like_": {"doc_hash": "4424b0d009ecf6ddebcd5fa8d8df389deeb6339267f2b1b1048fe114a78b5101"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_numpy_test_getitem_1d.if_is_list_like_numpy_res.else_.assert_modin_result_nu": {"doc_hash": "13668b6cc54855cfc344e3c71241464f12b4c4a592e9990aab91dc58b2fc9d4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_getitem_2d_test_getitem_2d.if_is_list_like_numpy_res.else_.assert_modin_result_nu": {"doc_hash": "6e993eb647171ab0b3152c0318c24cfb414a929636bc2a5b901c659462321540"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_getitem_nested_test_getitem_nested.None_1.else_.assert_modin_result_nu": {"doc_hash": "80452b2f826cfb64d374ec8191b13a7246a7ff71afe885beda8c44405fac2f98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_setitem_1d_test_setitem_1d_error.with_pytest_raises_ValueE.arr_0_5_1_2_": {"doc_hash": "551d3eb9defd34ba0783f7b92c85b293a293aed7c4463a163e2115b9cf6f0cd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_setitem_2d_": {"doc_hash": "1ee079415d629cbacdab023b67cf70ea5d4cad5d7f1ed35fa3bd61d048a51f85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_pytest_test_dot_from_pandas_reindex.assert_scalar_or_array_eq": {"doc_hash": "2684be7650c54835dc4dc10aa243148672c1edcccf78772f9ebd1cf8959b4b23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_dot_1d_test_dot_scalar.assert_scalar_or_array_eq": {"doc_hash": "2ba787528c008105125f9e6f36fc8e8af94f453c08b5f665a450a800faaafa87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_matmul_scalar_test_matmul_scalar.with_pytest_raises_ValueE.x1_x2": {"doc_hash": "89d52ac712b43168cf7633195f3468bfe4d04fa5fb4ed99141abb3665be62cbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_dot_broadcast_test_dot_broadcast.None_1": {"doc_hash": "c23a9e3743c2e8408640f305ed7a4aa97dbe967308ddafc386da102a393f21b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_norm_fro_2d_": {"doc_hash": "bf2dc567378a42324e3c88e4f0ff8d85ef1dc43bb55366a40e347fb871d9322f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_pytest_small_arr_r_1d.numpy_array_numpy_nan_0": {"doc_hash": "ab69327fb9f9406badb85574345883e4e171d2dc1db829972a611d698f42f8bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_unary_with_axis_test_unary_with_axis.assert_scalar_or_array_eq": {"doc_hash": "bd1ebb127570619a4a43fc7109a4c68a3bf007d779816d69073c53bec5296baa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_all_any_where_test_all_any_where.assert_not_bool_arr_any_w": {"doc_hash": "7c36c3eaf29515952ae42c22134f2b4baa52926185386ed186b0007258a99e69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_unary_with_complex_test_unary_with_complex.assert_scalar_or_array_eq": {"doc_hash": "63c86c931ad07dac5b15f66788f1b3f4bde4b5c4aa0b735afafd19471730d01a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_isnat_test_logical_not.assert_scalar_or_array_eq": {"doc_hash": "5ad10699ecdb2aa4fa310eb440e2d9dbea671ca36f27392709504849e0b59bfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_logical_binops_": {"doc_hash": "e25788124bb0b87ec5332a899631cdfe28266cd0dfd3f0dff5beb3bb715185e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_math.py_numpy_test_argmax_argmin.assert_scalar_or_array_eq": {"doc_hash": "367f82591fe3be630ea035853384c96361cbd8a24fb5a33dcfabd947b9f42d6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_math.py_test_rem_mod_": {"doc_hash": "c9f3fd0fe27999596c339ee5000e7cb39c41d35387421f974b2fc30a47d64d2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_numpy_test_transpose.assert_scalar_or_array_eq": {"doc_hash": "a9fbe68d3fff04b90a3dec31ec5c84fd1efb42f9701fb632912c6800ddda8a16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_split_2d_test_split_2d.None_1.assert_scalar_or_array_eq": {"doc_hash": "bfd2c294c59bf50c043e6e04f3367ce9d20255cf8a5ec4029e63317166da0ddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_split_2d_oob_test_split_2d_uneven.with_pytest_raises_.np_split_x_2_": {"doc_hash": "1abb534fc2a07764929f5e0b0177e34e1fe45322c38cfd61a66fbe98c1f1210d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_hstack_test_hstack.None_1": {"doc_hash": "235ac57b5b3bb59d13f4078e5f4e4099395e1546d09b2e5e694e2610d6acee96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_append_": {"doc_hash": "e0942ec443d1f0ba4187aa8afd7605b01c054c009aca363abc1355f6e54c7c4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/utils.py_numpy_": {"doc_hash": "a02781de7541d2f11e9d51ea7e1190bc1545f64f28a4d51d286dd7913989e49d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/trigonometry.py_numpy_": {"doc_hash": "a33adb3cd45564aca425384dbe7decf5d2d295a078455eaf049e92973b7dea57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/utils.py_pd_": {"doc_hash": "ac6844b2f455bd2ddab292c8535fd1bd4437eea6f226d20757f18b4d2f78b78d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py_pandas__is_first_update._": {"doc_hash": "61f7fd62b2b23fc4da9a2edb9978dcc9259b789ff8efc17ba88f35f8434176fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py__update_engine__update_engine._is_first_update_publishe": {"doc_hash": "146d2deb40bac34cba65e9f717cb5dd6effe6a7a0ed8ed18f002184701093aef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py___version___from_modin_utils_import_s": {"doc_hash": "7fca04748bcfe467a1ea7748fe6ba853bd7fbe7348100efed82a5cd8cf4d8193"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py___all___": {"doc_hash": "3a7ded50a098af4f15e779916f4e17b24acaf04e74e8b0d1c6f6c4ec555b0aa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_pandas_BaseSparseAccessor._validate.raise_NotImplementedError": {"doc_hash": "4317b90922c3b106cf465590c4531c02de3cc9db5b5be0439c6fca32fd2c1a82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_BaseSparseAccessor._default_to_pandas_BaseSparseAccessor._default_to_pandas.return.self__parent__default_to_": {"doc_hash": "8f3298c0d90aba2aeefe1ef9ba83d12068a9747bb837fb33f7195dcc22cfe900"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_SparseFrameAccessor_SparseFrameAccessor.to_coo.return.self__default_to_pandas_p": {"doc_hash": "fba68598b7d171720112c5a647698757b3d4b0ecb2f1d370ec89250d3d27b5c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_SparseAccessor_": {"doc_hash": "384f775ea825dcd8a5e7375d324e56056e36c97b7119b8dfce1b5393ed153e8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_from___future___import_an__doc_binary_op_kwargs._returns_BasePandasDa": {"doc_hash": "ff18818e9ac90d32247a34e86887e286da3ab3c7a7a8f674327d8abc90125902"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py__get_repr_axis_label_indexer__get_repr_axis_label_indexer.return.list_all_positions_front": {"doc_hash": "f421f805f23166e5ffa1795e95788664ef6de9cc19842c32de88d99f8d7e7324"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset_BasePandasDataset._pandas_class.pandas_core_generic_NDFra": {"doc_hash": "e5f45a2a8f0c62e00f83192a3a975d0313dc27e07435aa0573c2cc748f9b9bbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._is_dataframe_BasePandasDataset._is_dataframe.return.issubclass_self__pandas_c": {"doc_hash": "28e7da48651383e90328716c34e37ab0bc410ab3d2c4bbf587aef3ac592be11f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._create_or_update_from_compiler_BasePandasDataset._create_or_update_from_compiler.raise_NotImplementedError": {"doc_hash": "63ee30ac9d0fe0957eff68cbcf89d59915d274f384d2b887f87b2220ce521dd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._add_sibling_BasePandasDataset._add_sibling.for_sib_in_self__siblings.sib__siblings_sibling": {"doc_hash": "37377bcf1f3d7342ed4107a6e9d03f89584c4ba2a05ab581e3e58f62f917f0af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._build_repr_df_BasePandasDataset._update_inplace.old_query_compiler_free_": {"doc_hash": "59dd1ec7b3a144d6da8d8625e9a817547fdf0d043868fe081a2c976d91962a59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_other_BasePandasDataset._validate_other._Do_dtype_checking_": {"doc_hash": "db102ee42c790bbd9f9db0cdebf05b3d74275a6c2b786850291da4d498908867"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_other.if_dtype_check__BasePandasDataset._validate_other.return.result": {"doc_hash": "ea7f7564f830054bf8f31a7e04faa978ed3432bf60177d9e8096ee95f0cc2ad0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_function_BasePandasDataset._validate_function.for_fn_in_func_.if_isinstance_fn_str_.elif_not_callable_fn_.on_invalid_": {"doc_hash": "de29d8449a1c9fedb2b7988c2172b1f9e3cea924312c00159f1b7a71e326d594"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._binary_op_BasePandasDataset._binary_op.return.self__create_or_update_fr": {"doc_hash": "6d54935f1e1fcd8c3f64795e73c8ff8f31a25680be54347b904691b58c0bf52a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._default_to_pandas_BasePandasDataset._default_to_pandas.if_isinstance_result_typ.else_.try_.except_TypeError_.return.result": {"doc_hash": "e268c10f594a4b9275ee66c5992e4d1d9b1204cb8a81c34d5f64133b465fe5e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._get_axis_number_BasePandasDataset._get_axis_number.return.cls__pandas_class__get_ax": {"doc_hash": "d4345638e66dd6fb9e258cf523ccc1036e5a2fb08afea8e02a54512bcc048a3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__constructor___BasePandasDataset.add.return.self__binary_op_": {"doc_hash": "f036471ff7005bb8a2d1a37f2dfae43aaeb9b5962c59be89f30dbf88a0803ce4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.aggregate_BasePandasDataset.agg.aggregate": {"doc_hash": "5ba22c6900e9fe36311820444d46f74789f8357b8bf0d811c6ab45279b5ed42a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._aggregate_BasePandasDataset._aggregate.return.self_apply_func_axis__ax": {"doc_hash": "0df459250b6af746ba1f1b30a06e01d075bb018dd9879dc14b9343af97c2fcf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._string_function_BasePandasDataset._string_function.raise_ValueError_is_a": {"doc_hash": "23a2e6d768e3a0cb050d05a552f68ce63e1014aafb4d4bed644dcbb2d8f523a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._get_dtypes_BasePandasDataset.align.return.self___constructor___quer": {"doc_hash": "775b5b3f81ec032b8a03f92feff3943173f684ebe391dd69f7129e2f027aa594"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.all_BasePandasDataset.all.if_axis_is_not_None_.else_.return.result": {"doc_hash": "2bbcaeeaa9cfd4dea516cb86a302196f4f0395337ef32bc94ad0417a2d2e3487"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.any_BasePandasDataset.any.if_axis_is_not_None_.else_.return.result": {"doc_hash": "da5f496a660ee1e2f1bb371acd0563fa6efb8c43f2b62e088f828c982d14ab96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.apply_BasePandasDataset.apply.return.query_compiler": {"doc_hash": "da598ff989ea56d05429a22e420a0417a10b3b26f5641db9eea661d49fb8004a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.asfreq_BasePandasDataset.asof.return.result": {"doc_hash": "89f58a235c4c0b0956d8874929921cb4f56c24dd6a1aa13f962254e20a932129"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.astype_BasePandasDataset.astype.return.self": {"doc_hash": "3f84cac8ba28e7f1bea39f611a8807917f854d909d76576624561d71686ecf3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.at_BasePandasDataset.at_time.return.self_between_time_": {"doc_hash": "60ce36783e785a362424e4d3d3070e18b1944df925a504a64babebd9b5d7fbc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.between_time_BasePandasDataset.between_time.return.self__create_or_update_fr": {"doc_hash": "d13604b52048bed41f47077b85fd1d7535a22c521a521ad33bce500b9fb0a7e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.bfill_BasePandasDataset.bool.if_shape_1_and_shap.else_.return.self__to_pandas_bool_": {"doc_hash": "0ff6dd4b6007b0ebb7f36004b7edf4e5afe9b78c3e94d9dd17fe7d19e9005b34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.clip_BasePandasDataset.clip.return.self__create_or_update_fr": {"doc_hash": "b31ae94f72fee6b244a52cbf39a26ab842bce8e4732afa892dac87fdc1426129"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.combine_BasePandasDataset.copy.return.new_obj": {"doc_hash": "db5aff55c27e7f692eaf9e2d7c044e599d86b8efd475aa3618ffc4cbd7ea7db5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.count_BasePandasDataset.count.return.frame__reduce_dimension_": {"doc_hash": "464c50655b74c6d19f2ac44ababfdc653cf7c9f4915c8c51885bf1d48fca1468"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cummax_BasePandasDataset.cummax.return.self___constructor___": {"doc_hash": "528d5f0a51b996f5075416fedd34dc8413a2119f34f396af8f49f879ffbda385"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cummin_BasePandasDataset.cummin.return.self___constructor___": {"doc_hash": "f78fe3276a3d93b8d4321a5136dd508a9872dd594dd511524443ea03b8bcf320"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cumprod_BasePandasDataset.cumprod.return.self___constructor___": {"doc_hash": "dcbf29508f89e14574fb9993ee5875683e4fee4da113f2c821529b2af3925f88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cumsum_BasePandasDataset.cumsum.return.self___constructor___": {"doc_hash": "2cbb4c14ad1ee38e310220293c51107b3f67469c66cf1fd5a55361268e5917b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.describe_BasePandasDataset.describe.return.self___constructor___": {"doc_hash": "7d32d0b87bc48faea1c77f49018d876a7322cf1b3c266a7e7efed459d234c2ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.diff_BasePandasDataset.diff.return.self___constructor___": {"doc_hash": "f23aba56b22f463ad4ab422287e61c2f45808d2c07e40c20077ab29aa36ee3ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.drop_BasePandasDataset.drop.return.self__create_or_update_fr": {"doc_hash": "7aca1c2b077b169fba5108c089fbb5798a2da24f54b1930fcdff1ef9f5f72c8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.dropna_BasePandasDataset.dropna.return.self__create_or_update_fr": {"doc_hash": "a9c47effa1ee2341b388074a3f015c18c992ffeeec3b9c7031c5ee41724707c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.droplevel_BasePandasDataset.droplevel.return.result": {"doc_hash": "e5b8362a2f235df5ee7d7eb0fe658c85ef76e7c6363d4fe56ea6372da1007545"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.drop_duplicates_BasePandasDataset.drop_duplicates.if_inplace_.else_.return.result": {"doc_hash": "d5671bb8d820406cc46dd31e5ce9c77573dacc3cf90cacf693bd0e347061845a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.eq_BasePandasDataset.explode.return.exploded": {"doc_hash": "a30910a99b04e3dd6e90db03011b0104f64c5fe1d46583f7a16d4d83077ec911"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.ewm_BasePandasDataset.ewm.return.self__default_to_pandas_": {"doc_hash": "9477f88669553ffa1f63bc3c74e6c9cd1ed8f1a8cf3e9427a487fb89aef0a87d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.expanding_BasePandasDataset.pad.ffill": {"doc_hash": "15bc0bd6706209fb97fd755d97d78f54394f0d7ccdbd640bb076190309c3e916"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.fillna_BasePandasDataset.fillna.if_method_is_not_None_and.raise_ValueError_msg_": {"doc_hash": "7c10099b30e3deecceea6ed054df8428b233052f712c3ff6d0baba15b2602f58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.fillna.if_limit_is_not_None__BasePandasDataset.fillna.return.self__create_or_update_fr": {"doc_hash": "8a7af169ab54f9a89e3a13f09c8f8e174e4ff763e9960a8b678db4bd263bbe6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.filter_BasePandasDataset.filter.return.self_self_columns_bool_ar": {"doc_hash": "1a8c86f64179a9e7550f9b4f7edbf55cb3f8d7feaf059ff70db6ca467ec6cb75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.first_BasePandasDataset.iat.return._iLocIndexer_self_": {"doc_hash": "8242e4a02248e07cbf0735f108691cd06776864c3c18655f4e6755e5f306bfcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.idxmax_BasePandasDataset.idxmax.return.self__reduce_dimension_": {"doc_hash": "5b718c8d0081c1c392e3f4c4d7ce35548d124e09c75a451cdfc3d3c60543be12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.idxmin_BasePandasDataset.infer_objects.return.self__create_or_update_fr": {"doc_hash": "04aebc4acd284409f7c1214cb9647cfd1c706f0de90372a705fe6587cca95710"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.convert_dtypes_BasePandasDataset.convert_dtypes.return.self___constructor___": {"doc_hash": "bf43c062db44e8ae43ca7e8f972ee777478cf5a84bfba8893d9574c150ef8a81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.isin_BasePandasDataset.loc.return._LocIndexer_self_": {"doc_hash": "372ca7381b2e60d49d8bbbd0bf6ef177a767aebe9a01e1b0a8be906665307784"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.mask_BasePandasDataset.mask.return.self__create_or_update_fr": {"doc_hash": "b19dad5c6c58dc873b634fb9181a15e9212db5a59ea6fc7a06523b1139040d74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.max_BasePandasDataset.max.return.res": {"doc_hash": "48aeef234b94955fbebfdf013d87cf92887b7081df7c302380299e671a5668a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.min_BasePandasDataset.min.return.res": {"doc_hash": "717f0d271c29da8140d02877632ceae419f8bf6eb3a00afadab43249426cdb13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._stat_operation_BasePandasDataset._stat_operation.return._": {"doc_hash": "35887052f47ee9feb671f2a6759a14080a957cae1dd8f7ffbf6c1e35b09b15cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.memory_usage_BasePandasDataset.nunique.return.self__reduce_dimension_": {"doc_hash": "16d9ee0bb967a4adaf42fb7046bafc5daf91f89c09aa5844600dbabbbce4e61d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.pct_change_BasePandasDataset.pct_change.return.self___constructor___": {"doc_hash": "702ffa61c276922a71c372bb9400b29027f82eb736baeb34988abc35ed067358"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.pipe_BasePandasDataset.pow.return.self__binary_op_": {"doc_hash": "e587b77f46d432c9c700895d4775887cc9ddb9670b5ec15bb890009f1be523e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.quantile_BasePandasDataset.quantile.if_isinstance_q_pandas_.else_.return.result": {"doc_hash": "ba4e1ebfd0efb21aa4b05188a5e1b1964afb6cd24527b5949bfeac3e9b8f3bff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rank_BasePandasDataset.rank.return.self___constructor___": {"doc_hash": "e512e50b914b2ee0326a4ffd234f3ce3edef49f631b57057eb7cad5ff74f24de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._copy_index_metadata_BasePandasDataset._ensure_index.return.ensure_index_index_like_": {"doc_hash": "a69c86208d2395412cbf3415b777e6c09ad62f07cf51299ab2aa8537e41b120a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reindex_BasePandasDataset.reindex.return.self__create_or_update_fr": {"doc_hash": "984cb6f7c734e7390c4224267fad28a42fc99a056dd000e6eedd94e0ff774acf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rename_axis_BasePandasDataset.rename_axis.if_mapper_is_not_no_defau.else_.if_not_inplace_.return.result": {"doc_hash": "1f3c6d509647f825da370cd6101a5dee215d0947bc1a40427c58e72009710f6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reorder_levels_BasePandasDataset.resample.return.Resampler_": {"doc_hash": "a14c10fc504965f5decbc79f4e4890f9c3946ec1af34454382de6b88cf4ac0fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reset_index_BasePandasDataset.reset_index.return.self__create_or_update_fr": {"doc_hash": "e691d99f13c88f0c0a22a0624ba1ed94fff0c389bada3ab1e525a68349d9f042"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.radd_BasePandasDataset.rmul.return.self__binary_op_": {"doc_hash": "3aaddedbc2bad0d4ed463d569ebc9c5102f5841bb7c0acce370f1ced0dded9e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rolling_BasePandasDataset.rolling.return.Rolling_": {"doc_hash": "11bd54bc38df3eaf57d4b21fbaab7c7299fe4184e070bb3fcb59117fc0c75c4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.round_BasePandasDataset.round.return.self___constructor___": {"doc_hash": "0093602ed0ca1a14edb586223e8c31fdbe2ae637274345e6edf25615fdd0adb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rpow_BasePandasDataset.rdiv.rtruediv": {"doc_hash": "e9bdc8d3ad7e01f772f2af3bfcbbfbd7d54c5007916f92bf19af0ebbabf40718"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sample_BasePandasDataset.sample.if_n_0_.raise_ValueError_": {"doc_hash": "e37a56f30721bce4d557052fc9fde7f846b4d3a095313869183902b3495be095"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sample.None_4_BasePandasDataset.sample.None_6.else_.return.self___constructor___quer": {"doc_hash": "56529b006bcdd9b61eaf73c7967d4c8b974e4787bc594ae21e5f069d753560c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sem_BasePandasDataset.flags.return.self__default_to_pandas_l": {"doc_hash": "4a906195ba351bd674242b21984095987973ef9cae1f3b95483e8153667c260a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.shift_BasePandasDataset.skew.return.self__stat_operation_ske": {"doc_hash": "858ebcc288a61dc2fe5bdf8d47df566fe54b788b4fdb066a770de64143f8d052"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sort_index_BasePandasDataset.sort_index.return.self__create_or_update_fr": {"doc_hash": "40a10588816a3426850eda272c329768c7363e53ac94f48006913e49c00976f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sort_values_BasePandasDataset.sort_values.return.self__create_or_update_fr": {"doc_hash": "ad5450f2d64cc2db12aa1c2f78e19541e099aa155716b724f6e6b47bc949d50a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.std_BasePandasDataset.to_clipboard.return.self__default_to_pandas_": {"doc_hash": "4b0ead667d29123295b39f8d8a6d76bc5d6594da40c16c39c1873dded4f6ddad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_csv_BasePandasDataset.to_csv.return.FactoryDispatcher_to_csv_": {"doc_hash": "213b5b14c3b4a1a3fd6250838afa519f59f38d4b0ff91c0d7b05301e566383f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_excel_BasePandasDataset.to_excel.return.self__default_to_pandas_": {"doc_hash": "09716b87f00f5a81f0c0414e3380fa4d920f88f237530bac027b58876e3e81f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_dict_BasePandasDataset.to_hdf.return.self__default_to_pandas_": {"doc_hash": "35651235c02fd8f61ea1abf064dac7ae6f3da2b549a581d651a160da2c831684"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_json_BasePandasDataset.to_json.return.self__default_to_pandas_": {"doc_hash": "ed6aa06b1ba607df70a97564ad0486e2a1b65cdd4f373452c34f9ff10438bc93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_latex_BasePandasDataset.to_latex.return.self__default_to_pandas_": {"doc_hash": "fe2853f8f2740a61c82fcf4b9d6497394190b49c1c6d0f167db9d8a8e5e0b486"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_markdown_BasePandasDataset.to_markdown.return.self__default_to_pandas_": {"doc_hash": "79a3c41591cb791b55f8ba43367dcad4d164691698c9a8c7c3789413ed21a221"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_pickle_BasePandasDataset.to_pickle.to_pickle_": {"doc_hash": "d19373631e0b36f8bf873953f7a0d880c0172cd41dcbb0e0cf087b3437805b3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_numpy_BasePandasDataset.to_period.return.self__default_to_pandas_": {"doc_hash": "18a63c9266722bca921d054222116a0e0f389f19acbe2fde85faf9dbcadc459c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_string_BasePandasDataset.to_string.return.self__default_to_pandas_": {"doc_hash": "a4ba1d26fce8112c43537a5bf55dce02c85a15281f65ec632792a46649dc7263"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_sql_BasePandasDataset.to_sql.FactoryDispatcher_to_sql_": {"doc_hash": "96229c878191adb5741917dbd1c70b7abac6da98c8df60504c8cee6a7410aa5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.None_4_BasePandasDataset.div.divide.truediv": {"doc_hash": "3c5cc60ab7c20cae257ffeea131722cf5ad20c597c4d59ed10a141b7ccfca1cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.truncate_BasePandasDataset.truncate.return.self_iloc_slice_obj_": {"doc_hash": "b45db21194c89920c4f79685587671849a4ca6f6792d9cbd8ee6878f03eace73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.transform_BasePandasDataset.tz_convert.return.self__create_or_update_fr": {"doc_hash": "4ff54d7e6f108e404c295d65254d0cbead4f979679d41b2f92141527c53dd6b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.tz_localize_BasePandasDataset.tz_localize.return.self__create_or_update_fr": {"doc_hash": "2c92cb4f27628952a75a1c085b161f47a6277dc2261af5dda30364cadaebe10b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.interpolate_BasePandasDataset.None_12": {"doc_hash": "782cfa8ef4f969d4472cb1fe944483b1a8b291737c852a31315de2a595142da7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.value_counts_BasePandasDataset.value_counts.return.counted_values": {"doc_hash": "46a0d19011bd394eca4405cbdb14afc7d6238e19b8410fbf15337d551839ff57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.var_BasePandasDataset.__eq__.return.self_eq_other_": {"doc_hash": "c5f2c03e14638e156369bdc0364c54f9040affa7f2f29e1b57ed3a9831730950"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__finalize___BasePandasDataset.__ge__.return.self_ge_right_": {"doc_hash": "0ab3eec994bfb29e043971e8976f77a7b985bc82bcef3fddf7b9b6e895edc702"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__getitem___BasePandasDataset.__getitem__.if_indexer_is_not_None_.else_.return.self__getitem_key_": {"doc_hash": "2603a3f08b5e20115089cb816135436fb159f68a3715700cc37462e4353efa1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.xs_BasePandasDataset.xs.return.result": {"doc_hash": "569a951faab15c1b968341f166502293272a6a46a1342059377873ca70d995db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__hash___BasePandasDataset._getitem_slice.return.self_iloc_key_": {"doc_hash": "d8bed6c469deb01065c83bda6d53e3cfb02227e56e5b77bb300c4cc4acbc901b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__gt___BasePandasDataset.__invert__.return.self___constructor___quer": {"doc_hash": "5af0940a0fc73eb533ccb1529681c512fc8b19ed28398572384d75580f8a6074"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__le___BasePandasDataset.__rxor__.return.self__binary_op___rxor__": {"doc_hash": "849453bd5430f53a88612c16d80da67dd9cb06614dcf5469b1b73a2829a61c1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.size_BasePandasDataset._repartition.return.self___constructor___": {"doc_hash": "85fd46bbcf73663de3808362a982d925f0768737cc62b3caf453efe9e8d31cdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__getattribute___": {"doc_hash": "5ca48c3d0ba4788a520a5ea4952eefea2dfbc4c1e4ecb09a92b0266109bfe09d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_from___future___import_an_CachedAccessor": {"doc_hash": "122528f6a2959b0de5e403db13f71f27b07480b0f61f282d62f3552133838456"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame_DataFrame._pandas_class.pandas_DataFrame": {"doc_hash": "df29adfa6cb03771f5c78a005a1cae38e067223c522deb1b7c4a2287028a2a98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__init___DataFrame.__init__.if_isinstance_data_Data.else_.self._query_compiler.query_compiler": {"doc_hash": "4caf7367b98aed8fb4b428ef4b9b92c8248262266c33c24bf30669f0837927db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__repr___DataFrame.__repr__.if_len_self_index_num_.else_.return.result": {"doc_hash": "21eb6f862a96589144a165434ee8ecb94016eb0b9dfc3ce4476e2e4640653ca8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._repr_html__DataFrame._repr_html_.if_len_self_index_num_.else_.return.result": {"doc_hash": "bf6a2e9609ebee2d07ec498c93d0cecfa66ac0607f5e2b5219230126b5527029"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._get_columns_DataFrame.applymap.return.self___constructor___": {"doc_hash": "347a197643eff80a5040df16958335fce85954c018cd8975f0c70904ca0adf68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.apply_DataFrame.apply.return.output_type_query_compile": {"doc_hash": "4142bc5d22c3fee27100bab7aa3ace01502e4eabf8935db52e157c6300e81ba1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.groupby_DataFrame.groupby.return.DataFrameGroupBy_": {"doc_hash": "19781cf0942faafc2dd9d47f65a86efb93d9c107d6cbef06397dfa5e35716d2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.keys_DataFrame.assign.return.df": {"doc_hash": "94658169413ec75685979e851dbbb1fe3014197d418a963e5fc1e562335b8c47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.boxplot_DataFrame.combine.return.super_DataFrame_self_co": {"doc_hash": "6f24f597c868867836531cbd0318c5579acf6e9b302534bae7371d94ce782f4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.compare_DataFrame.compare.return.self___constructor___": {"doc_hash": "9be69cbe173ea0714e140dd079d840d7db46d708b54f908aa680076e2ff49a79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.corr_DataFrame.corrwith.return.self___constructor___": {"doc_hash": "8f464b623c5b9fa6db2c4fb2c71cb8330bcc23daa8bcfeb46a39dc8f74f19cd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.cov_DataFrame.cov.return.cov_df___constructor___": {"doc_hash": "25ebb7eae1d7900d4d2e8be260b61b1c16c8ce2ce8abfe12c0e87d4250e40804"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.dot_DataFrame.dot.return.self__reduce_dimension_": {"doc_hash": "b89ac17ec9e13b25a85149fbef5385b42897ebe1973cc02646d2809013128955"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.eq_DataFrame.equals.return._": {"doc_hash": "9e6b587351afb1f11a1482cc7614bd458799a0a6b7cc238eba2e3682cad38148"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._update_var_dicts_in_kwargs_DataFrame._update_var_dicts_in_kwargs.if_global_dict_.kwargs_global_dict_g": {"doc_hash": "847f590a83192f3e19df4c722dd8fdfff447337bd6007d1a756377371d6e6eb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.eval_DataFrame.eval.if_return_type_type_se.else_.return.getattr_sys_modules_self_": {"doc_hash": "50dbfe39ba9c2b1f63a6da61589b1760bd1cdaa0a6c28145ef8951199c01fffd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.fillna_DataFrame.fillna.return.super_DataFrame_self_fi": {"doc_hash": "8d094e339ad690abbc3b4ca3aa17f8da2e50ef2820bbc6aa74cd24191ab82cb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.floordiv_DataFrame.from_dict.return.from_pandas_": {"doc_hash": "1bb5dc4c1f64e81b5dab0eee09de80eccfe800931b254ec7a4acab3525e7dcc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.from_records_DataFrame.from_records.return.from_pandas_": {"doc_hash": "16a25787a13057560e6fa54adbe7b759b2c5a2ff9a82cef74247af034a2f1b49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.ge_DataFrame.gt.return.self__binary_op_": {"doc_hash": "b69687aa2dd4e1863ea723cd025c4453379bc3e602cc5e515f27157dc906ad38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.hist_DataFrame.hist.return.self__default_to_pandas_": {"doc_hash": "fa8839605464be5b7d708f8e923e2d0294ce0872d9977b595bd06cb6870bcb2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.info_DataFrame.info.info_render_": {"doc_hash": "f59ee64ec502d3d081d5f77d69a96dcf3151ffdc02aff4ae1509b2d5606c6ccb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.insert_DataFrame.insert.self__update_inplace_new_": {"doc_hash": "960e4056317ad263e6ce77ac364601bf623137aaafcb5df780587d39653e7a63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.isin_DataFrame.itertuples.for_v_in_partition_iterat.yield_v": {"doc_hash": "97a6740724174c72dab8896144b248ca8fb7882b06ee7c479d06e7d506069bfd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.join_DataFrame.join.return.new_frame": {"doc_hash": "3413fd0f72fcadc99d9e53ae1f2979828edebc861415986b50a4485bd6f09046"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.isetitem_DataFrame.lt.return.self__binary_op_": {"doc_hash": "6af902c18159b9e550ce50d433b28e11ec1a54234cfa1646bc54bed2f6046c33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.melt_DataFrame.melt.return.self___constructor___": {"doc_hash": "cd74ae7e2fb5007353156c4c37320f70d4a652e3bb5ee476c5d4abd325025d7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.merge_DataFrame.merge.return.self___constructor___": {"doc_hash": "4dcad68a7811b656f21cbd25ef22a627ca7ff5c13f225d7712ee66f299718bad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.mod_DataFrame.nsmallest.return.self___constructor___": {"doc_hash": "cf8085a8f373c1d4b7d5c45edd6696d194d5856ddbc6b48e40f2776a714e5d36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.unstack_DataFrame.unstack.if_not_is_multiindex_or_.else_.return.self___constructor___": {"doc_hash": "835ae5b29aa1bf6338665bfb925f4c6703e6ea7d7c66106b00abb55d75f08fdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pivot_DataFrame.pivot.return.self___constructor___": {"doc_hash": "d5206ff016f9c6e5ce20b367e4cec6058d638bfa208945524f8527777fc91c17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pivot_table_DataFrame.pivot_table.return.result": {"doc_hash": "ff2b8d2a119c587c79284ad80d2e3275b0f1325583837760ef178a6ff7a23f59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.plot_DataFrame.plot.return.self__to_pandas_plot": {"doc_hash": "c9d295288bcecff628eba6528ca08cebcf141f3ee472eac3358d72a7f7cf30b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pow_DataFrame.pow.return.self__binary_op_": {"doc_hash": "2b72997f1a5dc387c90bb52b331a2e5b333e2cb50cb600d262868b8e93420696"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.prod_DataFrame.prod.return.data__reduce_dimension_": {"doc_hash": "9d89fb290b39a41dbb6f8fefdd7c2fc5956996f521d9ef032cf08f8a8583cb8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.product_DataFrame.query.return.self__create_or_update_fr": {"doc_hash": "5cc2724b5179289dbb2956874db78a23f1cf48d887b42f9f7201a1149d028b37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rename_DataFrame.rename.if_not_inplace_.return.obj": {"doc_hash": "b824f4bb8fcc2b71933106580b53c6c35c1ae74af105447f2eec93d7ba8a3775"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.reindex_DataFrame.reindex.return.super_DataFrame_self_re": {"doc_hash": "641cd3304768ee0b257d53faf448718a30b3bb8dc01beb2cb755c4010e11fc4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.replace_DataFrame.replace.return.self__create_or_update_fr": {"doc_hash": "2720be18b589f96ec485a95507f6aa64dda3e657bdbd6931719065f662acb267"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rfloordiv_DataFrame.rfloordiv.return.self__binary_op_": {"doc_hash": "dd6dd9a9ec4f45425d7065d675f994b2a360a01014994ec8cc91f45597588beb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.radd_DataFrame.rmod.return.self__binary_op_": {"doc_hash": "5aeb8e135a70b53ce7105fabe0c88204899a3d821702140d146bb6e853352808"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rpow_DataFrame.rpow.return.self__binary_op_": {"doc_hash": "6a24b9f4f37850299178b16081ad1fcb35ae3d2d854ca3930021dac993fd6506"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rsub_DataFrame.rdiv.rtruediv": {"doc_hash": "c9e8fb61308b6df98f2f2ede1862b9c5bc9bc08b087142b19da033ce075142aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.select_dtypes_DataFrame.select_dtypes.return.self_drop_columns_self_co": {"doc_hash": "b718ef52cc7ef4f6df8df2c229e9bbf2e0210f25275968d0bbd52080c5ba85d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.set_index_DataFrame.set_index.return.self__create_or_update_fr": {"doc_hash": "e5f4476af1ba497532bcc17efa7db78e78a8746658af25fcce9acb89f7726a20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.sparse_DataFrame.squeeze.if_axis_0_and_len_self.else_.return.self_copy_": {"doc_hash": "9a25f0298506bebbf51f5b915f56316397b75d6c9614bd6c6c849b7cfd19a9f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.stack_DataFrame.subtract.sub": {"doc_hash": "5a75efc6a36f19c878acef99b7904f077818918ae3a87b712ef783955943c93b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.sum_DataFrame.sum.return.data__reduce_dimension_": {"doc_hash": "dc169afd265891f42986bc0c069f7f5638a1a44fd26a785f12012a8014f991c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_feather_DataFrame.to_orc.return.self__default_to_pandas_": {"doc_hash": "fd30dd45b39d7c60d37b2a4674bb09655f42086b621cc27843981671fabf331e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_html_DataFrame.to_html.return.self__default_to_pandas_": {"doc_hash": "8328dea7690be3fcdec44e2a6c87d2b1cbc2b9eb1e16ec6c58564503b672bb7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_parquet_DataFrame.to_parquet.return.FactoryDispatcher_to_parq": {"doc_hash": "7d3217d38b7be203acaf00c57e881f793274fa5d580fc9dfd0ed964135b42e33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_period_DataFrame.to_records.return.self__default_to_pandas_": {"doc_hash": "bc6eb2d9cb937b13a759a76e6237afab342e6002b28ef13c3c3764e8dc1a7095"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_stata_DataFrame.to_stata.return.self__default_to_pandas_": {"doc_hash": "e1f5043e53d075e85870960b1bf5b5ae18b936083433252928d6c45192d24bc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_xml_DataFrame.to_xml.return.self___constructor___": {"doc_hash": "a8b2564f5c6ec4e19bceb2390ae57495e4b90a0e4a4d5c31ff3cb337e1af696d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_timestamp_DataFrame.truediv.return.self__binary_op_": {"doc_hash": "1dfe10871cfc2327cadfd5cb48290d8fbb240453db2ddbecfb6090bc287a5354"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.div_DataFrame.update.self__update_inplace_new_": {"doc_hash": "71eb30b92a028b33396bae530ba2596ed6c5702a78b1961fca1fcb45eca02e53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.where_DataFrame.where.return.self__create_or_update_fr": {"doc_hash": "a25e1bb46853259a8d9f5ae95abde67dbcd74b72702ed107a43aeee02db1a0ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._getitem_column_DataFrame._getitem_column.return.s": {"doc_hash": "fd0fc3c7a0e5540efb66985724576130d3908bd4940570b03b59386a87873e40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__getattr___DataFrame.__getattr__.try_.except_AttributeError_as_.raise_err": {"doc_hash": "df4a6eb7d7e10751d00ca16f6429f060530062501a3beaae8d2f375cf118fcbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__setattr___DataFrame.__setattr__.object___setattr___self_": {"doc_hash": "293fff29bf82e860059dd7c0fd7e9cf4ef425f1a3f682e731470ec2f07e76687"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__setitem___DataFrame.__setitem__.if_not_self__query_compil.else_.self__update_inplace_self": {"doc_hash": "b0be81974b9b13c5f7d3ebbeb317b56e7009396debffefb4188f7ec75d0bd1c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__iter___DataFrame.__rdiv__.rdiv": {"doc_hash": "1900e569d6b07fd5f40379b558c6c7343815f1eaeecb9afee88999ac2738aed2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__dataframe___DataFrame.__dataframe__.return.self__query_compiler_to_d": {"doc_hash": "0249867226e5a82cfbd8f95abac0c0cddb822d517ffc1a7cf04d993d515d2276"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.attrs_DataFrame.reindex_like.return.self_reindex_": {"doc_hash": "84881e6ae93ed8ac6fecc0a779547a46ea8f3a8d5528fb167c4fee588514746c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._create_or_update_from_compiler_DataFrame._create_or_update_from_compiler.if_not_inplace_.else_.self__update_inplace_new_": {"doc_hash": "7e7624ef46b50ddfb31f71ba5e21f365cec6431e91467b0c6eef1e36cca18e01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._get_numeric_data_DataFrame._get_numeric_data.return.self_drop_": {"doc_hash": "c3a90e509d00090e348dcb3e012a32036cfdc3f1f387afde7065f0f1688f7967"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_DataFrame._validate_dtypes.for_t_in_self_dtypes_.if_numeric_only_and_not_i.elif_not_numeric_only_and.raise_TypeError_": {"doc_hash": "5a55c3f887fc918bde7967572f619d918674eca6eff50ac801bc1a6a9cff80fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_min_max_DataFrame._validate_dtypes_min_max.return.self__get_numeric_data_ax": {"doc_hash": "e075defa75c8a0bcc20044f964ceeefb14158e0b739b03c9326f42cb7f7177d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_sum_prod_mean_DataFrame._validate_dtypes_sum_prod_mean.return.self__get_numeric_data_ax": {"doc_hash": "f0861526cfcb31696e9a2584d1e4db882c0663843e3b3ae73643d189327394cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._to_pandas_DataFrame._validate_eval_query.None_1.if_parser_in_kwargs_and._pragma_no_cover": {"doc_hash": "906640eddd7713daed32f3ddf16a2eb6317d22c4d318dce07168f8b40b3ec520"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._reduce_dimension_DataFrame._set_axis_name.if_not_inplace_.return.renamed": {"doc_hash": "55da7fc4c13e24bda3cbf7d8ced253f35f68476141a5b734d5a3ead5f1bee1d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._to_datetime_DataFrame._getitem.if_isinstance_key_Series.else_.return.self__getitem_column_key_": {"doc_hash": "f8e7fbbecfb36fe37bb9a0c7968e79da77b2fda8cf7ecc159d56332687f2726c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._Persistance_support_met_": {"doc_hash": "938ddcb4906548c1bbad3bf2ef0e1155db054e81502efe39dd6ac9ad8f6579dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pandas_notnull.notna": {"doc_hash": "5d32b85eeef54ffd21c00779424a91ccd4b180ef1bda8749551bd5b9efffce79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_merge.return.left_merge_": {"doc_hash": "f57505e9f29da7a40cfd84785b3784114a76a290fdb1d1da6ad307a7fa6061b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_ordered_merge_ordered.return.DataFrame_": {"doc_hash": "bad5186f947ad3a68d224d0d2c376859c3af5d321e71beb36cbb7a65a554951f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_asof_merge_asof.return.DataFrame_": {"doc_hash": "92537251872ea56b7751789fec724ec3bf9a5db3a86f068782fe782c6fa50169"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pivot_table_pivot_table.return.data_pivot_table_": {"doc_hash": "9416de4a6c97da3de85bad6ec7ddfb0c83fca1385be36e97fe65afac2662a555"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pivot_pivot.return.data_pivot_index_index_c": {"doc_hash": "5bc8f7315dc106ec9df3f3702fd320cac27349c5d1e4430b915a04a844b21458"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_numeric_to_numeric.return.arg__to_numeric_": {"doc_hash": "3bf1d9262b08b14dd768b7e2d06fff507c9fe8eddef25271e06d20895c83e56d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_qcut_qcut.return.x__qcut_q_kwargs_": {"doc_hash": "dc60e84aa5438c8c3241a31794bef0ac2092dd548d21ae8e559e1af168569e35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_cut_cut.return._wrap_in_series_object_": {"doc_hash": "085d86f2d2c0fcead247d937d6460ce217f7f1000f2dcf801fec3debadd7d976"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_unique_value_counts.return.Series_values_value_coun": {"doc_hash": "18691ad05b19824e13176bfd15d719826326f71aee2094043df5a0dd43dcaf80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_concat_concat.if_keys_is_None_and_isins.keys.list_objs_keys_": {"doc_hash": "70b0bc0aa99e6025b41557bc5040c95b364e005c848c9d41481c0b69f36ec8ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_concat.if_keys_is_not_None__concat.return.result_df": {"doc_hash": "6ed8299352f71cda6b4fd16aa88f937594fb6dc3af1aedf20a4304ff2fb46268"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_datetime_to_datetime.return.arg__to_datetime_": {"doc_hash": "1d244a8548fa008f8fa13b2f58e8c3f0b903a6dc2640cc38c912d3befcf6fc43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_get_dummies_get_dummies.if_not_isinstance_data_D.else_.return.DataFrame_query_compiler_": {"doc_hash": "dd1fd9f6cfb5d53b3b1eeab54601d0c2f8bbf1244a5db388c208610eb5290401"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_melt_melt.return.frame_melt_": {"doc_hash": "9e28f0771706eeb06139897384018f9d7955c04b0e4207a8f566f7306d9a5474"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_crosstab_crosstab.return.DataFrame_pandas_crosstab": {"doc_hash": "1c099afc0f2cdf357c11a0dd93087a13391916e29178955a6b6d91344c1cb5c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_None_14_lreshape.return.DataFrame_pandas_lreshape": {"doc_hash": "83774bf61767870b8245cce49f18fcac58d5db9a4c19d320a0550fa433f0430c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_wide_to_long_wide_to_long.return.DataFrame_": {"doc_hash": "02f149219401d5bf25ee21cde362e06705522f7ba02dbd1a92b96326723f35a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py__determine_name__determine_name.if_np_all_names_names_.else_.return.None": {"doc_hash": "59caeb1fb2558a0e30ceec8e47374fa4c250897c0f70a21226da0dfbc8e3de2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_timedelta_": {"doc_hash": "b1d20fcad7e37afa43b066bdaa3077175de2d882f13a9f6468cb20842bae9366"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_np__DEFAULT_BEHAVIOUR._": {"doc_hash": "9731cca26a634553b156a80d5e677ca03a99a66eda667deec38b6aa8b7af866a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy_DataFrameGroupBy.ngroups.return.len_self_": {"doc_hash": "345a11305ce8542e215a56650cc0b422660dffa4d69cb8f616b18f8f74121947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.skew_DataFrameGroupBy.skew.return.self__wrap_aggregation_": {"doc_hash": "d5244f32244bfc64a77b82f57e63315d15cb5f3829d48904e6c4183b017a8e44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.ffill_DataFrameGroupBy.value_counts.return.self__default_to_pandas_": {"doc_hash": "b1f9df1352f735fd6e019360db345d43983ed93557c82198f370cb4a9832a55e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.mean_DataFrameGroupBy.mean.return.self__check_index_": {"doc_hash": "ff3926709649d4a66a0ed2962e3885c486cee76c5e73c0738155082d1ce43ead"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.any_DataFrameGroupBy.groups.return.self__groups_cache": {"doc_hash": "f9edd904668e3848b37f71664fefa510bd80f41711b3f8cd55304961630e1a5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.min_DataFrameGroupBy.min.return.self__wrap_aggregation_": {"doc_hash": "c9ce04954b7e03cc989abab1250e390e5350fcc1c7c97a633ea1fee754b4a8db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.max_DataFrameGroupBy.max.return.self__wrap_aggregation_": {"doc_hash": "fcf9408c9ab7c227f5279abb6ad27d810051a9ae22915a3f8c9178ad1c7dd1e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.idxmax_DataFrameGroupBy.ndim._ndim_is_always_2_for_Da": {"doc_hash": "c539180e35235825f3d08b86b17b07a0846455ed0f29e0f43635ea76ead9e520"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.shift_DataFrameGroupBy.shift._shift.return.result": {"doc_hash": "fe4601c3363cc4dc11cb9556c9ec090ce8829e89c1a312e3fea4c00ee8ed4bbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.shift.if_freq_is_None_and_axis__DataFrameGroupBy.shift.return.result": {"doc_hash": "31518efb3dda5e72c70d7bff3e7de0c6430f0e1889119853e2b505c347ec1554"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.nth_DataFrameGroupBy.nth.return.self__check_index_": {"doc_hash": "562aefd7e81382b852842d40d4d32dc9a6909e3177f6c7ab5005f67d07d93c81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.cumsum_DataFrameGroupBy.indices.return.self__indices_cache": {"doc_hash": "6e555526c04ee0ec37168d953347ec12c31e036351ef4a3bf400a7cda8b9f38d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.pct_change_DataFrameGroupBy.pct_change.return.self__check_index_name_": {"doc_hash": "0a628339f923fb20a4ebd2610cfb17d2f369a39b53b45743257f9a27d3dd5a31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.filter_DataFrameGroupBy.cummax.return.self__check_index_name_": {"doc_hash": "be445a2527230f6b2468bb1e4b72e739e8fe642c4094da9d90c3e37fb9de9780"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.apply_DataFrameGroupBy.apply.return.self__check_index_": {"doc_hash": "6d4d6cebeb6c3a6859f5892f0da05e547b0f5b7f01eb20c32b28d2f36ba01821"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.dtypes_DataFrameGroupBy.None_8": {"doc_hash": "657a2601ba4df0036e3634f6b09a55fbb6855a80351408580239e32398b80300"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._internal_by_DataFrameGroupBy._internal_by.return.internal_by": {"doc_hash": "a2ba30522abda8980c789f10e02173910c46b82ee741ba0da49d7d426b115e6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.__getitem___DataFrameGroupBy.__getitem__.return.SeriesGroupBy_": {"doc_hash": "912f20102d083eb2b7aa887489d4157f90defd6408d2aeef23746292913a720b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.cummin_DataFrameGroupBy.prod.return.self__wrap_aggregation_": {"doc_hash": "a17368895c3cb837c69a268cded744e6a9a5b8fbf3123fee3b096f38c98f5785"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.std_DataFrameGroupBy.std.return.self__wrap_aggregation_": {"doc_hash": "293f0bfaa48fd1dcf765bd390a395185fc35ef3df8095182809c1dbe1c3a2218"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.aggregate_DataFrameGroupBy.aggregate.do_relabel.None": {"doc_hash": "6dc433383d7ac4d016fac416bf29804be8deda568e12c3cfc518f050eef8f020"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.aggregate.if_isinstance_func_dict__DataFrameGroupBy.aggregate.return.do_relabel_result_if_do_": {"doc_hash": "251e21cabdacc47adaf277fdb1f4bc5791d7510bc5017be832b02c61eb847132"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.agg_DataFrameGroupBy.corrwith.return.self__default_to_pandas_l": {"doc_hash": "1938609359129cb327787dd18b74add3cf1a0089d21d2fbe25948dad018d9875"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.var_DataFrameGroupBy.var.return.self__wrap_aggregation_": {"doc_hash": "783a68e6c868c0685fe7bc5dd7d3743f8cdffe1b93d28c0167cc6b3ed11106cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.get_group_DataFrameGroupBy.all.return.self__wrap_aggregation_": {"doc_hash": "bbe4c75040af6e4f6da2f89cab233a7cf3da0af817939e7435b1fcd8871b5818"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.size_DataFrameGroupBy.size.return.result": {"doc_hash": "7f081ce7d96a07c0d5f62d1c0c17def83955ecd516d021da1341a0b5e28e2525"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.sum_DataFrameGroupBy.describe.return.self__default_to_pandas_": {"doc_hash": "222c7e6f059cbbf9a5c104b80e21b6c98f3888a41079731b5b7bf752c7ae6f56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.boxplot_DataFrameGroupBy.boxplot.return.self__default_to_pandas_": {"doc_hash": "ca054e12bf4cd7a5e9e65f1c684be6ae3364aed53efb51241c9601e7e4c378c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.ngroup_DataFrameGroupBy.cov.return.self__wrap_aggregation_": {"doc_hash": "b525894376ca3dca3b96d764bc63ee72a7492346d3138c28b65c4f073dd99853"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.transform_DataFrameGroupBy.corr.return.self__wrap_aggregation_": {"doc_hash": "e99d331c45e29362ec31946ee59616b14b155372314c8c9560b467f4474000ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.fillna_DataFrameGroupBy.fillna.return.work_object__check_index_": {"doc_hash": "7629359c6202712efbf07cb37f8849aa30efbeb9768118352db4fee15018d531"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.count_DataFrameGroupBy.rolling.return.self__default_to_pandas_l": {"doc_hash": "a050096ddfcb3c23f59dacbfb14b895b531e12788ae6d79c58aa7bc8f21ad7a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.hist_DataFrameGroupBy.hist.return.self__default_to_pandas_": {"doc_hash": "24ec0f1b7c49af655bda12a7dac17a291d1ae399e9865f70b3a971da439c5e78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.quantile_DataFrameGroupBy.quantile.return.self__check_index_": {"doc_hash": "a8df8de73d3d5afd26f5afb5e19274763b50e0d931efa4cfe8ac495613916d7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.diff_DataFrameGroupBy.diff.return.self__check_index_name_": {"doc_hash": "68062ab0fce63310d88415740720befdcac303531b2f25e258edf4fc6cbf87bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.take_DataFrameGroupBy._as_index.return.self__kwargs_get_as_inde": {"doc_hash": "a089c661682a57cb3ee7a6d176e894e0ca7ec881cf4498df7f649ceca4f41ee2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._iter_DataFrameGroupBy._iter.if_self__axis_0_.else_.return._": {"doc_hash": "ab261a7aaff4d9b1871cf9513d8563461c48e9c56c2ab8accedfab9300999509"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._compute_index_grouped_DataFrameGroupBy._compute_index_grouped.if_is_multi_by_.else_.if_dropna_.else_.return.groupby_obj_indices_if_nu": {"doc_hash": "66a424156ac906449cdcb9ed979ae5e39ce8d1deb7adb5666ae0e8b49efab3d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._wrap_aggregation_DataFrameGroupBy._wrap_aggregation.return.type_self__df_": {"doc_hash": "2adf1ff8e7dc5c1688cf94f1ae4790ec6df2cbcc9643ed70b9dd96430fffe7c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._check_index_DataFrameGroupBy._check_index_name.return.result": {"doc_hash": "033743af207e152293da9b7479307fb84796e0754ccff570722331efb97a8127"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._default_to_pandas_DataFrameGroupBy._default_to_pandas.return.self__df__default_to_pand": {"doc_hash": "fd914a4e46e561c19b2bd1fe44dbea3d7bbf07606bd6ce64a6d2802022eff13c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy_SeriesGroupBy._iter.if_self__axis_0_.else_.return._": {"doc_hash": "434b8908f537eb2139d7c652450cbaa50d3c6ee4162e3d284707dd6e1375cfd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy._try_get_str_func_SeriesGroupBy._try_get_str_func.return.fn___name___if_callable_f": {"doc_hash": "1bbd0609ed54c0ef9f1c180a79cd37ee1a287a82fbb822e8f1e0668a79558618"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.value_counts_SeriesGroupBy.idxmin.return.self__wrap_aggregation_": {"doc_hash": "422e6b6a09929618c72ede80a2c450a5b0acc79f84d0d1467ade37a76d41d7ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.hist_SeriesGroupBy.hist.return.self__default_to_pandas_": {"doc_hash": "a7043df0e7a0641076598bbe52d204b1f528ae9757e3f8e7b0b4e9cd88b67a97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.is_monotonic_decreasing_SeriesGroupBy.nsmallest.return.self__check_index_": {"doc_hash": "95c60a3edcfb2e296d3507221ce48ade7af5476b37d3e9aa6336e882d06df580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.aggregate_": {"doc_hash": "d4efd017524326a8eb30730a196b913a1aa4e5cfd948af17b5a206167a25b253"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_np_is_tuple.return.isinstance_x_tuple_": {"doc_hash": "7bc80ed70c8188bdee18ca1661b91b3792a91676d9fe209d4ff13baabf8e5e8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_boolean_array_is_boolean_array.return.is_list_like_x_and_all_m": {"doc_hash": "b7cf00a5b599c6a401a47923a53a1a7f0e4a38e9405ce191c2960164536420dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_integer_array_is_integer_array.return.is_list_like_x_and_all_m": {"doc_hash": "c8c5d3261cf3668607e7564b3e7de9c486c0d758a6eeea43aaefc182bc678667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_integer_slice_is_integer_slice.return.True": {"doc_hash": "af55dd8ed50ec1ec4ec1fff9d6469464124f0e5a9654ffaaa9f0d39d66c4dd3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_range_like_is_range_like.return._": {"doc_hash": "193598c1bba1bc1015295b51bea4218b4983a14f731cc575daa006f2d1f20a43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_boolean_mask_to_numeric_boolean_mask_to_numeric.if_isinstance_indexer_n.else_.return.np_fromiter_": {"doc_hash": "30f960d1e093922a989685ad40ebd92dc8361e2c6278c035214b486891d6cffe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__ILOC_INT_ONLY_ERROR__compute_ndim.return.ndim": {"doc_hash": "78f5f876ce6fca0e3e35c7d1bb63e13921a5c99d97ab9f808e9c86f13974e0f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase__LocationIndexerBase._validate_key_length.return.key": {"doc_hash": "b4f5228c718634b866c6d3e5ab7810ee449a42cef4240bb23c3c4b817ac79db3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase.__getitem____LocationIndexerBase.__setitem__.raise_NotImplementedError": {"doc_hash": "4b949badbfd3175ca38a53b93425e89aba57e621e56cd15a96d0dd16a2bfa6a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._get_pandas_object_from_qc_view__LocationIndexerBase._get_pandas_object_from_qc_view.return.res_df_squeeze_axis_axis_": {"doc_hash": "e373dc12981ab8fb3b2e815a012820b79ca99feff541f3f202299dbfd8b36ba1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._setitem_positional__LocationIndexerBase._setitem_positional.if_axis_0_.else_.self__write_items_row_loo": {"doc_hash": "a30a3d7944db9d97ed4b9ed305fc45bc592da2a4603b2c336f4db4d319ade026"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._write_items__LocationIndexerBase._write_items.self_df__create_or_update": {"doc_hash": "408f3e128c51aba622f321f32edc55b8139358ac3c05e62e9a0468e03664e6e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._determine_setitem_axis__LocationIndexerBase._determine_setitem_axis.return.axis": {"doc_hash": "ae4cc278b75a3b82b1ffef3f37aef938c832c9eea270c46ed22c6fba05995f57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._parse_row_and_column_locators__LocationIndexerBase._parse_row_and_column_locators.return.row_loc_col_loc__comput": {"doc_hash": "af88fb8e22c8fb69588fc940dd88d1d10c1a891f39145843d7e75078c85e9c55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._HACK_This_method_bypas__LocationIndexerBase._when_QC_API_would_suppo": {"doc_hash": "8279c8fff10d86731a3f4a195f973888bd7df470d42c695dc32da23a37284dce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._handle_boolean_masking__LocationIndexerBase._handle_boolean_masking.return.type_self_masked_df_sl": {"doc_hash": "385176e83d24fd2449982c7a526540b4d1a4880074877cfb65b861366162195a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._multiindex_possibly_contains_key__LocationIndexerBase._multiindex_possibly_contains_key.return.isinstance_key_tuple_an": {"doc_hash": "a4d1bfc923f7666f74437a999ef755c37660869bd1cb2471ba000fe6a2f39353"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer__LocIndexer.__getitem__.return.self__helper_for__getitem": {"doc_hash": "745e767be971dfa6681bfc6dd9463e2a1a02aeb47b5d7ed9ddeb796cac02b2d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._helper_for__getitem____LocIndexer._helper_for__getitem__.if_.if_.elif_not_isinstance_row_l.result.index.result_index_droplevel_li": {"doc_hash": "ffbed35f3476cae0e6742a68954d1ce41a1db085a36e401836b3f83679092c27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._helper_for__getitem__.None_3__LocIndexer._helper_for__getitem__.return.result": {"doc_hash": "78c5d9c942ab2bce02130fbcf814c8102e8e205cc88393d527f6157a4635fcc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer.__setitem____LocIndexer.__setitem__.if_ndims_1_and_append_.else_.self__set_item_existing_l": {"doc_hash": "111e1a04dd3c2951df0163171bfbd7332ad881d7cdc835253dcf0973027b9ab1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._setitem_with_new_columns__LocIndexer._setitem_with_new_columns.self__set_item_existing_l": {"doc_hash": "75494ee0b943d20891b4c26d9dcb5936046c715bf0849e9bbd5f071b3a3f9fd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._set_item_existing_loc__LocIndexer._set_item_existing_loc.self__setitem_positional_": {"doc_hash": "2c5cbe7a175fb4c81a3b15529e6a4b47096eb46c227a0c203936c80dce9d2386"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._check_missing_loc__LocIndexer._check_missing_loc.return.None": {"doc_hash": "a899fc485f0fb57b8347caf4ce5563c04fda262972c3761403a7de27999d0d8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._compute_enlarge_labels__LocIndexer._compute_enlarge_labels.return.nan_labels": {"doc_hash": "8cf432cbc7e4bf3b750578a2d5675ca6bcaa44d67976f646002590625a3e18fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer__iLocIndexer.__getitem__.return.result": {"doc_hash": "2c5fabdb2541d752b380ceabdd49155dfbfa5da1317c068eea5d4c4cca27ad37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer.__setitem____iLocIndexer.__setitem__.self__setitem_positional_": {"doc_hash": "bb84150f9f7ddbb8b95c4628f93c5744c242998411f02b6c5cd5b6b3a5dcfe83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer._compute_lookup__iLocIndexer._compute_lookup.return.lookups": {"doc_hash": "c20271978b9421e5f6cb2260a190958d389d22e79ddb6fe4f061c7c2da319dc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer._check_dtypes_": {"doc_hash": "69d8d850c93625a0df4bf1f0e6e67be2fbacac02635dcf7346f2333bca5c012a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_from___future___import_an_from_modin_utils_import__": {"doc_hash": "3ec5f2cb9afe9344eed728a4f955fc18df951f319a76d26677a8a1fc9da4fde0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py__read__read.return.result": {"doc_hash": "8469326ee081b420320bafeec303af49fbcbb226c48d69bedd05014bee1b611e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_xml_read_xml.return.DataFrame_pandas_read_xml": {"doc_hash": "afd1198c7e600a510a8d726da94a550c06321b5476c62fbe1b475bdc14cabdad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_csv_read_csv.return._read_kwargs_": {"doc_hash": "1d0e49beeaf0dcaa4c36edd2e41ca6bafb6ab80708079d9fd594f1532e0f19be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_table_read_table.return._read_kwargs_": {"doc_hash": "d4c69b562ffbcf7c800fe08dd792965842069fcf0135d8a63a577a90fb206a60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_parquet_read_parquet.return.DataFrame_": {"doc_hash": "ceac5c764f1b2f64b4dc0c947e6d2a49789a023cba2f2a753463a2f85f3d95cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_json_read_json.return.DataFrame_query_compiler_": {"doc_hash": "81b3e503ccc7ccb23bb98e7d837cebb277b342ac9eeea7fc7ca9f4ec044f2ee6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_gbq_read_gbq.return.DataFrame_query_compiler_": {"doc_hash": "8fd0737b641851c41e1a2e631eb29ab1a7ff8e715a23f2b19409652ba5119449"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_html_read_html.return._DataFrame_query_compiler": {"doc_hash": "a9ceed5d33a191e08768e2d9fe3ccffdc8edffc7a06109aada120a900a7751c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_clipboard_read_clipboard.return.DataFrame_query_compiler_": {"doc_hash": "d144be0193e7cd4c5994d7cd86cd48c2ccf994b976574e5674999a01f421b16d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_excel_read_excel.if_isinstance_intermediat.else_.return.DataFrame_query_compiler_": {"doc_hash": "6dfa1bb390038e81680ea3ef526cbc59e29377251441e3162752912576e2245a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_hdf_read_hdf.return.DataFrame_query_compiler_": {"doc_hash": "906690b3f347ac20cf3e5eed17e6b241c1227dc1942be83919a4e8a10f4a10e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_feather_read_feather.return.DataFrame_query_compiler_": {"doc_hash": "8487dba2ef18f4851580cd5dbe8e7ea9d3935c3e4857de0c9a807ba465fa75ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_stata_read_stata.return.DataFrame_query_compiler_": {"doc_hash": "c5a9ea705a68f9124d4f522a7be88982c7a8dcd61edf66e02d71c946abdbc6ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_sas_read_sas.return.DataFrame_": {"doc_hash": "144456e7ea29f8c79363f374f346b7d828443da1adada8b23a89431896895f53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_pickle_read_sql.return.DataFrame_query_compiler_": {"doc_hash": "60e26704b795dfcf2372f88b5b3421571483fdd2aa60c092a69af21a99402d85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_fwf_read_fwf.return.DataFrame_query_compiler_": {"doc_hash": "c5d7b74b61d869de2105f55791d627cdfcb724216bd4b2e2edf03e208caecc90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_sql_table_read_sql_table.return.DataFrame_query_compiler_": {"doc_hash": "da4a530b6a7b689294e124701b1ce717618699f2330881d2ed285c9e90526576"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_sql_query_read_sql_query.return.DataFrame_query_compiler_": {"doc_hash": "ba65eed642cb21e57984d4fce444e33e073902022561026d2e24be09fc1d142e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_to_pickle_to_pickle.return.FactoryDispatcher_to_pick": {"doc_hash": "662ed19f05c80a6fafeccb5bf4afaabb72fa8edeece4e4cec6c55b3e88108d60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_spss_read_spss.return.DataFrame_": {"doc_hash": "6a8a31f8de526af5aa4b850e57e315cdeaaf47bef1ce98904b3d0c02d8ba7ad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_json_normalize_json_normalize.return.DataFrame_": {"doc_hash": "f521c7d78e5b8be2c7c5e6a0b44772371bc9d284a6647e41901d60ef31da8df8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_orc_read_orc.return.DataFrame_": {"doc_hash": "fa4fe137f3bb657264cdaa7de59080001e9f5ec76fad21d9c794bb8046d09587"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_HDFStore_HDFStore.__getattribute__.return.method": {"doc_hash": "08fd4189b8b1c0b03a6ee04b22f3c08dd92d46fb46087566f854b8b4f434250b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_ExcelFile_ExcelFile.__getattribute__.return.method": {"doc_hash": "9acede3e82283ff840df1fd34ecf441dccc3dd236984e882387c737885397e2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py___all___": {"doc_hash": "f9b7d26941dd0481fdea037d7324b0909d7a10878240327e5ec8908453e6bf79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/iterator.py_from_collections_abc_impo_": {"doc_hash": "d1fc04789c92ee8f98eabd21668546b2bbfa06f3c1a7849a681d76c853c37cce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/plotting.py_from_pandas_import_plotti_": {"doc_hash": "afa64127b61143d8ed90cee63df685b50ac9e891f0781b83f645da17046647fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_np_Resampler.__init__.self.__groups.self__get_groups_": {"doc_hash": "acd4ec29d36508299c9be7fa166fd4629094aad58345d4f641d2eaa369e4ed96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler._get_groups_Resampler._get_groups.return.groups": {"doc_hash": "7b50f28068543a996c1b9d0ded5c380029582ab48ba67859e671ca36103aea52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.__getitem___Resampler.__getitem__.return._get_new_resampler_key_": {"doc_hash": "13ba19b55bc84aabe5ed25b6d6a0ae4e224922d03d551ac9c5d7695bdde685e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.groups_Resampler.get_group.return.self__dataframe___constru": {"doc_hash": "7d94323a7b91806bef992efa667b8cc8125245e951206033bbbcb33411679fd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.apply_Resampler.apply.if_is_list_like_func_or_.else_.if_len_dataframe_index_.else_.return.dataframe_squeeze_": {"doc_hash": "20c610ade3116e319b6428c83b206889fff8a5ebdbdace5745836f809d479f5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.aggregate_Resampler.aggregate.if_is_list_like_func_or_.else_.if_len_dataframe_index_.else_.return.dataframe_squeeze_": {"doc_hash": "7e55091b2aaba75c53917d9c8d1e2749bbf305a8899ea1bc3a22e4bb4d01a206"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.transform_Resampler.asfreq.return.self__dataframe___constru": {"doc_hash": "6323ecbd18a0837f72b75da5580c3ed42b509caad3e83887db36c4880ac7e7a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.interpolate_Resampler.interpolate.return.self__dataframe___constru": {"doc_hash": "ce57c3aa8b2e1c72e3b5839c765e7827e847017bffd9e8bfee49fb7c5a8b1da4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.count_Resampler.std.return.self__dataframe___constru": {"doc_hash": "0a8c0dafbf2248e20639defde4796f3499bba8b8df9527eda99d1b5b0f0f7179"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.sum_": {"doc_hash": "aeb8d7c1ce45e88eb7b453118c39647fd27d1f7b3822c8503f700a5da0312431"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_from___future___import_an_if_TYPE_CHECKING_.DataFrame": {"doc_hash": "1add9f9d2aaac2b449c2f309bb83a7beeea0086587c99498bdf0cfe2bf35c6cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series_Series._get_name.return.name": {"doc_hash": "05522484229cecb17ba1fa19043e4737d0d29075f3dc8161db33c420c3a86771"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._set_name_Series.__delitem__.self_drop_labels_key_inp": {"doc_hash": "2e339c75513b82b223099cd7ec40595c315f55420fd707d73314b063962e01fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__divmod___Series.__rfloordiv__.return.self_rfloordiv_right_": {"doc_hash": "4a4ccf5ba5a24cadd865950e008ca4436bc1ec60d21819170857d90b6b03f6f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__getattr___Series.__getattr__.try_.except_AttributeError_as_.raise_err": {"doc_hash": "f286174e8112179e6a9b5d391b5fe4c3c9086a7bf61d2c207479c17e668f05c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__float___Series.__rpow__.return.self_rpow_left_": {"doc_hash": "79e94ea99b7203bc8b398288d6da801ff6d48771b698f3a0d10f2928dfb9a018"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__repr___Series.__repr__.return.temp_str_rsplit_n_max": {"doc_hash": "e389462d111857fe4980bdd65fab88cda1dc7b3aa6f502995b068802b257a519"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__round___Series.__itruediv__.__truediv__": {"doc_hash": "0823d8ad191cff9a47c1667bd54c895cce81e4966d96e75512ade52ae0d10444"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.values_Series.values.return.data": {"doc_hash": "bd25827c3b2824ee99ce58f0d5398cc553eda41d32130b2de03bf7e0c8c471ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.add_Series.add_suffix.return.self___constructor___": {"doc_hash": "3953494d140b9de21de57c3d8a7f8a31300f33a8a3d72031f1d8945e20022fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.aggregate_Series.agg.aggregate": {"doc_hash": "78c6cf3d24cec3d5bf853f32e4152377f9407895c48976e99f3ff34019b46b3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.apply_Series.apply.return.result": {"doc_hash": "4eb0b2b2b2fefaaef0819bcadab5572a81555cd1faa6c522afeb3f734faf2004"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.argmax_Series.combine.return.super_Series_self_combi": {"doc_hash": "34ae7a83342afb8f8167e85fa5545024817e9ad706b61cfdfcf97ee021c25b51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.compare_Series.compare.return.result": {"doc_hash": "3e07e9b1421ac003b4d8778da85adbe31c747e77c49ce046951f051e5d09b37d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.corr_Series.corr.return.self___constructor___": {"doc_hash": "1d909fe7210afdfda01c481c3ed2ccd7471f6c171257bd806142d259b9bb0d95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.count_Series.cov.return.result": {"doc_hash": "4a5a8882a86f5fd3edf896e65f7892d0624e2edeb061f726bc381ab8e5ee3009"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.describe_Series.diff.return.super_Series_self_diff_": {"doc_hash": "c2ad88940a0ea084a6ca6a4844360f32a2735e24e28b7b3b05f1bf250eedb55b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.divmod_Series.divmod.return.self___constructor___quer": {"doc_hash": "b91a338ae1b0108a42c5db9ebb21005ca42c978a1f3d3d96a0f24d0cfa563e10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.dot_Series.dot.return.self__reduce_dimension_": {"doc_hash": "8d82f03216e0615e15c025ec372060d89cbb7866d54888ee802eb09a486d46f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.drop_duplicates_Series.factorize.return.self__default_to_pandas_": {"doc_hash": "820859a4ef3d2145efff00b058ea737a7fe8ea0bf617c838dbd6b54d41650b38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.fillna_Series.fillna.return.super_Series_self_filln": {"doc_hash": "ad92ab6d4a82ed7480ec0c9dfeae0566242c786405656f6768f57770526fc65e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.floordiv_Series.ge.return.super_Series_new_self_g": {"doc_hash": "89ff6225747786f18c3d3d49e07ef11c0f10c47eb5f2bf1a2f63deb5529ba71f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.groupby_Series.groupby.return.SeriesGroupBy_": {"doc_hash": "c9b37bb050d7cbcf90c70f4ec4275bbd8dd0e6f887fd086f7ecfb80a388e7fa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.gt_Series.hist.return.self__default_to_pandas_": {"doc_hash": "2bd0736bda067f63f3eefa94849f3142505dc72313dcf6edd578e315fe628335"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.idxmax_Series.lt.return.super_Series_new_self_l": {"doc_hash": "2db27b0004356b131af2a88ef7bcfff872191d359a88912b178f6de01e73894a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.map_Series.map.return.self___constructor___": {"doc_hash": "55ba5b49880e6dbd6369f9e601e80aa651b76717ac7fe09b3b0e0db062e5f216"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.memory_usage_Series.ne.return.super_Series_new_self_n": {"doc_hash": "b9e3bfa64c3cd04110008518dd16ba8444d11be2eb1875a3a643b60128a9320e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.nlargest_Series.nlargest.return.Series_": {"doc_hash": "284931081f6babcba247bd56f9f1ea6101605bb0f14d2a7f2c7fc80370f392dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.nsmallest_Series.nsmallest.return.self___constructor___": {"doc_hash": "d793ada2f75931bf30c73767b8e8e130943c81d57334a324a25a10ad7bb455fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.shift_Series.shift.return.super_type_self_self_s": {"doc_hash": "e772058c7237109fdab3bcd9c81a13002f5371c2ad53b4c25c6294933368c53d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.unstack_Series.unstack.return.result_droplevel_0_axis_": {"doc_hash": "f4548abee40a8a4094dbdb0bd44bddbad7fcb6da873e41b57a4e4fcb8653253b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.plot_Series.pow.return.super_Series_new_self_p": {"doc_hash": "2a0c11ac1d359a4f7cdd60535bbdb9f22f660ac7e99b72419e40703768984e39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.prod_Series.prod.return.data__reduce_dimension_": {"doc_hash": "b6ed9518372b1d998c7cd1ed6d3b6b1527d51fc13ff06f04198dba404230f326"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.product_Series.reindex.return.super_Series_self_reind": {"doc_hash": "aad32dd27869fb1fd94237980e26737407a55a8bf41a490b6eb3f56b6714c03b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rename_Series.repeat.return.self___constructor___quer": {"doc_hash": "f68c409ac5bd4213d91055004c7ff1bc9bad3f7471bf865a3a2086bc640127a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.reset_index_Series.reset_index.if_drop_and_level_is_None.else_.return.DataFrame_obj_reset_inde": {"doc_hash": "df195501d5844f4912235804e27f5a0a6e9ba659892ec96e542301dbb4aa0c68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rdivmod_Series.rdivmod.return.self___constructor___quer": {"doc_hash": "db667b11bb4afbc9379f7cd5aa1aef19e8d7108e554efa9b4a53d30773221a07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rfloordiv_Series.rfloordiv.return.super_Series_new_self_r": {"doc_hash": "61f452c668203e363dec0ea6c24da31e3d12988074b3a6669e0a55d9697afc92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rmod_Series.rsub.return.super_Series_new_self_r": {"doc_hash": "9e564a027cc40144485dc331d0ec36bf3a1c6c47eab928c4c49abbacc69be035"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rtruediv_Series.rtruediv.return.super_Series_new_self_r": {"doc_hash": "ae2f1969b673b0f7672a7862c653826ccad24c18e4a866f23f871cfdbaf9a975"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rdiv_Series.reorder_levels.return.super_Series_self_reord": {"doc_hash": "ac8717d954d251b26cdc5fa235621e114b9e4655c4dec2ca18ec9aea977d83a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.replace_Series.replace.return.self__create_or_update_fr": {"doc_hash": "c3fe27b51cfa631db2adf6d1435bb4e6bf19fe9bfd536decf87d73fe39796ba9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.searchsorted_Series.searchsorted.return.result": {"doc_hash": "7631b2a394de4b7b59b8ab49aa043ab428f542c7db82868ea0aef200bb6c21b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.sort_values_Series.sort_values.return.self__create_or_update_fr": {"doc_hash": "3418b07e6f915b61f5a529d7c65279106d00462c774bd3f35f483178f104dfdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.cat_Series.subtract.sub": {"doc_hash": "689ce0006607da3807e9d75f44a3c55c325f576fdccec808d50726a32ccaf829"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.sum_Series.sum.return.data__reduce_dimension_": {"doc_hash": "941fa17b70ad6bcdc9ede4f4d432084cfdc69aee9a1b6fcfc508e46dfef9a191"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.swaplevel_Series.to_list.return.self__query_compiler_to_l": {"doc_hash": "9664d655f91d0c2d0645004ed73cf4e3d91c2f7c2acb54e357ae6acb0d6984b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.to_numpy_Series.to_period.return.self__default_to_pandas_": {"doc_hash": "7261ff98e05a62137abce016d6fd4cf174fbac113e70e1d7d8cd5c06ff58b65e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.to_string_Series.to_string.return.self__default_to_pandas_": {"doc_hash": "49b03bb6e30f8f2d60166aa98e5435386b228fa90fd518a20ff0220bb9a9920e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.None_9_Series.T.property_transpose_": {"doc_hash": "ee327e9a5e7b024cc356d71e01d0012867254957c4cd86ef2df6075c2ba7190b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.truediv_Series.truediv.return.super_Series_new_self_t": {"doc_hash": "4dbd2b9b061422ac47864773a58223d510c7d47b0a4d5ba44a22c598cd09da75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.div_Series.update.self__update_inplace_new_": {"doc_hash": "acbb2e55f526e9908174b209909b6bcaff2e2c9a7a0529ede9dec83774d993ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.value_counts_Series.value_counts.return.counted_values": {"doc_hash": "4988637643d77384df785a5ba355e697258206a3288366293387dd8e4ab46b2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.view_Series.where.return.self__default_to_pandas_": {"doc_hash": "2949073545c5d567cc4b61c20fd1f25efd48ad2a27e089bd1b12093ded30383c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.attrs_Series.shape.return._len_self_": {"doc_hash": "8e5decd0b4c49f4ab1c69ac65f312af8f6cf8aa0772637ab402d131098d20fd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.reindex_like_Series.reindex_like.return.self_reindex_": {"doc_hash": "7bb2dddd4c0b30ba4caf68b78583b802c5b70590999333646c310d9dc6b1ac18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._to_pandas_Series._reduce_dimension.return.query_compiler_to_pandas_": {"doc_hash": "2f0a4bf1bfb6b6a24d7f4f87d8769f09abac6823b83c102d1655f490906ecd62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_sum_prod_mean_Series._validate_dtypes_sum_prod_mean.return.self": {"doc_hash": "a8d01d424458a8a75ed0ddc375a3c6968cb718908ac93b7342453134285546aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_min_max_Series._validate_dtypes_min_max.return.self": {"doc_hash": "67fec8fae12222dda6c68c18e2f174659d8bd7902973a54e3ebc7aa7ef21717f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_Series._get_numeric_data.return.self": {"doc_hash": "6124213ca4329b9e490193efc03ebee65b643b9cdd6f8282bd78177971922608"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._update_inplace_Series._update_inplace.if_self__parent_is_not_No.if_self__parent_axis_0.else_.self__parent_self_name_": {"doc_hash": "6461f12d7173c77b972a2a5c725ea6fbc5073121f6556f467b38f2ad1e216772"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._create_or_update_from_compiler_Series._create_or_update_from_compiler.if_not_inplace_and_new_qu.else_.self__update_inplace_new_": {"doc_hash": "fa7afc6a1a64ee8346c07e7c57ec8ef230e908fe00e13b43e2f52f21c05329f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._prepare_inter_op_Series._prepare_inter_op.return.new_self_new_other": {"doc_hash": "6a16e074f2f2a11ef1c6e553a8213662cc5a8ed21274f62e63bb9b1839a2b168"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._getitem_Series._getitem.return.self___constructor___quer": {"doc_hash": "30fd17ba3a30f7be79c34a3ce434ee10b68748b5912af0559f59b7de946812e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._repartition_Series._inflate_light.return.cls_query_compiler_query_": {"doc_hash": "151bfe9b363a76f9a7e13642fd410f58e8bfdfc1c36449721cdfb6fd0356a18e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._inflate_full_": {"doc_hash": "ca5ad7862ffe6782e8dbdf59d52859bdfa03dbbc207e543c421f0235877f9af2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_from_typing_import_TYPE_C_CategoryMethods.as_unordered.return.self__default_to_pandas_p": {"doc_hash": "64c1444cf1e839df6f37a19eec9222d7350e805489f31d7399ff83986636ee4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_CategoryMethods._default_to_pandas_CategoryMethods._default_to_pandas.return.self__series__default_to_": {"doc_hash": "599361f9ec202dd8f5143d16b938a794c58878d0c9c6e691612fac2b5a02acda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods_StringMethods.cat.return._": {"doc_hash": "c5a00666eb7e8bb8dea7a29193dc78398ac2b463d83d1dd68f443627a95b0ae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.decode_StringMethods.split.if_expand_.else_.return.self__Series_": {"doc_hash": "06e3913213b418cde201982ce08b8a499820f7a17fa08c628c9ada05a6c7e7de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.rsplit_StringMethods.rsplit.if_expand_.else_.return.self__Series_": {"doc_hash": "a476238ecc34f0b64e90d6ff529fc76846dadef80d886115b06f8f4dbf1b693c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.get_StringMethods.slice_replace.return.self__Series_": {"doc_hash": "f31b1208e67f9ee19d03e52d96b7ff3ce48674799576a6f8b4fed540cc3893b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.count_StringMethods.repeat.return.self__Series_query_compil": {"doc_hash": "c2f63a6472f80aea98859ca7853ae825fa8cf340a14bafde7cc66a237e49b313"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.rpartition_StringMethods.__getitem__.return.self__Series_query_compil": {"doc_hash": "9443ec09d5b145b47091781530587e9866ccfa6298c6a422c4c5f0d55795b603"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods._default_to_pandas_StringMethods._default_to_pandas.return.self__series__default_to_": {"doc_hash": "8e4706cdb3464ee259352cc9854a22ed2ab1cd9b988ecc41f58247f7c91ddce9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_DatetimeProperties_DatetimeProperties.unit.return.self__Series_query_compil": {"doc_hash": "962b7c86c61092e220a8fb90b786ee49ced3d6d0925af4aab8a9463ff1bac548"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_DatetimeProperties.as_unit_": {"doc_hash": "0b0558940fb12a57f77370b485c3d45284b191e76c68e169c80e284232c56c12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/__init__.py__": {"doc_hash": "65c44358b0d76d8ebf7e737dfd34567f6d263823f824ff4f6455cfbd8b07eaaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/data/__init__.py__": {"doc_hash": "c1ea00cd3b37ed3ad1986ca32463c51ef9a348fb84ba4957b4ff555d0d87e783"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/__init__.py__": {"doc_hash": "b1a630e73e5477a15a9670811ee9179ad3bf478f6e83bbce45e8d1b8deebac19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/conftest.py_pytest_": {"doc_hash": "465ed12e065372829e51f3631f0f427c3696bce80cf49966dafdd3fa180f3a90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_pytest_pytestmark.pytest_mark_filterwarning": {"doc_hash": "5f605a4a84c0267b0dd427ac8e8160da1f2712e5d45b57411d7e2807980c91c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_test_math_functions.eval_general_": {"doc_hash": "523577442e1a556eaef94652aa567897641ac56ab56af7b0370fffddf6570c21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_fill_value_test_math_functions_fill_value.eval_general_": {"doc_hash": "dfc5ee9fb2bd4a7d9f94f4012fb90e7bc9ea9b7f9a13f1cfb386c85e1e0a4bb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_level_test_math_functions_level.with_warns_that_defaultin.getattr_modin_df_op_mod": {"doc_hash": "a06e99c540d2c0010163dcb40c9bcaee6ae7c788ad3ee4e8a9f4606e7f0023ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_alias_test_math_alias.assert_getattr_pd_DataFra": {"doc_hash": "a3c0c56501941f5a5b6fc1afab0c99229f18b36141b96c21ac4dd3e1e67487ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_comparison_test_comparison.eval_general_": {"doc_hash": "783c58d275fb41754515e857df028f2fed373b8b8ad4e18abbb5a499fbf9b5a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_virtual_partitions_test_virtual_partitions.df_equals_modin_df_left_v": {"doc_hash": "b36dc85d46b29e23043b72c5c3256009ad6561166a969e08ff6b289874d3505e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_multi_level_comparison_test_multi_level_comparison.with_warns_that_defaultin.getattr_modin_df_multi_le": {"doc_hash": "32fc2239b603afce34a412e56315952c700edb5d5b234a992b66662b0620bcca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_equals_test_equals.None_2": {"doc_hash": "9fef01fbdfbf0669a50465068585fc2a2dae17a883569bc95d3e0172c7d87efe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_mismatched_row_partitions_test_mismatched_row_partitions.df_equals_modin_res_pand": {"doc_hash": "ca9421147bc8e9aecdbeb116663b84f0f544535ee4aa100912d1a45112411bc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_duplicate_indexes_test_duplicate_indexes.None_1": {"doc_hash": "2921a4027f43768f761c3c0830ddc2202622d880d74ea892e525091d0bd93925"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_mismatched_col_partitions_test_mismatched_col_partitions.df_equals_modin_res_pand": {"doc_hash": "c1293380859f8ce553f97f686c6467490570480d6fb2829b903b5346ac7503d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_empty_df_test_empty_df.df_equals_modin_res_pand": {"doc_hash": "b4feeef72cacd722941c7922c02cbeaf575e535133f2e594fc8f1813ad9c523e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_add_string_to_df_test_non_commutative_multiply_pandas.assert_not_integer_pan": {"doc_hash": "d55759a433f8e82e4327610279d3463b2e493678f0da886905aa3de5158ed8ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_non_commutative_multiply_": {"doc_hash": "63859120cdf89b05620c6e4055e8566664c7c55b874d9e09b9e9e96c7864e88d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_sys_pytestmark.pytest_mark_filterwarning": {"doc_hash": "a8de791aa024ec53f1133e6b0e23ef6881b94bfab9f1d829bb3eba3ad4d93896"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_ops_defaulting_to_pandas_test_ops_defaulting_to_pandas.with_warns_that_defaultin.if_make_args_is_not_None_.else_.try_.except_TypeError_.pass": {"doc_hash": "71489ed16653707cf06c4259b63b071a3de3ff2592b238b6fe05ff9ca4a77d49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_style_test_asfreq.with_warns_that_defaultin.df_asfreq_freq_30S_": {"doc_hash": "420ea57b5f4fa1c69d98a9a1425ffb480341f331f25e81824b2b26c4c8135ee4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_assign_test_assign.None_1": {"doc_hash": "39556c93af2cd958a734e3afeeaae21a179a90a6e0c1f020bccf09a9c9f5e7ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_at_time_test_at_time.df_equals_modin_df_T_at_t": {"doc_hash": "fc72505ed8420b8d7ffcc05cacc5eb91cead08af96a16ab11ca6de86fde3f83a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_between_time_test_between_time.None_2": {"doc_hash": "9a8b9b18b44cffacc5f5fa6f4bf25398cd4cb148052e343a0cda2bf7f8d9b884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_bfill_test_bool.None_1.single_bool_modin_df___bo": {"doc_hash": "0333b38b33756557bb67762935a002a4abada7a85b4c1e6be28a8abd5596fe00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_boxplot_test_combine_first.df_equals_": {"doc_hash": "3d53844a619e736b3e3559dcb98e9a2bffeb97ee9346d12505e8fadf9f22dc75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr_TestCorr.test_corr.None_1": {"doc_hash": "41e91ca439b7f32dff9725dbc5d5c5db3279084ce8ee6be12bd25c68832dd8aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr.test_corr_min_periods_TestCorr.test_corr_non_numeric.eval_general_": {"doc_hash": "9f7287203a41aef71ac6aa2aa1fe0c3c19843eca88776c57e2b098f38ba233eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr.test_corr_nans_in_different_partitions_TestCorr.test_corr_nans_in_different_partitions.None_3": {"doc_hash": "bd5f774cb9adf573b4a6909f5176d56fe400507564dd07391fda462027c15fb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_cov_test_cov_numeric_only.eval_general_": {"doc_hash": "abcdc15709e336c870616775a426d86babd2bf3c9817d4c7b35af5de1b9da899"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_dot_test_dot.None_4": {"doc_hash": "94410d5f6e2d10bbf6d7fac12bab60ff9fa931081423aa3dd2f1b1a609c4c1ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_matmul_test_matmul.None_1.modin_df_pd_Series_np_a": {"doc_hash": "a617453726dc6c867064bb87fbde7f2e27949f0252834450837e734ff125a41e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_first_test_first.None_1": {"doc_hash": "11ac730531b03fc784444999cb048d3a944d151e055741a29680aebd1b484a55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_info_default_param_test_info_default_param.with_io_StringIO_as_fir.assert_modin_info_1_": {"doc_hash": "14a3fc942fb4a856aad935b9b55f725b04ec852489217aac673b51499d52b87a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py__randint_data_covers_htt_test_info.with_io_StringIO_as_fir.assert_modin_info_1_": {"doc_hash": "e994fae4d14f251c4340fba595edb2a4d59ea8a92ce42c6b5b7e6218cd3cc882"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_kurt_kurtosis_test_kurt_kurtosis.eval_general_": {"doc_hash": "cff5bfc0df6d120531664e4b7aa8eb2291290c0acede16c59d44d4b693f6b796"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_last_test_last.None_1": {"doc_hash": "3fadbba279786a3c7883ac3b1bbf97689e92f36ea289c6f6d97e40c580509425"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_melt_test_melt.eval_general_": {"doc_hash": "e63070ad7abefd0cce13e99d1ea3d5bf2671a5610aa45a06396f41520bccfdfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_test_pivot.eval_general_": {"doc_hash": "da2f75ecdd787b9a8d4cb6cdbbad1905c390954643606bf36c8532fde506a330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_data_test_pivot_table_data.eval_general_": {"doc_hash": "3242548ee038c2e8d96b09f292c5eca0e6a7e98fe66152c1fe68d7faefec3f85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_margins_test_pivot_table_margins.eval_general_": {"doc_hash": "f34aa5a75236af5fdd9f07e15bcb8c93f98b2d124c5fce88f9e2278d5fd8d116"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_dropna_test_plot.if_name_contains_request_.for_left_right_in_zipped.if_isinstance_left_get_yd.else_.assert_np_array_equal_lef": {"doc_hash": "9c6ee4ab276cae276d14def606327d5ee28de76f1f159d068812e496f57ae597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_replace_test_replace.df_equals_modin_df_panda": {"doc_hash": "4e2d64b155f8c7d2ff609aec683a6e4bf827a6d99a8ed666130b72f939108c3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_test_resampler.df_equals_": {"doc_hash": "5425c3e67d0d5a6e29ebce5bb04f853b6186c8762381336e6f23603be34a21e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_functions_test_resampler_functions.eval_general_": {"doc_hash": "ef4bbd6538b879eb047230559874cdd600712f21a284932085291574075bb3f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_functions_with_arg_test_resampler_functions_with_arg.eval_general_": {"doc_hash": "c8cf7ba2f11e9242be5bf612e1caaf22f8e2076dcd9c73dbb98644382fbfc1ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resample_specific_test_resample_specific.None_2.df_equals_": {"doc_hash": "d06099e8fb7026584f0e0d34135be65fc610fdefe5835b45bee8876e7406e2d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resample_getitem_test_resample_getitem.eval_general_": {"doc_hash": "a1b684987cea6e73ecf78593361a914ecda75d4aaef1f060ba4f691cf48c7387"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_shift_test_shift.None_1": {"doc_hash": "ece39ddafdde2d52d3cfb8ece8f3538675141a6d6772869535aab12a4ad9ab79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_stack_test_stack.None_2.None_2": {"doc_hash": "ef33eac20bbd7e25dd5d93b6711cff03084dd10b5e4295e751bfec5dcca2f29f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_swapaxes_test_swapaxes_axes_names.df_equals_modin_result1_": {"doc_hash": "212617f1a066190dd4a1c1b4b1a96bdbf267b278eb0830399bb139d2d9ab4c2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_swaplevel_test_swaplevel.None_2": {"doc_hash": "56756f4e486b34fb97861ca4c88bf7a71e1ab6c7475951355d33941d4d44d31a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_take_test_to_string.eval_general_": {"doc_hash": "6ec71eab53a84e66a25c18ad80a7bfb286c109f5018bc2d4919d1d4d309abf80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_truncate_test_truncate.None_2.else_.df_equals_modin_result_p": {"doc_hash": "466b0b986c11c03514b12eac058d6c69dcf64281c29ffa44bb71c6da649415ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_truncate_before_greater_than_after_test_tz_convert.df_equals_": {"doc_hash": "2a903fe7a79808f0a00488f4b6d317559eacef35fbbdfcb6c862f27ef66f21b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_tz_localize_test_tz_localize.df_equals_": {"doc_hash": "b39829728b9ff986da85f6f2bd20ea96f3a88339083ed3ce7011304b236701ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_unstack_test_unstack.None_2.df_equals_": {"doc_hash": "f6368f5c7b5c2e288ebefcb06b053daa68d95bc54068d4f646ff1ae1db7fa378"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_unstack_multiindex_types_test_unstack_multiindex_types.if_multi_idx_idx_inde.None_1": {"doc_hash": "1cb859161759e7c077434ca187c1a15c913e2eeacb131e803899e39ac9c98b7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test___array___test_hasattr_sparse.eval_general_modin_df_pa": {"doc_hash": "3ab232fc0eb4904b5ba6cb339251b7ca6174895cf973cda80c01397ffbe2b60d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_setattr_axes_": {"doc_hash": "c7725ff26ea2d84fb9964462b5aab3f496bf28dc295606cfbb830a665c59b708"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_pytest_eval_loc.eval_general_": {"doc_hash": "166f3d4351b50cbed3af6bb79bfd02e1e09b7cecfb04b60fac118f2b9a44e5fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_with_nan_test_asof_with_nan.compare_asof_data_index_": {"doc_hash": "909bedf76f2f78843a9197d8f9227197223e1b8197ad9bd9f7fad504b3172a1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_without_nan_test_asof_without_nan.compare_asof_data_index_": {"doc_hash": "34a02b178427c542fbbc6ee1af16dcc083182d2c2bbea084dbfb295586887577"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_large_test_asof_large.compare_asof_data_index_": {"doc_hash": "0936126d2eed0932d86951b327f248b473e9e4b5920af5c571dbff4a75f36d18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_compare_asof_compare_asof.None_3": {"doc_hash": "e08da46682b00b509eb785a80f2ad0afccae168251f1e96b69e97343dcfd6645"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_first_valid_index_test_iat.with_pytest_raises_NotImp.modin_df_iat_": {"doc_hash": "cc94b175a7672a8bbe4cef5c899b67d455577ebe184c18030138d6aae9e0c987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_test_iloc.if_not_name_contains_requ.else_.with_pytest_raises_IndexE.modin_df_iloc_0_1_": {"doc_hash": "f509381d876cdc3869d09c7de8ffd30a06c5b09e01ed64f0619303f206fdbb96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_test_index.df_equals_modin_df_cp_ind": {"doc_hash": "bc9882f20deeaf235a460d2346b393540981582b1f88d9d4b78fbfaaff24305f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_indexing_duplicate_axis_test_indexing_duplicate_axis.df_equals_": {"doc_hash": "9fdfac4ef3e8231223293575c897748a0256aa1efb1aaa99c25c79b35330fbb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_set_index_test_set_index.eval_general_": {"doc_hash": "74f893a460c1720f36d2e42983302107a43d10473f62d428f3127f21e60d8235"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_set_index_with_multiindex_test_keys.df_equals_modin_df_keys_": {"doc_hash": "6f6f29cb9e7aeedd02047d55570448cf22f3eed22b50d318f0e798a844b43c0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_test_loc.modin_df_copy3.modin_df_copy_": {"doc_hash": "ce04217c87d78703698ffd0ea89f2cc5aa7a1e6603f5b520ff2ccc01bc8b8198"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc.pandas_df_copy3_test_loc.with_pytest_raises_KeyErr.modin_df_loc_NO_EXIST_": {"doc_hash": "e59c42c0943042b93243279d642e6d05fa83df8b473dd06b26c377b947d96d63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_4456_test_loc_4456.None_1": {"doc_hash": "7506ee8bdc3577665c89c35d63e7eef570a92a632cd0895b107b5f6bead10cec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_5829_test_loc_5829.eval_loc_": {"doc_hash": "a19099b08e922e488134606bfde25f22ac9fa5a55854e388f60665980db50512"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py__This_tests_the_bug_from_test_loc_setting_single_categorical_column.df_equals_modin_df_panda": {"doc_hash": "e7ecfb719a939194a4b3740a6e0123458f17a2765606182bce150b79cdf8aba3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_test_loc_multi_index.None_8": {"doc_hash": "e26f9f2f9e45fcc1251f6bf7821ca2fcfa463bf4394b3d8f4d496186f376eefd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_with_tuples_test_loc_multi_index_with_tuples.eval_general_modin_df_pa": {"doc_hash": "05ca365addcb8e3d8e0a3b3a6e11f35cae592a058f03e6b801471be3e3703701"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_rows_with_tuples_5721_test_loc_multi_index_rows_with_tuples_5721.None_1": {"doc_hash": "84dba572b2ce014040ddf1091cf7f929df590b4d6d2483b14638c016301e355a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_level_two_has_same_name_as_column_test_loc_multi_index_duplicate_keys.None_1": {"doc_hash": "cab35a588d8cc57bbd5ea00fa1873b56e2e48b3ef2a6960c160ea45416461c89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_both_axes_test_loc_multi_index_both_axes.None_1": {"doc_hash": "844070a73012683f690ee549a871c34bbd61b586a246b246f94f45dd7b600a7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_empty_test_loc_iloc_2064.eval_general_": {"doc_hash": "2ed5799ed7e0e9c0b194b438286a7a762051b09627cfeee6c3d1c24f5b2ef82b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_assignment_test_loc_assignment.df_equals_md_df_pd_df_": {"doc_hash": "38c07bc7bd4b1c3a058c39a682bafa71f074e6d1d7a7cd2433cf0f04cc8a6896"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_insert_row_test_loc_insert_row.eval_general_modin_df_pa": {"doc_hash": "98fae5da34a5869396fa9513b5235d8a8fe4ea5a152e2a78c286a822ca4cd553"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_insert_col_test_loc_insert_col.eval_general_modin_df_pa": {"doc_hash": "af22c97547013710e5258db88fa856cd1baf184d53f5ae71f9e22d3dc856175e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_loc_iter_dfs_test_loc_iter_assignment.df_equals_md_df_pd_df_": {"doc_hash": "7a5b4be30eaeafbd3dd3c4164644d0bd789d13889d483da6849fade57a1c13e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_order_test_loc_nested_assignment.None_1": {"doc_hash": "99b92c73eaaaad9377da2af1397d29afff95fe8625e706f22f2bfe7e702e7327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_assignment_test_iloc_assignment.df_equals_modin_df_panda": {"doc_hash": "0173e31ac0d6402d1802b70b631ea99c107880cd7e7c7296a6dedf988d4b7306"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_nested_assignment_test_iloc_nested_assignment.None_1": {"doc_hash": "4f1eb18a59431ce58bbbd4cbd793b70e0a89a046e996d5e107eb5c805b0bc40e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_empty_test_loc_series.df_equals_pd_df_md_df_": {"doc_hash": "b5cdbd778e6420daf3f250f86480667d034e59c7f393eb797c66c3568d3b1ce5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_iloc_slice_indexer_test_loc_iloc_slice_indexer.eval_general_md_df_pd_df": {"doc_hash": "73bf0b929434f99c6bd7462d08649c0149d4bd8a86745504d3fadd9f15250fc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_TestLocRangeLikeIndexer_TestLocRangeLikeIndexer.test_range_getitem_two_values_5702.eval_general_": {"doc_hash": "23a13c63244c3bac33c4caff40e10b0970885a0882ddd18afc272f67e0d91292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_pop_test_pop.if_empty_data_not_in_re.df_equals_temp_modin_df_": {"doc_hash": "1c2fbc58b7132796b48902c0d683675b7cf2fc2516f691c795463b60ae17c83e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_test_reindex.None_5": {"doc_hash": "bd19960a7f34dd01643a2496511c2a509c7a6ea3db2f67c6bd6e78a45b821100"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_4438_test_reindex_4438.None_4": {"doc_hash": "1ce17e33fef434b3be699353681647c4e77697dae940c753a5b2304185f14a1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_like_test_reindex_like.df_equals_modin_result_p": {"doc_hash": "0071dd7ed8f28458fe86873d899add7394c08ba9094d77304030797722e54514"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_sanity_test_rename_sanity.assert_renamed_index_name": {"doc_hash": "701ead1610bdd110a78b9b942724a4ce2a6ac17a72bfcf4026d13c068bcd6312"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_multiindex_test_rename_multiindex.modin_renamed_22.modin_df_rename_columns_f": {"doc_hash": "58130c7b7bf62e6f1bdfe9b9af07efd34249bef7033f73b35fcf0e92f90648fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_multiindex.None_7_test_rename_multiindex.assert_index_equal_modin_": {"doc_hash": "876f9ca63dd86a27de386b9088f267fb96b2cc77d1968a6a913007ded64290c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_nocopy_test_rename_nocopy.assert_modin_df_col3_": {"doc_hash": "40aa4a90ec40cd4692c4673666117d4c21960809b99337d382767e5cc30a6ed7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_inplace_test_rename_inplace.df_equals_modin_frame_fr": {"doc_hash": "a5c9c292631e69f8d92440ea14c65df8a3a55400a77e278cb3cae64b4408b813"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_bug_test_rename_bug.df_equals_modin_df_df_": {"doc_hash": "116260a39707324118e690a08a046e7a832946df443b826c6b3a130c988fc83c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_to_datetime_using_set_index_test_index_to_datetime_using_set_index.df_equals_modin_df_years_": {"doc_hash": "00d672a508a47350dbf4da9233e75201711542f9a1dcece31656fa37ab13c34a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_axis_test_rename_axis.with_pytest_raises_ValueE.df_equals_": {"doc_hash": "449b3304c77bbeef0de51aad921d1d09ebd6f29f46e81a8239b587b31b232f15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_axis_inplace_test_rename_axis_inplace.None_1": {"doc_hash": "c5e98da63a8f71a341ff23f6f1da001433abaaa6939418de0c17761400949434"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_issue5600_test_rename_issue5600.assert_df_renamed_columns": {"doc_hash": "461902c227dfb2f5cded8145e5cc11c8b7c065ec965f20e11c4058d7e2009fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reorder_levels_test_reorder_levels.df_equals_": {"doc_hash": "014156d224e5b2e839e6b02defa7ba9217770821acd7534a3f9a70349e643526"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_multiindex_test_reindex_multiindex.None_2": {"doc_hash": "b5e58743c697b380018a5e1d3c40fc71d08cacf31ee5f2077aa168dcadd5084d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_test_reset_index.df_equals_modin_df_cp_pd": {"doc_hash": "2e74666cff68e48aa6735c26bf7c951de863a7e518a058b3df9c6f8e02a8ad45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_multiindex_groupby_test_reset_index_multiindex_groupby.eval_general_": {"doc_hash": "fe47baeb3fedc5c34ad50e0b051d7d3985e7740deada2181a34a192cffa38bba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop_test_reset_index_with_multi_index_no_drop.index.names._": {"doc_hash": "fd2af49b526bda7fdb7432aca73d4275deb54f399a42c0130e66375192e3d2ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop.if_none_in_index_names_is_test_reset_index_with_multi_index_no_drop.kwargs._drop_drop_": {"doc_hash": "39defc63f418cb6c36db628ae3b5e3785515af23991ea88f28c0e9a02196a47b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop.if_level_no_level__test_reset_index_with_multi_index_no_drop.eval_general_": {"doc_hash": "152f5b5ccc5c1216a9648b1cf11ea31bbb43eee22fcf1e8bd462ae7a8c2d3674"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_drop_test_reset_index_with_multi_index_drop.test_reset_index_with_mul": {"doc_hash": "8fb35df4d24e21f5408930c73a6cbf81a6357a0fb7338d2506cfced9e86b2ce0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_named_index_test_reset_index_with_named_index.None_5": {"doc_hash": "801dc46e58c263860a70f157b65bef43407eed78a6f802952f8e0cf7cc0e102c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_metadata_update_test_reset_index_metadata_update.eval_general_modin_df_pa": {"doc_hash": "a2a8900e821cd80ec3425de6566292fe977a94606071a32f51d62bf088818635"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_sample_test_sample.None_5": {"doc_hash": "9f441e4507f06fb470abf05e0370e627249a1af7437ab84102f2caa1d37e5d0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_empty_sample_test_tail.df_equals_modin_df_tail_l": {"doc_hash": "f09fe4c5944cb760ad9280da3c18fe5f10b39a269ba81e8567746fcce9b4e137"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_xs_test_xs.None_5": {"doc_hash": "e87e9129ee0e6e5a09f70428f4189da19c1550b23db9d6d6f93fb8699dbfc371"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getitem___test___getitem__.df_equals_pd_DataFrame_": {"doc_hash": "7b8d1e18287768242e73b5dfc7b0be31132087d917718141213554e816325249"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getitem_bool_indexers_test___getitem_bool_indexers.df_equals_": {"doc_hash": "122d877be41f59e5a343e69a8f89f9228e5a72dc771a1f9ec4394d877eebe455"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_getitem_empty_mask_test_getitem_empty_mask.df_equals_": {"doc_hash": "cd74b19205aa6800f37d39ecbc738910abee070d55f6e53efcf8bd64060e0aa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_getitem_datetime_slice_test_getitem_same_name.df_equals_modin_df_c3_": {"doc_hash": "a2b5c9ab7829adcd98cc15ff99faaf84352640c6c7b5cd32ea4bbe2b06b37f5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getattr___test___getattr__.if_empty_data_not_in_re.assert_isinstance_df2_col": {"doc_hash": "4ac9808b0cd629c3f86851ddcbcb99dd502c0ff8f9a205331795ca2ae8873183"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem___test___setitem__.None_11": {"doc_hash": "bee03c3a64522f6cbca7c390107b0c36ea92cbf0c888723fd0fb3f9669851509"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__partitions_aligning_test___setitem__partitions_aligning.None_3": {"doc_hash": "43ccd32c80584e3161541865b839a8c44d77ad047508af4183c58f89c4176808"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__with_mismatched_partitions_test___setitem__with_mismatched_partitions.with_ensure_clean_csv_.df_equals_modin_df_panda": {"doc_hash": "566741f2d681bdd73f80e0def1656faf015f0ad1e763de9f7ee733df9c209314"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__mask_test___setitem__mask.with_pytest_raises_ValueE.modin_df_array_20": {"doc_hash": "0e14cba5083cf6747c5f46fe506a2e6ea3ca6b95b2dabee92df1d5a523d260fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_on_empty_df_test_setitem_on_empty_df.eval_general_": {"doc_hash": "fb31ecbf442d963b7f5790c07f4b1712a8214ef8f6bec5234d13e9fb69029864"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_on_empty_df_4407_test___setitem__unhashable_list.df_equals_modin_df_panda": {"doc_hash": "983b44eb21cfbcc6e98d673f17ed6391c5b6155cc1bbd1a89d614b22a974e202"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_unhashable_key_test_setitem_unhashable_key.for_key_in_col1_col.None_7": {"doc_hash": "4055fc4f8e0d394002156fb5972fd23466b9dd3e952e8781cd2017e03ca2f19f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_2d_insertion_test_setitem_2d_insertion.None_3": {"doc_hash": "9f8671ff4c3ed89012bab59bf1d5278ee55a875d1c12ec5a24a665a64c293448"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__single_item_in_series_test_iloc_assigning_scalar_none_to_string_frame.df_equals_modin_df_panda": {"doc_hash": "851e32098430cab1497324acac8472ca0f3ae860bcf56bdd687cdaf2a994751f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_boolean_assignment_scalar_dtypes_test_loc_boolean_assignment_scalar_dtypes.df_equals_modin_df_panda": {"doc_hash": "910f1c9b64c78528def1a2fe390b422964e3cef56b98a79bc07825e5fdce59c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___len___test_index_order.for_func_in_all_any_.df_equals_": {"doc_hash": "fb875405f601e41eac9ec844dcd6e5f1ba493377351de0c3d8cb4bbb3a4d7abd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_multiindex_from_frame_test__getitem_bool_single_row_dataframe.eval_general_pd_pandas_": {"doc_hash": "0ff75664220f4723f88525867150b95e11dbdd0e61478806c8b78c1f6a8c2922"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test__getitem_bool_with_empty_partition_test__getitem_bool_with_empty_partition.eval_general_": {"doc_hash": "39cd8bfae511449885854816fa153b683912db04b77cfd2785fe08f7f7781565"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py__This_is_a_very_subtle_b_test_lazy_eval_index.eval_general_modin_df_pa": {"doc_hash": "4314cec32fd8c9ca0ed4bd968c18da780a8e0deee3218524733da21d5d35c4e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_of_empty_frame_": {"doc_hash": "280e3a00c53788a4560cd7e14234b517bcdb30316d29bcfdbc89c139ee79b4bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_pytest_matplotlib_use_Agg_": {"doc_hash": "b1ff430bcacf74fe3feb4653d6073e083fac4dfb67a114db33d17fe8ed19fd31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_items_iterrows_test_items_iterrows.for_modin_item_pandas_it.assert_pandas_index_mo": {"doc_hash": "f5f467c608e0b9815b2145425f0aec12862904239e02e2e2b395d856c92962dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_itertuples_name_test_itertuples_name.for_modin_row_pandas_row.np_testing_assert_equal_m": {"doc_hash": "1db4db18d7e337869e95f8c23a774523b9e928d9af855d72eb2529449ad8ff09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_itertuples_multiindex_test_itertuples_multiindex.for_modin_row_pandas_row.np_testing_assert_equal_m": {"doc_hash": "9bcb2acf61ff1ba429e07249d8b14d2d93b9e008b55b7e8db6c8df2b195e111b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___iter___test___iter__.assert_list_modin_iterato": {"doc_hash": "d0a299f9fd8eeedfa9d52a1730334e8a46a9436da02fff3ed7fe8e4fc9c802ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___contains___test___contains__.if_empty_data_not_in_re.assert_result_key_in_": {"doc_hash": "67b2a6c283224e7c6af22a5c9bf4868ae95af4134c400d7347b0fc1ebe56caa8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_display_options_for___repr___test_display_options_for___repr__.assert_modin_df_repr_p": {"doc_hash": "0e3aa3b4301644eb76592c6fa2f3fccc4b1022e69676bb3211cf2ad90f50982d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___finalize___test___deepcopy__.df_equals_modin_df_copy_": {"doc_hash": "ad19212f407684afdb8d9109be0afa1d3aa1925e74baac82f00ba5cf9de5f3e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr___test___repr__._From_Issue_1705": {"doc_hash": "6c4a1a8d3184eb887040b0176dd623de5ddcf74b263eaa8b4efb9e5182ce7a34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr__.string_data_test___repr__.None_8": {"doc_hash": "716cee7b182b0e18269f0c023940bc18d69b9d2ed4a65e2b0f1288f8ccf2073f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr__does_not_raise_attribute_column_warning_test_inplace_series_ops.if_len_modin_df_columns_.None_5": {"doc_hash": "1e7393f5071b211c54f78939b899b9e76827f4ed69a09a87169717a9c0149c40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py__Note_Tests_setting_an__test___setattr__not_column.assert_modin_df_new_col_": {"doc_hash": "06db242cc79399b5d9e9f40bfaafcdd54f6b7bdacd4f3adae4192e76cb223f34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___setattr__mutating_column_test___setattr__mutating_column.assert_isinstance_": {"doc_hash": "d42105db7123c057ac3d20b36d5056e0b834ddc328ef8cdd1783d55017f1ccef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_isin_": {"doc_hash": "7a2b76fe987af27ac266c0c3f16ddcf929d059b01f0abfabc34cc308c2cba092"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_pytest_pd_DataFrame_": {"doc_hash": "535fb8f41ab81d79fed1962a2447d7ce2ff35f5c63b7a056d2efff2ada5037e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_combine_test_combine.pandas_df_combine_": {"doc_hash": "d68ddfaa56a70adf81de7cf3b34e58d588ae37e0c694bfd8cf44a9df15b05a86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join_test_join.pandas_df_9.pandas_DataFrame_frame_da": {"doc_hash": "45ab7c29f03e58dc2cdb863f32c071249227e573904df4319c51c5cb32557c0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join.frame_data2_test_join.None_2.df_equals_modin_join_pan": {"doc_hash": "2ef04896a26866daaaab9689a5706143741ab2cd1f0e7d1c065dc16fa21bae4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join_5203_test_join_5203.for_dfs_in_modin_dfs_pa.with_pytest_raises_.dfs_0_join_dfs_1_dfs_": {"doc_hash": "14cc760df09ba3acd2447ab2c7baf2d827c802f62d95350523534c6f8b720f93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_test_merge.pandas_df2_10.pandas_DataFrame_name_": {"doc_hash": "494a71f6b2aeb44e84b3cf13bbc2a06b4ff776c7d84731c3a6d7866a387282dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge.modin_result_test_merge.join_types._outer_inner_": {"doc_hash": "63a3d400895a51661b4f6fc0eb6e736bda3f233f8cc716e2f062de07f9b4332b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge.for_how_in_join_types__test_merge.with_pytest_raises_TypeEr.modin_df_merge_Non_valid": {"doc_hash": "079303ff238b761d3eb991ab3cfd724f37c6b6e462c6eeda4ef283d902151275"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_with_mi_columns_test_merge_with_mi_columns.eval_general_": {"doc_hash": "0de42440980eff022a112a89eb8d70e76012fedd86e710e48f19987c813b64ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index_test_merge_on_index.pandas_df2.pandas_df2_set_index_id": {"doc_hash": "a5c914b717a66d99d74e16413d8471b712c8d99986ad4f44919ff68e3c3aab52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index.setup_cache_test_merge_on_index.setup_cache.if_has_index_cache_.else_.modin_df2__query_compiler": {"doc_hash": "a5ee66ce08b768a52d02d206f0d1b910341fa55cefb88ecbef7a6839cf40b564"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index.for_on_in__test_merge_on_index.for_left_on_right_on_in_.eval_general_": {"doc_hash": "33c36b70385fc9174be2d42c154f0daa452de5cc1228303042c65dc0690fe05f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_index_test_sort_index.eval_general_": {"doc_hash": "4a4a21cf94336e601af44a1968b9e3fc92a6a25ba48ebcc724fa534116c79a7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_index_inplace_test_sort_multiindex.for_kwargs_in_level_.with_warns_that_defaultin.df_equals_": {"doc_hash": "bae9c718db262f721a738ae0ef2b6b810e5109abb041ad1021c4ff102c44b9c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_test_sort_values.by_list._": {"doc_hash": "1b9c3276aac42b2f3ffe1df52fc2aabfe8d8f2d3627378309aabbdc9a8ce775b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values.for_b_in_by_split__test_sort_values.eval_general_": {"doc_hash": "f1be6925fe14e0f537fffb4796249edc60ef29467c8d51aa441eed6d03cc40ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_descending_with_only_two_bins_test_sort_values_descending_with_only_two_bins.eval_general_": {"doc_hash": "00993a3855eee0f93026b381954b7aa01e0f9df6f1500b5bd636e6949718aa55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_preserve_index_names_test_sort_values_preserve_index_names.eval_general_": {"doc_hash": "ba8d5e67cb63662e4bcb6399cad51c68ee271ab6f13bb940092cc26a1621c552"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_one_partition_test_sort_values_with_one_partition.eval_general_": {"doc_hash": "0f8956f96fc00c5ace845651a3d61e09dac968639ff71b56b96f7c56775d5be6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_overpartitioned_df_test_sort_overpartitioned_df.try_.finally_.NPartitions_put_old_nptns": {"doc_hash": "cfed8f3de65b90eedd0a9e75f1d6e3133d10214688b876a4009302ce3567699d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_duplicates_test_sort_values_with_duplicates.df_equals_modin_df_panda": {"doc_hash": "fe2a32180007b396a2e801ab86f981d480b89f5157d91544f8085273e6200754"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_string_index_test_sort_values_with_string_index.df_equals_modin_df_panda": {"doc_hash": "e6f00a3c08c4747f4ec3784ad3a7f0240b15d1e355dd91a54e6c40f4b3e14ae3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_only_one_non_na_row_in_partition_test_sort_values_with_only_one_non_na_row_in_partition.eval_general_": {"doc_hash": "a7e4eeb8aca7ef1ccc2109ac4fb10acb5a59a0af07d8054ca721ab9d7ee5b411"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_sort_key_on_partition_boundary_test_sort_values_with_sort_key_on_partition_boundary.eval_general_modin_df_mo": {"doc_hash": "7ad96af684203ac08445141e2eb6922288ea0801d3c29185179b58877beb80c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_where_test_where.None_6": {"doc_hash": "be44053368e06fb95b3e8b16677f6a14b2f3511e520e12fba49ff4fde6deab6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_where_different_axis_order_test_where_different_axis_order.df_equals_modin_result_p": {"doc_hash": "4a54460a3e5156e0943344db5167656c88cc365f4ad940eae55bc3d667e3948a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_compare_": {"doc_hash": "12d4847bffa709c34b2919a17b9d3cc9f869259e0d02aab9559c00250741e8e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_pytest_eval_insert.eval_general_": {"doc_hash": "c4146d4dd3a2e6f8f04ae6e352271ca4bef4016ea91ab41b7aa14cfe114689f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_indexing_test_indexing.None_10": {"doc_hash": "9dd64c0733f553afd182eb2c08f9b2ef2acf7bdb280ec536fb1a5b402db073a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_empty_df_test_empty_df.None_12": {"doc_hash": "a086b6c5d9e4d9e0ccb42b67f60891bb81c258e3bdd9b14b3d86f829d721f0d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_abs_test_add_prefix.df_equals_new_modin_df_dt": {"doc_hash": "701a40a7c9e53c4287798df7dc315ffd9ef2e705982681ae57a25b73e915c774"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_add_suffix_test_add_suffix.df_equals_new_modin_df_co": {"doc_hash": "754a5e9a81ff29fc67627a46e7648875611eb76d0316dcb97dacbe6b9b8212df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_applymap_test_applymap.eval_general_modin_df_pa": {"doc_hash": "7d6289be2e9fac20352ff807a88044e3aab187f368b57ca388c187977988bb7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_applymap_numeric_test_applymap_numeric.if_name_contains_request_.try_.else_.df_equals_modin_result_p": {"doc_hash": "edde7e8d8fe6b9fef13345f30bdcc9db634179ec5d5ba48043889284973ca67f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_at_test_axes.for_modin_axis_pd_axis_i.assert_np_array_equal_mod": {"doc_hash": "14093654d4843b6cf8e8df1e838a1f00dcb675347ce0a5dd378a67cda0357beb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_copy_test_copy.df_equals_modin_df_modin": {"doc_hash": "b55d6919238535a4f42daa48d33a088a2366f59948c097c219f029ba6e2e6bca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dtypes_test_get.df_equals_": {"doc_hash": "58f7609cef199546a956984a3eac9a3f1e567abb33c3a70a98e183555a328948"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_get_dummies_test_get_dummies.try_.else_.df_equals_modin_result_p": {"doc_hash": "c7ed4f29af64fa6c3a86d8ce6dcfefef68142eef78ecff7c82e20039ce1c053b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_isna_test_isnull.df_equals_modin_result_p": {"doc_hash": "1ea52704d5419ea8df974809d1b2cfae7bc84ce611c102db1312715e5e5e5fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_test_astype.eval_general_": {"doc_hash": "4ba2c41d84d9fb694168b8928995cf6ff4ae4138460636d1d542025daf4088fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_errors_test_astype_errors.eval_general_": {"doc_hash": "84cdac0f5c7165195c9dc3a5059200d766f1dd5f5c8f9534a74859fe9f29e372"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_copy_test_astype_copy.df_equals_s1_s2_": {"doc_hash": "0400ca7ccb84d4ead465e3a5e24986104bce827ba35d2efbc8788f7936394cc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_dict_or_series_multiple_column_partitions_test_astype_dict_or_series_multiple_column_partitions.eval_general_modin_df_pa": {"doc_hash": "76a95c583301c01395c4868116f2495514bc092dfc5c1a05f762e45ae65c1f33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_category_test_astype_category.None_1": {"doc_hash": "04b10cb8619416d7ad2f7962144f0729de5ed3262ebfc36ab77fd1ae8a2e64e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_category_large_test_astype_category_large.None_1": {"doc_hash": "467eff4f8138abb1141791021ebe0c5a8ce96eee56f7ba596259a7a57940f5e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_int64_to_astype_category_github_issue_6259_test_astype_int64_to_astype_category_github_issue_6259.eval_general_": {"doc_hash": "c2d99ff2df89740ef1dcc439ba75a82a1d71daa7ac8d10ec89c26cc58f7f7b4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype_TestCategoricalProxyDtype._get_lazy_proxy.if_StorageFormat_get_.else_.raise_NotImplementedError": {"doc_hash": "037f9f7b0e69e2d936aa367259b5f5d5cd6826536de36890337011356840186a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_update_proxy_TestCategoricalProxyDtype.test_update_proxy.None_6": {"doc_hash": "0ab238f62101477f7e81aa591fcb7a8ff9a61aa73ed8f4e0d6311169b79ac131"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_update_proxy_implicit_TestCategoricalProxyDtype.test_update_proxy_implicit.None_1.else_.raise_NotImplementedError": {"doc_hash": "f35d5fac69a9ec90aa8ffea9a4994fa6861f35c4b8a9de82719cc9adc7360bfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_if_proxy_lazy_TestCategoricalProxyDtype.test_if_proxy_lazy.assert_lazy_proxy__is_mat": {"doc_hash": "3ace228a143de51fe706789f5ef94761bb0e560c524c02e62d04c744920b6ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_proxy_as_dtype_TestCategoricalProxyDtype.test_proxy_as_dtype.eval_general_": {"doc_hash": "6cf4fcfe12fe52a831d17298a67a7b82f7099d96af8721ff179ad35ad56e6b39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_proxy_with_pandas_constructor_test_infer_objects_single_partition.assert_modin_result_dtype": {"doc_hash": "9c59db7ea05528d5b2a113ae3b75680f8425decdc3ec15af72b65445d638e0ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_single_partition_test_convert_dtypes_single_partition.assert_modin_result_dtype": {"doc_hash": "25abadc72265c124818e8f957677c7ccca59476b6935bef0664979e7b9e69604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_dtype_backend_test_convert_dtypes_dtype_backend.eval_general_": {"doc_hash": "b690262772e5a9299ccd47e09402eba2959c6fbac74b4ba1349fc19cd261df04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_multiple_row_partitions_test_convert_dtypes_multiple_row_partitions.assert_modin_result_dtype": {"doc_hash": "9c3b134adbcba17cef8e266ffd897ea17abb8cb1b1de1c5925da93865e9ca49f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_5653_test_convert_dtypes_5653.assert_modin_df_dtypes_0_": {"doc_hash": "9f79e2b5f4ee0952ddf4c2fe1da6ef70f711446fbf575576b6aaea3ffea789e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_clip_test_clip.if_name_contains_request_.with_pytest_raises_ValueE.modin_df_clip_lower_1_2": {"doc_hash": "0fd22f74f852a31865fd21924caf7f3954638d08aeb0b4f9daf110a8363c7193"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_test_drop.midx.pd_MultiIndex_": {"doc_hash": "e7cbeabda06db36faca830b52c299accd3d65dff05436c2535f897de6639db92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop.df_13_test_drop.with_warns_that_defaultin.df_drop_index_length_l": {"doc_hash": "dd9eb4d3c7ca394a010d4c0cf8b7cc0257ec56ec97542c36114ace3d8372b873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_api_equivalence_test_drop_api_equivalence.None_2.modin_df_drop_axis_1_": {"doc_hash": "447b3e97e0507a1acc9564d3480d2d533040f385884d724b3106083d877b25e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_transpose_test_drop_transpose.None_2": {"doc_hash": "11c5bea528ca1e6629c20812a401ef581b3a8f698b4a585693a16ce2b873101e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_droplevel_test_droplevel.df_droplevel_level_2_a": {"doc_hash": "5848583210d1c4f6b845041747161b0f1b66f3558d032c68ea2363b5bf7ffe35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_test_drop_duplicates.None_1.else_.df_equals_modin_results_": {"doc_hash": "4f8105a72202f7b7d47de3fd1eb0faa994a8dd6ab0ce7cb1eb8683dc5d4e5b08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_with_missing_index_values_test_drop_duplicates_with_missing_index_values.df_equals_modin_result_p": {"doc_hash": "734eec486f71f9b79b363284359a86c691c44efc0a9b3dca6eb4817e70e93d26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_after_sort_test_drop_duplicates_with_repeated_index_values.eval_general_modin_df_pa": {"doc_hash": "42d244f0f971ce5ed5ba5a00320e0b48f9fe97f35b379adc3ab9e64e29acafdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_test_dropna.df_equals_modin_result_p": {"doc_hash": "22f54868bd078b03d39c0f6a4d360470c11b4ca67eb3200053c9bcad64a02323"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_inplace_test_dropna_multiple_axes.None_1.modin_df_dropna_how_all_": {"doc_hash": "2588de3c2417ffd41aba7d8c9de2eeed11f533cfd6e8295ce95ba1372e86da8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_subset_test_dropna_subset.if_empty_data_not_in_re.None_3": {"doc_hash": "18ea4aa78e38e7f3ac5e1e4c35c4950b54fe394b6960c14651553ce894cedabc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_subset_error_test_insert_loc.eval_insert_modin_df_pan": {"doc_hash": "143dfa5ae86d7a5d159814b61269dbf0f84bbc22ee96b6d18268a38135a4cbb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_insert_test_insert.None_10": {"doc_hash": "2f3f5cbe993448eeb1e317b950bede04645bbc55829db692394323c2e1fa8594"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_insert_4407_test_insert_4407.for_idx_value_in_enumera.eval_insert_": {"doc_hash": "6259cd30cb1e71e45abdd8399a9924fac2ad22c4243c47dc3652ef2f9515a7f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_ndim_test_round.None_1": {"doc_hash": "28be0220522110020e97b1964e4ebe2417276c5d9180560145cd5c6a17e52bf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_set_axis_test_set_axis.df_equals_modin_df_panda": {"doc_hash": "dbe27ef1303d086c0045c6a0b07ac516ecd5a36b08ba859afc2f843b2a4d1ceb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_set_index_test_size.assert_modin_df_size_p": {"doc_hash": "42364bf73b98f0fee624aeddc41d42c2a34ae7c547fd4e1d8e39fb23e8524b24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_squeeze_test_squeeze.df_equals_df_iloc_0_pf_": {"doc_hash": "e7cf3a163a89e3ae02a076bdb5f8a47a46d8042cf675f5804b872dc4e9c8a42e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_transpose_test_transpose.df_equals_modin_df_T_notn": {"doc_hash": "d7c7faef5faa3bb7fda753cd1c0a02f21d8ff6b94558cf6f7e9aa539820ee32a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_update_test_update.eval_general_": {"doc_hash": "c2aff923ec0a2bbced86ead7f11b8157a85c00ac39c6a4133e071c2876651278"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___neg___test___hash__.eval_general_modin_df_pa": {"doc_hash": "c1c487d980eec6fa19ce56a4193fa61e363add8acb00ee99e15356de78c40b9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___delitem___test___delitem__.if_empty_data_not_in_re.None_5": {"doc_hash": "a3cc63fe009c709c2345d736952c99b4a0ab84131e4a92a299ed923dbf018c2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___nonzero___test___round__.eval_general_pd_DataFrame": {"doc_hash": "262246ee39c670cab56435fc8c705456bc65210d1e58367bfdc0cd79c312ad51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_from_modin_series_test_constructor_from_modin_series.df_equals_new_modin_new_": {"doc_hash": "dc7f03928c40e12317bff7b8be2adfee647812dfc6cad49dae018a9c9e2945cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_test_constructor.None_1": {"doc_hash": "5e343594279b60d687dabc709df47f2cc8c393953dcfab7bab38672caf59b36f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_dtypes_test_constructor_dtypes.df_equals_modin_df_panda": {"doc_hash": "965c8dc74cc58f180961ef3d2fb53de6fe0389e068a0490e3fc6f3aa011dfb94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_columns_and_index_": {"doc_hash": "e495efb8e3acbce8405a05b20503e5bb82f474861e5c678692e4c517ccb20abd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_pickle.py_pytest_": {"doc_hash": "e7910670ca132dd67060707b85950ee1cfb6423f9f899a6e151d95b3f7df102d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_pytest_pytestmark.pytest_mark_filterwarning": {"doc_hash": "7a54eed1d38b77286694eefd80211f7e2e0767bba4e76e6ef4b4a4caa0bd73a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_all_any_test_all_any.eval_general_": {"doc_hash": "8a080c3d5f41087f7a13333a240578143e349f070742c3091dd7e9c1f7264053"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_all_any_specific_test_describe.eval_general_": {"doc_hash": "1f77c0e8136e30113f752f19daea8f293fb0f8f3140ee7533c84da23fac0aef4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_2195_test_2195.eval_general_": {"doc_hash": "479e06e815846b75818acdbd2cc8296640f42767064fb51664414379ed78d1df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py__Issue_https_github_c_test_describe_column_partition_has_different_index.eval_general_modin_df_pa": {"doc_hash": "339ddff7fcf8bd7b0bca4d63ed2628fc3fffd8c18b02a55b408a090b5b39a1f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_specific_test_describe_specific.eval_general_": {"doc_hash": "1d11f177083aab379228806680403ea785d458e7476b52814f8693e9bb63a297"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_str_test_describe_str.try_.except_AssertionError_.df_equals_": {"doc_hash": "b321845780cbfa1a1fa48f0873b859b2b187f5951db45c54ef79572dc29926bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_dtypes_test_idxmin_idxmax.eval_general_": {"doc_hash": "f6b62a2b74d1b80ae0d6d229ba6a28c4e07e8bef0ccd01cc7c9b8068364aa0ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_last_valid_index_test_memory_usage.eval_general_create_test": {"doc_hash": "1451d5853484469947ab7ba67c100407c077273f2a2a35950ca76f6659a9913a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_min_max_mean_test_min_max_mean.eval_general_": {"doc_hash": "a389facc524587aae4f0538446512500ac731908aaadfe0e45420aa7fc61ae4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_prod_test_prod.df_equals_modin_result_p": {"doc_hash": "b4271530e3302bdf0d68f7de229852b8875c900e83c54515df177693c76c4233"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_sum_test_sum.df_equals_modin_result_p": {"doc_hash": "7d0076b12d54ab965ee5b0055a28405ee07260da90e5ac39d088e46b7fcd073c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_sum_prod_specific_test_sum_single_column.df_equals_modin_df_sum_ax": {"doc_hash": "1b7b4c05f52f20fd4646e53f3dea0e4f60190cf7defb671b0d58cf410c4d8953"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_reduce_specific_test_reduce_specific.eval_general_": {"doc_hash": "c28212a794f3affa888d7230b581ba4be84e4192dfa403d6c397b2396b89611f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts_test_value_counts.comparator.if_sort_.else_.df_equals_md_res_sort_ind": {"doc_hash": "91d9f4219b70c7903ea8441911ed1823c93dba2622473956070d032789b8cdd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts.data_test_value_counts.eval_general_": {"doc_hash": "0c7c3640cd2e695f3b477105b3475825a22b1339452c385edb1cdd7f4752655b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts_categorical_": {"doc_hash": "b3e1466771e77ec373905691e95a022154e2adbf7d486fae80d05831c1b2ca39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_pytest_pytestmark.pytest_mark_filterwarning": {"doc_hash": "a55c29da83679b08f3370428023bb3430e036c0dc5e1650eb23b778cbfb79acf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_dict_test_agg_dict.None_1": {"doc_hash": "cefa287dddb504235b24c7917666dade1fb3ff979606e121237ee87538c9a9a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_apply_test_agg_apply.eval_general_": {"doc_hash": "35f65be20b86d1f9bbad4841d1ec5d3c82ee73edfb13650fd2f693be7966b781"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_apply_axis_names_test_agg_apply_axis_names.eval_general_": {"doc_hash": "aaff917bfcad32e35db2b246790895a8fbe29b990a01005e54d7b52548d9e02c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_aggregate_alias_test_aggregate_error_checking.with_pytest_raises_ValueE.modin_df_aggregate_NOT_E": {"doc_hash": "bd8016b88cd4d203f0c456831fa2390856213489af0923d5764ec3e616e2c7c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_key_error_test_apply_key_error.eval_general_": {"doc_hash": "dbe381fffd923b1b942d336c2f4021fa3165a7cfb12c3bca4edc5ecac9724667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_text_func_with_level_test_apply_text_func_with_level.eval_general_": {"doc_hash": "361bdc9769f168b7faf750816de4f2f5660ba55f29e01c02a6dc8798ea6d52a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_explode_single_partition_test_explode_single_partition.eval_general_": {"doc_hash": "4f876e9ca19ca59ae1fc1f376415012060a252f80f39d0b57a44687f9edd133f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_explode_all_partitions_test_explode_all_partitions.eval_general_": {"doc_hash": "05e43e65e2521ec736f774fa7f313a16fcc9a4447a9f7f3c2f8fb872acc073c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_args_test_apply_udf.eval_general_": {"doc_hash": "e4574c34775a1face4d4a6ea90805b723094bce20e413be962cf1fba67a0a11e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_dict_4828_test_apply_dict_4828.None_5": {"doc_hash": "ff38a3460faa66e5a7b78878f645c309585c3c55a755a4d300a4d8b080319a13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_modin_func_4635_test_apply_modin_func_4635.df_equals_": {"doc_hash": "9953161ae5aaf88ad42487e0b9d56a269b506cd4ca923b100ac4f740612acab4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_df_use_case_test_eval_df_use_case.df_equals_modin_df_df_": {"doc_hash": "418175e236817eb123ee42e42e49e6de9a0be5d86d20e22e6148e3bc4b3f8512"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_df_arithmetic_subexpression_TEST_VAR.2": {"doc_hash": "3520a826de885f840a8dd9b9febc461c7992eb011442881e8082ebea9894821c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_and_query_with_local_and_global_var_test_eval_and_query_with_local_and_global_var.for_expr_in_f_col1_op_.df_equals_getattr_modin_d": {"doc_hash": "5a11fbd35f16a195a3a4ee9e63bb352f57b60d411a922a09cacabcdacb3a5232"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_filter_test_filter.None_1.modin_df_filter_": {"doc_hash": "022a1a1ca802618aa66b69afcddfecedef98fed8d95507f08f2d003288ce2225"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_pipe_test_pipe.None_1": {"doc_hash": "454e4b71e7d3176e02c601fb631b49138daf1b11db34a0882712bfa8256a5460"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_query_test_empty_query.with_pytest_raises_ValueE.modin_df_query_": {"doc_hash": "775a89f853b6b3a36cb8e0688c08bdf5fd6f044d12c1f6fc6c0b2fcda61eba47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_query_after_insert_": {"doc_hash": "b3fc94cfe4ad6180902c12cf648d4cada6c54cf62d363b3aefd1e6779d71c28b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_pytest_if_StorageFormat_get_.pytestmark.pytest_mark_filterwarning": {"doc_hash": "990ee91d43c945c1eebebc0ab289b142aa87ac87267362a006c3d2ff1f13ceb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_cumprod_cummin_cummax_cumsum_test_cumprod_cummin_cummax_cumsum.eval_general_": {"doc_hash": "cefd9d36c7b6aa0f529904fa9dcd93b2beb41bfba2d99c8804c1ebcb90580c51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_cumprod_cummin_cummax_cumsum_transposed_test_diff_transposed.eval_general_": {"doc_hash": "15840d192ba25bf2a2c143b0a1f1d45c69e9fd1bf7ecbe6711462e2a825cce56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_duplicated_test_ffill.df_equals_modin_df_ffill_": {"doc_hash": "1b42e555d90f5cb001cdd76888f3bd22f94a771fb275108fe1d453da4abeb313"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_test_fillna.if_axis_1_and_axis_.try_.else_.df_equals_modin_result_p": {"doc_hash": "362d7c72e28fdfec169a12d5baacc9d02fb3f801868007ce52ebc66726665733"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_sanity_test_fillna_sanity.df_equals_modin_df_df_fi": {"doc_hash": "84dcb88260ca9b54cf50bbf01624e98c908c41106dada5b7fcdd0f3f4c411c38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_downcast_test_fillna_4660.eval_general_": {"doc_hash": "8796b48c898eac4c39a05da383d2099c300f4b96beda4c9d90ed53b4351dc0bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_inplace_test_fillna_inplace.None_5": {"doc_hash": "e6b1a419aaef0a85949a46efb32eb6f14de3a06885befdcf1acf3427cbfe0be0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_frame_fillna_limit_test_frame_fillna_limit.None_7": {"doc_hash": "1e4766d9596f48f00ba9f152120c6b75b6b8bc33e3d16d0b289782a9bf8dc760"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_frame_pad_backfill_limit_test_frame_pad_backfill_limit.None_1": {"doc_hash": "7823e4cb4fd8dcd663723f99057d210c16c980b2ab153a500325f63985821854"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dtype_conversion_test_fillna_skip_certain_blocks.df_equals_modin_df_fillna": {"doc_hash": "5b40beeb93cc2483a00890a60a6b2000f3cccc99ec3948ace4029ef1e7edacd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dict_series_test_fillna_dict_series.None_2": {"doc_hash": "345262c47701045d7dccc398f721a6d2a4f6052867c7601d1cff5da82994febd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dataframe_test_fillna_dataframe.df_equals_modin_df_fillna": {"doc_hash": "8300e982b0a3671fec824fa88d5beadb27b6908e37777f2a9608323c3a237dea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_columns_test_fillna_columns.None_1": {"doc_hash": "eb6d783f593d182644dd8ec07d9d35c3940d602c6d1eca5b100b60197e21896c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_invalid_method_test_fillna_col_reordering.df_equals_modin_df_fillna": {"doc_hash": "75f4aa97389558cff8e036fbd4b9e753449f18eaca0c3a39c7c81debb590f0ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_datetime_columns_test_fillna_datetime_columns.None_1": {"doc_hash": "367bb7277321abcb07777ca5bcaa6197ceb2444c3700c2f852f784f649838e45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_median_skew_test_median_skew_std_var_rank_sem_specific.eval_general_": {"doc_hash": "df6807623b030770b1800536187233d5e00494c8bbf96223cd3d51777d715042"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_median_skew_std_var_sem_1953_test_median_skew_std_var_sem_1953.eval_general_modin_df_pa": {"doc_hash": "f4096b125c88d89757f8b46d5ae5d41563203a3c87d170cfa70f0be6cd6c5759"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_mode_test_mode.try_.else_.df_equals_modin_result_p": {"doc_hash": "4562e71d3e9721fe6d503e7e2e569f95e4899316057fcfd30ef74f3d7ba7c806"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nlargest_test_nlargest.df_equals_modin_df_nlarge": {"doc_hash": "4e00c3cbd5b141ead7a6191fd4499c9f2513ee473f72b775ad093385b608f0d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nsmallest_test_nsmallest.None_1": {"doc_hash": "9bf2db759a19133c192f0603dc4dbf52a2d3efb46befe1c2694d28215b799c81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nunique_test_nunique.None_1": {"doc_hash": "7a05e1067ef68c3333c401600acec34dc72c06dd46e3866135204c2ef74cf01c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_quantile_test_quantile.None_1.else_.with_pytest_raises_ValueE.modin_df_T_quantile_q_": {"doc_hash": "4e55544728c482b868c4bab4e543c9884ecd5b3f6f7f7932a6886dcf9db92e3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_rank_transposed_test_sem_int_only.eval_general_": {"doc_hash": "4865f70d2cd814860b62184e3aa79643d1b8d9f0d67e75d9eaa255f027e5e2e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_std_var_rank_test_std_var_rank.eval_general_": {"doc_hash": "c30557ebe08e66de07acf280557368763097fb6a98a08b37226ccf4250f65f66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_std_var_transposed_": {"doc_hash": "c4f37a2c2ff9e62636b1e7fe54538f727761025c5c2ad4a451119fc1b22d2b53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/integrations/__init__.py__": {"doc_hash": "ee961c76e98c509f953bad35baa21abcdc0a948e318fa866eeb6e12f5458d7e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/integrations/test_lazy_import.py_lazy_import_": {"doc_hash": "11a3c7edf083a595363d60a7ad71bdb9c6d0c3f8f45c1daf840107bad3781f5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/__init__.py__": {"doc_hash": "3e07640b81142b2737b617b8df4f8dd1158c678e29a6430d3a5a379ca70a9c6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/test_benchmark_mode.py_mock_": {"doc_hash": "35665a7ff0a795edadd99828ead234f46cf78f806b1e7a428a0e6c80c888ac5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/test_repartition.py_pytest_": {"doc_hash": "bfb8124eb505276bb136f3bb3675c7a16f7e1e0ee3bba2702a384e36d9aaf190"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_pandas_test_top_level_api_equality._Check_that_we_have_no_e": {"doc_hash": "034aad7149e0af11a05fccce2fabe494f019f8fc2bd8ac0f2f6325466930bce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_top_level_api_equality.None_1_test_top_level_api_equality.None_3": {"doc_hash": "308195fe6cff1bdb6156e2d0df5154af4dfdd460957213115ff410baf8faf5f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_dataframe_api_equality_test_dataframe_api_equality.assert_parameters_eq_pan": {"doc_hash": "1c47be625f4fe7ea57d732a78ef7149a3e4d903c5d3721f05fed0a753fd9ad59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_str_api_equality_test_series_str_api_equality.assert_parameters_eq_pan": {"doc_hash": "e5ea04fbe16ea59fad438d4f29234d779219aa8d896fc9967fc8c863c2613609"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_dt_api_equality_test_series_dt_api_equality.assert_parameters_eq_pan": {"doc_hash": "074738bf568850c33b306ef562edca967123c175d7bd118fdbe6449eaab9ae5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_cat_api_equality_test_series_cat_api_equality.assert_parameters_eq_pan": {"doc_hash": "bbdaf869c93857606a83fb33430bedb6addd82d4443d8b97a31fe051b1fdd54f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_sparse_accessor_api_equality_test_sparse_accessor_api_equality.assert_not_len_extra_in_m": {"doc_hash": "dae8903b9a7de291e087d181f540445e628f6c23fc22db6aa6ba83375c8e7bb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_groupby_api_equality_test_groupby_api_equality.assert_parameters_eq_": {"doc_hash": "5b922f5b41dea1ecf7c5de2b55dee683aebb3f974fbd395b12bdebbc943437a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_api_equality_test_series_api_equality.assert_parameters_eq_pan": {"doc_hash": "ce416f0980e27bf224342a02bbf7c5a781c5c0d5978f906d2144ab9714ad44e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_assert_parameters_eq_": {"doc_hash": "175847da0b4631bb39ef9a09f8e809c8e5ec16d6784b763a1b35eeccd53371dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_np_test_concat.df_equals_pd_concat_modi": {"doc_hash": "376612f0dfbb19d12110b166322567d87fd0e95eee35001b048a435b81abf28c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_with_series_test_concat_with_series.None_1": {"doc_hash": "e0c6dfcb12045cb58d6463c5279ee25e0d93835da6432805bb02ecd13225cb58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_on_index_test_concat_on_index.None_2": {"doc_hash": "b3631ebfee92d67562c5ec11ee11a7be5a3f08d3b19371655ba44389a3b5a272"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_on_column_test_concat_on_column.assert_modin_result_dtype": {"doc_hash": "bed8f3e6bd3b500aea1c0069c241ecd963977e70023af052c177527035debeb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_invalid_axis_errors_test_ignore_index_concat.df_equals_": {"doc_hash": "d88b4b967ba0084873ab77faa015f79a28df59d5a8cab8ca56e79fcfde2180cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_non_subscriptable_keys_test_concat_non_subscriptable_keys.df_equals_modin_result_p": {"doc_hash": "b11471db5749a29e7bd6e0787d1b8e2487e8e040942759125407d4f567385540"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_series_only_test_concat_5776.df_equals_": {"doc_hash": "3ae1a66c6cb846dda8b44b2a8e8c8de6f3727a422442ab2c4d19ba6ac673a9a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_with_empty_frame_test_concat_with_empty_frame.None_2": {"doc_hash": "f3b5e28a0a25c7daed1e507168bb35448874308692c5f0905928bf7e951837f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_multiindex_test_concat_multiindex.df_equals_": {"doc_hash": "ad358fdc76092c8d2f3eacd9bfa1ff2d72792b5571e5dfafe690ad923852e8f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_dictionary_test_concat_dictionary.df_equals_": {"doc_hash": "92d4bfc2f78824355d0bddb7aae6b04a955c665bfc98098b06c8f78350c31103"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_sort_order_test_sort_order.assert_list_pandas_concat": {"doc_hash": "2a8ea1c3ba0c68dc5021ed26d49eda8f24880ef3eae43dc8a013970ba89e11cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_empty_test_concat_empty.df_equals_": {"doc_hash": "ce03c6aab3d7ff294eac3dc2226a74d3b543a1d066c8878ce018c3d0fe4d1925"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_empty_df_series_test_concat_empty_df_series.None_1": {"doc_hash": "5b505ff65d6b5011183b5ca20256c2fafdb8bf606f0da2784c9b620b72fc08e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_different_num_cols_test_concat_different_num_cols.create_frame.return.df": {"doc_hash": "4c57b3e484fd1bb34f1caceb838e7c6d4d195706e9e8ea672a1b82e630b4e142"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_different_num_cols.concat_": {"doc_hash": "864c84848fd74592eba5f7d61a22005d69e07202e2554fbf5bbdbe0f83e3c867"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_pytest_create_test_series.return.modin_series_pandas_seri": {"doc_hash": "250445fad94df170800acad7a396bb452316919d1912ff71910af91c2edcfc85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_test_dataframe.eval_general_": {"doc_hash": "12792df3f0dcf316e036604fcbb5603468a3bf5b748a57bb685ed4d5528c6d40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_corr_cov_test_dataframe_corr_cov_with_self.with_warns_that_defaultin.eval_general_": {"doc_hash": "43bb8b55618194691d8d5cea0123250708f40b409dde1c1f47b2f787bfa1c092"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_agg_test_dataframe_agg.df_equals_": {"doc_hash": "ef68a266cff7546d2d8312dbdbb025897203cf04db3f7b3673a3d93c1c6ab14a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_series_test_series.eval_general_": {"doc_hash": "3d751371af3de3ef2dc49685cf2dcc24237aae10761c2075a6281550f87c763a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_series_agg_": {"doc_hash": "c036fef3aeb7ac93273039313e76d45e034ce9c73e1e252ed80ab9c82516b4c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_contextlib__nullcontext.yield": {"doc_hash": "aa9620f99d5388d718754cfea1fa839bb3a4f661421500cc266344b88a0f354a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_isna_isnull_notna_notnull_test_isna_isnull_notna_notnull.assert_pd_isna_np_nan_": {"doc_hash": "5e425cddd0fc20f53042fadaac133e0576b961553c49c960625af635e3864b9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_test_merge.with_pytest_raises_TypeEr.pd_merge_Non_valid_type_": {"doc_hash": "7db749ccfcd2f7032f2e001efdbb14c73d9169cf05bb8a3929a843e372bc982e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_ordered_test_merge_ordered.with_pytest_raises_TypeEr.pd_merge_ordered_data_a_": {"doc_hash": "3ad4a8e594aaae8a87c6fdf19527243425ea7c9aaccb816f6f9ee13104a93764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_test_merge_asof.with_pytest_raises_ValueE.pd_merge_asof_": {"doc_hash": "b8bdf8e1ad25a79dfdfc4e7edf05175b7f08288e640d487bf30fdb44a8fd1998"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_on_variations_test_merge_asof_on_variations.for_on_arguments_in_.df_equals_pandas_merged_": {"doc_hash": "4fbfefcbddf1bf2fb2f8d4ce3cac8db9556e11be875df4793e28e69ec7d555dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_suffixes_test_merge_asof_suffixes.None_2.pd_merge_asof_": {"doc_hash": "d889275de4370aa010011b4601d43557f357ffe4400846852eb165fe202171aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_bad_arguments_test_merge_asof_bad_arguments.None_17.pd_merge_asof_modin_left_": {"doc_hash": "a607586d322a34ba5e9b9cabe82d6407145b03c5df24e9fd7514b37b8949903f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_merge_options_test_merge_asof_merge_options._Tolerance": {"doc_hash": "8781dd89f2fb676f8a4f0513d12a0007236c8c7386956681ba72349c3b29e3c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_merge_options.None_2_test_merge_asof_merge_options.None_4": {"doc_hash": "96054b3925bf6ec35d4c84b6043cb27d278b7705c9ae0706ee60ebb310108cff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_test_pivot.if_get_current_execution_.None_1": {"doc_hash": "541c08d75b0c30cb2dcf21474753ab4c56addce32c60cd71caba8186b08a632a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_values_is_none_test_pivot_values_is_none.assert_isinstance_df_pd_": {"doc_hash": "b79e62e9ebd617287fbaf6dcc81cd755f4fec77cf55619c10c7a471ca79463cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_table_test_pivot_table.with_pytest_raises_ValueE.pd_pivot_table_": {"doc_hash": "60d3aedcd66a5f8d67292f6fced77f14e6aff4b732429010b1def40dfc502f11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_unique_test_unique.None_5": {"doc_hash": "88d5347cd7d278ac038cf184586de57182bcb163ab65cd845a98b046a89d2588"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_value_counts_test_value_counts.None_2": {"doc_hash": "d65c50e3a40b23ebf4968f03a3264811f15a24d17718394943c11b505fe94905"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_datetime_test_to_datetime.None_2": {"doc_hash": "6ca58f1dfa0fbd37e2d5257fe3d387369044cadf616c1595adee56270b6a95db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_datetime_inplace_side_effect_test_to_datetime_inplace_side_effect.df_equals_": {"doc_hash": "c89107e64b8bfa3a973bb0c39b0f968be3a352199bb8188ed15a37ceaa82d2e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_numeric_test_to_numeric.df_equals_modin_result_p": {"doc_hash": "3cb4f9b3116c6a4ee04bf8c4ff9c06fc98de835a597a3f925df0ac7200097698"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_qcut_test_qcut.df_equals_modin_result_p": {"doc_hash": "c91a2e15f7cf418da3c23a9bb58005982cab1c69970ea9da3dafae28c7a23cc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_cut_test_cut.try_.else_.if_not_isinstance_pd_resu.else_.for_pd_res_md_res_in_zip.if_isinstance_pd_res_pan.else_.np_testing_assert_array_e": {"doc_hash": "bdb6ab789dea6eb0e8f39c2bcc9b46d4fa3014f8cb687fd5ff19a89368b4af87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_cut_fallback_test_to_pandas_indices.for_axis_in_0_1_.assert_not_hasattr_md_df_": {"doc_hash": "ac43909252f22f2cb4daf17a66e55a4c1fa345cd33b508a3455b937a3abf5cea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_create_categorical_dataframe_with_duplicate_column_name_test_create_categorical_dataframe_with_duplicate_column_name.assert_frame_equal_": {"doc_hash": "2bcd717fa6982d635ad375227a35de3a80b50a9632a639a178aa8b921cca30f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_default_to_pandas_warning_message_test_default_to_pandas_warning_message.with_pytest_warns_UserWar.func_df_": {"doc_hash": "963d44c50a0995dc0db605e6f20fba5bf43ac142d0ab14233d0ad34047ad3c88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_empty_dataframe_": {"doc_hash": "0a80c9acc5a0c452a7a508f545876fc742b89df8cf3970e4a04cc67bc455b8d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_pytest_pytestmark.pytest_mark_filterwarning": {"doc_hash": "12430eb3ce9fb351169d287f8c6fdcd7f56207f47d9e2898bc5ba4a785c28cf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_modin_groupby_equals_pandas_eval_aggregation.return.eval_general_": {"doc_hash": "836e28a954141a84eacbd4e48ac0a55af0edc475cc9223c2312babfeb94a9d6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_build_types_asserter_build_types_asserter.return.wrapper": {"doc_hash": "f1030c859e79ab4ce189af1c3deb060b26c76fa4a3e8ba4fc6769d5370490a2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_dtypes_groupby_test_mixed_dtypes_groupby.for_by_in_by_values_": {"doc_hash": "e0bda0aec707d8a6c3157bb143e3453b4b11edf384f8cd36c7bbb28f67315234"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_dtypes_groupby.for_by_in_by_values_.if_isinstance_by_0_str__test_mixed_dtypes_groupby.for_by_in_by_values_.eval_groups_modin_groupby": {"doc_hash": "84e9fb6abe6acb3969945ca1f441fbdc7b54f02e49c185a87581c5103d008a48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_GetColumn_test_simple_row_groupby.maybe_get_columns.if_isinstance_by_list_.else_.return.by": {"doc_hash": "dbca49cb8231626811ee87969170c51b2cb3832ca9c97b9a9bb7fa6245085012"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.modin_groupby_test_simple_row_groupby.eval_general_modin_groupb": {"doc_hash": "aac169eb7a05595a51eb83d46a93f3878076ead3c82c095cd0f1e9785356d6b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_as_index__test_simple_row_groupby.None_8": {"doc_hash": "9d33fcc32597607b3df1a0c1c2463763791753ca3f0ab542df868ef48c70a116"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.eval_ndim_modin_groupby__test_simple_row_groupby.None_10": {"doc_hash": "12a1f0af401a284ba9237da3f61804a064bccd2d488160ce350b1dfebeb69c0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.apply_functions_test_simple_row_groupby.agg_functions._": {"doc_hash": "4d5ad1c2b57c3139d0926257499dc73d35908ab49b1f3e9867d3fbdd69239dc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.for_func_in_agg_functions_test_simple_row_groupby.None_1": {"doc_hash": "a82881ce08b641f3de1e9f1fb40eba82431c9f4e67ca786dce051a39b894281e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.None_20_test_simple_row_groupby.None_25": {"doc_hash": "26d4e260b07168624ec7c3a45906db32e80155f831ba33214708ddbc901ef7f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.None_6_test_simple_row_groupby.eval_count_modin_groupby_": {"doc_hash": "4e4579316dbcbe9c34ae1afab683eb69011c9ae0280c22a5ee9d5529cda8ac55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_get_current_execution__test_simple_row_groupby._Intersection_of_the_sel": {"doc_hash": "e055f5379767d60dd8f07baae43c21a74b23ab3df1ed337ca853eceecdb4f439"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.non_by_cols_test_simple_row_groupby._that_this_workaround_wo": {"doc_hash": "88ac50a7b0986c8b759e97d60adf25f6c1ef2b8ae55eaff9b2dec92dd291fd87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_len_modin_groupby__int_test_simple_row_groupby.if_len_modin_groupby__int.eval___getitem___": {"doc_hash": "1c638d9aa8bb2a52704bf8f2d74399527fdb5bb0e36eaf479d43fccb80678cc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_single_group_row_groupby_test_single_group_row_groupby.None_31": {"doc_hash": "9715477a37f78585de0188c185959e29b01d2b905beddeb80fed0391253380bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_single_group_row_groupby.eval_cumprod_modin_groupb_test_single_group_row_groupby.eval_groups_modin_groupby": {"doc_hash": "00af292d5f7237db40d141e7a96895543e18d6963ecdf3d2ff2275f41b04242e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_large_row_groupby_test_large_row_groupby.eval_ngroup_modin_groupby": {"doc_hash": "38001bcdf85798626dbc66d2ae08e411031958edd3000f56c924520f7f161dac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_large_row_groupby.eval_nunique_modin_groupb_test_large_row_groupby.eval_groups_modin_groupby": {"doc_hash": "dddb2b39670e9a3429e84338f7526dc132d27d0e61b8a160015c4f2292645e89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_col_groupby_test_simple_col_groupby.transform_functions._lambda_df_df_4_lambd": {"doc_hash": "76ccaca6c7269b4377cc9af692db410b74127ef04ee75ba585e6b5490dcbeb39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_col_groupby.for_func_in_transform_fun_test_simple_col_groupby.eval_groups_modin_groupby": {"doc_hash": "9a90d5406b70bbe240e3e7b0a709a99f6518c330e4540658ba0dc43de6c3d8b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_series_groupby_test_series_groupby.n.1": {"doc_hash": "def6a5db671723baad01f1f469f60983b3eb5d66025265e6dfe7bcc399b1f66e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_series_groupby.try__test_series_groupby.try_.else_.eval_groups_modin_groupby": {"doc_hash": "0287ce528f9cef934dbee31de4c544c32dbb8a7cd3524e5e355a84ff68f0cf69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_multi_column_groupby_test_multi_column_groupby.with_pytest_raises_KeyErr.modin_df_groupby_by_axis": {"doc_hash": "410041041d0fcc56f2c07736e26eebb6791d09629f4d7179d62186d0dcec4374"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_sort_index_if_experimental_groupby_eval_rank.df_equals_modin_groupby_r": {"doc_hash": "77a1b5957bd8f3724eae1463b4834577446ca497207916090b325bcd7e16c1b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_max_eval_median.modin_df_almost_equals_pa": {"doc_hash": "6a6be63d5e3a1e99f69e86269db6efd3e3ce194230c6de756ea23886c79b9489"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_cumprod_eval_cumprod.None_1": {"doc_hash": "aeb1871fe9d9bf280e1de38b2727326674771f49dfebdf95f17fd97aad174b05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_transform_eval___getattr__.None_1": {"doc_hash": "e7a7e671f6d6f89c879b2577afba0259a265c2f6a1335a21119b941dd7830f83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval___getitem___eval___getitem__.build_list_agg.return.test": {"doc_hash": "11c252ab5f5772ea0fa3fe4fdecfbf8d5d4ce491fa82b269cd076383b8d746fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval___getitem__.None_2_eval_groups.for_name_in_pandas_groupb.df_equals_modin_groupby_g": {"doc_hash": "e74b26126434dee328153463e6d9b90119a91b23739f13117a5b4e3d1585d890"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_shift_eval_shift.if_get_current_execution_.if_isinstance_pandas_grou.else_.eval_general_": {"doc_hash": "e1da332c4c8df5a782e30314029a6c92e403e6242ee0d691991da1204ee783f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_index_values_with_loop_test_groupby_on_index_values_with_loop.None_1.df_equals_modin_dict_k_": {"doc_hash": "e2a060de7ee67b02ef14c9e37a9bc1c69b2650bd6eb1851a14e86ea066a0c63b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_getitem_preserves_key_order_issue_6154_test_groupby_getitem_preserves_key_order_issue_6154.eval_general_": {"doc_hash": "4ed6c493c7e89f29981a5b8b6a08f53fe92bdc892302dc1b95db1ac4afdb74e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_multiindex_test_groupby_multiindex.df_equals_md_grp_first_": {"doc_hash": "f016f664bf00d35019cfc0ee7e5fabf80a2573105367f1581020667c1334aa76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_kwarg_dropna_test_groupby_with_kwarg_dropna.if_not_not_dropna_and_le.df_equals_md_grp__default": {"doc_hash": "6e4e205caad5f5fb608246a8feff21f72a2278113ecd5d096dc0bb7501d44166"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_shift_freq_test_shift_freq.for__by_in_by_.eval_general_": {"doc_hash": "46037c5964e6771ebc1243950cce5b64ac9891ac2476e69204a33adbce8e1f80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_func_None_rename_test_agg_func_None_rename.df_equals_modin_result_p": {"doc_hash": "b91cc1639f92d66c0f8777b1fe513f30f134f690a6ddc1259db12ca868b1c18c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_dict_agg_rename_mi_columns_test_dict_agg_rename_mi_columns.df_equals_md_res_pd_res_": {"doc_hash": "fa0bb4c41da63abfda7dc15d3d73834e7456fe2740fb1958f355a647ce1241e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_4604_test_agg_4604.eval_agg_modin_groupby_p": {"doc_hash": "e0659360444f44cc2619018c52eb557c0bc6de138596d2314bd39b6d5dc15f50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_exceptions_test_agg_exceptions.eval_aggregation_create_": {"doc_hash": "4230e296de0fc6fc11fecfc47b04c0bb7d26458a7c69ac22cf927817b6198448"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_to_pandas_convertion_test_to_pandas_convertion.eval_aggregation_create_": {"doc_hash": "7c2aa9bbddbbbe8f0776e92905a12429724202751473ea51ebae1f24f678c60a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_columns_test_mixed_columns.df_equals_ref_exp_": {"doc_hash": "b57188b3cdc33976845dea61cafe234e20e8a08112aaa88a27628df9e87e1b8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_internal_by_detection_test_internal_by_detection.assert_ref_exp": {"doc_hash": "a7f306d0e913d6553c2df8da2c07a81380b7e1c03c0af38f4eba509ab50e5aeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_columns_not_from_df_test_mixed_columns_not_from_df.None_3": {"doc_hash": "a2db857418c53fde541163223948dc7a1b80298e0f805f4602be896f6f22767f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_unknown_groupby_test_unknown_groupby.None_1.modin_df_groupby_by_get_c": {"doc_hash": "d37eecb0650731760e1971ba871f1bbd486ca48ac409d1dc8c591bc07a6145b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_multi_column_groupby_different_partitions_test_multi_column_groupby_different_partitions.None_2": {"doc_hash": "777a94162320a8344782962b939b6d8a50a4acb7d007dc3828b1d348f0c169a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_not_str_by_test_not_str_by.None_5": {"doc_hash": "cdde31831d0633c2bc47de4e3b8eac4151ad2c42f54cf59959bce41b944ad439"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index_test_handle_as_index.if_has_categorical_by_.df.df_astype_df_columns_1_": {"doc_hash": "bc5ef183aa0f3f3e12dbf18404f4a66c8d8fa35511c40e08a93f425fa2f56cbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index.if_isinstance_agg_func_d_test_handle_as_index.agg_reference.agg_func_grp_reference_": {"doc_hash": "86b2f44e2b68236125355e400a029822cd8c6bd959d24ec8a806079627995604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index.if_use_backend_agnostic_m_test_handle_as_index.df_equals_agg_result_agg": {"doc_hash": "4a33bfd229253abd83ca7b08c6691ff6e537886a1870d2f74e6a0e51426d1f5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_validate_by_test_validate_by.compare_reference_by_res": {"doc_hash": "4c22a75f783c0059a2c7be140b7b4561e2db3631533c8b05acd9dfe04fd16c06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_virtual_partitions_test_groupby_with_virtual_partitions.eval_general_": {"doc_hash": "64e9f9c9aaa5df91034143b64ff0132a476f8d2a35aad7cffd17ee8330c4dd22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_sort_test_groupby_sort.None_6": {"doc_hash": "9c47820fada13294460564d8ae05a9f3678809914b558cedc868cfb8f84066f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_sum_with_level_test_sum_with_level.eval_general_modin_df_pa": {"doc_hash": "46c4caae5771a4abe8e8c3a46288ef16a43928b6adade8cd591863ad63167649"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_frozenlist_test_groupby_with_frozenlist.eval_general_modin_df_pa": {"doc_hash": "7c963c1b71b45cede85530afd3401e66f3f47720b68d5283fd99fef6502e2e61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mean_with_datetime_test_mean_with_datetime.eval_general_modin_df_pa": {"doc_hash": "5284a4fd2fe5f5150476ec60b14d08affa9c7996716fd4a03f0f00118bf18a46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_ohlc_test_groupby_ohlc.None_2": {"doc_hash": "0016630020dcd8d8fdf1d2add2f752cdef50f6915a96388d591764393ad6c151"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data_test_groupby_on_empty_data.ModinDfConstructor.frame_with_deferred_index.return.df": {"doc_hash": "9ed14a6ec106cbb7d11aed50a110041b518471e30f82183b96dbec96ca8b571d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.ModinDfConstructor.lazy_frame_test_groupby_on_empty_data.ModinDfConstructor.__exit__.if_self__mock_obj_is_not_.self__mock_obj___exit___": {"doc_hash": "986c554ca695c313f4d183a204a8e41b2b3b062257bd095f28c265ea4215a0d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.run_test_test_groupby_on_empty_data.run_test.with_ModinDfConstructor_m.eval_function_modin_grp_": {"doc_hash": "811bd542c5295fd66f3692ab25e4a436953c60203cdbb4901dd0ed8915170799"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.run_test_eval___getattr___test_groupby_on_empty_data._run_test_eval_std_": {"doc_hash": "a56ce3ea9b00da62e9833000b9ae89643d0932a20bfff13677dfea552918ca07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_skew_corner_cases_test_skew_corner_cases.None_2": {"doc_hash": "598dcaf0e9ae7964648c1be13ad187e4c920ec5e8c38fb8cfab100c813b68647"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_grouper_test_groupby_with_grouper.eval_general_": {"doc_hash": "f014d363d6284f737f7c61e6e79a610a20bd6e762b4e8f62586edc9b00f19a7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_preserves_by_order_test_groupby_preserves_by_order.df_equals_modin_res_pand": {"doc_hash": "7580c1be0e07c0d4cf0127a58f671685e9d7ee260b96b85517fd7b3b56632c6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_agg_with_empty_column_partition_6175_test_groupby_agg_with_empty_column_partition_6175.eval_general_": {"doc_hash": "0a11a8b3cff82411c862e2b3d7e8431b9c73ca6bcd9fb7007f690b637aeef311"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_pct_change_diff_6194_": {"doc_hash": "899a81ae25d11237e6aa7ecd0362a9a7381ca3775a1d3b0e5917886bbab126bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_mock_assert_files_eq.with_open_path1_rb_as.if_file1_content_file2.else_.return.False": {"doc_hash": "9d97221967f82167888fb5da2d4c2cf02eecbf602a8edf78e525458942402de7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_setup_clipboard_parquet_eval_to_file.df_equals_pandas_df_modi": {"doc_hash": "423e2ed70726ff41fde1083fd73156f8901695f6e43b6164637253900f0894e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_eval_to_file_eval_to_file.assert_assert_files_eq_un": {"doc_hash": "5117e278156c170d59428c5f211cc8678ff3ef8d8be73021423139c1bb4dc6d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_eval_to_csv_file_eval_to_csv_file.if_force_read_or_not_asse.df_equals_pandas_obj_mod": {"doc_hash": "aeea2af0e1f6a7a9ad2270cea1b15fef22fc561fb83777e7d133bb6e99fc2ec5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_make_parquet_dir_TestCsv.test_read_csv_delimiters.with_ensure_clean_csv_.eval_io_": {"doc_hash": "6d7e7ac7d414f20789196148fcc72703f7862fa451bd41787570fb73a229db87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_dtype_backend_TestCsv._Column_and_Index_Locati": {"doc_hash": "fa72d45dfc69656c8542b4c99df68e44d2ffe149347468ed7b31dbfa748f0a49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_col_handling_TestCsv.test_read_csv_col_handling.eval_io_": {"doc_hash": "5dda2144d5a05c3ae0f7919f0513a45b304343f1ac60458ac55655ae8f9a61e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_from_csv_with_callable_usecols_TestCsv.test_read_csv_parsing_1.eval_io_": {"doc_hash": "087512f77ba1dc4bb1ec28cdc1ae0089e283c6970543b927d6c798df55bede36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parsing_2_TestCsv.test_read_csv_parsing_2.with_ensure_clean_csv_.eval_io_": {"doc_hash": "eb064e8ad343ca16f247f07b5dab4c5fa35ff98560146663571612f60ed631c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parsing_3_TestCsv.test_read_csv_parsing_3.eval_io_": {"doc_hash": "75c8504f40a233b7e849d48e408a0d01f26c85d3295d4274044bd878385ff288"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skipinitialspace_TestCsv._NA_and_Missing_Data_Han": {"doc_hash": "07b93db79b96d5c2e27bb5f4417b41c7debf6ed6626c0cdfa7c5a7284d8ab67a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_nans_handling_TestCsv._Datetime_Handling_tests": {"doc_hash": "a7b3eb4d484ca51fe68b6d628ff1ab10fc63ce7aed3df1b2b0428c4a9fed763d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_datetime_TestCsv.test_read_csv_datetime.eval_io_": {"doc_hash": "8eabb10adeeeb94732b94ae46077d68a4646b157fcf7453b72312ed200453382"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_dtype_parse_dates_TestCsv._Iteration_tests": {"doc_hash": "07b3fcf6489fb33bae819a412df8e9daffe880b7f61d1667881415bdec79097b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_iteration_TestCsv.test_read_csv_iteration.None_1": {"doc_hash": "aea5ee2de4b521f66255aa632f782909294156e05033dc3d66499481669a2242"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_encoding_976_TestCsv._Quoting_Compression_pa": {"doc_hash": "e1f9a2f1a0f21efe66e0d715266995646a5e87c040465caec4b39148cda59578"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_compression_TestCsv.test_read_csv_compression.with_ensure_clean_csv_.eval_io_": {"doc_hash": "36a522fb3db5af960aaa67f62f750a0c63c1f626506efc0d8177991570f2ffe7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_encoding_TestCsv.test_read_csv_encoding.with_ensure_clean_csv_.eval_io_": {"doc_hash": "fae1668fd1c0b35e97164b4b0b5194197757e87f5b1f393f657297d412ef73ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_file_format_TestCsv.test_read_csv_file_format.with_ensure_clean_csv_.eval_io_": {"doc_hash": "41bae635da24adf6b2ba57e428f4f763b75228617af3af1c141f14c777ddc96d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_quoting_TestCsv.test_read_csv_quoting.with_ensure_clean_csv_.eval_io_": {"doc_hash": "d69938856dfaa5175c7bef26c96d579ab863210e69c9d5ab9fdeb429b52c8fb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv._Error_Handling_paramete_TestCsv._Internal_parameters_tes": {"doc_hash": "6850b7294bf620928b0318023e06c8020b104dfaad4a64d55b1a1042966eddbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_internal_TestCsv.test_read_csv_internal.with_ensure_clean_csv_.if_use_str_data_.else_.eval_io_": {"doc_hash": "72b74fe121a3b35b2e94de8efc06a33a026a2dbcc04b1760070556a648e3fe63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv._Issue_related_specific_TestCsv.test_read_csv_google_cloud_storage.eval_io_": {"doc_hash": "6b4ed27dd504afbb2ca923ffb4fb2bebfb8bf3c323b572f9bd013fa52b20d4d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parse_dates_TestCsv.test_read_csv_parse_dates.eval_io_": {"doc_hash": "07496163a2ddb141e6bf4a4093a48bd0b58b2cc9a20b210d32da62efd4764992"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_s3_TestCsv.test_read_csv_s3.eval_io_": {"doc_hash": "cc4881b80b8002fc12c8e5cc11f1f33a252a119ecfa7ea4c9a5093aa991cc3ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_s3_issue4658_TestCsv._has_pandas_fallback_reason.return.Engine_get_Python_": {"doc_hash": "fc22f92b5906db622ae6df3ceab6cccf399b49edc7aa0d2c815578ff9a97b596"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_default_to_pandas_TestCsv.test_read_csv_default_to_pandas.with_warns_that_defaultin.with_open_pytest_csvs_nam.pd_read_csv_StringIO__f_r": {"doc_hash": "90ffb9c7190e67c92261b232d946ee81959ab3db5849ece9c77f1ac6a72b8a19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_url_TestCsv.test_read_csv_url.eval_io_": {"doc_hash": "a3630d2eb6c80cddd77a3d17556d1ee2fdb15fd0f51674b81130efe8cce52383"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_newlines_in_quotes_TestCsv.test_read_csv_newlines_in_quotes.eval_io_": {"doc_hash": "5275870a6effeb24ef3239a0784f939b7c688d86e9b6b14a97e8f6f04870037e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skiprows_with_usecols_TestCsv.test_read_csv_skiprows_with_usecols.eval_io_": {"doc_hash": "592adba05d94bbb30cd344734989830456fafb72be296f9cb8ddc1d2f35603b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_sep_none_TestCsv.test_read_csv_incorrect_data.eval_io_": {"doc_hash": "67e1c0a244311249ef1057892dfdd11b40e716814c04d0571b01932d11d25cda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_names_neq_num_cols_TestCsv.test_read_csv_wrong_path.eval_io_": {"doc_hash": "8c7177fce4fdb750eaafe73884680be3ad83cd0e53558fe8f3853f64b794c2d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_to_csv_TestCsv.test_to_csv.eval_to_csv_file_": {"doc_hash": "7eecb54f9ff21e3c1c88a567d027c95b20f41ac3fda9fb58b72070edb98ee4f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_dataframe_to_csv_TestCsv.test_dataframe_to_csv.eval_to_csv_file_": {"doc_hash": "a991d2a77d1f794b18e3b15514d0b92cbaa6ebda81907c23a51727d94f169cee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_series_to_csv_TestCsv.test_series_to_csv.eval_to_csv_file_": {"doc_hash": "d8f63263be66120b2c09f1744f79345a2d918d5edf09ce625ee3e3c0d73fdf3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_within_decorator_TestCsv.test_read_csv_within_decorator.df_equals_modin_df_panda": {"doc_hash": "ce8a56772e799633dc965a071306b9a77e10398fd9333c150d3e07836181d5a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_file_handle_TestCsv.test_read_csv_file_handle.if_not_AsyncReadMode_get_.df_equals_modin_df_panda": {"doc_hash": "664715054d03db9bcea5e9a3a87c015afbf6d56a87f08801abcab557bbcdd43d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_unnamed_index_TestCsv.test_read_csv_empty_frame.eval_io_": {"doc_hash": "d9a61125d66aac2f9902c7bc9eed7956a8d165191dedfdfca6d0c77972c7f335"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skiprows_corner_cases_TestCsv.test_read_csv_skiprows_corner_cases.eval_io_": {"doc_hash": "f59f778903cccf46dfd8fc2e54d73055133fb6b465650f510b596213de8557eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_to_csv_with_index_TestCsv.test_to_csv_with_index.eval_to_csv_file_tmp_path": {"doc_hash": "071d707c64537c9215fa7cff237b30fd32fb3fb45a82189f8f3c1419d42a3ccd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_issue_5150_TestCsv.test_read_csv_issue_5150.if_not_AsyncReadMode_get_.df_equals_expected_pandas": {"doc_hash": "32e9dbbd2b8fa4a7a39a446c0b98b67533de256e5b69b94a5a33d2b3b5c0b9af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestTable_TestTable.test_read_table_empty_frame.with_ensure_clean_as_un.eval_io_": {"doc_hash": "3cb7d425a28afdc7f65e7e2efef72779235f17f6ae7739bfa627dd84df7beb2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet_TestParquet.test_read_parquet.with_ensure_clean_parqu.eval_io_": {"doc_hash": "b67dcd40a1193f87dd98a77b8f1a1f278f3efad7773b36178a29efbd37bf4dd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_dtype_backend_TestParquet.test_read_parquet_dtype_backend.with_ensure_clean_parqu.eval_io_": {"doc_hash": "eb2a839a128806a66f67bcfa45962d1bd07ace8b60730ae388e0eeedc6820a0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_list_of_files_5698_TestParquet.test_read_parquet_list_of_files_5698.with_ensure_clean_parqu.eval_io_fn_name_read_par": {"doc_hash": "6f0871942d41716447e2836771aa6109228b7733845cb4ea330b646afecae8a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_indexing_by_column_TestParquet.test_read_parquet_indexing_by_column.for_col_in_parquet_df_col.parquet_df_col_": {"doc_hash": "1a38e2500bda45653a5a69824cea4f18f08f0bed1b3a68f576e38485018a6144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_directory_TestParquet.test_read_parquet_directory.eval_io_": {"doc_hash": "c8d1736bedd9af2052d904331e9dce39501e1b39cda17927f0e61a20f5bc08f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_partitioned_directory_TestParquet.test_read_parquet_partitioned_directory.eval_io_": {"doc_hash": "993f9c3c5c220d487e3ef75626816f9d619f59a5f86177aea6663720a8dbb17d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_pandas_index_TestParquet.test_read_parquet_pandas_index.with_ensure_clean_parqu.eval_io_": {"doc_hash": "f415a455cf6bda0c4533fdb47e724e5da24c641ce0fe4a499f30fc34ac3370fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_pandas_index_partitioned_TestParquet.test_read_parquet_pandas_index_partitioned.eval_io_": {"doc_hash": "0d1a779e371ba7baa3d5580b39e6fcf3306a5e8df1d3731ffd4a63300369c655"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_hdfs_TestParquet.test_read_parquet_s3.if_path_type_object_.else_.eval_io_": {"doc_hash": "9f75265c357c86a08f04d53711dcd82b3cc2cd7557a0988908b6d7088856e2f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_without_metadata_TestParquet.test_read_parquet_without_metadata.eval_io_": {"doc_hash": "7659420d41b5b58c2402c1b9f801d6cc3c726584692d44cdbeaf4efdd3c79fa3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_empty_parquet_file_TestParquet.test_to_parquet.parquet_eval_to_file_": {"doc_hash": "9e7d66e342b6560c51fc25b2f5ca3db35f4feadb3f026e0316b09d2b6f621232"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_to_parquet_keep_index_TestParquet.test_to_parquet_keep_index.parquet_eval_to_file_": {"doc_hash": "e6d50e0de3757da86c88ad1aa4cbb208b9ff1f3e3fea68d7f7a0b88c9933294b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_to_parquet_s3_TestParquet.test_to_parquet_s3.assert_not_os_path_isdir_": {"doc_hash": "ae0a4a96030a934c893e2e8c3c1449f39a754d54976a5bda42c3518c43d08e63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_2462_TestParquet.test_read_parquet_2462.df_equals_test_df_read_d": {"doc_hash": "951a40e44cab885f20abce76bb0535873f4b33a1f635ac10d079955a8b6d58a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_5767_TestParquet.test_read_parquet_5767.df_equals_test_df_read_d": {"doc_hash": "ed0102bcf0442cb39af0336087f8f8ee0ce8252d6732aca8065b6b2b95d03544"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_5509_TestParquet.test_read_parquet_s3_with_column_partitioning.eval_io_": {"doc_hash": "d700e9df848e3bf2af558c198c358f4829bd8cad354a65110b7086b16485adeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson_TestJson.test_read_json_dtype_backend.eval_io_": {"doc_hash": "606a2ff3b57f446aba421ce2ab848bd9afa5203ef620c55ff7c0be4fcceee2a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_s3_TestJson.test_read_json_different_columns.with_warns_that_defaultin.eval_io_": {"doc_hash": "65ec0201500f6e993c935d4bbe09460c567796143cacdeefa5550ae62ef878a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_string_bytes_TestJson.test_read_json_string_bytes.df_equals_modin_df_panda": {"doc_hash": "09217daa36f03ca6809092a41d9812757b56900f8373b2edafa30545ec2c5548"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_to_json_TestJson.test_read_json_file_handle.with_open_make_json_file_.df_equals_df_pandas_df_m": {"doc_hash": "52c77fd70e6e7c647eed21aa66b3b899c6cf6ab53eba0d4b93769a28483e2108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_metadata_TestJson.test_read_json_metadata.assert_parts_width_cached": {"doc_hash": "bb17d351a3076481bfbdb72d07b618ba0077b9e0698cb7b22136f59b3a0ceff9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel_TestExcel.test_read_excel_dtype_backend.eval_io_": {"doc_hash": "3e529fcec63521831b43470f88d1108ad404fb01285dac37b2f60a9d6babcf9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_engine_TestExcel.test_read_excel_engine.eval_io_": {"doc_hash": "8b8930a945c80a61e58d459e441afe9edfd60cc55e909152b2ba8e4a0700cfeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_index_col_TestExcel.test_read_excel_index_col.eval_io_": {"doc_hash": "934c24f57fce39059b575d9d5adff34594f7b7117ff9d833d3b394ea06d1086a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_all_sheets_TestExcel.test_read_excel_all_sheets.for_key_in_pandas_df_keys.df_equals_modin_df_get_ke": {"doc_hash": "bff18a28d6ab1fc520d6095799275904bca57c2ee450d83d50f0ca191b731ccd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_sheetname_title_TestExcel.test_read_excel_header_none.eval_io_": {"doc_hash": "c09fdcf276a7a63bf5c1312e0bc1a85209d8e8ee8bb487fa7aca6550b2480422"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_sheet_name_TestExcel.test_read_excel_sheet_name.eval_io_": {"doc_hash": "044c248521ff34df828b04750fbc0d06ad179ef777fa2857bdc803a45f990c62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_ExcelFile_TestExcel.test_ExcelFile.try_.finally_.pandas_excel_file_close_": {"doc_hash": "c83a5b7bd27e563c38b8d10eaf6e0f21d12752cb16e121c35b93f9bb59f8b1a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_to_excel_TestExcel.test_to_excel.assert_assert_files_eq_un": {"doc_hash": "19927d6da2868880f239e429e2a222184085292cc42013159503225944d893a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_empty_frame_TestExcel.test_read_excel_empty_frame.eval_io_": {"doc_hash": "7bdfb36c0821bd7344413bbdb9d66d13b55b45ff0e78c02463c3267587cdb509"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf_TestHdf.test_read_hdf.eval_io_": {"doc_hash": "6cfaf2ae0fc07237c3940a3cba2b88d693013c1a32fe18a0fda4eabddba667c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf.test_HDFStore_TestHdf.test_HDFStore.None_4": {"doc_hash": "4bbdf850e64547e96192d58da08f00bdff05aaa6298a0bce449d4a73054f5aca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf.test_HDFStore_in_read_hdf_TestHdf.test_HDFStore_in_read_hdf.df_equals_modin_df_panda": {"doc_hash": "6538f1ef6897f4251cf70b9b87dfb399bf77dfd303c20df87a948b3117de2921"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql_TestSql.test_read_sql.df_equals_modin_df_panda": {"doc_hash": "d827af51eb3b43300b1f6598c1232b7d5c90e16e35c7b43b68d49cc900c5be10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_dtype_backend_TestSql.test_read_sql_dtype_backend.eval_io_": {"doc_hash": "ab26885d743f25f5cb030b759bc58f0bdc664e8f9ba812439f6418ec0f8e0907"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_from_sql_server_TestSql.test_read_sql_from_sql_server.df_equals_modin_df_panda": {"doc_hash": "de7ca56c252f7318be9a485df2277f89dec8a406092d2f1760bd00da9efe02b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_from_postgres_TestSql.test_read_sql_from_postgres.df_equals_modin_df_panda": {"doc_hash": "ccf4bfe4b487c165836827cd19eb4d26ced76c224db8da5cc5ada827af96e255"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_invalid_modin_database_connections_TestSql.test_read_sql_with_chunksize.for_modin_df_pandas_df_i.df_equals_modin_df_panda": {"doc_hash": "f52ad5a15c06a32aee5381e42397e4ecc28da948dead52ae189e35825d1879a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_to_sql_TestSql.test_to_sql.assert_df_modin_sql_sort_": {"doc_hash": "fbbef6048b14a3623fb05f5a5ce74a4b02c6c0a38d1c746d7be25931b0af0af0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHtml_TestFwf.test_fwf_file.assert_isinstance_df_pd_": {"doc_hash": "802146ac5b4083a2d343065a5ca9d14e3295c14249876ddf1045cd2344862864"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_colspecs_widths_TestFwf.test_fwf_file_colspecs_widths.df_equals_modin_df_panda": {"doc_hash": "f6791af553034beee1e2a529884ff3bec78d26af4178f8636ff826513a8add74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_usecols_TestFwf.test_fwf_file_usecols.eval_io_": {"doc_hash": "aa05b713c0205671436d71c65b53c17f228c1ac82dd42b564b0bf5e7cb7e1493"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_dtype_backend_TestFwf.test_read_fwf_dtype_backend.with_ensure_clean_fwf_.eval_io_": {"doc_hash": "022637869de9ba113b10cc2f17a9a20177a6d551c036f42cd55cdc473e40933f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_chunksize_TestFwf.test_fwf_file_chunksize.None_1": {"doc_hash": "54267008302a5c554a1035d24983953c429d94eef2c5a1ccfdf9a5b589b4c64a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_skiprows_TestFwf.test_fwf_file_skiprows.None_1": {"doc_hash": "93dfd1aaac5d1338c3c3865ca508efb06b2440aefec5999231af5bb2c1afdef9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_index_col_TestFwf.test_fwf_file_skipfooter.eval_io_": {"doc_hash": "d3f5c0943b5de63da31322c48ca8274a0371f73848c345bb8ceffe97e6cca74c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_parse_dates_TestFwf.test_fwf_file_parse_dates.None_1": {"doc_hash": "0bedf93e78fa1381c8a10d59fc8f49a5b0d6e8056f542f93986f7105fd4043e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_file_handle_TestFwf.test_read_fwf_file_handle.with_open_make_fwf_file_.df_equals_df_modin_df_pa": {"doc_hash": "9309f05437cd53e4f869c4c5bd812f2f04bbf08bbd8ae93da2797df2b13fa566"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_empty_frame_TestFwf.test_read_fwf_s3.eval_io_": {"doc_hash": "bf57d647047e7d827c4e8472aafa1e4a86f5a2783036a54c9feabced31962dbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestGbq_TestGbq.test_to_gbq.with_pytest_raises_.modin_df_to_gbq_modin_ta": {"doc_hash": "18bdf3369782b69d1ef1d6ad6f3082601519e63a1112d3410683c63ca6aa4397"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestGbq.test_read_gbq_mock_TestGbq.test_read_gbq_mock.read_gbq_assert_called_on": {"doc_hash": "9923fc85bb3bc6cd790ec5fdb4417619047d4362e4ac8a1fcd812b8d31e2efff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestStata_TestSas.test_read_sas.eval_io_": {"doc_hash": "efcea2c4fa93513e1626a3212751a3e399f0e6f3e0ef0da5e96791db87ac4c73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather_TestFeather.test_read_feather_dtype_backend.eval_io_": {"doc_hash": "847c1d640d20fc639790982ff936ee19fb069d485feb7cbd677f37731c598e00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_s3_TestFeather.test_read_feather_s3.eval_io_": {"doc_hash": "a0fb086a95f1d8f5f02d6754ca9f6dcbe29e9a8143b0166649bf6d10f192af0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_path_object_TestFeather.test_to_feather.eval_to_file_": {"doc_hash": "a140505362bf060370a08731616280e009d29b268ffcabce1ae7abec10c082b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_with_index_metadata_TestFeather.test_read_feather_with_index_metadata.eval_io_": {"doc_hash": "137cce40450d06a12a6061e3106a081977b2bf6cf68516dd9098d65bb254f718"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestClipboard_TestClipboard.test_to_clipboard.assert_modin_as_clip_equa": {"doc_hash": "cad31198e7b5e4634261ba85245e399475faaad7c16043d2d06c4e6166d9d9af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestPickle_TestPickle.test_to_pickle.eval_to_file_": {"doc_hash": "b08fccee3b404105d293d6eb9a8f4f1dc87661648329e0eb45992085ec770eed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestXml_TestXml.test_read_xml.eval_io_read_xml_path_": {"doc_hash": "bfd7bb04538c03ee15ca2c55964f79869cefc47a35d24af05f8b49860d5f0418"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestOrc_TestOrc.test_read_orc.read_orc_assert_called_on": {"doc_hash": "634dce8b0c515fe1907f4c5cba56df44e68a23d3f4e7421e02662f39792962d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSpss_TestSpss.test_read_spss.read_spss_assert_called_o": {"doc_hash": "5082929bf83d4231a3ca41dc2a94914e48e04827cb7c5949d0051133581f4767"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_json_normalize_test_from_arrow.df_equals_modin_df_panda": {"doc_hash": "54c083dd50ef5aca4de1e52b032162b354839d5f5b9c92fc40bcc8e48de160be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_from_spmatrix_test_from_spmatrix.df_equals_modin_df_panda": {"doc_hash": "3526db1243b79a1bc86798ce924861dea7d876db01a8e189ac8c2887698336c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_dense_test_to_dict_dataframe.assert_modin_df_to_dict_": {"doc_hash": "898d0167342b45fe5ac653fe1d9a05dbb36b8a9d11e217f203fa5cc78e56a840"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_dict_series_test_to_dict_series.eval_general_": {"doc_hash": "241087dbbaf1b2c9bcf3680227889a36273c869800745462084bf66ae1f83725"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_latex_": {"doc_hash": "a26f488171d16d19524fd3b305db5eefb9fd937f97486b1ca96264c8743868b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_pandas_test_get_dummies.None_2": {"doc_hash": "3216059ac566ef7b4c4b4416a1c264740ed6dc93fa44c349d9b7329675117b3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_melt_test_crosstab.None_2.assert_isinstance_df_pd_": {"doc_hash": "a6662147cbe2744ee5b5e734cb759eaf9b804fc20572241788b3b90e2579e199"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_lreshape_test_lreshape.with_pytest_raises_ValueE.pd_lreshape_data_to_numpy": {"doc_hash": "28465388a6fc4bc646f3bbe6579cfd190a032483f24a4102f3e9de8c5be53053"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_wide_to_long_": {"doc_hash": "18a413db46399f253c15fa2b5f3abb8d1c61f1d095fc4c08c2b36bfc733bdcac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_pytest_create_test_series.return.modin_series_pandas_seri": {"doc_hash": "6383dba9a0b0a8fb399dd216aeb3df42a1a434e092f3f688cc5365c7071bdc12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_rolling_test_dataframe_rolling.eval_general_": {"doc_hash": "a3f4ffb942c5c39e177dbdd70d7509dc79f97095a1deabed844d5625c7440250"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_agg_test_dataframe_agg.if_axis_1_.df_equals_": {"doc_hash": "a9d09b65b7e99bfc4c1634bb78f5ebb29ffdb751bbb8f3325cb67283290833b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_window_test_dataframe_window.eval_general_": {"doc_hash": "c595f3f4622ba64e7c30ecb9cc91fb7e45d9424a0dea617ee614dcfe893c0b65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_dt_index_test_dataframe_dt_index.if_isinstance_window_int.else_.df_equals_modin_rolled_qu": {"doc_hash": "5cbc82d9906649edd533910241b710f18d75d1199427e3ad0ab7cb71e4284297"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_rolling_test_series_rolling.eval_general_": {"doc_hash": "0e5823b86be483bec14a20ad37bfd27d05155b31b7e5ded2d7846256b0067603"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_corr_cov_test_series_corr_cov.None_2": {"doc_hash": "634765d844e1416c52d3d0a0125aa7d56a669c1fae0f833b930decf10eda6f5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_window_test_series_window.eval_general_": {"doc_hash": "8cf95307b9c30b9fb916a67e6ed70c0bfbbb818f1e47940e83b7bd7b0eed1f37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_dt_index_test_series_dt_index.df_equals_modin_rolled_qu": {"doc_hash": "e9639a5629faba91364a83881cd0466a52afa0c304ce2f050e28446312615cdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_api_indexer_": {"doc_hash": "a424c761841bdb6935cd77f190e13bbdac1eb11a04d66fe38b9019d612d8371d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_from___future___import_an_inter_df_math_helper.if_rop_.inter_df_math_helper_one_": {"doc_hash": "0e12e103fd273093e20c6060a8075b2d4c9fc2edaf13978b98391d096be0d7c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_inter_df_math_helper_one_side_inter_df_math_helper_one_side.None_6.except_TypeError_.pass": {"doc_hash": "d337ad52562428521a8cf129ab0ee8a061a02f0e9289e76ef4a3378e28a7fbe3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_create_test_series_create_test_series.return.modin_series_pandas_seri": {"doc_hash": "bd70a8702b443b665e09181b7f0131589ed9265141ccfd8bf5bdc3afd04f5aa5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_to_frame_test___bool__.try_.else_.df_equals_modin_result_p": {"doc_hash": "a1e955e43c73b1b80e94ffbee0bbf79545ca15ed2deffb7c28c0fbe6c9ecdf99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___contains___test___contains__.if_empty_data_not_in_re.assert_result_key_in_": {"doc_hash": "614207b003baef4f88e24e055ab3139a8857722d7a0b16b6566a7f20400e0034"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___copy___test___deepcopy__.None_2": {"doc_hash": "9591c5b6cf571ed75f2f2758f92b8b9a8b95ee25670e1ae5d350eac0c408d7e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___delitem___test___delitem__.None_2": {"doc_hash": "d13abc98ef42530452e8baff73f334232b06cd6d2af62f55ea10890f087f1341"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_divmod_test___ge__.inter_df_math_helper_modi": {"doc_hash": "5ad2ade8e49125f53f4155aaa2aba76b828803472150aabe14f71fb7137bb73d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___getitem___test___getitem__.df_equals_pd_Series_": {"doc_hash": "dde3f415403e79b2b34fbfcbbccf58909265651cb4dad4b2ef94e44c49576cd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___getitem__1383_test___getitem_edge_cases.df_equals_modin_series_st": {"doc_hash": "98982f0b9ffe8415c9143b64a9761888d9e4797897e72ddb3a5e0c3279b2e39a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___gt___test___neg__.try_.else_.df_equals_modin_series___": {"doc_hash": "2ada685ef52fb4ec22a9d4431495b3b92fd7f8d1c2445a8698e76d43f3d18e45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___or___test___pow__.inter_df_math_helper_modi": {"doc_hash": "3ad7b54c01d0e6b2c687b9cef8cdcf2b9cebdb978a0c8904a3c4d6a8e53c5d8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___repr___test___repr__.assert_repr_modin_series_": {"doc_hash": "c0954be9831998bc9f79770cd992817ac2a4255776f3e1c49485d2b2b7f8a89e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___repr__4186_test___setitem__.for_key_in_modin_series_k.df_equals_modin_series_p": {"doc_hash": "d142d0c19b307ebc06d34fe7064462d9690b3fab9440fac32441d99ee1ba0517"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___setitem___non_hashable_test___setitem___non_hashable.df_equals_md_sr_pd_sr_": {"doc_hash": "79637d20607897b781001479c356ca259e9fb322220154b58b0fce2003b0dee7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___sizeof___test_add_custom_class.eval_general_": {"doc_hash": "bbf58e016ed64f18e78a0d70454438b5632e4fe13b33c9c665fafd7d2e013cbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_agg_test_agg_numeric.if_name_contains_request_.eval_general_": {"doc_hash": "fe5c66bfbf59bd1744ff86764ac94842f973711e99b28b753fd5a2f413ea3a3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_agg_numeric_except_test_agg_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_": {"doc_hash": "bbfe5000becbbaa61f35bc0233fa70fde4780fa15b341b5bb5de55327f2fe016"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_test_aggregate_numeric.if_name_contains_request_.eval_general_": {"doc_hash": "49bbcfe1fa544e71a339a8949cbc589c0aba4cb93ba11cba5d54725387a5b072"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_numeric_except_test_aggregate_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_": {"doc_hash": "283a013684dd5e9bed30f55be3f3a3b9e46613eb21cb0415bd6e68d96e7aac60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_error_checking_test_aggregate_error_checking.None_1": {"doc_hash": "eb595512645f91a818be03625928bb16c2f6d458f45c26620ee9f0de11b67652"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_align_test_any.eval_general_create_test": {"doc_hash": "43932dbf2efa47215b214f37d4ff2b9325a349a7932f1966712542dcf5e0dd49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_append_test_append.for_verify_integrity_in_v.None_1.else_.df_equals_modin_result_p": {"doc_hash": "1b4d6acc673b79a70dd1d7066c623b14152935710cf95909620c247bd80b76c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_test_apply_except.with_pytest_raises_Specif.eval_general_": {"doc_hash": "5f65bcd85835e44c8296e1b892eb8e877f1636faf7922b3c9f2cbed2bffb910d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_external_lib_test_apply_external_lib.df_equals_modin_result_p": {"doc_hash": "82836dc4c137efdfd6e0bb30fceb3aec4b73349dfbd38cf4cbaae87048483190"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_numeric_test_apply_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_": {"doc_hash": "266d24eb1f381c461b93ab12f0f58158644294c18ffc51f960354d914e022993"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_text_func_test_apply_text_func.eval_general_modin_series": {"doc_hash": "e750234b8ab8ba7af039f6e8406620707b9e3c073b1dc4248b08a0013a02c620"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_argmax_test_asfreq.with_warns_that_defaultin.series_asfreq_freq_30S_": {"doc_hash": "82bd61109473195a0fb3022276d2981d08fd1cedc6f65b469711d12697665c0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_asof_test_asof.None_1": {"doc_hash": "378b1a1297107b733bd65ba27d9f6b625b13ed7fc0da2bc14352149be51ac7f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_asof_large_test_asof_large.df_equals_modin_series_as": {"doc_hash": "ee4ff02e3800124ee5bce073b2378102890210ce6e30f69130456cb1b68cbe28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_test_astype._dict_to_astype_for_a_": {"doc_hash": "e6792a7e5893353abdf006d510a7dbdd2379b223cbe21f6b3256c468010f57e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_categorical_test_astype_categorical.assert_modin_result_dtype": {"doc_hash": "6b58df5c991f62a0555f62a89f8aa263cffe2a9dc0a5b9f8f53a27b0523fd5a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_categorical_issue5722_test_astype_categorical_issue5722.None_2": {"doc_hash": "2709a77686d887624866fbb1fec7d5e93d92f29228c3f2d962ff15d24aa68120"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_at_test_at_time.None_1": {"doc_hash": "02e72cafd8ea90104f014569f03c969415ac2940d40f7437718be90186e4be8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_autocorr_test_between.with_pytest_raises_NotImp.modin_series_between_None": {"doc_hash": "57c9256325ffc63e476c7930e20870b84ef73c49606fa13c338ea93222a1a2da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_between_time_test_between_time.None_2": {"doc_hash": "a049dbde0fd16d22e8bb0452bda1721f5873c62d0922489abea7b183e43b27d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_add_series_to_timedeltaindex_test_bool.None_1.modin_series___bool___": {"doc_hash": "2b699f73bc5a2c1eb1f80f1c3d2035d5835ee90b444efd467899e183e047050e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_clip_scalar_test_clip_scalar.if_name_contains_request_.None_1": {"doc_hash": "cfe605824808b5739ca2e3c4219343315fe94beb30e7fec70661facf7f76fa02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_clip_sequence_test_clip_sequence.if_name_contains_request_.None_1": {"doc_hash": "b9d269c408ee7b7303db91a599729496832f2163e338dbf558e8f1539c39faa0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_combine_test_combine.modin_series_combine_modi": {"doc_hash": "2bdabb7137c1944d29eddd166fd66e3d7012449e24cda8f453a52024f3319679"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_combine_first_test_combine_first.df_equals_modin_result_p": {"doc_hash": "666c55a5d1d6fb9de541774973df0dd173727c7f1f1d5976087868ed4845403f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_compress_test_constructor.df_equals_pd_Series_modin": {"doc_hash": "a1da83b574eaa6afabde5679ead915515fff3d1a2d9472ec84ba240fb878ee00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_constructor_columns_and_index_test_constructor_columns_and_index.with_pytest_raises_NotImp.pd_Series_modin_series_i": {"doc_hash": "936ea5e4278b333f3377b380732f103b7f290279d9dab2274b151724457df592"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_copy_test_cov.df_equals_modin_result_p": {"doc_hash": "40ba26e0bd3ba75c32c7cc15d828cbf215b96f5a4822cfa8eb04ffd0bfc8c4de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cummax_test_cummax.try_.else_.df_equals_modin_series_cu": {"doc_hash": "e6008a696c95eece384bbc8d4738f3185365a435bd075347e9ceccee2b8e42cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cummin_test_cummin.try_.else_.df_equals_modin_series_cu": {"doc_hash": "0153137ea35a8d8d7a5a720eefd277b103d65cecec558ed969802b1b5b0593c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cumprod_test_cumprod.try_.else_.df_equals_modin_series_cu": {"doc_hash": "52eddbe301614dfa64d41219c8e0a91e02cfebe291a8dab5371030c872baf851"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cumsum_test_cumsum.try_.else_.df_equals_modin_series_cu": {"doc_hash": "27e5ffd22e69c9701eadd3f287dfe933d4e4337522eddc5ef6ee5f908195f387"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_describe_test_describe.None_4": {"doc_hash": "f4d354b7bf039e105ec688d827e0b968357d2e499fa17bcdae37ec9b7e4a7872"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_diff_test_divide.inter_df_math_helper_modi": {"doc_hash": "83b3502e4a4aef198fdf7e8089fb51b295679d7e628112c9fd1ea3630ef02466"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dot_test_dot.None_4": {"doc_hash": "624ad4e0485173153fa6c123c9f74d2b4b64de79d85de7187c0293e00c9c973f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_matmul_test_matmul.None_1.modin_series_pd_Series_": {"doc_hash": "1b22b7688d709f418b047e70ad12f84751cd808afd8382225a839449e2cf1f97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_drop_test_drop_duplicates.df_equals_": {"doc_hash": "7e4769ac54f46d9aed528893064b5a0d5cfa90ad732de11f88d3686b00ff5835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dropna_test_dtype.None_2": {"doc_hash": "4864028c3d660e4453046384fc410bf951d11c4606a552ac48a8a7646ed3cb4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__Bug_https_github_com__test_dt.None_32": {"doc_hash": "62e2f2b823d54b12fd81dc62480c378e8df41d3d6c09a828a3afc6e1c4415564"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dt.None_33_test_dt.None_49": {"doc_hash": "97ce67555fa4ddb4381245ccceac6da7fc1fcff0d7ad09ac3533aefa37883155"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dt.dt_with_empty_partition_test_dt.if_timezone_is_None_.df_equals_modin_series_dt": {"doc_hash": "e23877e16d42a52a82f1f4b5cf9b8d4d70486a8136be42b5ec9ffbee5f998d17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_duplicated_test_eq.inter_df_math_helper_modi": {"doc_hash": "295d0d1f45b80003edf47360715d59064fec935e189e9e72bff308fbedab0b2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_equals_test_equals.None_1.df_equals_modin_df3_modi": {"doc_hash": "d430a2ff36b31bd7bbc5bc4f39cf85044e0b9e944039d37d9cb140bbb8518529"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ewm_test_ffill.df_equals_modin_series_cp": {"doc_hash": "679318de1993a5f41cc27542e8119a0ce4109e824547b695d648e961f5eb00e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_fillna_test_fillna.None_4": {"doc_hash": "327dcd2668d0fbb83b4f5d1333e4afe6b2db5934548fa2dd06e60bfe2a19d400"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_filter_test_iat.df_equals_modin_series_ia": {"doc_hash": "3002c950bfd25d56ad78b9227423ba3740ec4a37a494a48880bdc9860abb2b5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_idxmax_test_idxmax.None_1": {"doc_hash": "9feb38f239ff9134f5130bcb2224dc0522a4fc0c54b1a68c24f22c08d0f4b9e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_idxmin_test_idxmin.None_1": {"doc_hash": "c6ea10408d9d5b25c5638aa21f1eba27bd3196ed96795a054a6352d9b6fc7017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_iloc_test_iloc.if_not_name_contains_requ.else_.with_pytest_raises_IndexE.modin_series_iloc_0_": {"doc_hash": "1be20978b172b87ee72a6c5d8b6a52525042399efce608a03162b166fa99c842"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_index_test_isin.df_equals_modin_result_p": {"doc_hash": "992e24ef347c25e38030bace9bf404af7f716587363e01468b07ff2d4e776892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_isin_with_series_test_isin_with_series.None_1": {"doc_hash": "2aaf470d618fb15dd865a32bc26715121591a8ffaa8a82d5a3ad7d662c29b6d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_isnull_test_items.for_modin_item_pandas_it.assert_pandas_index_mo": {"doc_hash": "b6fbb9ed222e0d8155fbd0191437e03f38c204fce426c67f44848d08936039bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_keys_test_kurtosis_numeric_only.eval_general_": {"doc_hash": "c2d58ad173ba9dc9c4f2120f89adbe71226fea9565ba6a556643e7a2ab56fa06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_last_test_last.None_1": {"doc_hash": "290b40dfdd3c9918aac5b202b82501efe60c825aea1fbe48d218c25b3b167424"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_index_order_test_le.inter_df_math_helper_modi": {"doc_hash": "ccae2669a8cad893b0c3aaa46883944d0184ee6bda39d0a625fa52a809654a11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_loc_test_loc.None_1": {"doc_hash": "0784297c10f8e8caa1821a4efdf47bc1ff1fe995208d882ad4badd0d44e01764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__This_tests_the_bug_from_test_iloc_assigning_scalar_none_to_string_series.df_equals_modin_series_p": {"doc_hash": "0ce0c09c580f4eeead17a1418b4d62a8bd71b7113d46cc43f022abbb118b2851"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_set_ordered_categorical_column_test_lt.inter_df_math_helper_modi": {"doc_hash": "3284fdb2f59fbcae1596d95d504842d2e615cfc3ea9a6660f86c7d1d0658089e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_map_test_map.None_3": {"doc_hash": "0d01fb9d757a78bd379b07d746223c403298dd4afe13092ca19abb4f9469cdde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_mask_test_median.eval_general_create_test": {"doc_hash": "70313b5072c7156ebbce33a6d7e2924ae29b0b6e3053151a3a610e07bf8862b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_median_skew_std_sum_var_prod_sem_1953_test_median_skew_std_sum_var_prod_sem_1953.eval_general_modin_s_pan": {"doc_hash": "a92cf611517becfad53c4e843f0811962cdbc99ccd1bc0fb36f2608cb97e4e70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_memory_usage_test_notnull.df_equals_modin_series_no": {"doc_hash": "aa3d658fd6f77d1892939f81875d71a872de6a0d1ddd543d51402695dc9292ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_nsmallest_test_nsmallest.df_equals_modin_series_ns": {"doc_hash": "7769dd57ec2cedeede214cd5717b683cc9cc00fb52fe4a7cfdd1e1c446f9714b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_nunique_test_pct_change.with_warns_that_defaultin.modin_series_pct_change_": {"doc_hash": "291686251913e346881cf636d45f9b7ce65eea0dc9a643f5696e39f95c720ec9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_pipe_test_pipe.None_1": {"doc_hash": "d3110230e7e8b080bb76c52c0e46acc21094257d0d89d3da5c79092370394087"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_plot_test_plot.if_name_contains_request_.for_left_right_in_zipped.if_isinstance_left_get_yd.else_.assert_np_array_equal_lef": {"doc_hash": "21d987e120a583e97fd33d0dc27164c90f75960a88852b4c696e662fbe9b25b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_pop_test_radd.inter_df_math_helper_modi": {"doc_hash": "132bccf654f2e35db02c513964e8f0254b5044f1d3b16868203b50507684e523"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_rank_test_ravel.np_testing_assert_equal_": {"doc_hash": "caec08f1e7652a68147d5f5927b1cf5eaa3a078324852ded438c75ddb82b0f6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ravel_category_test_ravel_category.categories_equals_modin_s": {"doc_hash": "4f71d3507659f251d9c8ae2319b2e78d3da09762ec9956d5c59bbe68a17523cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ravel_simple_category_test_rdiv.inter_df_math_helper_modi": {"doc_hash": "c020d4dce41466ba34fbcd8c759c1cae064a45e9bf4effa2898758447abba9e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reindex_test_reindex.None_1": {"doc_hash": "ec0a0f8e95bf094917027072a2db2593ba2d9d8d78cfcc38f84bf9f6536f0a36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reindex_like_test_reindex_like.df_equals_modin_result_p": {"doc_hash": "9605b1fc51e1ca977b57a9f31f011ad67a1a3226cb4ddfcb37bfe31e604eda61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_rename_test_rename.df_equals_modin_result_p": {"doc_hash": "33c1a632114c1a2d0e2af6c8c43379b2a09a1ec243a80412788dd83c8c8bdb79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reorder_levels_test_reorder_levels.df_equals_modin_result_p": {"doc_hash": "fecec68a0d2d8d26447b61c9c5193c7aae0954b21dbfcaeadd474f4d4542eeef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_repeat_test_repeat_lists.eval_general_": {"doc_hash": "8f4528c955f4eb4611f5c09510d10e54c4e0b4c6b170ad244a31a7e5339348ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_replace_test_replace.None_1": {"doc_hash": "2c048bcd71326500c5e123c734f30886cf119d41daf130bad8c5c10eb7474938"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_resample_test_resample.None_22": {"doc_hash": "7703bc039ce2ed0f2bf1ed0262ad80772a27117d2d0be6cac129f6b814529e53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reset_index_test_reset_index.eval_general_": {"doc_hash": "cbaa1ad138a03448ded2ade299775380c76c759c8034375d2a6e39174e3a7cef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reshape_test_rtruediv.inter_df_math_helper_modi": {"doc_hash": "2f23663e68db4c50d411d8f3e59dd1b359d057ee347e2e283a9735f96de115c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sample_test_sample.with_pytest_raises_ValueE.modin_series_sample_n_3_": {"doc_hash": "4572eed363450c2243e21857c7826d8f6b25a89082660e8ab11c8a96d6315e24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_searchsorted_test_searchsorted.for_case_in_test_cases_.assert_case": {"doc_hash": "3c816c4f8f8695d2ea1c342e78e8d41538ee66b5004d38e0795d06e5802e8c2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sem_float_nan_only_test_skew.eval_general_create_test": {"doc_hash": "b2a4013c461b5dac6138dac3124e0e608718cc5f48624c4c9b3b6bcefca54d6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_shift_test_shift.eval_general_modin_series": {"doc_hash": "99f10baf1598b219a64753b000afdb213564b458406734647e0c4f58873ce3d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sort_index_test_sort_index.None_1": {"doc_hash": "4417241ff50cfe8443e5610854c8514ca68aeebd28f676114bfc0f10abcbcacb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sort_values_test_sort_values.None_1.else_.np_testing_assert_equal_m": {"doc_hash": "92c3e8fe553244b0b97b9136dd7a4cad51bd65c8f48c2497a87581f9b8621ee7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_squeeze_test_std.try_.else_.df_equals_modin_result_p": {"doc_hash": "08d95265089e3dd3e126523f92ac963dadbb16ee6dbdcd18b477c4ea93b6f753"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sub_test_subtract.inter_df_math_helper_modi": {"doc_hash": "278ee5016d9e57db18acfb5e90e16629e3452a5f8b222ea1c86cb169130440aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sum_test_sum.eval_general_": {"doc_hash": "8d25f9a6064eafd6ab1296ebc6972d1981c33afddd02b8f567dfe12e49ad1c35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_swapaxes_test_swapaxes.try_.else_.df_equals_modin_result_p": {"doc_hash": "c359adcaaa0dc41d336dd4738e774c0fbc32f6630ff4983aeaeeeb3e91e6c66d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_swaplevel_test_swaplevel.None_2": {"doc_hash": "4b1b572d1a6eac4f543e62be37bb5e798a186416395795cde8853e63f502c96e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tail_test_take.try_.except_Exception_as_err_.with_pytest_raises_type_e.modin_s_take_2_axis_1_": {"doc_hash": "f51013d9212606bde0f0da3d8e15b43fd3374ab57d1338839c882fe94137ab6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_explode_test_explode.df_equals_": {"doc_hash": "1fac06c9ec5e531a344011e0c32305b35a5a1db0ff94f3e161bce0e22cb5d679"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_to_period_test_transpose.None_2": {"doc_hash": "3b8fc55e91aa75ae6fed876cc4904e5d70bb52bce36fbe9a21b0f73bd0415c31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_truediv_test_truncate.None_2": {"doc_hash": "19102f61598178dc2ddf2ac5e7ff47a52cbf32195f3b92f78a4d7ce1efa5de9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tz_convert_test_tz_convert.df_equals_": {"doc_hash": "9d0816083cc12ab76367adca89b2cac855820eb9882ab70a752816dae01a2dfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tz_localize_test_tz_localize.None_1": {"doc_hash": "09d954f0179e7a931414c882e83c7fd6028873d7029aa39e93938462712f5164"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unique_test_unique.None_6": {"doc_hash": "dc36ab3c55e498de95bb87298c58eb6e3eaa5133af6b78b51f8fa750a1036e57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unstack_test_unstack.df_equals_": {"doc_hash": "3aaa609a9f235fb116d79470514211fc3dd294ee4c2f18c5dc1ec45cbe0fba42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unstack_error_no_multiindex_test_update.df_equals_modin_series_p": {"doc_hash": "818601e2ea8dcdb3c39d273dc767a442aa3a1e0b5f5a30a3dcb6d65e9b66131d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_value_counts_test_value_counts.None_1": {"doc_hash": "cd04c42ad0fad547bca91756139a8e8044802b103178afc2e5ad55f007645748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_value_counts_categorical_test_value_counts_categorical.eval_general_": {"doc_hash": "803c2d383edb18c37be8981366fad4a014498c2bcdc80d086fbff050d441a53a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_values_test_values_ea.df_equals_modin_values_p": {"doc_hash": "65bd4ad7b25a977ad7ffbe0d9d06655d0867f2610e354738ad5c4e5c2efb939a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_var_test_var.try_.else_.df_equals_modin_result_p": {"doc_hash": "a157a892664967a518441d7b6bc7b97d2dbca8943a39fc9ad46ef1e73af8fa2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_view_test_view.None_2": {"doc_hash": "6161eadefef02080a5892e0c8beb2c180ca9f8df63d39f21cd7bd8df29db07bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_where_test_where.None_3": {"doc_hash": "3bd314773a184fcd8c28ef52de8dc2fec6849a084a2df88c3dc7d1c168769bef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str___getitem___test_str___getitem__.df_equals_": {"doc_hash": "bb61f5290682a26e11f56c7afe504d9396ee7cc02d7493942a9d92bf9292c955"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__Test_str_operations_test_str_cat.eval_general_create_test": {"doc_hash": "a85ef388d97e0cdd16d1cab25cd1273076c5aa1eabf5996a44ce5dd4883499ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_split_test_str_split.eval_general_": {"doc_hash": "deda602cbfc446314a4442d58d0257330fcc5beb5506582b68dfb26fcd51910d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rsplit_test_str_rsplit.eval_general_": {"doc_hash": "f061da7dc2a6e451ddb137943013a42465209bb0c906808bebcaf65ec1d83808"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_get_test_str_join.eval_general_modin_series": {"doc_hash": "3d6207c8f42b8d7358a34d65363e326ae8a89cc8af57a34954da20db0a36652c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_get_dummies_test_str_get_dummies.if_sep_.with_warns_that_defaultin.modin_series_str_get_dumm": {"doc_hash": "78ee532ffeb156eb071561fa1b49aa3f30b5b4fe9ed94971841c2494c7390ba5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_contains_test_str_contains.None_1": {"doc_hash": "409e1fe6726caf937ee8e1b8fb0b49b6612218752858e499a22e31d94142d948"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_replace_test_str_replace.None_1": {"doc_hash": "893e25bac58fd8f8515ad42e3167da149ab11395404d4b152ea29f6f209374af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_repeat_test_str_removesuffix.eval_general_": {"doc_hash": "53b4fd53c9f51c391bf59fe3872555c217c8e672e7fe76d97999c65437b80044"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_pad_test_str_pad.eval_general_": {"doc_hash": "4727f00818c7f2e46a2f26aff6f9ce2a1636346d1bf8ce7f8c57dcdb2310668f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_center_test_str_center.eval_general_": {"doc_hash": "47d1b914ee9b7472d056df70d13a08438aa4b38c13de64d335f6da8f373bd1bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_ljust_test_str_ljust.eval_general_": {"doc_hash": "3a7e05f38cb2257f240dafb2e5c6d2ccde29f4f8dc0db3a97278989347155ee8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rjust_test_str_rjust.eval_general_": {"doc_hash": "cf44492d4ebb7c1580083f21c77ae3ddc63acf24d10db5e98627b941e8a0c814"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_zfill_test_str_wrap.eval_general_modin_series": {"doc_hash": "c4d4392c72ab05aae4fbb37bae1f74a058a9cc1aed7544285cb6993cc212cac1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_slice_test_str_slice.eval_general_": {"doc_hash": "4b30cd307229d0623ecb5c7900423af8b2ac506ab8b9c117aa70fa5bc2b9620a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_slice_replace_test_str_count.eval_general_modin_series": {"doc_hash": "9a0dbe0e7b979c297887496ccb0fadfd9bc8b5022e1da3409099172894583f77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_startswith_test_str_startswith.eval_general_": {"doc_hash": "328f9e390148e6b856b9022c85d03cdb87c0545d09251c42d97f6065c10bb730"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_endswith_test_str_endswith.eval_general_": {"doc_hash": "6aef1dc596e59bd65a0da409fb67c8a9957ffff78813a63f373b2264c95d70b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_findall_test_str_fullmatch.eval_general_modin_series": {"doc_hash": "e2582af83529cb180bf9f21e12e2c710ffe652b51860426d369d360e7e2b9d8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_match_test_str_match.eval_general_": {"doc_hash": "108ac172ffe9937cdf1acaea680238216da177ee330c24643c1abc531f73c8db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_extract_test_str_extract.eval_general_": {"doc_hash": "6cf5077df8fa7e92c5af0e46b3fdd2235806c1ad8fd87dded8b78756b0722ce3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_extractall_test_str_lstrip.eval_general_": {"doc_hash": "839b8e323b6dd0fc12740e11f1d325cd8b42bf2c97ff479164add3e49ae473b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_partition_test_str_partition.eval_general_": {"doc_hash": "f26de4477984b9a446ae24406dfcda9559ca1b37447a010a4c6838c814767805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rpartition_test_str_rpartition.eval_general_": {"doc_hash": "0974ab627c187a84ec990e8cecf545a375aa1d15cf2de101b875a9478d6f2911"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_lower_test_str_title.eval_general_modin_series": {"doc_hash": "9b76867aac04be0b535145e45d17921b30ad160304f2857db55328ea89af2ae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_find_test_str_find.eval_general_": {"doc_hash": "337d3320d0e4b8ef4b89c54b0bc855746519fbe3de7cf7cb6cc438d29dac38f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rfind_test_str_rfind.eval_general_": {"doc_hash": "8cbf1c4490ac6e38c9c2fd4d4c268070b85539527e501cb573eae2017dd473f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_index_test_str_index.eval_general_": {"doc_hash": "2bb49eab988d821d31fc6fe6fa7c164b6809d90249d6700c039bb2b815304251"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rindex_test_str_rindex.eval_general_": {"doc_hash": "2ff3ba698fb909ae4bf2d698fc9460de52a4c660a6417932c9b9358037c964a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_capitalize_test_str_normalize.eval_general_modin_series": {"doc_hash": "e451dc73fa15b771e659a9556e32e6844d0c339a07801401238a421f9ad378de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_translate_test_str_translate.None_2": {"doc_hash": "d479677905e887ae1f21a5336273fae627cca1cea703e8ca6d308c54d6500190"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_isalnum_test_str_isnumeric.eval_general_": {"doc_hash": "2a62fb5fd76855b7adb0a3b5e7bf932a82719033ad2f0d69d618871ac04c2e56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_isdecimal_test_str_decode.eval_general_": {"doc_hash": "1a5557d3a7f26105b7af6391de2e439496eaa59ceb5a3c6bdc1a07451c986365"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_non_commutative_add_string_to_series_test_non_commutative_multiply_pandas.assert_not_integer_pan": {"doc_hash": "7dd0500c4e1ca8ec5c1d72951c1d2da94ffce10dbf3d7c8b997301ee65991c70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_non_commutative_multiply_test_non_commutative_multiply.None_1": {"doc_hash": "e7ffa0f2515e8246608543b8597e48d8b60ecc1ec945495c6c2b577d5cca3918"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_hasattr_sparse_test_hasattr_sparse.eval_general_modin_df_pa": {"doc_hash": "454a7896925343e6fbfe720336ad62a473df422e4d2620ba5350de28a652d707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_categories_test_cat_categories.eval_general_modin_series": {"doc_hash": "0dc1b958b271c0a5e97b760b06791ca3c3e1ae7d351a7ef70bb62cb4475cb3bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_ordered_test_cat_codes.df_equals_modin_result_p": {"doc_hash": "6350cca9ec128fe3b4127a287538c73f337df652e980d0799a56f28045392346"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_codes_issue5650_test_cat_codes_issue5650.eval_general_": {"doc_hash": "f5b7fc285884bce5dab3715569842b0f55853e21ed6313f2378422ccca0c67b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_rename_categories_test_cat_reorder_categories.df_equals_modin_result_p": {"doc_hash": "417441e8efcf229b1a8a9474641f2abb6fc45eb6e5fa724223dbf30568e21715"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_add_categories_test_cat_remove_categories.df_equals_modin_result_p": {"doc_hash": "6268ac9ebd446037be305facc6717e3d397d04a8c2901cca0c405ae6158f5758"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_remove_unused_categories_test_cat_remove_unused_categories.df_equals_modin_result_p": {"doc_hash": "dede2308d17a1c163980e7b0d43fd64d2829a65469e2624ecb1e277ff002207d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_set_categories_test_cat_set_categories.df_equals_modin_result_p": {"doc_hash": "462d585cb1b0686f711c2b08ad4defa383350d2e5b862fc5dfca3b8adf1754b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_as_ordered_": {"doc_hash": "3ff45ce6b8454a3754bc0b3e4c1c034864630e58598c0d3b6b0f65db429553b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_re__The_test_data_that_we_w": {"doc_hash": "9a8ed7543a37bf2acee164cb24d11dc9245fe3d9f75d49c7ceb79b2c0119190b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_test_data__that_purpose_at_time_p": {"doc_hash": "b0e954423155c59a1561ca6d2bbc98ea7b58aca38bdfcebc66c467dfc23981ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_parse_dates_values_by_id_test_data_with_duplicates": {"doc_hash": "c7ecb2bd3e4fd8888fc2900981eadbbb47a1143cf96f5a82fcc99c821fef4977"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_test_data_small_test_func_values.list_test_func_values_": {"doc_hash": "add663d5a9e4c0fbdfbc4247848efd90e122cbf9469a6156684a597ce9580a27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_numeric_test_funcs_None_33": {"doc_hash": "78b9c82975838596eb2537fa17a8a5f6d302dfee38a36c4e6e5857e2933c79a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_groupby_agg_func_COMP_TO_EXT._gzip_gz_bz2_bz": {"doc_hash": "ac9c70db38e66666bab53feea94f8d8e944fe3fc16d311d0de82f86250454217"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_time_parsing_csv_path_NonCommutativeMultiplyInteger.__rmul__.return.self_value_other_1": {"doc_hash": "1ac59276f18eb61b291519ebc5103847c92168e1f27b97747fcea2ed26e4070e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_categories_equals_df_categories_equals.for_i_in_range_len_df1_ca.assert_extension_array_eq": {"doc_hash": "09ae140ebbbf03785e62db74e4d2fbdd0690487215bfe886ef63b6575557b25b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_empty_frame_equal_assert_empty_frame_equal.if_df1_empty_and_not_df2.elif_df1_empty_and_df2_em.assert_False_f_Empty_fra": {"doc_hash": "05f7406c2be7b2733dd3146720974406626a94a2ba34af8cfdf29d10676dbae5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_all_act_same__maybe_cast_to_pandas_dtype.return.dtype": {"doc_hash": "9e42a6142b07c53d6b12695ca565ed50b6c4f0ad0877ad9cd830c19af209c6be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_dtypes_equal_assert_dtypes_equal.for_col_in_dtypes1_keys_.for_comparator_in_dtype_c.if_assert_all_act_same_co.break": {"doc_hash": "6258b2adfb629fcf1dadb481c908b7da77fd0e0d958e2f82a48e61a3ab1791dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_equals_df_equals.if_isinstance_df1_pandas.assert_empty_frame_equal_": {"doc_hash": "90d755054b39addef32724dd8f8b6641696f78f41886a59b1298494b6c756972"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_equals.None_6_df_equals.None_6.else_.if_df1_df2_.np_testing_assert_almost_": {"doc_hash": "bef863038b6d763d5470132e4516a9b7d2d2e19da6f1566dc09b4fdacc6b7a0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_modin_df_almost_equals_pandas_modin_df_almost_equals_pandas.assert_diff_max_max_dif": {"doc_hash": "36bcdd0d1ec757b8c4afadc7807f7c585a50b71a9465e479b446f6160f7e021f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_try_modin_df_almost_equals_compare_try_modin_df_almost_equals_compare.if_all_map_is_numeric_dty.else_.df_equals_df1_df2_": {"doc_hash": "7e8c597ff9c90b4a119c5014ece4cf89563a7f825f0c9e29c1edfd8c41679429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_is_empty_name_contains.return.any_val_in_test_name_for_": {"doc_hash": "022ec5b0a3e005c8cab324f30acc170990cc72c95e10aad1bac71d79be61ac1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_check_df_columns_have_nans_check_df_columns_have_nans.return._": {"doc_hash": "93a7231fc731c76a828a04df27bfba320e9c74012ab7994092a7af1346eff9b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_general_eval_general.execute_callable.try_.else_.return._md_result_pd_result_if": {"doc_hash": "d9c9d8903c04a5d8fe99b9f2d66e4880127da02490a77210b158214485a3094c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_general.for_key_value_in_kwargs__eval_general.if_values_is_not_None_.comparator_values_co": {"doc_hash": "51c0956099dfe53fcf8ec29d27e25254834c1e7ae75a63b1d17fe31a42e0c789"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_io_eval_io.if_modin_warning_.else_.call_eval_general_": {"doc_hash": "e4a3f1776840d4359047bdf3c614deff7fd409b6edbda453934aa8e1109857f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_io_from_str_create_test_dfs.return.map_": {"doc_hash": "04046177ba50040c1b8639209032101ac999ba4c2cc8453b496753c40d3740ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_dfs_generate_multiindex_dfs.return.df1_df2": {"doc_hash": "e708edd58ae143f15d7df5ee1b329728c2618cc0f595fe8e368b60dffbfae72e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_multiindex_generate_multiindex.if_is_tree_like_.else_.return.pd_MultiIndex_from_tuples": {"doc_hash": "62855f0178494dd70d0044a2bb18ff619d84b9eb4513f262cbca7f07d01a5a0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_none_dfs_generate_none_dfs.return.df_df2": {"doc_hash": "58c4a62a6f5f10c0f40e837e3392eb232a7b19fcf9344acb12b876d0f08594c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_get_unique_filename_get_unique_filename.if_debug_mode_.else_.return.os_path_join_data_dir_uu": {"doc_hash": "2e9168f90f5771cc9784f35bbedd0ef883d4fa329938b3422831151c762b67a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_get_random_string_insert_lines_to_csv.with_open_csv_name_w_.writer_writerows_lines_": {"doc_hash": "2bc45955112de33f5f277e0ed8e561c04f13475240746572e1a28dbb000b9ce8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py__get_open_files_check_file_leaks.return.check": {"doc_hash": "8ebdd3dcadb15b25f2eb32d7939c50f97ead74209220e679f4086f898428eb03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_dummy_decorator_generate_dataframe.return.pandas_DataFrame_data_in": {"doc_hash": "1aa4bef1dcf5f4cc7bb02a52eb5e63d9a8cb00d9119086fa1d5d8b77636e03d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py__make_csv_file__make_csv_file.return._csv_file_maker": {"doc_hash": "e52c29c74fd763070835d9978e5dae74414c09c1ee9ec8b09f85d0de2f448c8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_teardown_test_file_sort_index_for_equal_values.return.res": {"doc_hash": "817e4213ceb91d0699d064e0e75d1e69d585303e6556765ec2e67c74cbdc3431"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_equals_with_non_stable_indices_rotate_decimal_digits_or_symbols.if_value_dtype_object_.else_.return.tens_ones_10": {"doc_hash": "f0e04bdc11a878ae8f63e6bf806099053efcdf275410265d4e01c083d6e3a1cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_make_default_file_make_default_file.extension.file_type_to_extension_ge": {"doc_hash": "7a8aed6ec9d8eb150a2c83008b93e1ce9e6857201c907c2626267d025ce5803d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_make_default_file._make_default_file_make_default_file.return._make_default_file_filen": {"doc_hash": "bb865dced7bcee6f4af464e451a79aed9ade4d4a689df410fc93288addb65fc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_value_equals_": {"doc_hash": "97e708de8e0fbd165b66a464d9b668d70f8bb6c9aca829b76ce80a0003cc351f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_typing_import_Iterat_SET_DATAFRAME_ATTRIBUTE_WARNING._": {"doc_hash": "2bb6c282ec87085634152ae3964119ced49f7a408b3cd95826078ab342c3de97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_non_pandas_from_non_pandas.return.new_qc": {"doc_hash": "b020ebb85a8c610ee614bd2e01e10685fc74f0fa2ffcf8d441318c4d22375a41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_pandas_from_arrow.return.DataFrame_query_compiler_": {"doc_hash": "a9ca427d3d824a8fdaef8b0efb60222fc409086e16f002d73270fc9e7892e885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_dataframe_from_dataframe.return.DataFrame_query_compiler_": {"doc_hash": "2e4e915e6b3f41480ba3ae71d830ce2a08d5a1a3749f754ecff893cf401eae2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_cast_function_modin2pandas_cast_function_modin2pandas.return.func": {"doc_hash": "c3d449bbf190b50e4c525cfe0e6ea7d352a1003b577fd39270c71e9a108c0a27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_is_scalar_is_scalar.return.not_isinstance_obj_BaseP": {"doc_hash": "9140e5c8e8fc53940dc4f1feaf562872b795c95931a6736accebb40d76174f31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_is_full_grab_slice_is_full_grab_slice.return._": {"doc_hash": "974b4607fd78eba9c502b402f91f16a7a6289d2c39e2f27b996a477fe5a43164"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_modin_frame_to_mi_from_modin_frame_to_mi.return._original_pandas_MultiInd": {"doc_hash": "c70889eb470f266891236ddf7016d3a967d756cef02e6ff02737704c9440bde3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_is_label_is_label.return.hashable_label_and_": {"doc_hash": "405b523737ba1e8b52a1871e6ff3efd2ca3aee4597d41996e77f8ddf4790c0bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_check_both_not_none_check_both_not_none.return.not_option1_is_None_or_o": {"doc_hash": "27fd0cfd73100ca77667e95b796230da411678f0286084e407469cb1319195bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_broadcast_item_broadcast_item.try_.except_ValueError_.raise_ValueError_": {"doc_hash": "4f756dd054115f003a22725133308403cd41210bf2f4cb0e5befca2bd95104d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py__walk_aggregation_func__walk_aggregation_func.if_isinstance_value_lis.else_.yield_key_value_None_c": {"doc_hash": "057fc79cf319171a705bcbd5872084c95e6de3f47e237aa65aacec384662a806"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_walk_aggregation_dict_walk_aggregation_dict.for_key_value_in_agg_dic.yield_from__walk_aggregat": {"doc_hash": "0fbeab05258781ec2c490597b2cd899bf85d46d3fe8f7e125707d180fd4f168b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py__doc_binary_op_": {"doc_hash": "9fc4f451cf6533570a38f47173967ea7cd8ea7ac8ce3f46e3c78821f40ca4a36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_from_typing_import_Option_Window.std.return.self__dataframe___constru": {"doc_hash": "30e6d93d11456c94afc2ba9dc663430663c0ef18779961f278f4a9d2ce811f26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling_Rolling.max.return.self__dataframe___constru": {"doc_hash": "a255888ad19e9a65b4a04274825b427f734a81730bcffc7681648fbfab71380e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.corr_Rolling.corr.return.self__dataframe___constru": {"doc_hash": "d8b463cff2f2fb8bef077208ff92376af944802491df05fd669279cfb4497c4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.cov_Rolling.cov.return.self__dataframe___constru": {"doc_hash": "7abe16df95c4db569a893a4df9dbdc3eb453772315d29ac77cc6a02fc48fd193"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.skew_Rolling.apply.return.self__dataframe___constru": {"doc_hash": "38bc5db4973c1220f6aebc662118916b1db303fc397a913ebaf0cf0111abe910"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.aggregate_Rolling.aggregate.if_isinstance_self__dataf.else_.return.dataframe_squeeze_": {"doc_hash": "ae2b31c2b7123d348627e41c8f06fa852f8f64c312f094ca293d6076ac5b9ac8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.agg_Rolling.rank.return.self__dataframe___constru": {"doc_hash": "d7c501681db5070b3ec70d70ae6dd2177d9fd0767b40a1e637995b4e741511e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding_Expanding.count.return.self__dataframe___constru": {"doc_hash": "527348a9075f6802fbb39e7a3bdcaab20729bfcd194b3f00d2ef5bbed51d7eda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding.cov_Expanding.cov.return.self__dataframe___constru": {"doc_hash": "fd51f42ecb65cf626bc1423a68cfdbe29737ab64547f669306b29f213db6ff76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding.corr_Expanding.corr.return.self__dataframe___constru": {"doc_hash": "47480f42d4f4def9e677721de18b54bbb8de84720db8e0cc0ee4b4a0a64accf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding.sem_": {"doc_hash": "b7aae876950fbf69d95b84555f0552e3e6d73f98dae580a328a1943afb8f7748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/__init__.py__": {"doc_hash": "47ea0260833f533447d4714f11e1e47563501b3d8be955e61690581649ebf26a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/__init__.py__": {"doc_hash": "ca8c39de3946e2e6dd51457ccb4a65978b8310223ce80fcfb691f4fb6fc9bb6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/__init__.py__": {"doc_hash": "1244bfb1b363ffd58d1f7c24ccb7b5a75e0ec24281cbcfd1152507962b51f04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/__init__.py__": {"doc_hash": "a8da9b26b2257ca31baf485679accdece39d17f4bd33e8844ca84c3b798fca25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/test_sanity.py_pytest_": {"doc_hash": "5b15ec0b8df3a6e08f97db5cce6ef4ce89cf8b1e33727581071a1fd584517069"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/test_utils.py_pytest_": {"doc_hash": "a76067d96cb51bce0f8e3caca4ff3302e57d360d221b072d9cfdfe7a39d7f3bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/__init__.py__": {"doc_hash": "7f8413fd853dd2e391e01b818899e3b8852c6e0947c6001e49558836bb43e7fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_pytest_get_data_of_all_types": {"doc_hash": "b45af7ad44157337b0f3a2392656c0de6b20c62a86bc0252bafaf9aabea0c532"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_simple_export_test_simple_export.df_equals_md_df_exported": {"doc_hash": "59f1795b39ab2e12c1bc62618a8c3f71c609401ff601c76dd2c4f7ee56047f74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_aligned_at_chunks_test_export_aligned_at_chunks.None_3": {"doc_hash": "1bda64252bbed0b01d7c5eed9c7872a8d1102cc87d93e047bfcc733ab082c734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_unaligned_at_chunks_test_export_unaligned_at_chunks.None_3": {"doc_hash": "1e79c32c486dbe7979a9e513450cd2babb0ee7f3ff511af4d94ceab3f37629bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_indivisible_chunking_test_export_indivisible_chunking.None_3": {"doc_hash": "58a7870517176499218abd71370bc5ca97a94018a4d5de8bca40dea6b3d50819"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_when_delayed_computations_test_export_when_delayed_computations.df_equals_exported_df_pd": {"doc_hash": "9a591bafa3e68997ab77abe4e01e6edad9f5cc6a09349de21dfe0c0b008536ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_simple_import_test_simple_import.None_1": {"doc_hash": "8324228f3d3408254c88421ff93a8abbe55e46407d89618afe9408226bc846aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_zero_copy_export_for_primitives_test_zero_copy_export_for_primitives.with_pytest_raises_Runtim.primitive_column_to_ndarr": {"doc_hash": "a19be859f4e602dea45e4f8674e01d1e236793c5ab0ce12ef74104b510883b7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_bitmask_chunking_test_bitmask_chunking.df_equals_md_df_exported": {"doc_hash": "92ec05fdf86e904d53a29a1e959a43d779c57912080f51e878f258c33c840a68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_buffer_of_chunked_at_test_buffer_of_chunked_at.None_1.with_pytest_raises_Runtim.col_get_buffers_": {"doc_hash": "f2a2e7f5a78a76c12a61f239ecf5eddf18917139b02b0bb9d2782f3ceead09a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_concat_chunks_": {"doc_hash": "f5bc60448c6e2e3a84430aa65bcdf0bdbbc86a7455a37af8ecd5432eb5dfb44f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_pandas_split_df_into_chunks.return.chunks": {"doc_hash": "a3ee4491ea24e1682572a1939be0a1f6661ee253d10655f824cee0cde7f15e83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_export_frame_export_frame.return.exported_df": {"doc_hash": "ac32f2962bafb930c111bf033176ce9a75ec7c84d17b0136e38658c267c4d29f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_from_dataframe_to_pandas_assert_chunking_from_dataframe_to_pandas_assert_chunking.return.pd_df": {"doc_hash": "8fcf8c92065b62a7c78f3ab4f98122bc2e36a9f8278bdba4f45cfcf270529c3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_get_data_of_all_types_get_data_of_all_types._datetime": {"doc_hash": "52d7e3223423763fcdde4e48d876913b335b786a6afddd95ada17543dbb30e5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_get_data_of_all_types.for_unit_in_s_ms__": {"doc_hash": "6012499b53bd26aa2d7128ef8867410e9553f743fa513a6752c5088372bd1bde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/pandas/__init__.py__": {"doc_hash": "232121f50ca7056093a456820fb3087c6fa005da9543064a7ae69d3076ec48d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/pandas/test_protocol.py_pd_": {"doc_hash": "94af5da8f6ab963ffc01c373bc383636f169cfd47382fe2d93a33300a8b6c6f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_pytest_test_only_one_dtype.for_column_in_columns_.None_2": {"doc_hash": "2c1880159a2ce4e713e0843255e451e783d4673c463051e4e103c37be1ee1382"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_float_int_test_float_int.assert_dfX_get_column_by_": {"doc_hash": "9714b5bbf4acfa974d78d0e3ac00e5f17a8e66da551fa1f068c7c45d27be17b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_na_float_test_categorical.assert_isinstance_is_dict": {"doc_hash": "40f76ab4409ea75ffe59043c6386c827eb2a5124883972a0204c2e4527b1423e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_dataframe_test_dataframe.assert_list_dfX_select_co": {"doc_hash": "630f00cb6ecf781365ced7d4bd97d7687f4830087c8ac675f0ec94e5ec5dbbd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_df_get_chunks_test_get_columns.assert_dfX_get_column_1_": {"doc_hash": "29869f752c736d64714aa8268605276d532b102ce155769af57bc5f52fb9c8a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_buffer_": {"doc_hash": "9ea45e59435118021c1ae4627ce0113c2fac4e9ff7f56e1bc6e602a299cb54a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/base/test_internals.py_pandas_test_insert_item.None_1": {"doc_hash": "d9c7991a08e1eb775cbf778380e7a4c7cbe7e6e8f73c633f3b77939363b513f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/base/test_internals.py_test_repr_size_issue_6104_": {"doc_hash": "3c8ad29ed35ef0c400f12f50ec366bab56189dbf1d80770e661fc9c50c83d8d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/cudf/test_gpu_managers.py__": {"doc_hash": "932a972470152853976d4861876bedbb296ad4eb84646ab47312c3759e831e33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/cudf/test_internals.py__": {"doc_hash": "557b77d494fb58411b938dc8c9210e02a025011771bc0caeca0bb616035adcc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/hdk/test_internals.py_pytest_test_hdk_import.if_res_returncode_0_.pytest_fail_str_res_stder": {"doc_hash": "5922cb368b1768e9f4dd014b0d68a4dd812e77945e7c1436dd83d84649f0c741"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/hdk/test_internals.py_test_hdk_compatibility_with_pyarrow_gandiva_": {"doc_hash": "da66f9f2acc1f227baaf509c7767c0d2d1cba3e15c65911cca5de0ea4f31db8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_pd_if_Engine_get_Ray_.else_.raise_NotImplementedError": {"doc_hash": "f38d6e60222458ebc7ec38b24db6e466e743fd57ef022055bb3a465386dd6932"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_construct_modin_df_by_scheme_construct_modin_df_by_scheme.return.md_df": {"doc_hash": "8079263ac9fd54d4896982003eda03afd9a9e2d796e0a7c3879b292c4e29d42f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_modify_config_validate_partitions_cache.for_i_in_range_df__partit.for_j_in_range_df__partit.None_1": {"doc_hash": "fec2437da64003dde848efdd3779ab04da3d7312896663fa6530293be0669077"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_aligning_blocks_test_aligning_partitions.repr_modin_df2_": {"doc_hash": "5f5ffa60453c6b34e74dd377a30faf1faa75f7701782dc9309904eaa8981acb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_take_2d_labels_or_positional_test_take_2d_labels_or_positional.df_equals_md_df_pd_df_": {"doc_hash": "7721da1a03e2f1fe817a71fb9fd68fee2b298accca272258f8fb154f37a35ed6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_apply_func_to_both_axis_test_apply_func_to_both_axis.df_equals_md_df_pd_df_": {"doc_hash": "a075d84cb53b08d9637bf27cd73c02423c4dc6a88bca3e4a37c8cce5140d2a3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_rebalance_partitions_test_rebalance_partitions._over_the_same_axis_from": {"doc_hash": "dd31d8f6708754fe76317e433a0fe09e734efe59266e6c35920db0ebc67036ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_rebalance_partitions.row_apply_func_test_rebalance_partitions.None_7": {"doc_hash": "16ac27ae20ccf6575ec131f00eee951b45eb72a7e2ab5d23e4f15d46734ef38c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue_TestDrainVirtualPartitionCallQueue._Test_draining_virtual_": {"doc_hash": "a203805e40175ba7fb5f46fcf923c0d787ce3fdea19bddb8dfe62831a8e75e6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues_TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues.df_equals_": {"doc_hash": "497781d4bda4b55f513f3e6554b1471796b479fbeea941ce9af3b73193baaed3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues_TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues.df_equals_level_two_virtu": {"doc_hash": "54a761c51b2eb95ca09e2b9aed9fab050999b6132865cb594176e9782f2a501c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels_TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels.df_equals_": {"doc_hash": "b844d3119052262232589fb04604e3df023aa861eaa14fc974335e928fb19631"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_virtual_partition_apply_not_returning_pandas_dataframe_test_virtual_partition_apply_not_returning_pandas_dataframe.assert_apply_result_1": {"doc_hash": "e5ccf8e0032c4fdce3dba61cf11a1b0ff4ba6417fb26e9d300211245f065779c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_virtual_partition_dup_object_ref_test_virtual_partition_dup_object_ref.partition_wait_": {"doc_hash": "ceda95191e4ee48cc3c88313bd5cdb558f1643e51d11fb9e7b35e0f874ca13b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py___test_reorder_labels_cache_axis_positions___test_reorder_labels_cache_axis_positions._": {"doc_hash": "33a97861cf7fd6be5915a86133bf0b71fe0c5ad52366cbb20701bbe845a0de05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_reorder_labels_cache_test_reorder_labels_cache.validate_partitions_cache": {"doc_hash": "6e48e8fb3f8ed016391a141f5da232728a7f82e9783c5ccee732d63b6bd04161"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_reorder_labels_dtypes_test_reorder_labels_dtypes.df_equals_result_dtypes_": {"doc_hash": "4f4b5dfae0b139cd5b3bf18f3102d2332f9fa31d70dcb11797984f950de9df66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_partitioning_test_merge_partitioning.res_6.merge_partitioning_left_": {"doc_hash": "9ba6abee51fe354d04a8faf158ffdae5acf7e8f37100831e4aab145dddab4652"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_partitioning.assert_res_ref_with_no_test_merge_partitioning.None_8": {"doc_hash": "f85ba151654368961bd7e88520ffc26ad172a44f1e90e1d543b71d99af743017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_repartitioning_test_repartitioning.df_equals_res_to_pandas_": {"doc_hash": "75ef60c229bb368f0028fe3566718ade96c54950d49523fae4ff288d87b58026"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_kernel_test_split_partitions_kernel.if_not_ascending_.bounds.bounds_1_": {"doc_hash": "295894ca2d884dbd6f946ba473f4d8cb99228bea971f7f0c1e56328cc24ed3be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_kernel.for_idx_part_in_enumerat_test_split_partitions_kernel.for_idx_part_in_enumerat.if_ascending_.else_.assert_": {"doc_hash": "7582dddad9e0266ad6668a6a27082396c0563a262eafef2e1b75eca504ba72cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_with_empty_pivots_test_split_partitions_with_empty_pivots.assert_result_0_equals_d": {"doc_hash": "d9dbc9ece54af7a96da20bc8aeb39c02156d28b28a19c0fb4d9b44b7fafaebbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_shuffle_partitions_with_empty_pivots_test_shuffle_partitions_with_empty_pivots.assert_ref_equals_res_": {"doc_hash": "7ac580606766a8691b2e553f71ca00f9e521b33ae0724f14821b1966a8ab320f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partition_preserve_names_test_split_partition_preserve_names.for_part_in_splits_.assert_part_columns_name_": {"doc_hash": "e450234e50a808fd5674c54d03222f7db6f3d1249c98f86f4b0aab4795ec88ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_preserves_metadata_test_merge_preserves_metadata.None_2.else_.if_not_has_dtypes_metadat.assert_not_modin_frame_ha": {"doc_hash": "8a734f47402ab5499b4be42b835f72d0160f59650658f3c02f52048a506e32a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_binary_op_preserve_dtypes_test_binary_op_preserve_dtypes.None_7": {"doc_hash": "414ea06605be8299424f0bfe7052cec8f287bb6bf7af37bad3d0a125556caa46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_setitem_bool_preserve_dtypes_": {"doc_hash": "97b6c49ce5b4759ea00b448cb3d7c80cdb4a6213bfe0f519e7dffe1f2eae006a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_docstring_urls.py_from_urllib_request_impor_": {"doc_hash": "8c20a798477f99503da34daa51b26677ac09fe779d372ba997f589ae8e46736b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_catcher.py_os_": {"doc_hash": "4b9214f0b1849ded04d89dbe85b5665cdd897594c753a3757a8341ef455d74cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_npartitions.py_pd_test_set_npartitions.assert_part_shape_0_n": {"doc_hash": "f5b2331e3be0bd45e1de7c42db9d3e942170a6fe10397bd65ea96eb8a587a864"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_npartitions.py_test_runtime_change_npartitions_": {"doc_hash": "c629f7e14d2da16849d18447ec55d3263b8d209bdae4e5cea9adb6f4721d69b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_executions_api.py_pytest_test_base_abstract_methods.assert_": {"doc_hash": "2f693e5b110e6ac4afec2392c478cb729ea0a73807d00497c2dee4fca41e5a1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_executions_api.py_test_api_consistent_": {"doc_hash": "e5b80aac252ee5549b4820afbdc028136fd94aef401076e50ec8222b1416f1f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_headers.py_os_test_headers.for_subdir_dirs_files_i.for_file_in_files_.if_file_endswith_py_a.with_open_filepath_r_.for_left_right_in_zip_.assert_left_right": {"doc_hash": "71a3dbe20b57be54360cd6cd61a33e0137adb84a51ba379e7b4c153549136830"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_headers.py_test_line_endings_": {"doc_hash": "97fa9b809b8e316a64722641c28bbd21403216f4258522cf82de70078c6c3c45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_pytest__FakeLogger.clear.cls._loggers._": {"doc_hash": "da42fb612680ad0a9fa55e4d0232cf7276cd65fd05ee97706bc9ff2763f8b25e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py__get_logger_test_function_decorator.assert_get_log_messages_": {"doc_hash": "9fc5a5dd9dbfd5fe516571ab4b673f8b4f40b5b51551feb11842ce4c0b88d713"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_function_decorator_on_outer_function_6237_test_function_decorator_on_outer_function_6237.assert_get_log_messages_": {"doc_hash": "241c7f63487aa534fa340f9f28af10f2997aedd4ec2b122e01c4318e21e95980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_class_decorator_test_class_decorator.assert_get_log_messages_": {"doc_hash": "b6fa5a4197d4bb1aa9df42c148874fcbc3492b1af3b84a0774beb4f6028c40c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_class_inheritance_": {"doc_hash": "83d166ddcec4ae4fd9b6539cf86a905585bd2b0d3b5e8109ce0faa7582cf2c4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_np_pd_DataFrame_": {"doc_hash": "7b49afe7faf73f460fa0acadeae7a6a9a39025f0b296e8f099ec27e318e536ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_unwrap_partitions_test_unwrap_partitions.if_axis_is_None_.else_.for_item_idx_in_range_len.if_Engine_get_in_Ray_.df_equals_": {"doc_hash": "30ef567f88159bb0514233c1c730092265ac9627d1b19b19a7ef076f8c4492df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_from_partitions_test_from_partitions.df_equals_expected_df_ac": {"doc_hash": "e9f10c4adff567eabdea72eefb73df666f943adbdf1b7dc7f48200d709ebe1f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_from_partitions_mismatched_labels_test_from_partitions_mismatched_labels.df_equals_expected_df_ac": {"doc_hash": "851261b1e601679ac25df84ee46e80cda2e50a49c10596ae8625845650d898cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_mask_preserve_cache_": {"doc_hash": "82785cbc797ac02ee14a362c73397c79da582b5ed00dbd29adbcc10ddaf50d95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_pytest_test_doc_inherit_prop_builder.assert_Child_prop_C": {"doc_hash": "3fa06c37ca10669c7820fca50117675ab0aa8aa7ed373780de3f569a2d428b64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_append_to_docstring_test_align_indents.assert_source_result": {"doc_hash": "b60726948df336e7b5012f5404489774391df1866b5ab81511c33db8893e7b56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_format_string_test_format_string.assert_answer_expected": {"doc_hash": "661d705034628896d7139d199cc66c8025e524ee0fb94356a4051849c4193599"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_warns_that_defaulting_to_pandas_warns_that_defaulting_to_pandas.return.pytest_warns_UserWarning_": {"doc_hash": "3ea73201afff349932e3950080a4a30c14cb83f8c8ae8b524fdb365fb47de735"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_show_versions_test_warns_that_defaulting_to_pandas.None_1.ErrorMessage_default_to_p": {"doc_hash": "033085fca040d87e16d78a4220912b6b83f13cabd1882b9f89acedbbb4a0fdc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_assert_dtypes_equal_": {"doc_hash": "fc9ef18da0dfffcbc4994087c60b1817c6e45281388e9e3b32544a8e03390319"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_importlib__get_indent.return.min_indents_if_indents_e": {"doc_hash": "34f5a49b3a142649e565e1125df71a490884d4cd6ca32ea57125fb4962220dbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__get_indents__get_indents.return.indents": {"doc_hash": "294e31e4a52359b9ab7325eb1f225437d597a4be821ee9b0f0dfd09c924a62a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_format_string_format_string.return.template_format_kwargs_": {"doc_hash": "f9cfd439d6bf50bec0dc1ef63b791fed5d6c70654a11a8bd07471175ff90b2db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_align_indents_append_to_docstring.return.decorator": {"doc_hash": "df96fbaa24f9e889adc9bdebe388afd460d67add1880f36277ef099988392aaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__replace_doc__replace_doc.if_parent_cls_and_isinsta.else_.target_obj.__doc__.doc": {"doc_hash": "81acfab818791c527ce45f7f0b1a84510d5131feeddf226029817e18d5e0f0b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__inherit_docstrings__inherit_docstrings._documentable_obj.return.bool_": {"doc_hash": "c33019aab24609c2238b369b0d6c48d0339cfa3c502cc3b84d184e7b0789f051"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__inherit_docstrings.decorator__inherit_docstrings.return.decorator": {"doc_hash": "2366df528269362fb797520a54436325e4a2c8d6a25b8b82c54a79f2fe53f7a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__TODO_add_proper_type_an_to_numpy.return.array": {"doc_hash": "992c4a1bd74b35e23e861d667a82e75ee595694fb515aa43bd8cad2e673836ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_hashable_hashable.return.True": {"doc_hash": "d3c6673a5f35844f59d853b7732f0712043d26e9cc8210015f493e57968ec01c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_try_cast_to_pandas_try_cast_to_pandas.return.obj": {"doc_hash": "7257702cfb0d5bf905fba95d4c1b7898058f99da0779f2d9124860c11235e697"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_wrap_into_list_wrap_into_list.return.res": {"doc_hash": "94c4b1848c77a3cfa7b69a4926d217f0dd5bc6a569d44b6fc901d027fc5ccc7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_wrap_udf_function_wrap_udf_function.return.wrapper": {"doc_hash": "ea19e5a6158f061fc1c2593c19d4f854130b0629ae58b73544ec170a4ebd22ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_get_current_execution_instancer.return._class_": {"doc_hash": "7fe605dd7b25619cb614ff797fcc32f5e2d61fbfd547b07bb81a9ba3f90d5c31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_import_optional_dependency_import_optional_dependency.try_.except_ImportError_.raise_ImportError_": {"doc_hash": "1a66d8ea0339009776ee6dd5c3e0497fdddd9a37af22a52bb0d8bdf9cd15344b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__get_modin_deps_info__get_modin_deps_info.return.result": {"doc_hash": "99a2c0904229b527093b44ad38f7c8299e3a2ba616a128396ddc2205d4e25d18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__Disable_flake8_checks_f_": {"doc_hash": "0cf9a0fe63730a3df49c93345f0a406c9ed0a498f3df8c24b4d9f404456ed3b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/__init__.py__": {"doc_hash": "d7d874a3b36eee11a93c40f739d8ba915f11f503cf7c5ee7a1712335efab04fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_argparse_MODIN_ERROR_CODES._": {"doc_hash": "94add30c23e3e37c6300471c3ac9dc443654fd148ab08db8e07bcad2b2e0b54c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_optional_args_get_optional_args.return._": {"doc_hash": "eef9960954d501c19a7b99c82c446d701d08484ed5ee80151557a145640d12fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_optional_args_check_optional_args.return.errors": {"doc_hash": "f3cb364e063c8699b41c106904f745a483f759e0b9616a3793fa3a6224a9a791"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_spelling_words_check_spelling_words.return.errors": {"doc_hash": "cd1521e4101a44d0da7056bb90d94f59801fc40123c0b4dfbb280cb78afeac74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_docstring_indention_check_docstring_indention.return.errors": {"doc_hash": "44ba7bc72d00773fffbd1c905fedcd78695b7af780c2a5cefdb9299f3e9df66a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_validate_modin_error_validate_modin_error.return.results": {"doc_hash": "18521e14504534561e8aad247c15fd9812f50b040f5e073aec24ea728aae19a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_skip_check_if_noqa_skip_check_if_noqa.return.err_code_in_noqa_checks": {"doc_hash": "aab320e50b2983d7ac5d0536280d7f925710510c03c70220e7861a9b8ae43913"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_noqa_checks_get_noqa_checks.return._check_strip_for_check_": {"doc_hash": "8e4462b42ac3d6e68149834932873936316ccedd95a2054093f3fdeeabbe8b97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py__code_snippet_from_numpy_validate_object.return.errors": {"doc_hash": "b2dfa52124b3c22abb900954499455a4ec966c7609ea3c4b2a41a2e03eb43e10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_numpydoc_validate_numpydoc_validate.return.is_successfull": {"doc_hash": "c2d4c8e68d8055b9ab6ce9f5a70dff962efc9c54b60306e9ed7f519f10a71f34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_pydocstyle_validate_pydocstyle_validate.return.True_if_result_returncode": {"doc_hash": "0085c1dd135b9c34d6569e83fda1bb71c537ccf51dc37a93f23d9120cf0ecdf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_monkeypatching_monkeypatching.sys.setdlopenflags.Mock_": {"doc_hash": "95735ae73534a76a3d0241b00d2fe74508bb573718d1a954988ae7410e113e98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_validate_validate.return.is_successfull": {"doc_hash": "b1074227a71197af6deacdb81b7f57399d1ea051ede4d1d5d7d8306a7804c8dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_args_check_args.for_path_in_args_paths_.if_not_abs_path_startswit.raise_ValueError_": {"doc_hash": "554074719e24e068c62178c122663b0147a9e56993fb80365a79888248e2cf02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_args_": {"doc_hash": "d57635f91f1ee23b1bb070041cbd8f4527d8ff5104e52c74d26515b3f45ac8aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_re_GithubUserResolver.__register.self___cache_f_name_e": {"doc_hash": "9579e85c8e552eabc7226dc00e3a6b69b74838636753138d74ee545e34fec799"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GithubUserResolver.resolve_GithubUserResolver.resolve.return.logins_unknowns": {"doc_hash": "4f407bf8291d2c5a8a03d8285280a18b514edf8345a4d720577fbd8b3e56c5e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GithubUserResolver.resolve_by_reviews_GithubUserResolver.__save.self___cache_file_write_t": {"doc_hash": "21faedbab1a49ef7f4d7ee18c17e68cc614a9025bca49463aae1bc81ef50b2f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GitWrapper_GitWrapper.get_previous_release.return.prev_ref_self_repo_refer": {"doc_hash": "ec8c9ae5d0440f0b7d99fe4b7c64cfc9a6509be6af67ea5ed71817f7b9ef3ebd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GitWrapper.get_commits_upto_GitWrapper.ensure_title_link.return.title": {"doc_hash": "d1fb3578d53efbd913131a09c41ab9e1d78fe9eb538de7996cbdd140d693461e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_make_notes_make_notes.sys_stdout_write_notes_": {"doc_hash": "d2a0271c4ebf29db1513c78d2c40a61669bc4f4d0f0f72b13ea2dcbe19f176ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_main_": {"doc_hash": "697fbe4be496a837d971b9b41b6e214610475b99404b7d3885664323d320a79e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/__init__.py__": {"doc_hash": "abe0837e6e23d2d5d2895f3782fcabdbf5cfe8048284ec5dd8e7ed5820b0dbc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/examples.py__noqa_MD01_": {"doc_hash": "18ce5958c35f68c861084db3b76d9018f4bba3bd4c8fe7a0b4a51d37b85084cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_pytest_test_get_optional_args.assert_optional_args_r": {"doc_hash": "f9cc659e1b3a96cd8efc32976a6958d81b5c3176661647aeb46aab8f0716bc4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_check_optional_args_test_check_optional_args.assert_errors_result": {"doc_hash": "368e448bcc18e87b90b3da9cf3cba3dbed6def0154aa30e8b74a4476fe2ea5a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_check_spelling_words_test_check_spelling_words.for_error_in_errors_.assert_error_in_result_er": {"doc_hash": "4c9aad77db6946a4e45a4838ef6310513704a88cee8c49cb5e4455ed7ae6194f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_get_noqa_checks_": {"doc_hash": "e672b3122d7c57dcaae6978d2761320d1ef6e2a94c61e31409b9b964c04a55db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/setup.py_from_setuptools_import_se_": {"doc_hash": "9d17cc79198e3d89ba0e2e02c9cbe939bffd649bb8126d99b0f8520008a6def8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_matplotlib_None_9": {"doc_hash": "44031095130bbb9a85dbbe0a0f1bacef3e62f9254f4330d6f60a30a04ed25376"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_reg_15_print_Best_score_fo": {"doc_hash": "ff9f33fa12c4df2aea5f6c45a80c9e3b0b4ffcb46c647b21cb9356474b67ab27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_param_grid_dendrogram_merg_leaf_rot": {"doc_hash": "3de2fa9d0e7afb30dbfef8e2ac893f6d4d69ca9c93633b2466cdaad4d2d50d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_None_86_": {"doc_hash": "5f5dfb00719247def701f02e342e4cf07c64279f9784ecfca36bbe99cf2cacf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_matplotlib_IDtest.test_PassengerId_": {"doc_hash": "b9b2a9b88312609d094655bd359c6ab5af3a990488bcd21e4c1e8d4855dbb52b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_detect_outliers_detect_outliers.return.multiple_outliers": {"doc_hash": "da1a37262579afd91a7dfa526d122d4b657057700a83924b60b83997c4f2b550"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_Outliers_to_drop_g_28.sns_factorplot_y_Age_x": {"doc_hash": "64c260796b579e195eafcdf1bb491312d7b66052b5f907a7417a5f55b9374448"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_g_29_dataset_MedF_dataset": {"doc_hash": "0971683e8c771d5c7616320df0fdca917c60db19e8af190504171a787fa0e659"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_dataset_LargeF_datas_cv_results._": {"doc_hash": "d798d1d3b9d427e67cda38af8f17f41c0d140a6027472bb72db095aa57f5505f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_for_classifier_in_classif_GBC.GradientBoostingClassifie": {"doc_hash": "6fa363d0ef6bd86ecb895ae31664c6e8b5cee0232a4fc4b1e996295d9749d49a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_gb_param_grid_gsSVMC_best_score_": {"doc_hash": "8ce86b92b3fd14b0f97c350ebdc094c5990c8d9f69ab3d686aa357bc04721809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_plot_learning_curve_plot_learning_curve.return.plt": {"doc_hash": "c790dc7e421800538cbbf867420c4380e7e2b525bcc45c3a8031fe295d3c6ee4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_g_96_": {"doc_hash": "b60d6133f5c3cdd1f04ecd37e119309f4f68bbb4688c762c759bc8a2309c0fa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle13.py__usr_bin_env_python_": {"doc_hash": "b7f94238531223936a94c388713ead52f3d299b0a60b2a86f3b39c0161a01e3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_matplotlib__Checking_the_Initials_w": {"doc_hash": "c206bfcc6645635fe76bfda237228c1306e9eabb6206b8148581d67bb0f8b491"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_data_Initial_replace__None_59": {"doc_hash": "b12d11bcd299c0d969bec0e897c666e66877c279463d38e3b1e9be74a92d7ef6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_data_Embarked_fillna___Alone": {"doc_hash": "ba39a16b883f13fb3bb6f04527a7ba1501efa15e1e922107a88f260f5d52cdd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_None_24_prediction1.model_predict_test_X_": {"doc_hash": "e10024b303744b246e3ab60d63afc63318ea5e642cb31c0ab271ee420d1157a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_print_Accuracy_for_rbf_S_plt_title_Average_CV_Mea": {"doc_hash": "d90a584bbbf63561ae9b6fad0d57cfb35966b4974fdbedc8786da60d2b5513ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_fig_38_hyper_52._n_estimators_n_estima": {"doc_hash": "bea77ad764c403d84d1b3ed14a5456686c324300023041b89ac88cdecd9343e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_gd_53_gd_71.GridSearchCV_estimator_Ad": {"doc_hash": "e9ed281359a5a7b360600e56047346a19f6b0ab731cad39976c2c480258f09f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_None_173_": {"doc_hash": "3907283ba620ee6e46aeaaf74024fbec55ece05257f7cc6d0721d40e10a8a7cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle17.py__": {"doc_hash": "e20350b7a6694c51b3f5eefe6959094586e93f40aa7d9f4402c1552440d0192f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py__usr_bin_env_python__None_33": {"doc_hash": "d53506cac7554e14ab44515e484ec5978a1d375c2f80d81f16c9e6e3da39384e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_test_general_cat_test_df.train_groupby_desc_len_": {"doc_hash": "8588c180ad64927c6c55fce8be95f418d84b69dd3b705be2bab68860118f4763"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_trace1_24_stop.set_stopwords_words_engl": {"doc_hash": "7e00d1c97a250453c2affca0ba6caeb151b6c48637509f61c8dd8eecee67897b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_tokenize_tokenize.try_.except_TypeError_as_err_.print_text_err_": {"doc_hash": "6477091d500e12ff2a5cfc44dcd5615a33e4744ff9d9a8f873b2b919c16e5681"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_cat_desc_stop_38.set_stopwords_words_engl": {"doc_hash": "bcd0cee2e284264eb6ae46c536e51d9b57a16532d5d5d9e4c040842f353c4518"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_tokenize_3_tokenize_3.try_.except_TypeError_as_err_.print_text_err_": {"doc_hash": "9f1c6faa6cf8ad18ba4fd39d24930d19b4356ad67b22ddaed21479846873d4ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_train_tokens_train__output_notebook_": {"doc_hash": "abf033d9b63da23fa652232d540ac931e74f0ba4a042b84e60ed460fe75e7bcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_plot_tfidf_kmeans_df_category_c": {"doc_hash": "d8c6bc3a11e82950227b1707137edfc5ee9718a23a2ad25c23d1d0830b517aee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_plot_kmeans_show_plot_lda_": {"doc_hash": "f78fe0bf25fc6cfb59a8a61702a00ae43f95de0367581f6066d9443deef314f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_prepareLDAData_": {"doc_hash": "7ad8126ad60e19c5e3cbf99e3f10ba6ad4b9704458808989e474a0f05a0565d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py__usr_bin_env_python_data_8.train_copy_": {"doc_hash": "4c7a31bb2bef87b7e68b78f8c92d68bc1fa54ba91f0a01a8e2a781fe073a0d95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_data_9_plt_text_4_0_6_Heals_": {"doc_hash": "1bdece310689ce56765db98c3f1d4d47e486f81eb511c651fa9ebf1e76ec67b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_plt_text_4_0_55_Boosts_plt_text_14_0_45_Duos_": {"doc_hash": "92def2022b447a4022384705850d4dabc7cc7d901886e144c2ac8ea869778e38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_plt_text_14_0_4_Duos__train_healsAndBoostsPerW": {"doc_hash": "7ad7c02cf4e15e8618e29d7701ca7df686ffc5026fb6a36a808582a293a1a957"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_train__": {"doc_hash": "ba72bff95134e3ae2870cc4c19c0a0202712f497701211f9a35982207e81f94a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_matplotlib_data_23.pd_concat_y_data_n_2_il": {"doc_hash": "402496fe0cbdc390d5466ce5da461ce1f5f0b3c0d28966e201cd570b99563e6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_data_24_None_13": {"doc_hash": "245166a80a9e7f276eba924144f562c66cc243fb374dfcaa7c30466a072bf16e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_clf_rf_4_": {"doc_hash": "1d56e4d3b40efa86eb677de35b27b8a774ee26f816fecc4daea6733034e58fc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle22.py_matplotlib_": {"doc_hash": "34adaf9cbc0b9a313e936700bdadc967a809b734400c14d8c06766ee68ab0bb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py__usr_bin_env_python_a_b_c_tuble_ex_": {"doc_hash": "da24464fcc598c6d155133d315013331938556c9e80cba6d68a87b6fe1ddc3c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_print_a_b_c__data2_32.data_Defense_head_": {"doc_hash": "5a7f215eca1eb9e753a307cce177c7f0ff783b4456337997f1ac3c4d18c7459b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_conc_data_col__data_frames": {"doc_hash": "273f1c88ca075cddf5443932bbe96ce4e19b053de8d48bc1e714bc4842c11a0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_data_loc_1_10_HP_Defe_": {"doc_hash": "c7370c15b96460d561d17a5af4c3c18e56828e854ef5ff57ca6ef40fa2356b86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_matplotlib_print_all_data_size_is_": {"doc_hash": "d927eec59cf759da8481d5e156865e48542ff2758fa025aadc2b9af3b4557503"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_all_data_na_None_21": {"doc_hash": "158e1e7c4781164b43e995f0cf70bcda2c4c7fa3c07ece52906a562c47336e2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_all_data_OverallCond__ENet.make_pipeline_": {"doc_hash": "f625b087e193c35097b5f634b48d38e11018eb7d510fca54643feba27d6a447d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_KRR_None_48": {"doc_hash": "5405a98b027db65232adc3b2bb3ba292bf44bf9fc50fe44242d28494ef48ff45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_StackingAveragedModels_StackingAveragedModels.fit.return.self": {"doc_hash": "1d3cce573542679ee9befe5f4f111518581cae197265714a1603d3bfc76b79aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_predict_": {"doc_hash": "47769a6471cdfe917a80c70a52e941981541712756ff5dcdb6d64367d91473f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_matplotlib_None_1.None_3": {"doc_hash": "7ab25ee9d71d01862e2b7fd31d5c99334a8e14cd90fae7437620fb9e444b57f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_train_df_Title_Survi_train_df_FamilySize_": {"doc_hash": "bcc941a9e2d7c066f2b9b692cf5d95cdb9ab1185da5a1016d11777be3e838e13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_None_8_knn_fit_X_train_Y_train_": {"doc_hash": "f8eed8ce97e5100152b841532644e20b06ce41d0975318f75b45f638e6284ce2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_Y_pred_35_": {"doc_hash": "50d66c7df273699340c2e5b7fddc26ff9cdca4a676d33286acb9daf57ef5c0d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_matplotlib_batch_size.86": {"doc_hash": "91225c263fe5cf55a2db06b8551f2c221ee7ad552a870444c907345d35787040"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_datagen_legend_20.ax_1_legend_loc_best_": {"doc_hash": "36052870d0619972e5e5303454746eec443aca79548b34be213fc04a344a0d4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_plot_confusion_matrix_plot_confusion_matrix.plt_xlabel_Predicted_lab": {"doc_hash": "88cc2f0dd0ecaba7150d0e8dcc1014acf1af394ceceda45e835fc8e7ea2821af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_Y_pred_X_val_errors.X_val_errors_": {"doc_hash": "de5c303d484358f70dbe1d94c58bc7d621d12737ea23e38b3f4625344e14d776"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_display_errors_display_errors.for_row_in_range_nrows_.for_col_in_range_ncols_.n_1": {"doc_hash": "9343092539dae4d8d437ea206dc4a881259648f7dd4bd31d0b9a6bdab299963e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_Y_pred_errors_prob_": {"doc_hash": "f8b1383cba7599cc22125553420757b891923812823f2ad39e502462312aa612"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_matplotlib_app_train_TARGET_astyp": {"doc_hash": "ee3e75dd3c5c0906d5a8ac89839e21670ff5fc54537364437231dc9301b635d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_missing_values_table_missing_values_table.return.mis_val_table_ren_columns": {"doc_hash": "95df2a3afe14243acae774c6e5df76120911213cfca8f45702457a255c4a9af5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_app_train_dtypes_value_co_age_data_YEARS_BIRTH_": {"doc_hash": "7dfaa960e1ffee9a35845420e474da6e954dd51f628178ca76eeb3b4378d94f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_age_data_YEARS_BINNED__print_Training_data_with": {"doc_hash": "7e0977b3b4b689141a6977c5f68485b79384ed19255641d8da05d64300f56caa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_print_Testing_data_with__poly_features_test_55.scaler_transform_poly_fea": {"doc_hash": "609178348ef0d2165bbdd9405586491c2cded9c6acd89a2c5a91df89b9cec1bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_random_forest_poly_None_61": {"doc_hash": "a231725e26b98c50a62d0fdfb0ca963eec0665ab8799de6ad88ee0ad13be143f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_plot_feature_importances_gc": {"doc_hash": "c3419998135f43428d75d1550a2cf7dfa2889693de2a94797b04980c644d0e83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_model_model.return.submission_feature_impor": {"doc_hash": "9dcff759994d25860a26f931c95042c67f67451a46b88b82820c1aaeaabb58fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_submission_fi_metrics__": {"doc_hash": "478c79def87f979edb1f440577d4372ef31a65e132c89ad2ff9946449c6c09c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle8.py_pd_": {"doc_hash": "5252d9ff538d4db5992398ee502991d559ce892f6e7c2bd3b486c0c6cd414e84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle9.py_matplotlib_dtest.xgb_DMatrix_X_test_": {"doc_hash": "70aa1aeba1078fabbe81e8e6197ba8804fffb2eda896c34e3b8d1fce433cd304"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle9.py_params_": {"doc_hash": "64a94121422ef7cce47ba8e059799c7ccfb00c9f466114c90bf3724f1d2931de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_os_KAGGLE_DIR_PATH._kaggle_format_DIR_PA": {"doc_hash": "e87978df9480ab48ba01f63c0b49f6768620ff1b5a177c3eda474db09f94f195"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_create_dataframe_create_dataframe.return.pd_DataFrame_result_dict_": {"doc_hash": "8a9707b96b6e67a39698157c6b194327f427c7652358195363c59dfe694e4acf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_generate_dataset_generate_dataset.for_filename_in_filenames.if_os_path_exists_filenam.os_remove_filename_": {"doc_hash": "17f5eceee6db39c780389529420bbd2ca2b0f83643872562e545070cd4c5ccec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle3_test_kaggle3.assert_ipynb_returncode_": {"doc_hash": "8a9705e0bd340f3bad90f296f5cfc7e2427e064d4900b72c8a46243fa28c41e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle4_test_kaggle4.columns._": {"doc_hash": "5436f856269cda993415f629a94d6344ab1e2fa4b24f3b0ebc52bf545ddbae4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle4.dtypes_test_kaggle4.assert_ipynb_returncode_": {"doc_hash": "e614fd844e5e2414dc6727a0b514a166239db02605827cbd6d159af8966b1cb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle5_test_kaggle5.assert_ipynb_returncode_": {"doc_hash": "ac1464c015536e8e552e619b861b971b02d131d5cfa2835498d3ecf0dc75f882"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle6_test_kaggle6.assert_ipynb_returncode_": {"doc_hash": "1172c9637a860811c4b136479f2c7c88c0e533cd95ced0241c6b0820ea4fb14f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle7_test_kaggle7.columns._": {"doc_hash": "67086304ac01c036b59a92bcd169b90d58a4adef220f13d49420097b6a3f45d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle7.dtypes_test_kaggle7.assert_ipynb_returncode_": {"doc_hash": "a0b72ad5717214d2e68f934a60f87ced52d05f10e21a92fb6106cbedf64a1b45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle8_test_kaggle8.columns._": {"doc_hash": "7704b132dc1746d2b28820c812b6743fd588570a8d58e620b0a4fa8e4843a967"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle8.dtypes_test_kaggle8.assert_ipynb_returncode_": {"doc_hash": "1066022897f5cd29ecebc1be2d918221a3ea852dc1e9c64566ae8bcb19fed7de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle9_test_kaggle9.columns._": {"doc_hash": "3b86d48a539a0e99207ab27c8e9a13cfee204ec44af57e8a5236a888e0b838e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle9.dtypes_test_kaggle9.assert_ipynb_returncode_": {"doc_hash": "b67525462112c0e2e05a8b0687c1688cb054f8729054d516e215d2f775f47173"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle10_test_kaggle10.assert_ipynb_returncode_": {"doc_hash": "7c9869ebb6874ebe374ba89971d10d54634158f0058d30b170c96d93a7a59afc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle12_test_kaggle12.assert_ipynb_returncode_": {"doc_hash": "d32b464189a03ee686f52f1efcffca30d8ac640d7a10f81ec977de8c678055c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle13_test_kaggle13.assert_ipynb_returncode_": {"doc_hash": "ed2dc1bc9d864206aa23ee6b092db6d6488de44a6bc0570783736da01364d6ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle14_test_kaggle14.assert_ipynb_returncode_": {"doc_hash": "70b243f33cc98ce6a8db836e31ecfd228836fe31062aa3e06a67fecc23a86af2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle17_test_kaggle17.assert_ipynb_returncode_": {"doc_hash": "020330a316bb1c86d0e64a208f433942c0d4980af2a5f56e04cfd03cdeba4cb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle18_test_kaggle18.assert_ipynb_returncode_": {"doc_hash": "48795b5993fbf9fc2287e897712a0dc8d8206b9ea33b368668a2c26355d5c566"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle19_test_kaggle19.assert_ipynb_returncode_": {"doc_hash": "effaaf963b7c2b5dae2479964a2dba2bb13e8deedcdfbe7b3b33eb9219b595c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle20_test_kaggle20.assert_ipynb_returncode_": {"doc_hash": "6f3a87e4bdd5df4356766b35f62bef8956bf24b72535b0a626538b12a1bd4056"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle22_": {"doc_hash": "ab17ca18a47aa3e178835437f950783e7a9c0a345644979e4f5a2c3a6204f1a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py__Version_0_18_get_root.return.root": {"doc_hash": "cfbc44f44b90e93a428ad720a1afc40f49e8fb69a90bab58ebef19f13ac396a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_config_from_root_get_config_from_root.return.cfg": {"doc_hash": "f94a68557f2fa0e531bce6e838f5874c06260f952089627ebf62e00848d1793f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_NotThisMethod_register_vcs_handler.return.decorate": {"doc_hash": "209978a9b4f519d38c5bf0b8d257f117978f030963b0215eb440088a5235d5cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_run_command_run_command.return.stdout_p_returncode": {"doc_hash": "c3c49c365f08a01fed9c257ad8be09877b74b952cbb1797a156de0d05eb1be21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_get_keywords_git_get_keywords.return.keywords": {"doc_hash": "24589a0695cc6db686b17707d2ae846bb00b32afb520696f4ba33bdcef540ce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_versions_from_keywords_git_versions_from_keywords.return._version_0_unknown_": {"doc_hash": "3297536fac99896b09ab0a169f9211eaa3e5cf1c40b96e6704c2cbad2c0f9e44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_pieces_from_vcs_git_pieces_from_vcs.return.pieces": {"doc_hash": "c010b76cd82c80fb32f0059dc0e2286f95102ada81db5235d212d3c808f7c0f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_do_vcs_install_do_vcs_install.run_command_GITS_add_": {"doc_hash": "ce6841ff519b17aa2d7473d5ad7ac0e07f12143a79c7f074763a9631c2fc7184"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_versions_from_parentdir_versions_from_parentdir.raise_NotThisMethod_root": {"doc_hash": "01cdb0a5245ceae8f5344269dce77fb9de0e4d91d8927a1138be0df01b7b7107"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_SHORT_VERSION_PY_versions_from_file.return.json_loads_mo_group_1_": {"doc_hash": "84d5b7f6500df71ca5aac9f7a53c7a6295ca59ef90cdfb640cef00becd530ac6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_write_to_version_file_plus_or_dot.return._": {"doc_hash": "2606d956a2836928821f54af5066ae269853eb928d94e338d6e665ef5fc27c5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_render_pep440_pre.return.rendered": {"doc_hash": "62f8dd7acee0867457d7b07d3e6edcf3260a2a189611ef33381ac724528d4433"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_post_render_pep440_post.return.rendered": {"doc_hash": "118807a5c2a97d74d8fe5f796e9018ac18aadcc9b3182b6181ecd25e8dcbd0d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_old_render_pep440_old.return.rendered": {"doc_hash": "6c6b4eb402371d591eeb0abb50ada6698ebe88b10543f867cefca40fd086f508"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_git_describe_render_git_describe.return.rendered": {"doc_hash": "a3d9b39392875e0334af8c64b46fe88c38f8d51c8b168839e4ae228db30b0daf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_git_describe_long_render_git_describe_long.return.rendered": {"doc_hash": "cf56b90f4c7b7ac99479cdeafeebaf306a0ab42713bb536dffdfe85f0a8b1c00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_VersioneerBadRootError._The_project_root_direc": {"doc_hash": "3e4c325087404da0ffae165f6d3e86a06485928b5599f4651f70ea3ec7e14108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_versions_get_versions.return._version_0_unknown_": {"doc_hash": "7fe797b3fa9fa6e57a32cf0b23a277df9f91edd6a8d97fe0b1ce9032826a7b32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_version_get_cmdclass.from_distutils_core_impor": {"doc_hash": "b46b8ebb3921cc678793c9ac073ce2ccfa012b4f230b5a81c900c42f0a97cf9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmd_version_get_cmdclass.cmd_version.run.if_vers_error_.print_error_s_vers": {"doc_hash": "e0cb6df2b5995ce185fbe7f4e46b80764040478598a909f72d8a8c80b245b2a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmds_version_cmd_ver_get_cmdclass.if_setuptools_in_sys_mo.else_.from_distutils_command_bu": {"doc_hash": "a0bf8dc59a233b0825031555fda061024a7d2b85aa9a1de660fb24206df6f093"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmd_build_py_get_cmdclass.cmd_build_py.run.if_cfg_versionfile_build_.write_to_version_file_tar": {"doc_hash": "a3e61fb1c123a544a0866cae1590acbd50ccfa6687b2bde1c15463c1eb266a0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmds_build_py_cmd_bu_get_cmdclass.None_4.else_.from_distutils_command_sd": {"doc_hash": "7414280031496a605640994b0290ca2859299eba73723e4ecfd433ae905af7fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmd_sdist_get_cmdclass.return.cmds": {"doc_hash": "8282207f276c680678f0dbfda07ca1696ba9602de8b75e07d62c92859164fa4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_CONFIG_ERROR_INIT_PY_SNIPPET._": {"doc_hash": "aadd871f92dd45b60bf6a6dfe7fc15fa89a744ae887e426fcf312b1aa2557082"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_do_setup_do_setup.return.0": {"doc_hash": "97b56f8d137b9a57fbf309daa9e4837d884802b052ca1c38db586da628568a55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_scan_setup_py_": {"doc_hash": "83c4211be1e0dcbb1815fd41e4ccb28871b1cd8f3dd45fa8ed714ff8f031fbda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.reduce_GroupByReduce.reduce.return.result_if_finalizer_fn_is": {"doc_hash": "ca20b8166e76872c1a47acab033fc3502d84cd0e5afcc5cf1f5304779341a2ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.caller_GroupByReduce.caller.if_.return.default_to_pandas_func_": {"doc_hash": "f73e3e4c6f6f31ec0baab2b2f669a3c4801977ba11cb0d671e68601307e905de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.caller._The_bug_only_occurs_in__GroupByReduce.caller.return.result": {"doc_hash": "e3696f3907620776e855d7a0cf3dcf538a9791cdce6b7fc8bdeccafe5063ca01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/sql/sql_dispatcher.py_SQLDispatcher._is_supported_sqlalchemy_object_": {"doc_hash": "830661e63b2c4147dc60bebb855164d3b42e118505c49f77195df47d35654338"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.build_qc_method_GroupbyReduceImpl.build_qc_method.map_reduce_method.GroupByReduce_register_": {"doc_hash": "17729ea7484d317fe20099d79749439594163791e800b04fdb624a5e306a44de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.build_qc_method.method_GroupbyReduceImpl.build_qc_method.return.method": {"doc_hash": "e4e83058f2a96afa016083a0b66370043a601f7ce1a2a8441da6a8992baf2982"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._pivot_table_tree_reduce_PandasQueryCompiler._pivot_table_tree_reduce.return.result": {"doc_hash": "4c78e622d5853ec603110c63080b94bbce4f8e61da1d7a1567a3d183ec77eaa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.join_HdkOnNativeDataframe.join._are_index_columns_in_th": {"doc_hash": "0096e352b36974a16e8bcc9649e8ded7dfda863f7b106b95c2a5ef1caa2b864d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.join.if_left_on_is_not_orig_l_HdkOnNativeDataframe.join.return.res": {"doc_hash": "d175bba20c8a44268487406ee2f9b55ea80bac49e4a66fc358959b2b85912c36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._build_index_cache_HdkOnNativeDataframe._build_index_cache.if_self__partitions_is_No.else_.if_isinstance_obj_pd_Da.else_.if_self__index_cols_is_No.else_.self_set_index_cache_idx_": {"doc_hash": "27e8715f262e5ff2b4a8ae86e96005a62b5ac96df03527a71383716a0be3c792"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/db_worker.py_from_hdk_worker_import_H_": {"doc_hash": "776ac1ad059450d45f2bfb984505aab54c80f14966a64099b4d95a6bc3d1406b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode_FrameNode.can_execute_arrow.return.self_modin_frame__has_arr": {"doc_hash": "d3971cd9c19afb7bff29b93bf33a4dcc191a16dfaaf01c00c5651f8612e57ae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition.py_from_typing_import_Option_": {"doc_hash": "fcffbaa3ffd5cb07141e0b5613f34893b0aa9a2d106b003f0882f19fbc302cfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager_HdkOnNativeDataframePartitionManager.from_pandas.if_len_unsupported_cols_.else_.return.cls_from_arrow_at_return": {"doc_hash": "b0f60fa8bdf5548905c69b4b95806137767edb6a090446467f14e9690cb33b72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_left_right_on_TestMerge.test_merge_left_right_on.None_1": {"doc_hash": "c47faa8ad9082a646d5f9200363bc67c4dc61fd6423e5dddfcf23fb979956a52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_self_merge_TestMerge.test_merge_float.run_and_compare_": {"doc_hash": "81d375912b5f647b719e3a46c8a0f88573e82124f542808660c4a20a5047674b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_categorical_TestMerge.test_merge_categorical.run_and_compare_": {"doc_hash": "6ca7f329554ed3f2ae579adaf669767bbaf675a36d9883708bf5a993ce8ad9a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_date_TestMerge.test_merge_date.run_and_compare_": {"doc_hash": "9b7e2203f35711cfd4a8b3b4c8432c7dc63ae2ea4bf55706ac7392ab578623a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler_DFAlgQueryCompiler.copy.return.self___constructor___self": {"doc_hash": "1d4c1622f85cf5b568c67b738f54f97c1a8a64a3888b285273a76940aa2968ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.getitem_column_array_DFAlgQueryCompiler.getitem_column_array.return.self___constructor___new_": {"doc_hash": "6140821d4ba3048b151ebdce130bd7dae77d837be37e2c661ddbfc18c19ee138"}}, "docstore/data": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/__init__.py__", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_np_BaseTimeGroupBy.setup.self_df_self_groupby_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_np_BaseTimeGroupBy.setup.self_df_self_groupby_col", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 53, "span_ids": ["BaseTimeGroupBy.setup", "BaseTimeGroupBy", "docstring"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pandas._testing as tm\nimport math\n\nfrom .utils import (\n generate_dataframe,\n gen_nan_data,\n RAND_LOW,\n RAND_HIGH,\n random_string,\n random_columns,\n random_booleans,\n GROUPBY_NGROUPS,\n IMPL,\n execute,\n translator_groupby_ngroups,\n get_benchmark_shapes,\n trigger_import,\n)\n\n\nclass BaseTimeGroupBy:\n def setup(self, shape, ngroups=5, groupby_ncols=1):\n ngroups = translator_groupby_ngroups(ngroups, shape)\n self.df, self.groupby_columns = generate_dataframe(\n \"int\",\n *shape,\n RAND_LOW,\n RAND_HIGH,\n groupby_ncols,\n count_groups=ngroups,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByMultiColumn_TimeGroupByMultiColumn.time_groupby_agg_mean.execute_self_df_groupby_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByMultiColumn_TimeGroupByMultiColumn.time_groupby_agg_mean.execute_self_df_groupby_b", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 68, "span_ids": ["TimeGroupByMultiColumn.time_groupby_agg_quan", "TimeGroupByMultiColumn.time_groupby_agg_mean", "TimeGroupByMultiColumn"], "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 TimeGroupByMultiColumn(BaseTimeGroupBy):\n param_names = [\"shape\", \"ngroups\", \"groupby_ncols\"]\n params = [\n get_benchmark_shapes(\"TimeGroupByMultiColumn\"),\n GROUPBY_NGROUPS,\n [6],\n ]\n\n def time_groupby_agg_quan(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).agg(\"quantile\"))\n\n def time_groupby_agg_mean(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).apply(lambda df: df.mean()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByDefaultAggregations_TimeGroupByDefaultAggregations.time_groupby_mean.execute_self_df_groupby_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByDefaultAggregations_TimeGroupByDefaultAggregations.time_groupby_mean.execute_self_df_groupby_b", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 88, "span_ids": ["TimeGroupByDefaultAggregations.time_groupby_size", "TimeGroupByDefaultAggregations.time_groupby_count", "TimeGroupByDefaultAggregations.time_groupby_sum", "TimeGroupByDefaultAggregations", "TimeGroupByDefaultAggregations.time_groupby_mean"], "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 TimeGroupByDefaultAggregations(BaseTimeGroupBy):\n param_names = [\"shape\", \"ngroups\"]\n params = [\n get_benchmark_shapes(\"TimeGroupByDefaultAggregations\"),\n GROUPBY_NGROUPS,\n ]\n\n def time_groupby_count(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).count())\n\n def time_groupby_size(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).size())\n\n def time_groupby_sum(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).sum())\n\n def time_groupby_mean(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).mean())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByDictionaryAggregation_TimeGroupByDictionaryAggregation.time_groupby_dict_agg.execute_self_df_groupby_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeGroupByDictionaryAggregation_TimeGroupByDictionaryAggregation.time_groupby_dict_agg.execute_self_df_groupby_b", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 112, "span_ids": ["TimeGroupByDictionaryAggregation.setup", "TimeGroupByDictionaryAggregation.time_groupby_dict_agg", "TimeGroupByDictionaryAggregation"], "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 TimeGroupByDictionaryAggregation(BaseTimeGroupBy):\n param_names = [\"shape\", \"ngroups\", \"operation_type\"]\n params = [\n get_benchmark_shapes(\"TimeGroupByDictionaryAggregation\"),\n GROUPBY_NGROUPS,\n [\"reduce\", \"aggregation\"],\n ]\n operations = {\n \"reduce\": [\"sum\", \"count\", \"prod\"],\n \"aggregation\": [\"quantile\", \"std\", \"median\"],\n }\n\n def setup(self, shape, ngroups, operation_type):\n super().setup(shape, ngroups)\n self.cols_to_agg = self.df.columns[1:4]\n operations = self.operations[operation_type]\n self.agg_dict = {\n c: operations[i % len(operations)] for i, c in enumerate(self.cols_to_agg)\n }\n\n def time_groupby_dict_agg(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).agg(self.agg_dict))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeJoin_TimeJoin.time_join.execute_self_df1_join_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeJoin_TimeJoin.time_join.execute_self_df1_join_sel", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 129, "span_ids": ["TimeJoin", "TimeJoin.time_join", "TimeJoin.setup"], "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 TimeJoin:\n param_names = [\"shapes\", \"how\", \"sort\"]\n params = [\n get_benchmark_shapes(\"TimeJoin\"),\n [\"left\", \"inner\"],\n [False],\n ]\n\n def setup(self, shapes, how, sort):\n self.df1 = generate_dataframe(\"int\", *shapes[0], RAND_LOW, RAND_HIGH)\n self.df2 = generate_dataframe(\"int\", *shapes[1], RAND_LOW, RAND_HIGH)\n\n def time_join(self, shapes, how, sort):\n # join dataframes on index to get the predictable shape\n execute(self.df1.join(self.df2, how=how, lsuffix=\"left_\", sort=sort))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeJoinStringIndex_TimeJoinStringIndex.time_join_dataframe_index_single_key_small.execute_self_df_join_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeJoinStringIndex_TimeJoinStringIndex.time_join_dataframe_index_single_key_small.execute_self_df_join_self", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 173, "span_ids": ["TimeJoinStringIndex.setup", "TimeJoinStringIndex.time_join_dataframe_index_single_key_bigger", "TimeJoinStringIndex", "TimeJoinStringIndex.time_join_dataframe_index_multi", "TimeJoinStringIndex.time_join_dataframe_index_single_key_small"], "tokens": 488}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeJoinStringIndex:\n param_names = [\"shapes\", \"sort\"]\n params = [\n get_benchmark_shapes(\"TimeJoinStringIndex\"),\n [True, False],\n ]\n\n def setup(self, shapes, sort):\n assert shapes[0] % 100 == 0, \"implementation restriction\"\n level1 = tm.makeStringIndex(10).values\n level2 = tm.makeStringIndex(shapes[0] // 100).values\n codes1 = np.arange(10).repeat(shapes[0] // 100)\n codes2 = np.tile(np.arange(shapes[0] // 100), 10)\n index2 = IMPL.MultiIndex(levels=[level1, level2], codes=[codes1, codes2])\n self.df_multi = IMPL.DataFrame(\n np.random.randn(len(index2), 4), index=index2, columns=[\"A\", \"B\", \"C\", \"D\"]\n )\n\n self.key1 = np.tile(level1.take(codes1), 10)\n self.key2 = np.tile(level2.take(codes2), 10)\n self.df = generate_dataframe(\"int\", *shapes, RAND_LOW, RAND_HIGH)\n # just to keep source shape\n self.df = self.df.drop(columns=self.df.columns[-2:])\n self.df[\"key1\"] = self.key1\n self.df[\"key2\"] = self.key2\n execute(self.df)\n\n self.df_key1 = IMPL.DataFrame(\n np.random.randn(len(level1), 4), index=level1, columns=[\"A\", \"B\", \"C\", \"D\"]\n )\n self.df_key2 = IMPL.DataFrame(\n np.random.randn(len(level2), 4), index=level2, columns=[\"A\", \"B\", \"C\", \"D\"]\n )\n\n def time_join_dataframe_index_multi(self, shapes, sort):\n execute(self.df.join(self.df_multi, on=[\"key1\", \"key2\"], sort=sort))\n\n def time_join_dataframe_index_single_key_bigger(self, shapes, sort):\n execute(self.df.join(self.df_key2, on=\"key2\", sort=sort))\n\n def time_join_dataframe_index_single_key_small(self, shapes, sort):\n execute(self.df.join(self.df_key1, on=\"key1\", sort=sort))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMergeDefault_TimeMergeDefault.time_merge.execute_IMPL_merge_self_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMergeDefault_TimeMergeDefault.time_merge.execute_IMPL_merge_self_d", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 189, "span_ids": ["TimeMergeDefault.time_merge", "TimeMergeDefault.setup", "TimeMergeDefault"], "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 TimeMergeDefault:\n param_names = [\"shapes\", \"how\", \"sort\"]\n params = [\n get_benchmark_shapes(\"TimeMergeDefault\"),\n [\"left\", \"inner\"],\n [True, False],\n ]\n\n def setup(self, shapes, how, sort):\n self.df1 = generate_dataframe(\"int\", *shapes[0], RAND_LOW, RAND_HIGH)\n self.df2 = generate_dataframe(\"int\", *shapes[1], RAND_LOW, RAND_HIGH)\n\n def time_merge(self, shapes, how, sort):\n execute(IMPL.merge(self.df1, self.df2, how=how, sort=sort))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMerge_TimeMerge.time_merge_dataframe_empty_left.execute_IMPL_merge_self_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMerge_TimeMerge.time_merge_dataframe_empty_left.execute_IMPL_merge_self_d", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 220, "span_ids": ["TimeMerge.time_merge_dataframe_empty_left", "TimeMerge.time_merge_dataframe_empty_right", "TimeMerge.setup", "TimeMerge", "TimeMerge.time_merge"], "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 TimeMerge:\n param_names = [\"shapes\", \"how\", \"sort\"]\n params = [\n get_benchmark_shapes(\"TimeMerge\"),\n [\"left\", \"inner\"],\n [True, False],\n ]\n\n def setup(self, shapes, how, sort):\n self.df1 = generate_dataframe(\"int\", *shapes[0], RAND_LOW, RAND_HIGH)\n self.df2 = generate_dataframe(\"int\", *shapes[1], RAND_LOW, RAND_HIGH)\n\n def time_merge(self, shapes, how, sort):\n # merge dataframes by index to get the predictable shape\n execute(\n self.df1.merge(\n self.df2, left_index=True, right_index=True, how=how, sort=sort\n )\n )\n\n def time_merge_dataframe_empty_right(self, shapes, how, sort):\n # Getting an empty dataframe using `iloc` should be very fast,\n # so the impact on the time of the merge operation should be negligible.\n execute(IMPL.merge(self.df1, self.df2.iloc[:0], how=how, sort=sort))\n\n def time_merge_dataframe_empty_left(self, shapes, how, sort):\n # Getting an empty dataframe using `iloc` should be very fast,\n # so the impact on the time of the merge operation should be negligible.\n execute(IMPL.merge(self.df1.iloc[:0], self.df2, how=how, sort=sort))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMergeCategoricals_TimeMergeCategoricals.time_merge_categoricals.execute_IMPL_merge_self_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMergeCategoricals_TimeMergeCategoricals.time_merge_categoricals.execute_IMPL_merge_self_l", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 255, "span_ids": ["TimeMergeCategoricals", "TimeMergeCategoricals.time_merge_categoricals", "TimeMergeCategoricals.setup"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeMergeCategoricals:\n param_names = [\"shapes\", \"data_type\"]\n params = [\n get_benchmark_shapes(\"MergeCategoricals\"),\n [\"object\", \"category\"],\n ]\n\n def setup(self, shapes, data_type):\n assert len(shapes) == 2\n assert shapes[1] == 2\n size = (shapes[0],)\n self.left = IMPL.DataFrame(\n {\n \"X\": np.random.choice(range(0, 10), size=size),\n \"Y\": np.random.choice([\"one\", \"two\", \"three\"], size=size),\n }\n )\n\n self.right = IMPL.DataFrame(\n {\n \"X\": np.random.choice(range(0, 10), size=size),\n \"Z\": np.random.choice([\"jjj\", \"kkk\", \"sss\"], size=size),\n }\n )\n\n if data_type == \"category\":\n self.left = self.left.assign(Y=self.left[\"Y\"].astype(\"category\"))\n execute(self.left)\n self.right = self.right.assign(Z=self.right[\"Z\"].astype(\"category\"))\n execute(self.right)\n\n def time_merge_categoricals(self, shapes, data_type):\n execute(IMPL.merge(self.left, self.right, on=\"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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeConcat_TimeConcat.time_concat.execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeConcat_TimeConcat.time_concat.execute_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 276, "span_ids": ["TimeConcat.time_concat", "TimeConcat", "TimeConcat.setup"], "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 TimeConcat:\n param_names = [\"shapes\", \"how\", \"axis\", \"ignore_index\"]\n params = [\n get_benchmark_shapes(\"TimeConcat\"),\n [\"inner\", \"outer\"],\n [0, 1],\n [True, False],\n ]\n\n def setup(self, shapes, how, axis, ignore_index):\n self.df1 = generate_dataframe(\"int\", *shapes[0], RAND_LOW, RAND_HIGH)\n self.df2 = generate_dataframe(\"int\", *shapes[1], RAND_LOW, RAND_HIGH)\n\n def time_concat(self, shapes, how, axis, ignore_index):\n execute(\n IMPL.concat(\n [self.df1, self.df2], axis=axis, join=how, ignore_index=ignore_index\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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeBinaryOp_TimeBinaryOp.time_binary_op.execute_self_op_self_df2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeBinaryOp_TimeBinaryOp.time_binary_op.execute_self_op_self_df2_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 293, "span_ids": ["TimeBinaryOp.setup", "TimeBinaryOp", "TimeBinaryOp.time_binary_op"], "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 TimeBinaryOp:\n param_names = [\"shapes\", \"binary_op\", \"axis\"]\n params = [\n get_benchmark_shapes(\"TimeBinaryOp\"),\n [\"mul\"],\n [0, 1],\n ]\n\n def setup(self, shapes, binary_op, axis):\n self.df1 = generate_dataframe(\"int\", *shapes[0], RAND_LOW, RAND_HIGH)\n self.df2 = generate_dataframe(\"int\", *shapes[1], RAND_LOW, RAND_HIGH)\n self.op = getattr(self.df1, binary_op)\n\n def time_binary_op(self, shapes, binary_op, axis):\n execute(self.op(self.df2, axis=axis))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeBinaryOpSeries_TimeBinaryOpSeries.time_binary_op_series.execute_self_op_self_seri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeBinaryOpSeries_TimeBinaryOpSeries.time_binary_op_series.execute_self_op_self_seri", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 296, "end_line": 313, "span_ids": ["TimeBinaryOpSeries.time_binary_op_series", "TimeBinaryOpSeries.setup", "TimeBinaryOpSeries"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeBinaryOpSeries:\n param_names = [\"shapes\", \"binary_op\"]\n params = [\n get_benchmark_shapes(\"TimeBinaryOpSeries\"),\n [\"mul\"],\n ]\n\n def setup(self, shapes, binary_op):\n df1 = generate_dataframe(\"int\", *shapes[0], RAND_LOW, RAND_HIGH)\n df2 = generate_dataframe(\"int\", *shapes[1], RAND_LOW, RAND_HIGH)\n self.series1 = df1[df1.columns[0]]\n self.series2 = df2[df2.columns[0]]\n self.op = getattr(self.series1, binary_op)\n execute(self.series1)\n execute(self.series2)\n\n def time_binary_op_series(self, shapes, binary_op):\n execute(self.op(self.series2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseTimeSetItem_BaseTimeSetItem.setup.if_not_is_equal_indices_.self.item.index.reversed_self_item_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseTimeSetItem_BaseTimeSetItem.setup.if_not_is_equal_indices_.self.item.index.reversed_self_item_index_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 345, "span_ids": ["BaseTimeSetItem", "BaseTimeSetItem.setup", "BaseTimeSetItem.get_loc"], "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 BaseTimeSetItem:\n param_names = [\"shape\", \"item_length\", \"loc\", \"is_equal_indices\"]\n\n @staticmethod\n def get_loc(df, loc, axis, item_length):\n locs_dict = {\n \"zero\": 0,\n \"middle\": len(df.axes[axis]) // 2,\n \"last\": len(df.axes[axis]) - 1,\n }\n base_loc = locs_dict[loc]\n range_based_loc = np.arange(\n base_loc, min(len(df.axes[axis]), base_loc + item_length)\n )\n return (\n (df.axes[axis][base_loc], base_loc)\n if len(range_based_loc) == 1\n else (df.axes[axis][range_based_loc], range_based_loc)\n )\n\n def setup(self, shape, item_length, loc, is_equal_indices):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH).copy()\n self.loc, self.iloc = self.get_loc(\n self.df, loc, item_length=item_length, axis=1\n )\n\n self.item = self.df[self.loc] + 1\n self.item_raw = self.item.to_numpy()\n if not is_equal_indices:\n self.item.index = reversed(self.item.index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeSetItem_TimeInsert.time_insert_raw.execute_self_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeSetItem_TimeInsert.time_insert_raw.execute_self_df_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 379, "span_ids": ["TimeSetItem.time_setitem_raw", "TimeInsert.time_insert_qc", "TimeSetItem.time_setitem_qc", "TimeSetItem", "TimeInsert", "TimeInsert.time_insert_raw"], "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 TimeSetItem(BaseTimeSetItem):\n params = [\n get_benchmark_shapes(\"TimeSetItem\"),\n [1],\n [\"zero\", \"middle\", \"last\"],\n [True, False],\n ]\n\n def time_setitem_qc(self, *args, **kwargs):\n self.df[self.loc] = self.item\n execute(self.df)\n\n def time_setitem_raw(self, *args, **kwargs):\n self.df[self.loc] = self.item_raw\n execute(self.df)\n\n\nclass TimeInsert(BaseTimeSetItem):\n params = [\n get_benchmark_shapes(\"TimeInsert\"),\n [1],\n [\"zero\", \"middle\", \"last\"],\n [True, False],\n ]\n\n def time_insert_qc(self, *args, **kwargs):\n self.df.insert(loc=self.iloc, column=random_string(), value=self.item)\n execute(self.df)\n\n def time_insert_raw(self, *args, **kwargs):\n self.df.insert(loc=self.iloc, column=random_string(), value=self.item_raw)\n execute(self.df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeArithmetic_TimeArithmetic.time_transpose.execute_self_df_transpose": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeArithmetic_TimeArithmetic.time_transpose.execute_self_df_transpose", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 382, "end_line": 432, "span_ids": ["TimeArithmetic.time_median", "TimeArithmetic.time_sum", "TimeArithmetic.time_nunique", "TimeArithmetic.time_mod", "TimeArithmetic.setup", "TimeArithmetic.time_count", "TimeArithmetic.time_mul", "TimeArithmetic.time_abs", "TimeArithmetic.time_mean", "TimeArithmetic.time_is_in", "TimeArithmetic.time_add", "TimeArithmetic.time_apply", "TimeArithmetic", "TimeArithmetic.time_transpose", "TimeArithmetic.time_mode", "TimeArithmetic.time_aggregate"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeArithmetic:\n param_names = [\"shape\", \"axis\"]\n params = [\n get_benchmark_shapes(\"TimeArithmetic\"),\n [0, 1],\n ]\n\n def setup(self, shape, axis):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n\n def time_sum(self, shape, axis):\n execute(self.df.sum(axis=axis))\n\n def time_count(self, shape, axis):\n execute(self.df.count(axis=axis))\n\n def time_median(self, shape, axis):\n execute(self.df.median(axis=axis))\n\n def time_nunique(self, shape, axis):\n execute(self.df.nunique(axis=axis))\n\n def time_apply(self, shape, axis):\n execute(self.df.apply(lambda df: df.sum(), axis=axis))\n\n def time_mean(self, shape, axis):\n execute(self.df.mean(axis=axis))\n\n def time_mode(self, shape, axis):\n execute(self.df.mode(axis=axis))\n\n def time_add(self, shape, axis):\n execute(self.df.add(2, axis=axis))\n\n def time_mul(self, shape, axis):\n execute(self.df.mul(2, axis=axis))\n\n def time_mod(self, shape, axis):\n execute(self.df.mod(2, axis=axis))\n\n def time_abs(self, shape, axis):\n execute(self.df.abs())\n\n def time_aggregate(self, shape, axis):\n execute(self.df.aggregate(lambda df: df.sum(), axis=axis))\n\n def time_is_in(self, shape, axis):\n execute(self.df.isin([0, 2]))\n\n def time_transpose(self, shape, axis):\n execute(self.df.transpose())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeSortValues_TimeSortValues.time_sort_values.execute_self_df_sort_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeSortValues_TimeSortValues.time_sort_values.execute_self_df_sort_valu", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 435, "end_line": 453, "span_ids": ["TimeSortValues.setup", "TimeSortValues.time_sort_values", "TimeSortValues"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeSortValues:\n param_names = [\"shape\", \"columns_number\", \"ascending_list\"]\n params = [\n get_benchmark_shapes(\"TimeSortValues\"),\n [1, 2, 10, 100],\n [False, True],\n ]\n\n def setup(self, shape, columns_number, ascending_list):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n self.columns = random_columns(self.df.columns, columns_number)\n self.ascending = (\n random_booleans(columns_number)\n if ascending_list\n else bool(random_booleans(1)[0])\n )\n\n def time_sort_values(self, shape, columns_number, ascending_list):\n execute(self.df.sort_values(self.columns, ascending=self.ascending))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDrop_TimeDrop.time_drop.execute_self_df_drop_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDrop_TimeDrop.time_drop.execute_self_df_drop_self", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 456, "end_line": 474, "span_ids": ["TimeDrop.setup", "TimeDrop", "TimeDrop.time_drop"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeDrop:\n param_names = [\"shape\", \"axis\", \"drop_ncols\"]\n params = [\n get_benchmark_shapes(\"TimeDrop\"),\n [0, 1],\n [1, 0.8],\n ]\n\n def setup(self, shape, axis, drop_ncols):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n drop_count = (\n int(len(self.df.axes[axis]) * drop_ncols)\n if isinstance(drop_ncols, float)\n else drop_ncols\n )\n self.labels = self.df.axes[axis][:drop_count]\n\n def time_drop(self, shape, axis, drop_ncols):\n execute(self.df.drop(self.labels, axis=axis))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeHead_TimeHead.time_head.execute_self_df_head_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeHead_TimeHead.time_head.execute_self_df_head_self", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 477, "end_line": 493, "span_ids": ["TimeHead", "TimeHead.setup", "TimeHead.time_head"], "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 TimeHead:\n param_names = [\"shape\", \"head_count\"]\n params = [\n get_benchmark_shapes(\"TimeHead\"),\n [5, 0.8],\n ]\n\n def setup(self, shape, head_count):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n self.head_count = (\n int(head_count * len(self.df.index))\n if isinstance(head_count, float)\n else head_count\n )\n\n def time_head(self, shape, head_count):\n execute(self.df.head(self.head_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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeTail_TimeExplode.time_explode.execute_self_df_explode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeTail_TimeExplode.time_explode.execute_self_df_explode_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 496, "end_line": 527, "span_ids": ["TimeTail", "TimeExplode.time_explode", "TimeExplode", "TimeTail.setup", "TimeTail.time_tail", "TimeExplode.setup"], "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 TimeTail:\n param_names = [\"shape\", \"tail_count\"]\n params = [\n get_benchmark_shapes(\"TimeTail\"),\n [5, 0.8],\n ]\n\n def setup(self, shape, tail_count):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n self.tail_count = (\n int(tail_count * len(self.df.index))\n if isinstance(tail_count, float)\n else tail_count\n )\n\n def time_tail(self, shape, tail_count):\n execute(self.df.tail(self.tail_count))\n\n\nclass TimeExplode:\n param_names = [\"shape\"]\n params = [\n get_benchmark_shapes(\"TimeExplode\"),\n ]\n\n def setup(self, shape):\n self.df = generate_dataframe(\n \"int\", *shape, RAND_LOW, RAND_HIGH, gen_unique_key=True\n )\n\n def time_explode(self, shape):\n execute(self.df.explode(\"col1\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaSeries_TimeFillnaSeries.time_fillna_inplace.execute_self_series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaSeries_TimeFillnaSeries.time_fillna_inplace.execute_self_series_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 530, "end_line": 559, "span_ids": ["TimeFillnaSeries", "TimeFillnaSeries.time_fillna_inplace", "TimeFillnaSeries.time_fillna", "TimeFillnaSeries.setup"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeFillnaSeries:\n param_names = [\"value_type\", \"shape\", \"limit\"]\n params = [\n [\"scalar\", \"dict\", \"Series\"],\n get_benchmark_shapes(\"TimeFillnaSeries\"),\n [None, 0.8],\n ]\n\n def setup(self, value_type, shape, limit):\n self.series = gen_nan_data(*shape)\n\n if value_type == \"scalar\":\n self.value = 18.19\n elif value_type == \"dict\":\n self.value = {k: k * 1.23 for k in range(shape[0])}\n elif value_type == \"Series\":\n self.value = IMPL.Series(\n [k * 1.23 for k in range(shape[0])], index=IMPL.RangeIndex(shape[0])\n )\n else:\n assert False\n limit = int(limit * shape[0]) if limit else None\n self.kw = {\"value\": self.value, \"limit\": limit}\n\n def time_fillna(self, value_type, shape, limit):\n execute(self.series.fillna(**self.kw))\n\n def time_fillna_inplace(self, value_type, shape, limit):\n self.series.fillna(inplace=True, **self.kw)\n execute(self.series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaDataFrame_TimeFillnaDataFrame.time_fillna_inplace.execute_self_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaDataFrame_TimeFillnaDataFrame.time_fillna_inplace.execute_self_df_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 562, "end_line": 601, "span_ids": ["TimeFillnaDataFrame.time_fillna", "TimeFillnaDataFrame", "TimeFillnaDataFrame.setup", "TimeFillnaDataFrame.time_fillna_inplace"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeFillnaDataFrame:\n param_names = [\"value_type\", \"shape\", \"limit\"]\n params = [\n [\"scalar\", \"dict\", \"DataFrame\", \"Series\"],\n get_benchmark_shapes(\"TimeFillnaDataFrame\"),\n [None, 0.8],\n ]\n\n def setup(self, value_type, shape, limit):\n self.df = gen_nan_data(*shape)\n columns = self.df.columns\n\n if value_type == \"scalar\":\n self.value = 18.19\n elif value_type == \"dict\":\n self.value = {k: i * 1.23 for i, k in enumerate(columns)}\n elif value_type == \"Series\":\n self.value = IMPL.Series(\n [i * 1.23 for i in range(len(columns))], index=columns\n )\n elif value_type == \"DataFrame\":\n self.value = IMPL.DataFrame(\n {\n k: [i + j * 1.23 for j in range(shape[0])]\n for i, k in enumerate(columns)\n },\n index=IMPL.RangeIndex(shape[0]),\n columns=columns,\n )\n else:\n assert False\n limit = int(limit * shape[0]) if limit else None\n self.kw = {\"value\": self.value, \"limit\": limit}\n\n def time_fillna(self, value_type, shape, limit):\n execute(self.df.fillna(**self.kw))\n\n def time_fillna_inplace(self, value_type, shape, limit):\n self.df.fillna(inplace=True, **self.kw)\n execute(self.df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseTimeValueCounts_TimeValueCountsFrame.time_value_counts.execute_self_df_value_cou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseTimeValueCounts_TimeValueCountsFrame.time_value_counts.execute_self_df_value_cou", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 604, "end_line": 626, "span_ids": ["TimeValueCountsFrame.time_value_counts", "TimeValueCountsFrame", "BaseTimeValueCounts", "BaseTimeValueCounts.setup"], "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 BaseTimeValueCounts:\n def setup(self, shape, ngroups=5, subset=1):\n ngroups = translator_groupby_ngroups(ngroups, shape)\n self.df, self.subset = generate_dataframe(\n \"int\",\n *shape,\n RAND_LOW,\n RAND_HIGH,\n groupby_ncols=subset,\n count_groups=ngroups,\n )\n\n\nclass TimeValueCountsFrame(BaseTimeValueCounts):\n param_names = [\"shape\", \"ngroups\", \"subset\"]\n params = [\n get_benchmark_shapes(\"TimeValueCountsFrame\"),\n GROUPBY_NGROUPS,\n [2, 10],\n ]\n\n def time_value_counts(self, *args, **kwargs):\n execute(self.df.value_counts(subset=self.subset))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeValueCountsSeries_TimeValueCountsSeries.time_value_counts.execute_self_df_value_cou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeValueCountsSeries_TimeValueCountsSeries.time_value_counts.execute_self_df_value_cou", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 629, "end_line": 642, "span_ids": ["TimeValueCountsSeries.time_value_counts", "TimeValueCountsSeries", "TimeValueCountsSeries.setup"], "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 TimeValueCountsSeries(BaseTimeValueCounts):\n param_names = [\"shape\", \"ngroups\", \"bins\"]\n params = [\n get_benchmark_shapes(\"TimeValueCountsSeries\"),\n GROUPBY_NGROUPS,\n [None, 3],\n ]\n\n def setup(self, shape, ngroups, bins):\n super().setup(ngroups=ngroups, shape=shape)\n self.df = self.df[self.subset[0]]\n\n def time_value_counts(self, shape, ngroups, bins):\n execute(self.df.value_counts(bins=bins))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexing_TimeIndexing.time_loc.execute_self_df_loc_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexing_TimeIndexing.time_loc.execute_self_df_loc_self_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 645, "end_line": 693, "span_ids": ["TimeIndexing.time_iloc", "TimeIndexing.setup", "TimeIndexing", "TimeIndexing.time_loc"], "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": "class TimeIndexing:\n param_names = [\"shape\", \"indexer_type\"]\n params = [\n get_benchmark_shapes(\"TimeIndexing\"),\n [\n \"bool_array\",\n \"bool_series\",\n \"scalar\",\n \"slice\",\n \"continuous_slice\",\n \"numpy_array_take_all_values\",\n \"python_list_take_10_values\",\n \"function\",\n ],\n ]\n\n indexer_getters = {\n \"bool_array\": lambda df: np.array([False, True] * (len(df) // 2)),\n # This boolean-Series is a projection of the source frame, it shouldn't\n # be reimported or triggered to execute:\n \"bool_series\": lambda df: df.iloc[:, 0] > 50,\n \"scalar\": lambda df: len(df) // 2,\n \"slice\": lambda df: slice(0, len(df), 2),\n \"continuous_slice\": lambda df: slice(len(df) // 2),\n \"numpy_array_take_all_values\": lambda df: np.arange(len(df)),\n \"python_list_take_10_values\": lambda df: list(range(min(10, len(df)))),\n \"function\": lambda df: (lambda df: df.index[::-2]),\n }\n\n def setup(self, shape, indexer_type):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n\n self.indexer = self.indexer_getters[indexer_type](self.df)\n if isinstance(self.indexer, (IMPL.Series, IMPL.DataFrame)):\n # HACK: Triggering `dtypes` meta-data computation in advance,\n # so it won't affect the `loc/iloc` time:\n self.indexer.dtypes\n\n def time_iloc(self, shape, indexer_type):\n # Pandas doesn't implement `df.iloc[series boolean_mask]` and raises an exception on it.\n # Replacing this with the semantically equivalent construction:\n if indexer_type != \"bool_series\":\n execute(self.df.iloc[self.indexer])\n else:\n execute(self.df[self.indexer])\n\n def time_loc(self, shape, indexer_type):\n execute(self.df.loc[self.indexer])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingColumns_TimeIndexingColumns.time___getitem__.execute_self_df_self_labe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingColumns_TimeIndexingColumns.time___getitem__.execute_self_df_self_labe", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 696, "end_line": 713, "span_ids": ["TimeIndexingColumns.setup", "TimeIndexingColumns", "TimeIndexingColumns.time___getitem__", "TimeIndexingColumns.time_iloc", "TimeIndexingColumns.time_loc"], "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 TimeIndexingColumns:\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"TimeIndexing\")]\n\n def setup(self, shape):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n self.numeric_indexer = [0, 1]\n self.labels_indexer = self.df.columns[self.numeric_indexer].tolist()\n\n def time_iloc(self, shape):\n execute(self.df.iloc[:, self.numeric_indexer])\n\n def time_loc(self, shape):\n execute(self.df.loc[:, self.labels_indexer])\n\n def time___getitem__(self, shape):\n execute(self.df[self.labels_indexer])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMultiIndexing_TimeMultiIndexing.time_multiindex_loc.execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeMultiIndexing_TimeMultiIndexing.time_multiindex_loc.execute_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 716, "end_line": 741, "span_ids": ["TimeMultiIndexing.setup", "TimeMultiIndexing", "TimeMultiIndexing.time_multiindex_loc"], "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 TimeMultiIndexing:\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"TimeMultiIndexing\")]\n\n def setup(self, shape):\n df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n\n index = IMPL.MultiIndex.from_product(\n [df.index[: shape[0] // 2], [\"bar\", \"foo\"]]\n )\n columns = IMPL.MultiIndex.from_product(\n [df.columns[: shape[1] // 2], [\"buz\", \"fuz\"]]\n )\n\n df.index = index\n df.columns = columns\n\n self.df = df.sort_index(axis=1)\n\n def time_multiindex_loc(self, shape):\n execute(\n self.df.loc[\n self.df.index[2] : self.df.index[-2],\n self.df.columns[2] : self.df.columns[-2],\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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeResetIndex_TimeResetIndex.time_reset_index.execute_self_df_reset_ind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeResetIndex_TimeResetIndex.time_reset_index.execute_self_df_reset_ind", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 744, "end_line": 763, "span_ids": ["TimeResetIndex.time_reset_index", "TimeResetIndex.setup", "TimeResetIndex"], "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 TimeResetIndex:\n param_names = [\"shape\", \"drop\", \"level\"]\n params = [\n get_benchmark_shapes(\"TimeResetIndex\"),\n [False, True],\n [None, \"level_1\"],\n ]\n\n def setup(self, shape, drop, level):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n\n if level:\n index = IMPL.MultiIndex.from_product(\n [self.df.index[: shape[0] // 2], [\"bar\", \"foo\"]],\n names=[\"level_1\", \"level_2\"],\n )\n self.df.index = index\n\n def time_reset_index(self, shape, drop, level):\n execute(self.df.reset_index(drop=drop, level=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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeAstype_TimeAstype.time_astype.execute_self_df_astype_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeAstype_TimeAstype.time_astype.execute_self_df_astype_se", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 766, "end_line": 784, "span_ids": ["TimeAstype.time_astype", "TimeAstype", "TimeAstype.setup"], "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 TimeAstype:\n param_names = [\"shape\", \"dtype\", \"astype_ncolumns\"]\n params = [\n get_benchmark_shapes(\"TimeAstype\"),\n [\"float64\", \"category\"],\n [\"one\", \"all\"],\n ]\n\n def setup(self, shape, dtype, astype_ncolumns):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n if astype_ncolumns == \"all\":\n self.astype_arg = dtype\n elif astype_ncolumns == \"one\":\n self.astype_arg = {\"col1\": dtype}\n else:\n raise ValueError(f\"astype_ncolumns: {astype_ncolumns} isn't supported\")\n\n def time_astype(self, shape, dtype, astype_ncolumns):\n execute(self.df.astype(self.astype_arg))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDescribe_TimeProperties.time_index.return.self_df_index": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDescribe_TimeProperties.time_index.return.self_df_index", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 787, "end_line": 816, "span_ids": ["TimeDescribe.time_describe", "TimeProperties.setup", "TimeProperties.time_columns", "TimeDescribe", "TimeProperties.time_shape", "TimeProperties", "TimeProperties.time_index", "TimeDescribe.setup"], "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 TimeDescribe:\n param_names = [\"shape\"]\n params = [\n get_benchmark_shapes(\"TimeDescribe\"),\n ]\n\n def setup(self, shape):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n\n def time_describe(self, shape):\n execute(self.df.describe())\n\n\nclass TimeProperties:\n param_names = [\"shape\"]\n params = [\n get_benchmark_shapes(\"TimeProperties\"),\n ]\n\n def setup(self, shape):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n\n def time_shape(self, shape):\n return self.df.shape\n\n def time_columns(self, shape):\n return self.df.columns\n\n def time_index(self, shape):\n return self.df.index", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingNumericSeries_TimeIndexingNumericSeries.setup.execute_self_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingNumericSeries_TimeIndexingNumericSeries.setup.execute_self_data_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 819, "end_line": 840, "span_ids": ["TimeIndexingNumericSeries.setup", "TimeIndexingNumericSeries"], "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 TimeIndexingNumericSeries:\n param_names = [\"shape\", \"dtype\", \"index_structure\"]\n params = [\n get_benchmark_shapes(\"TimeIndexingNumericSeries\"),\n (np.int64, np.uint64, np.float64),\n (\"unique_monotonic_inc\", \"nonunique_monotonic_inc\"),\n ]\n\n def setup(self, shape, dtype, index_structure):\n N = shape[0]\n indices = {\n \"unique_monotonic_inc\": IMPL.Index(range(N), dtype=dtype),\n \"nonunique_monotonic_inc\": IMPL.Index(\n list(range(N // 100)) + [(N // 100) - 1] + list(range(N // 100, N - 1)),\n dtype=dtype,\n ),\n }\n self.data = IMPL.Series(np.random.rand(N), index=indices[index_structure])\n self.array = np.arange(N // 2)\n self.index_to_query = N // 2\n self.array_list = self.array.tolist()\n execute(self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingNumericSeries.time_getitem_scalar_TimeIndexingNumericSeries.time_loc_slice.execute_self_data_loc_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIndexingNumericSeries.time_getitem_scalar_TimeIndexingNumericSeries.time_loc_slice.execute_self_data_loc_s", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 842, "end_line": 881, "span_ids": ["TimeIndexingNumericSeries.time_getitem_list_like", "TimeIndexingNumericSeries.time_loc_scalar", "TimeIndexingNumericSeries.time_loc_slice", "TimeIndexingNumericSeries.time_iloc_slice", "TimeIndexingNumericSeries.time_loc_array", "TimeIndexingNumericSeries.time_iloc_scalar", "TimeIndexingNumericSeries.time_iloc_list_like", "TimeIndexingNumericSeries.time_getitem_slice", "TimeIndexingNumericSeries.time_getitem_scalar", "TimeIndexingNumericSeries.time_loc_list_like", "TimeIndexingNumericSeries.time_getitem_array", "TimeIndexingNumericSeries.time_iloc_array", "TimeIndexingNumericSeries.time_getitem_lists"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeIndexingNumericSeries:\n\n def time_getitem_scalar(self, shape, index, index_structure):\n # not calling execute as execute function fails for scalar\n self.data[self.index_to_query]\n\n def time_getitem_slice(self, shape, index, index_structure):\n execute(self.data[: self.index_to_query])\n\n def time_getitem_list_like(self, shape, index, index_structure):\n execute(self.data[[self.index_to_query]])\n\n def time_getitem_array(self, shape, index, index_structure):\n execute(self.data[self.array])\n\n def time_getitem_lists(self, shape, index, index_structure):\n execute(self.data[self.array_list])\n\n def time_iloc_array(self, shape, index, index_structure):\n execute(self.data.iloc[self.array])\n\n def time_iloc_list_like(self, shape, index, index_structure):\n execute(self.data.iloc[[self.index_to_query]])\n\n def time_iloc_scalar(self, shape, index, index_structure):\n # not calling execute as execute function fails for scalar\n self.data.iloc[self.index_to_query]\n\n def time_iloc_slice(self, shape, index, index_structure):\n execute(self.data.iloc[: self.index_to_query])\n\n def time_loc_array(self, shape, index, index_structure):\n execute(self.data.loc[self.array])\n\n def time_loc_list_like(self, shape, index, index_structure):\n execute(self.data.loc[[self.index_to_query]])\n\n def time_loc_scalar(self, shape, index, index_structure):\n self.data.loc[self.index_to_query]\n\n def time_loc_slice(self, shape, index, index_structure):\n execute(self.data.loc[: self.index_to_query])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindex_TimeReindex.setup.execute_self_s_subset_no_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindex_TimeReindex.setup.execute_self_s_subset_no_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 884, "end_line": 912, "span_ids": ["TimeReindex", "TimeReindex.setup"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeReindex:\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"TimeReindex\")]\n\n def setup(self, shape):\n rows, cols = shape\n rng = IMPL.date_range(start=\"1/1/1970\", periods=rows, freq=\"1min\")\n self.df = IMPL.DataFrame(\n np.random.rand(rows, cols), index=rng, columns=range(cols)\n )\n self.df[\"foo\"] = \"bar\"\n self.rng_subset = IMPL.Index(rng[::2])\n self.df2 = IMPL.DataFrame(\n index=range(rows), data=np.random.rand(rows, cols), columns=range(cols)\n )\n level1 = tm.makeStringIndex(rows // 10).values.repeat(10)\n level2 = np.tile(tm.makeStringIndex(10).values, rows // 10)\n index = IMPL.MultiIndex.from_arrays([level1, level2])\n self.s = IMPL.Series(np.random.randn(rows), index=index)\n self.s_subset = self.s[::2]\n self.s_subset_no_cache = self.s[::2].copy()\n\n mi = IMPL.MultiIndex.from_product([rng[: len(rng) // 10], range(10)])\n self.s2 = IMPL.Series(np.random.randn(len(mi)), index=mi)\n self.s2_subset = self.s2[::2].copy()\n execute(self.df), execute(self.df2)\n execute(self.s), execute(self.s_subset)\n execute(self.s2), execute(self.s2_subset)\n execute(self.s_subset_no_cache)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindex.time_reindex_dates_TimeReindex.time_reindex_multiindex_no_cache_dates.execute_self_s2_subset_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindex.time_reindex_dates_TimeReindex.time_reindex_multiindex_no_cache_dates.execute_self_s2_subset_re", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 914, "end_line": 930, "span_ids": ["TimeReindex.time_reindex_multiindex_with_cache", "TimeReindex.time_reindex_multiindex_no_cache", "TimeReindex.time_reindex_multiindex_no_cache_dates", "TimeReindex.time_reindex_dates", "TimeReindex.time_reindex_columns"], "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 TimeReindex:\n\n def time_reindex_dates(self, shape):\n execute(self.df.reindex(self.rng_subset))\n\n def time_reindex_columns(self, shape):\n execute(self.df2.reindex(columns=self.df.columns[1:5]))\n\n def time_reindex_multiindex_with_cache(self, shape):\n # MultiIndex._values gets cached (pandas specific)\n execute(self.s.reindex(self.s_subset.index))\n\n def time_reindex_multiindex_no_cache(self, shape):\n # Copy to avoid MultiIndex._values getting cached (pandas specific)\n execute(self.s.reindex(self.s_subset_no_cache.index.copy()))\n\n def time_reindex_multiindex_no_cache_dates(self, shape):\n # Copy to avoid MultiIndex._values getting cached (pandas specific)\n execute(self.s2_subset.reindex(self.s2.index.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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindexMethod_TimeReindexMethod.time_reindex_method.execute_self_ts_reindex_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeReindexMethod_TimeReindexMethod.time_reindex_method.execute_self_ts_reindex_s", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 933, "end_line": 948, "span_ids": ["TimeReindexMethod.time_reindex_method", "TimeReindexMethod.setup", "TimeReindexMethod"], "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 TimeReindexMethod:\n params = [\n get_benchmark_shapes(\"TimeReindexMethod\"),\n [\"pad\", \"backfill\"],\n [IMPL.date_range, IMPL.period_range],\n ]\n param_names = [\"shape\", \"method\", \"constructor\"]\n\n def setup(self, shape, method, constructor):\n N = shape[0]\n self.idx = constructor(\"1/1/2000\", periods=N, freq=\"1min\")\n self.ts = IMPL.Series(np.random.randn(N), index=self.idx)[::2]\n execute(self.ts)\n\n def time_reindex_method(self, shape, method, constructor):\n execute(self.ts.reindex(self.idx, method=method))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaMethodSeries_TimeFillnaMethodSeries.time_float_32.execute_self_ts_float32_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaMethodSeries_TimeFillnaMethodSeries.time_float_32.execute_self_ts_float32_f", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 951, "end_line": 967, "span_ids": ["TimeFillnaMethodSeries.setup", "TimeFillnaMethodSeries.time_reindexed", "TimeFillnaMethodSeries.time_float_32", "TimeFillnaMethodSeries"], "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 TimeFillnaMethodSeries:\n params = [get_benchmark_shapes(\"TimeFillnaMethodSeries\"), [\"pad\", \"backfill\"]]\n param_names = [\"shape\", \"method\"]\n\n def setup(self, shape, method):\n N = shape[0]\n self.idx = IMPL.date_range(\"1/1/2000\", periods=N, freq=\"1min\")\n ts = IMPL.Series(np.random.randn(N), index=self.idx)[::2]\n self.ts_reindexed = ts.reindex(self.idx)\n self.ts_float32 = self.ts_reindexed.astype(\"float32\")\n execute(self.ts_reindexed), execute(self.ts_float32)\n\n def time_reindexed(self, shape, method):\n execute(self.ts_reindexed.fillna(method=method))\n\n def time_float_32(self, shape, method):\n execute(self.ts_float32.fillna(method=method))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaMethodDataframe_TimeFillnaMethodDataframe.time_float_32.execute_self_df_ts_float3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeFillnaMethodDataframe_TimeFillnaMethodDataframe.time_float_32.execute_self_df_ts_float3", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 970, "end_line": 985, "span_ids": ["TimeFillnaMethodDataframe.time_float_32", "TimeFillnaMethodDataframe.setup", "TimeFillnaMethodDataframe.time_reindexed", "TimeFillnaMethodDataframe"], "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 TimeFillnaMethodDataframe:\n params = [get_benchmark_shapes(\"TimeFillnaMethodDataframe\"), [\"pad\", \"backfill\"]]\n param_names = [\"shape\", \"method\"]\n\n def setup(self, shape, method):\n self.idx = IMPL.date_range(\"1/1/2000\", periods=shape[0], freq=\"1min\")\n df_ts = IMPL.DataFrame(np.random.randn(*shape), index=self.idx)[::2]\n self.df_ts_reindexed = df_ts.reindex(self.idx)\n self.df_ts_float32 = self.df_ts_reindexed.astype(\"float32\")\n execute(self.df_ts_reindexed), execute(self.df_ts_float32)\n\n def time_reindexed(self, shape, method):\n execute(self.df_ts_reindexed.fillna(method=method))\n\n def time_float_32(self, shape, method):\n execute(self.df_ts_float32.fillna(method=method))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeLevelAlign_TimeLevelAlign.time_reindex_level.execute_self_df2_reindex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeLevelAlign_TimeLevelAlign.time_reindex_level.execute_self_df2_reindex_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 988, "end_line": 1018, "span_ids": ["TimeLevelAlign.time_align_level", "TimeLevelAlign.setup", "TimeLevelAlign", "TimeLevelAlign.time_reindex_level"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeLevelAlign:\n params = [get_benchmark_shapes(\"TimeLevelAlign\")]\n param_names = [\"shapes\"]\n\n def setup(self, shapes):\n rows, cols = shapes[0]\n rows_sqrt = round(math.sqrt(rows))\n # the new number of rows may differ from the requested (slightly, so ok)\n rows = rows_sqrt * rows_sqrt\n self.index = IMPL.MultiIndex(\n levels=[np.arange(10), np.arange(rows_sqrt), np.arange(rows_sqrt)],\n codes=[\n np.arange(10).repeat(rows),\n np.tile(np.arange(rows_sqrt).repeat(rows_sqrt), 10),\n np.tile(np.tile(np.arange(rows_sqrt), rows_sqrt), 10),\n ],\n )\n self.df1 = IMPL.DataFrame(\n np.random.randn(len(self.index), cols), index=self.index\n )\n self.df2 = IMPL.DataFrame(np.random.randn(*shapes[1]))\n execute(self.df1), execute(self.df2)\n\n def time_align_level(self, shapes):\n left, right = self.df1.align(self.df2, level=1, copy=False)\n execute(left), execute(right)\n\n def time_reindex_level(self, shapes):\n # `reindex` returns the same result here as `align`.\n # Approximately the same performance is expected.\n execute(self.df2.reindex(self.index, level=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_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDropDuplicatesDataframe_TimeDropDuplicatesDataframe.time_drop_dups_inplace.execute_self_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDropDuplicatesDataframe_TimeDropDuplicatesDataframe.time_drop_dups_inplace.execute_self_df_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1021, "end_line": 1045, "span_ids": ["TimeDropDuplicatesDataframe.time_drop_dups_inplace", "TimeDropDuplicatesDataframe.setup", "TimeDropDuplicatesDataframe.time_drop_dups", "TimeDropDuplicatesDataframe"], "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 TimeDropDuplicatesDataframe:\n params = [get_benchmark_shapes(\"TimeDropDuplicatesDataframe\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n from pandas import DataFrame\n\n rows, cols = shape\n N = rows // 10\n K = 10\n # Assigning a large number of columns - inefficient in Modin, so use pandas\n temp_df = DataFrame()\n # dataframe would have cols-1 keys(strings) and one value(int) column\n for col in range(cols - 1):\n temp_df[\"key\" + str(col + 1)] = tm.makeStringIndex(N).values.repeat(K)\n self.df = IMPL.DataFrame(temp_df)\n self.df[\"value\"] = np.random.randn(N * K)\n execute(self.df)\n\n def time_drop_dups(self, shape):\n execute(self.df.drop_duplicates(self.df.columns[:-1]))\n\n def time_drop_dups_inplace(self, shape):\n self.df.drop_duplicates(self.df.columns[:-1], inplace=True)\n execute(self.df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDropDuplicatesSeries_TimeDatetimeAccessor.time_timedelta_seconds.execute_self_series_dt_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeDropDuplicatesSeries_TimeDatetimeAccessor.time_timedelta_seconds.execute_self_series_dt_se", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1048, "end_line": 1082, "span_ids": ["TimeDatetimeAccessor.time_dt_accessor", "TimeDropDuplicatesSeries.setup", "TimeDatetimeAccessor.time_timedelta_seconds", "TimeDropDuplicatesSeries", "TimeDatetimeAccessor.time_timedelta_days", "TimeDatetimeAccessor", "TimeDropDuplicatesSeries.time_drop_dups_string", "TimeDatetimeAccessor.setup", "TimeDropDuplicatesSeries.time_drop_dups"], "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 TimeDropDuplicatesSeries:\n params = [get_benchmark_shapes(\"TimeDropDuplicatesSeries\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n rows = shape[0]\n self.series = IMPL.Series(np.tile(tm.makeStringIndex(rows // 10).values, 10))\n execute(self.series)\n\n def time_drop_dups(self, shape):\n execute(self.series.drop_duplicates())\n\n def time_drop_dups_string(self, shape):\n self.series.drop_duplicates(inplace=True)\n execute(self.series)\n\n\nclass TimeDatetimeAccessor:\n params = [get_benchmark_shapes(\"TimeDatetimeAccessor\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n self.series = IMPL.Series(\n IMPL.timedelta_range(\"1 days\", periods=shape[0], freq=\"h\")\n )\n execute(self.series)\n\n def time_dt_accessor(self, shape):\n execute(self.series.dt)\n\n def time_timedelta_days(self, shape):\n execute(self.series.dt.days)\n\n def time_timedelta_seconds(self, shape):\n execute(self.series.dt.seconds)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseCategories_TimeMaskBool.time_frame_mask.execute_self_df_mask_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_BaseCategories_TimeMaskBool.time_frame_mask.execute_self_df_mask_self", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1085, "end_line": 1197, "span_ids": ["TimeReplace.setup", "TimeRemoveCategories.time_remove_categories", "TimeStack.setup", "BaseReshape.setup", "TimeRepr.setup", "TimeReplace.time_replace", "TimeSetCategories", "TimeGroups", "TimeSetCategories.time_set_categories", "BaseCategories", "BaseCategories.setup", "TimeMaskBool", "TimeGroups.time_series_indices", "TimeRepr.time_repr", "TimeUnstack.time_unstack", "TimeUnstack", "TimeRemoveCategories", "TimeReplace", "BaseReshape", "TimeRepr", "TimeGroups.setup", "TimeMaskBool.time_frame_mask", "TimeStack", "TimeGroups.time_series_groups", "TimeStack.time_stack", "TimeMaskBool.setup"], "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": "class BaseCategories:\n def setup(self, shape):\n rows = shape[0]\n arr = [f\"s{i:04d}\" for i in np.random.randint(0, rows // 10, size=rows)]\n self.ts = IMPL.Series(arr).astype(\"category\")\n execute(self.ts)\n\n\nclass TimeSetCategories(BaseCategories):\n params = [get_benchmark_shapes(\"TimeSetCategories\")]\n param_names = [\"shape\"]\n\n def time_set_categories(self, shape):\n execute(self.ts.cat.set_categories(self.ts.cat.categories[::2]))\n\n\nclass TimeRemoveCategories(BaseCategories):\n params = [get_benchmark_shapes(\"TimeRemoveCategories\")]\n param_names = [\"shape\"]\n\n def time_remove_categories(self, shape):\n execute(self.ts.cat.remove_categories(self.ts.cat.categories[::2]))\n\n\nclass BaseReshape:\n def setup(self, shape):\n rows, cols = shape\n k = 10\n arrays = [\n np.arange(rows // k).repeat(k),\n np.roll(np.tile(np.arange(rows // k), k), 25),\n ]\n index = IMPL.MultiIndex.from_arrays(arrays)\n self.df = IMPL.DataFrame(np.random.randn(rows, cols), index=index)\n execute(self.df)\n\n\nclass TimeStack(BaseReshape):\n params = [get_benchmark_shapes(\"TimeStack\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n super().setup(shape)\n self.udf = self.df.unstack(1)\n execute(self.udf)\n\n def time_stack(self, shape):\n execute(self.udf.stack())\n\n\nclass TimeUnstack(BaseReshape):\n params = [get_benchmark_shapes(\"TimeUnstack\")]\n param_names = [\"shape\"]\n\n def time_unstack(self, shape):\n execute(self.df.unstack(1))\n\n\nclass TimeReplace:\n params = [get_benchmark_shapes(\"TimeReplace\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n rows, cols = shape\n self.to_replace = {i: getattr(IMPL, \"Timestamp\")(i) for i in range(rows)}\n self.df = IMPL.DataFrame(np.random.randint(rows, size=(rows, cols)))\n execute(self.df)\n\n def time_replace(self, shape):\n execute(self.df.replace(self.to_replace))\n\n\nclass TimeGroups:\n params = [get_benchmark_shapes(\"TimeGroups\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n self.series = IMPL.Series(np.random.randint(0, 100, size=shape[0]))\n execute(self.series)\n\n # returns a pretty dict thus not calling execute\n def time_series_groups(self, shape):\n self.series.groupby(self.series).groups\n\n # returns a dict thus not calling execute\n def time_series_indices(self, shape):\n self.series.groupby(self.series).indices\n\n\nclass TimeRepr:\n params = [get_benchmark_shapes(\"TimeRepr\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n self.df = IMPL.DataFrame(np.random.randn(*shape))\n execute(self.df)\n\n # returns a string thus not calling execute\n def time_repr(self, shape):\n repr(self.df)\n\n\nclass TimeMaskBool:\n params = [get_benchmark_shapes(\"TimeMaskBool\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n self.df = IMPL.DataFrame(np.random.randn(*shape))\n self.mask = self.df < 0\n execute(self.df), execute(self.mask)\n\n def time_frame_mask(self, shape):\n execute(self.df.mask(self.mask))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIsnull_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/benchmarks.py_TimeIsnull_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1200, "end_line": 1244, "span_ids": ["TimeEquals", "TimeDropna", "impl", "TimeDropna.time_dropna", "TimeEquals.time_frame_float_equal", "TimeIsnull.setup", "TimeEquals.setup", "TimeDropna.setup", "TimeIsnull.time_isnull", "TimeIsnull"], "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 TimeIsnull:\n params = [get_benchmark_shapes(\"TimeIsnull\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n sample = np.array([np.nan, 1.0])\n data = np.random.choice(sample, (shape[0], shape[1]))\n self.df = IMPL.DataFrame(data)\n execute(self.df)\n\n def time_isnull(self, shape):\n execute(IMPL.isnull(self.df))\n\n\nclass TimeDropna:\n params = ([\"all\", \"any\"], [0, 1], get_benchmark_shapes(\"TimeDropna\"))\n param_names = [\"how\", \"axis\", \"shape\"]\n\n def setup(self, how, axis, shape):\n row, col = shape\n self.df = IMPL.DataFrame(np.random.randn(row, col))\n self.df.iloc[row // 20 : row // 10, col // 3 : col // 2] = np.nan\n self.df[\"foo\"] = \"bar\"\n execute(self.df)\n\n def time_dropna(self, how, axis, shape):\n execute(self.df.dropna(how=how, axis=axis))\n\n\nclass TimeEquals:\n params = [get_benchmark_shapes(\"TimeEquals\")]\n param_names = [\"shape\"]\n\n def setup(self, shape):\n self.df = IMPL.DataFrame(np.random.randn(*shape))\n self.df.iloc[-1, -1] = np.nan\n execute(self.df)\n\n # returns a boolean thus not calling execute\n def time_frame_float_equal(self, shape):\n self.df.equals(self.df)\n\n\nfrom .utils import setup # noqa: E402, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/__init__.py__", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_generate_dataframe_from_benchmarks_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_generate_dataframe_from_benchmarks_import_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 36, "span_ids": ["docstring"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from ..utils import (\n generate_dataframe,\n gen_nan_data,\n RAND_LOW,\n RAND_HIGH,\n GROUPBY_NGROUPS,\n IMPL,\n execute,\n translator_groupby_ngroups,\n random_columns,\n random_booleans,\n trigger_import,\n get_benchmark_shapes,\n)\nimport numpy as np\nimport pandas\n\nfrom ..benchmarks import (\n TimeIndexing as TimeIndexingPandasExecution,\n TimeIndexingColumns as TimeIndexingColumnsPandasExecution,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeJoin_TimeJoin.time_join.execute_self_df1_join_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeJoin_TimeJoin.time_join.execute_self_df1_join_sel", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 91, "span_ids": ["TimeJoin", "TimeJoin.time_join", "TimeJoin.setup"], "tokens": 474}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeJoin:\n param_names = [\"shape\", \"how\", \"is_equal_keys\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeJoin\"),\n [\"left\", \"inner\"],\n [True, False],\n ]\n\n def setup(self, shape, how, is_equal_keys):\n self.df1, self.df2 = (\n generate_dataframe(\n \"int\",\n *frame_shape,\n RAND_LOW,\n RAND_HIGH,\n cache_prefix=f\"{i}-th_frame_to_join\",\n )\n for i, frame_shape in enumerate((shape, shape))\n )\n\n if is_equal_keys:\n # When the frames have default indices to join on: RangeIndex(frame_length),\n # HDK backend performs join on the internal meta-column called 'rowid'.\n # There is a bug in the engine that makes such joins fail. To avoid joining\n # on the meta-column we explicitly specify a non-default index to join on.\n # https://github.com/modin-project/modin/issues/3740\n # Generating a new object for every index to avoid shared index objects:\n self.df1.index = pandas.RangeIndex(1, len(self.df1) + 1)\n self.df2.index = pandas.RangeIndex(1, len(self.df2) + 1)\n else:\n # Intersection rate indicates how many common join-keys `self.df1`\n # and `self.df2` have in terms of percentage.\n indices_intersection_rate = 0.5\n\n frame_length = len(self.df1)\n intersect_size = int(frame_length * indices_intersection_rate)\n\n intersect_part = np.random.choice(\n self.df1.index, size=intersect_size, replace=False\n )\n non_intersect_part = np.arange(\n start=frame_length, stop=frame_length + (frame_length - intersect_size)\n )\n new_index = np.concatenate([intersect_part, non_intersect_part])\n\n np.random.shuffle(new_index)\n self.df1.index = new_index\n\n trigger_import(self.df1, self.df2)\n\n def time_join(self, shape, how, is_equal_keys):\n # join dataframes on index to get the predictable shape\n execute(self.df1.join(self.df2, how=how, lsuffix=\"left_\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeMerge_TimeMerge.time_merge.execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeMerge_TimeMerge.time_merge.execute_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 125, "span_ids": ["TimeMerge", "TimeMerge.setup", "TimeMerge.time_merge"], "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 TimeMerge:\n param_names = [\"shapes\", \"how\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeMerge\"),\n [\"left\", \"inner\"],\n ]\n\n def setup(self, shapes, how):\n gen_unique_key = how == \"inner\"\n self.dfs = []\n for i, shape in enumerate(shapes):\n self.dfs.append(\n generate_dataframe(\n \"int\",\n *shape,\n RAND_LOW,\n RAND_HIGH,\n gen_unique_key=gen_unique_key,\n cache_prefix=f\"{i}-th_frame_to_merge\",\n )\n )\n trigger_import(*self.dfs)\n\n def time_merge(self, shapes, how):\n # merging dataframes by index is not supported, therefore we merge by column\n # with arbitrary values, which leads to an unpredictable form of the operation result;\n # it's need to get the predictable shape to get consistent performance results\n execute(\n self.dfs[0].merge(\n self.dfs[1], on=\"col1\", how=how, suffixes=(\"left_\", \"right_\")\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_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeBinaryOpDataFrame_TimeBinaryOpSeries.time_mul_series.execute_self_op_self_seri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeBinaryOpDataFrame_TimeBinaryOpSeries.time_mul_series.execute_self_op_self_seri", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 160, "span_ids": ["TimeBinaryOpDataFrame.time_mul_scalar", "TimeBinaryOpSeries", "TimeBinaryOpDataFrame.time_mul_dataframes", "TimeBinaryOpDataFrame", "TimeBinaryOpSeries.setup", "TimeBinaryOpDataFrame.setup", "TimeBinaryOpSeries.time_mul_series"], "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 TimeBinaryOpDataFrame:\n param_names = [\"shape\", \"binary_op\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeBinaryOpDataFrame\"),\n [\"mul\"],\n ]\n\n def setup(self, shape, binary_op):\n self.df1 = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df1)\n self.op = getattr(self.df1, binary_op)\n\n def time_mul_scalar(self, shape, binary_op):\n execute(self.op(2))\n\n def time_mul_dataframes(self, shape, binary_op):\n execute(self.op(self.df1))\n\n\nclass TimeBinaryOpSeries:\n param_names = [\"shape\", \"binary_op\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeBinaryOpSeries\"),\n [\"mul\"],\n ]\n\n def setup(self, shape, binary_op):\n self.series = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)[\"col0\"]\n trigger_import(self.series)\n self.op = getattr(self.series, binary_op)\n\n def time_mul_series(self, shape, binary_op):\n execute(self.op(self.series))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeArithmetic_TimeArithmetic.time_mean.execute_self_df_mean_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeArithmetic_TimeArithmetic.time_mean.execute_self_df_mean_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 184, "span_ids": ["TimeArithmetic.time_median", "TimeArithmetic.time_sum", "TimeArithmetic.time_nunique", "TimeArithmetic.setup", "TimeArithmetic.time_mean", "TimeArithmetic.time_apply", "TimeArithmetic"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeArithmetic:\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"hdk.TimeArithmetic\")]\n\n def setup(self, shape):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n\n def time_sum(self, shape):\n execute(self.df.sum())\n\n def time_median(self, shape):\n execute(self.df.median())\n\n def time_nunique(self, shape):\n execute(self.df.nunique())\n\n def time_apply(self, shape):\n execute(self.df.apply(lambda df: df.sum()))\n\n def time_mean(self, shape):\n execute(self.df.mean())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeSortValues_TimeSortValues.time_sort_values.execute_self_df_sort_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeSortValues_TimeSortValues.time_sort_values.execute_self_df_sort_valu", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 206, "span_ids": ["TimeSortValues.setup", "TimeSortValues.time_sort_values", "TimeSortValues"], "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 TimeSortValues:\n param_names = [\"shape\", \"columns_number\", \"ascending_list\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeSortValues\"),\n [1, 5],\n [False, True],\n ]\n\n def setup(self, shape, columns_number, ascending_list):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n self.columns = random_columns(self.df.columns, columns_number)\n self.ascending = (\n random_booleans(columns_number)\n if ascending_list\n else bool(random_booleans(1)[0])\n )\n\n def time_sort_values(self, shape, columns_number, ascending_list):\n execute(self.df.sort_values(self.columns, ascending=self.ascending))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeDrop_TimeDrop.time_drop.execute_self_df_drop_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeDrop_TimeDrop.time_drop.execute_self_df_drop_self", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 227, "span_ids": ["TimeDrop.setup", "TimeDrop", "TimeDrop.time_drop"], "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 TimeDrop:\n param_names = [\"shape\", \"drop_ncols\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeDrop\"),\n [1, 0.8],\n ]\n\n def setup(self, shape, drop_ncols):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n drop_count = (\n int(len(self.df.axes[1]) * drop_ncols)\n if isinstance(drop_ncols, float)\n else drop_ncols\n )\n self.labels = self.df.axes[1][:drop_count]\n\n def time_drop(self, shape, drop_ncols):\n execute(self.df.drop(self.labels, axis=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_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeHead_TimeHead.time_head.execute_self_df_head_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeHead_TimeHead.time_head.execute_self_df_head_self", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 247, "span_ids": ["TimeHead", "TimeHead.setup", "TimeHead.time_head"], "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 TimeHead:\n param_names = [\"shape\", \"head_count\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeHead\"),\n [5, 0.8],\n ]\n\n def setup(self, shape, head_count):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n self.head_count = (\n int(head_count * len(self.df.index))\n if isinstance(head_count, float)\n else head_count\n )\n\n def time_head(self, shape, head_count):\n execute(self.df.head(self.head_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_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeFillna_TimeFillna.create_fillna_value.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeFillna_TimeFillna.create_fillna_value.return.value", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 250, "end_line": 278, "span_ids": ["TimeFillna.time_fillna", "TimeFillna.setup", "TimeFillna.create_fillna_value", "TimeFillna"], "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 TimeFillna:\n param_names = [\"value_type\", \"shape\", \"limit\"]\n params = [\n [\"scalar\", \"dict\"],\n get_benchmark_shapes(\"hdk.TimeFillna\"),\n [None],\n ]\n\n def setup(self, value_type, shape, limit):\n self.df = gen_nan_data(*shape)\n columns = self.df.columns\n trigger_import(self.df)\n\n value = self.create_fillna_value(value_type, columns)\n limit = int(limit * shape[0]) if limit else None\n self.kw = {\"value\": value, \"limit\": limit}\n\n def time_fillna(self, value_type, shape, limit):\n execute(self.df.fillna(**self.kw))\n\n @staticmethod\n def create_fillna_value(value_type: str, columns: list):\n if value_type == \"scalar\":\n value = 18.19\n elif value_type == \"dict\":\n value = {k: i * 1.23 for i, k in enumerate(columns)}\n else:\n assert False\n return value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_BaseTimeValueCounts_TimeIndexingColumns.params._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_BaseTimeValueCounts_TimeIndexingColumns.params._", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 334, "span_ids": ["TimeValueCountsDataFrame", "BaseTimeValueCounts", "BaseTimeValueCounts.setup", "TimeIndexingColumns", "TimeValueCountsSeries", "TimeValueCountsDataFrame.time_value_counts", "TimeValueCountsSeries.setup", "TimeValueCountsSeries.time_value_counts", "TimeIndexing"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseTimeValueCounts:\n def setup(self, shape, ngroups=5, subset=1):\n ngroups = translator_groupby_ngroups(ngroups, shape)\n self.df, self.subset = generate_dataframe(\n \"int\",\n *shape,\n RAND_LOW,\n RAND_HIGH,\n groupby_ncols=subset,\n count_groups=ngroups,\n )\n trigger_import(self.df)\n\n\nclass TimeValueCountsDataFrame(BaseTimeValueCounts):\n param_names = [\"shape\", \"ngroups\", \"subset\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeValueCountsDataFrame\"),\n GROUPBY_NGROUPS,\n [2, 10],\n ]\n\n def time_value_counts(self, *args, **kwargs):\n execute(self.df.value_counts(subset=self.subset))\n\n\nclass TimeValueCountsSeries(BaseTimeValueCounts):\n param_names = [\"shape\", \"ngroups\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeValueCountsSeries\"),\n GROUPBY_NGROUPS,\n ]\n\n def setup(self, shape, ngroups):\n super().setup(shape, ngroups, subset=1)\n self.series = self.df[self.subset[0]]\n trigger_import(self.series)\n\n def time_value_counts(self, shape, ngroups):\n execute(self.series.value_counts())\n\n\nclass TimeIndexing(TimeIndexingPandasExecution):\n params = [\n get_benchmark_shapes(\"hdk.TimeIndexing\"),\n *TimeIndexingPandasExecution.params[1:],\n ]\n\n\nclass TimeIndexingColumns(TimeIndexingColumnsPandasExecution):\n params = [\n get_benchmark_shapes(\"hdk.TimeIndexing\"),\n *TimeIndexingColumnsPandasExecution.params[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_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeResetIndex_TimeResetIndex.time_reset_index.execute_self_df_reset_ind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeResetIndex_TimeResetIndex.time_reset_index.execute_self_df_reset_ind", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 359, "span_ids": ["TimeResetIndex.time_reset_index", "TimeResetIndex.setup", "TimeResetIndex"], "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 TimeResetIndex:\n param_names = [\"shape\", \"drop\", \"level\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeResetIndex\"),\n [False, True],\n [None, \"level_1\"],\n ]\n\n def setup(self, shape, drop, level):\n if not drop or level == \"level_1\":\n raise NotImplementedError\n\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n if level:\n index = IMPL.MultiIndex.from_product(\n [self.df.index[: shape[0] // 2], [\"bar\", \"foo\"]],\n names=[\"level_1\", \"level_2\"],\n )\n self.df.index = index\n trigger_import(self.df)\n\n def time_reset_index(self, shape, drop, level):\n execute(self.df.reset_index(drop=drop, level=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_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeAstype_TimeAstype.create_astype_arg.return.astype_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeAstype_TimeAstype.create_astype_arg.return.astype_arg", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 362, "end_line": 386, "span_ids": ["TimeAstype.create_astype_arg", "TimeAstype.time_astype", "TimeAstype", "TimeAstype.setup"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeAstype:\n param_names = [\"shape\", \"dtype\", \"astype_ncolumns\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeAstype\"),\n [\"float64\"],\n [\"one\", \"all\"],\n ]\n\n def setup(self, shape, dtype, astype_ncolumns):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n self.astype_arg = self.create_astype_arg(dtype, astype_ncolumns)\n\n def time_astype(self, shape, dtype, astype_ncolumns):\n execute(self.df.astype(self.astype_arg))\n\n @staticmethod\n def create_astype_arg(dtype, astype_ncolumns):\n if astype_ncolumns == \"all\":\n astype_arg = dtype\n elif astype_ncolumns == \"one\":\n astype_arg = {\"col1\": dtype}\n else:\n assert False\n return astype_arg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeDescribe_TimeProperties.time_index.return.self_df_index": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeDescribe_TimeProperties.time_index.return.self_df_index", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 416, "span_ids": ["TimeDescribe.time_describe", "TimeProperties.setup", "TimeProperties.time_columns", "TimeDescribe", "TimeProperties.time_shape", "TimeProperties", "TimeProperties.time_index", "TimeDescribe.setup"], "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 TimeDescribe:\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"hdk.TimeDescribe\")]\n\n def setup(self, shape):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n\n def time_describe(self, shape):\n execute(self.df.describe())\n\n\nclass TimeProperties:\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"hdk.TimeProperties\")]\n\n def setup(self, shape):\n self.df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH)\n trigger_import(self.df)\n\n def time_shape(self, shape):\n return self.df.shape\n\n def time_columns(self, shape):\n return self.df.columns\n\n def time_index(self, shape):\n return self.df.index", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_BaseTimeGroupBy_TimeGroupByDefaultAggregations.time_groupby_sum.execute_self_df_groupby_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_BaseTimeGroupBy_TimeGroupByDefaultAggregations.time_groupby_sum.execute_self_df_groupby_b", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 419, "end_line": 447, "span_ids": ["TimeGroupByDefaultAggregations.time_groupby_sum", "TimeGroupByDefaultAggregations.time_groupby_count", "BaseTimeGroupBy", "TimeGroupByDefaultAggregations", "BaseTimeGroupBy.setup"], "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 BaseTimeGroupBy:\n def setup(self, shape, ngroups=5, groupby_ncols=1):\n ngroups = translator_groupby_ngroups(ngroups, shape)\n self.df, self.groupby_columns = generate_dataframe(\n \"int\",\n *shape,\n RAND_LOW,\n RAND_HIGH,\n groupby_ncols,\n count_groups=ngroups,\n )\n # correct while we use 'col*' like name for non-groupby columns\n # and 'groupby_col*' like name for groupby columns\n self.non_groupby_columns = self.df.columns[:-groupby_ncols]\n trigger_import(self.df)\n\n\nclass TimeGroupByDefaultAggregations(BaseTimeGroupBy):\n param_names = [\"shape\", \"ngroups\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeGroupByDefaultAggregations\"),\n GROUPBY_NGROUPS,\n ]\n\n def time_groupby_count(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).count())\n\n def time_groupby_sum(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).sum())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeGroupByMultiColumn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/benchmarks.py_TimeGroupByMultiColumn_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/benchmarks.py", "file_name": "benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 450, "end_line": 476, "span_ids": ["TimeGroupByMultiColumn", "impl:2", "TimeGroupByMultiColumn.time_groupby_agg_mean", "TimeGroupByMultiColumn.time_groupby_agg_nunique", "TimeGroupByMultiColumn.time_groupby_agg_mean_dict", "TimeGroupByMultiColumn.time_groupby_sum"], "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 TimeGroupByMultiColumn(BaseTimeGroupBy):\n param_names = [\"shape\", \"ngroups\", \"groupby_ncols\"]\n params = [\n get_benchmark_shapes(\"hdk.TimeGroupByMultiColumn\"),\n GROUPBY_NGROUPS,\n [6],\n ]\n\n def time_groupby_sum(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).sum())\n\n def time_groupby_agg_mean(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).agg(\"mean\"))\n\n def time_groupby_agg_nunique(self, *args, **kwargs):\n execute(self.df.groupby(by=self.groupby_columns).agg(\"nunique\"))\n\n def time_groupby_agg_mean_dict(self, *args, **kwargs):\n execute(\n self.df.groupby(by=self.groupby_columns).agg(\n {col: \"mean\" for col in self.non_groupby_columns}\n )\n )\n\n\nfrom ..utils import setup # noqa: E402, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/io.py_generate_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/io.py_generate_dataframe_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 67, "span_ids": ["impl", "TimeReadCsvNames.time_read_csv_names", "docstring", "TimeReadCsvNames.setup_cache", "TimeReadCsvNames.setup", "TimeReadCsvNames"], "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": "from ..utils import (\n generate_dataframe,\n RAND_LOW,\n RAND_HIGH,\n ASV_USE_IMPL,\n IMPL,\n get_shape_id,\n trigger_import,\n get_benchmark_shapes,\n)\n\nfrom ..io.csv import TimeReadCsvTrueFalseValues # noqa: F401\n\n\nclass TimeReadCsvNames:\n shapes = get_benchmark_shapes(\"hdk.TimeReadCsvNames\")\n param_names = [\"shape\"]\n params = [shapes]\n\n def setup_cache(self, test_filename=\"io_test_file_csv_names\"):\n # filenames with a metadata of saved dataframes\n cache = {}\n for shape in self.shapes:\n df = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH, impl=\"pandas\")\n file_id = get_shape_id(shape)\n cache[file_id] = (\n f\"{test_filename}_{file_id}.csv\",\n df.columns.to_list(),\n df.dtypes.to_dict(),\n )\n df.to_csv(cache[file_id][0], index=False)\n return cache\n\n def setup(self, cache, shape):\n # ray init\n if ASV_USE_IMPL == \"modin\":\n IMPL.DataFrame([])\n file_id = get_shape_id(shape)\n self.filename, self.names, self.dtype = cache[file_id]\n\n def time_read_csv_names(self, cache, shape):\n df = IMPL.read_csv(\n self.filename,\n names=self.names,\n header=0,\n dtype=self.dtype,\n )\n trigger_import(df)\n\n\nfrom ..utils import setup # noqa: E402, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/utils.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/hdk/utils.py__", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/asv_bench/benchmarks/io/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/__init__.py__", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/asv_bench/benchmarks/io/csv.py_np_BaseReadCsv.setup.self.shape_id.get_shape_id_shape_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_np_BaseReadCsv.setup.self.shape_id.get_shape_id_shape_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/csv.py", "file_name": "csv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 42, "span_ids": ["BaseReadCsv.setup", "BaseReadCsv", "BaseReadCsv.setup_cache", "docstring"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\n\nfrom ..utils import (\n generate_dataframe,\n RAND_LOW,\n RAND_HIGH,\n ASV_USE_IMPL,\n ASV_USE_STORAGE_FORMAT,\n IMPL,\n execute,\n get_shape_id,\n prepare_io_data,\n get_benchmark_shapes,\n)\n\n\nclass BaseReadCsv:\n # test data file should be created only once\n def setup_cache(self, test_filename=\"io_test_file\"):\n test_filenames = prepare_io_data(\n test_filename, self.data_type, get_benchmark_shapes(self.__class__.__name__)\n )\n return test_filenames\n\n def setup(self, test_filenames, shape, *args, **kwargs):\n # ray init\n if ASV_USE_IMPL == \"modin\":\n IMPL.DataFrame([])\n self.shape_id = get_shape_id(shape)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvSkiprows_TimeReadCsvSkiprows.time_skiprows.execute_IMPL_read_csv_tes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvSkiprows_TimeReadCsvSkiprows.time_skiprows.execute_IMPL_read_csv_tes", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/csv.py", "file_name": "csv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 65, "span_ids": ["TimeReadCsvSkiprows", "TimeReadCsvSkiprows.setup", "TimeReadCsvSkiprows.time_skiprows"], "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 TimeReadCsvSkiprows(BaseReadCsv):\n shapes = get_benchmark_shapes(\"TimeReadCsvSkiprows\")\n skiprows_mapping = {\n \"lambda_even_rows\": lambda x: x % 2,\n \"range_uniform\": np.arange(1, shapes[0][0] // 10),\n \"range_step2\": np.arange(1, shapes[0][0], 2),\n }\n data_type = \"str_int\"\n\n param_names = [\"shape\", \"skiprows\"]\n params = [\n shapes,\n [None, \"lambda_even_rows\", \"range_uniform\", \"range_step2\"],\n ]\n\n def setup(self, test_filenames, shape, skiprows):\n super().setup(test_filenames, shape, skiprows)\n self.skiprows = self.skiprows_mapping[skiprows] if skiprows else None\n\n def time_skiprows(self, test_filenames, shape, skiprows):\n execute(IMPL.read_csv(test_filenames[self.shape_id], skiprows=self.skiprows))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvTrueFalseValues_TimeReadCsvTrueFalseValues.time_true_false_values.execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvTrueFalseValues_TimeReadCsvTrueFalseValues.time_true_false_values.execute_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/csv.py", "file_name": "csv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 82, "span_ids": ["TimeReadCsvTrueFalseValues.time_true_false_values", "TimeReadCsvTrueFalseValues"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeReadCsvTrueFalseValues(BaseReadCsv):\n data_type = \"true_false_int\"\n\n param_names = [\"shape\"]\n params = [get_benchmark_shapes(\"TimeReadCsvTrueFalseValues\")]\n\n def time_true_false_values(self, test_filenames, shape):\n execute(\n IMPL.read_csv(\n test_filenames[self.shape_id],\n true_values=[\"Yes\", \"true\"],\n false_values=[\"No\", \"false\"],\n ),\n trigger_hdk_import=ASV_USE_STORAGE_FORMAT == \"hdk\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype_TimeReadCsvNamesDtype._add_timestamp_columns.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype_TimeReadCsvNamesDtype._add_timestamp_columns.return.df", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/csv.py", "file_name": "csv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 105, "span_ids": ["TimeReadCsvNamesDtype._add_timestamp_columns", "TimeReadCsvNamesDtype._get_file_id", "TimeReadCsvNamesDtype"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeReadCsvNamesDtype:\n shapes = get_benchmark_shapes(\"TimeReadCsvNamesDtype\")\n _dtypes_params = [\"Int64\", \"Int64_Timestamp\"]\n _timestamp_columns = [\"col1\", \"col2\"]\n\n param_names = [\"shape\", \"names\", \"dtype\"]\n params = [\n shapes,\n [\"array-like\"],\n _dtypes_params,\n ]\n\n def _get_file_id(self, shape, dtype):\n return get_shape_id(shape) + dtype\n\n def _add_timestamp_columns(self, df):\n df = df.copy()\n date_column = IMPL.date_range(\"2000\", periods=df.shape[0], freq=\"ms\")\n for col in self._timestamp_columns:\n df[col] = date_column\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype.setup_cache_TimeReadCsvNamesDtype.setup_cache.return.cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype.setup_cache_TimeReadCsvNamesDtype.setup_cache.return.cache", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/csv.py", "file_name": "csv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 125, "span_ids": ["TimeReadCsvNamesDtype.setup_cache"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TimeReadCsvNamesDtype:\n\n def setup_cache(self, test_filename=\"io_test_file_csv_names_dtype\"):\n # filenames with a metadata of saved dataframes\n cache = {}\n for shape in self.shapes:\n for dtype in self._dtypes_params:\n df = generate_dataframe(\n \"int\", *shape, RAND_LOW, RAND_HIGH, impl=\"pandas\"\n )\n if dtype == \"Int64_Timestamp\":\n df = self._add_timestamp_columns(df)\n\n file_id = self._get_file_id(shape, dtype)\n cache[file_id] = (\n f\"{test_filename}_{file_id}.csv\",\n df.columns.to_list(),\n df.dtypes.to_dict(),\n )\n df.to_csv(cache[file_id][0], index=False)\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_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype.setup_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/csv.py_TimeReadCsvNamesDtype.setup_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/csv.py", "file_name": "csv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 155, "span_ids": ["TimeReadCsvNamesDtype.time_read_csv_names_dtype", "TimeReadCsvNamesDtype.setup", "impl"], "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 TimeReadCsvNamesDtype:\n\n def setup(self, cache, shape, names, dtype):\n # ray init\n if ASV_USE_IMPL == \"modin\":\n IMPL.DataFrame([])\n file_id = self._get_file_id(shape, dtype)\n self.filename, self.names, self.dtype = cache[file_id]\n\n self.parse_dates = None\n if dtype == \"Int64_Timestamp\":\n # cached version of dtype should not change\n self.dtype = self.dtype.copy()\n for col in self._timestamp_columns:\n del self.dtype[col]\n self.parse_dates = self._timestamp_columns\n\n def time_read_csv_names_dtype(self, cache, shape, names, dtype):\n execute(\n IMPL.read_csv(\n self.filename,\n names=self.names,\n header=0,\n dtype=self.dtype,\n parse_dates=self.parse_dates,\n )\n )\n\n\nfrom ..utils import setup # noqa: E402, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/parquet.py_ASV_USE_IMPL_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/io/parquet.py_ASV_USE_IMPL_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/io/parquet.py", "file_name": "parquet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 55, "span_ids": ["impl", "TimeReadParquet.setup", "TimeReadParquet.setup_cache", "docstring", "TimeReadParquet.time_read_parquet", "TimeReadParquet"], "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 ..utils import (\n ASV_USE_IMPL,\n IMPL,\n execute,\n get_shape_id,\n prepare_io_data_parquet,\n get_benchmark_shapes,\n)\n\n\nclass TimeReadParquet:\n shapes = get_benchmark_shapes(\"TimeReadParquet\")\n data_type = \"str_int\"\n\n param_names = [\"shape\"]\n params = [\n shapes,\n ]\n\n # test data file should be created only once\n def setup_cache(self, test_filename=\"io_test_file\"):\n test_filenames = prepare_io_data_parquet(\n test_filename, self.data_type, get_benchmark_shapes(self.__class__.__name__)\n )\n return test_filenames\n\n def setup(self, test_filenames, shape):\n # ray init\n if ASV_USE_IMPL == \"modin\":\n IMPL.DataFrame([])\n self.shape_id = get_shape_id(shape)\n\n def time_read_parquet(self, test_filenames, shape):\n execute(\n IMPL.read_parquet(\n test_filenames[self.shape_id],\n )\n )\n\n\nfrom ..utils import setup # noqa: E402, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/__init__.py__", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/scalability/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/asv_bench/benchmarks/scalability/scalability_benchmarks.py_pd_TimeFromPandas.time_from_pandas.execute_from_pandas_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/scalability_benchmarks.py_pd_TimeFromPandas.time_from_pandas.execute_from_pandas_self_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/scalability/scalability_benchmarks.py", "file_name": "scalability_benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 52, "span_ids": ["TimeFromPandas", "TimeFromPandas.time_from_pandas", "TimeFromPandas.setup", "docstring"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import modin.pandas as pd\nfrom modin.pandas.utils import from_pandas\n\ntry:\n from modin.utils import to_pandas\nexcept ImportError:\n # This provides compatibility with older versions of the Modin, allowing us to test old commits.\n from modin.pandas.utils import to_pandas\nimport pandas\n\nfrom ..utils import (\n gen_data,\n generate_dataframe,\n RAND_LOW,\n RAND_HIGH,\n execute,\n get_benchmark_shapes,\n)\n\n\nclass TimeFromPandas:\n param_names = [\"shape\", \"cpus\"]\n params = [\n get_benchmark_shapes(\"TimeFromPandas\"),\n [4, 16, 32],\n ]\n\n def setup(self, shape, cpus):\n self.data = pandas.DataFrame(gen_data(\"int\", *shape, RAND_LOW, RAND_HIGH))\n from modin.config import NPartitions\n\n NPartitions.get = lambda: cpus\n # trigger ray init\n pd.DataFrame([])\n\n def time_from_pandas(self, shape, cpus):\n execute(from_pandas(self.data))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/scalability_benchmarks.py_TimeToPandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/scalability/scalability_benchmarks.py_TimeToPandas_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/scalability/scalability_benchmarks.py", "file_name": "scalability_benchmarks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 74, "span_ids": ["impl:3", "TimeToPandas.time_to_pandas", "TimeToPandas", "TimeToPandas.setup"], "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 TimeToPandas:\n param_names = [\"shape\", \"cpus\"]\n params = [\n get_benchmark_shapes(\"TimeToPandas\"),\n [4, 16, 32],\n ]\n\n def setup(self, shape, cpus):\n from modin.config import NPartitions\n\n NPartitions.get = lambda: cpus\n self.data = generate_dataframe(\"int\", *shape, RAND_LOW, RAND_HIGH, impl=\"modin\")\n\n def time_to_pandas(self, shape, cpus):\n # to_pandas is already synchronous\n to_pandas(self.data)\n\n\nfrom ..utils import setup # noqa: E402, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/__init__.py_ASV_USE_IMPL_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/__init__.py_ASV_USE_IMPL_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 60, "span_ids": ["docstring"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .compatibility import (\n ASV_USE_IMPL,\n ASV_USE_STORAGE_FORMAT,\n)\nfrom .data_shapes import RAND_LOW, RAND_HIGH, GROUPBY_NGROUPS, get_benchmark_shapes\nfrom .common import (\n IMPL,\n execute,\n get_shape_id,\n gen_data,\n gen_nan_data,\n generate_dataframe,\n prepare_io_data,\n prepare_io_data_parquet,\n random_string,\n random_columns,\n random_booleans,\n translator_groupby_ngroups,\n trigger_import,\n setup,\n)\n\n__all__ = [\n \"ASV_USE_IMPL\",\n \"ASV_USE_STORAGE_FORMAT\",\n \"RAND_LOW\",\n \"RAND_HIGH\",\n \"GROUPBY_NGROUPS\",\n \"get_benchmark_shapes\",\n \"IMPL\",\n \"execute\",\n \"get_shape_id\",\n \"gen_data\",\n \"gen_nan_data\",\n \"generate_dataframe\",\n \"prepare_io_data\",\n \"prepare_io_data_parquet\",\n \"random_string\",\n \"random_columns\",\n \"random_booleans\",\n \"translator_groupby_ngroups\",\n \"trigger_import\",\n \"setup\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_logging_IMPL.POSSIBLE_IMPL_ASV_USE_IMP": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_logging_IMPL.POSSIBLE_IMPL_ASV_USE_IMP", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 41, "span_ids": ["docstring"], "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 logging\nimport modin.pandas\nimport pandas\nimport numpy as np\nimport uuid\nfrom typing import Optional, Union\n\nfrom .compatibility import (\n ASV_USE_IMPL,\n ASV_DATASET_SIZE,\n ASV_USE_ENGINE,\n ASV_USE_STORAGE_FORMAT,\n)\nfrom .data_shapes import RAND_LOW, RAND_HIGH\n\nPOSSIBLE_IMPL = {\n \"modin\": modin.pandas,\n \"pandas\": pandas,\n}\nIMPL = POSSIBLE_IMPL[ASV_USE_IMPL]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_translator_groupby_ngroups_dataframes_cache.dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_translator_groupby_ngroups_dataframes_cache.dict_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 72, "span_ids": ["impl:5", "translator_groupby_ngroups", "weakdict"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translator_groupby_ngroups(groupby_ngroups: Union[str, int], shape: tuple) -> int:\n \"\"\"\n Translate a string representation of the number of groups, into a number.\n\n Parameters\n ----------\n groupby_ngroups : str or int\n Number of groups that will be used in `groupby` operation.\n shape : tuple\n Same as pandas.Dataframe.shape.\n\n Returns\n -------\n int\n \"\"\"\n if ASV_DATASET_SIZE == \"big\":\n if groupby_ngroups == \"huge_amount_groups\":\n return min(shape[0] // 2, 5000)\n return groupby_ngroups\n else:\n return groupby_ngroups\n\n\nclass weakdict(dict): # noqa: GL08\n __slots__ = (\"__weakref__\",)\n\n\ndata_cache = dict()\ndataframes_cache = dict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_nan_data_gen_nan_data.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_nan_data_gen_nan_data.return.data", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 75, "end_line": 110, "span_ids": ["gen_nan_data"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_nan_data(nrows: int, ncols: int) -> dict:\n \"\"\"\n Generate nan data with caching.\n\n The generated data are saved in the dictionary and on a subsequent call,\n if the keys match, saved data will be returned. Therefore, we need\n to carefully monitor the changing of saved data and make its copy if needed.\n\n Parameters\n ----------\n nrows : int\n Number of rows.\n ncols : int\n Number of columns.\n\n Returns\n -------\n modin.pandas.DataFrame or pandas.DataFrame or modin.pandas.Series or pandas.Series\n DataFrame or Series with shape (nrows, ncols) or (nrows,), respectively.\n \"\"\"\n cache_key = (ASV_USE_IMPL, nrows, ncols)\n if cache_key in data_cache:\n return data_cache[cache_key]\n\n logging.info(\"Generating nan data {} rows and {} columns\".format(nrows, ncols))\n\n if ncols > 1:\n columns = [f\"col{x}\" for x in range(ncols)]\n data = IMPL.DataFrame(np.nan, index=IMPL.RangeIndex(nrows), columns=columns)\n elif ncols == 1:\n data = IMPL.Series(np.nan, index=IMPL.RangeIndex(nrows))\n else:\n assert False, \"Number of columns (ncols) should be >= 1\"\n\n data_cache[cache_key] = data\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_int_data_gen_int_data.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_int_data_gen_int_data.return.data", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 151, "span_ids": ["gen_int_data"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_int_data(nrows: int, ncols: int, rand_low: int, rand_high: int) -> dict:\n \"\"\"\n Generate int data with caching.\n\n The generated data are saved in the dictionary and on a subsequent call,\n if the keys match, saved data will be returned. Therefore, we need\n to carefully monitor the changing of saved data and make its copy if needed.\n\n Parameters\n ----------\n nrows : int\n Number of rows.\n ncols : int\n Number of columns.\n rand_low : int\n Low bound for random generator.\n rand_high : int\n High bound for random generator.\n\n Returns\n -------\n dict\n Number of keys - `ncols`, each of them store np.ndarray of `nrows` length.\n \"\"\"\n cache_key = (\"int\", nrows, ncols, rand_low, rand_high)\n if cache_key in data_cache:\n return data_cache[cache_key]\n\n logging.info(\n \"Generating int data {} rows and {} columns [{}-{}]\".format(\n nrows, ncols, rand_low, rand_high\n )\n )\n data = {\n \"col{}\".format(i): np.random.randint(rand_low, rand_high, size=(nrows))\n for i in range(ncols)\n }\n data_cache[cache_key] = weakdict(data)\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_str_int_data_gen_str_int_data.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_str_int_data_gen_str_int_data.return.data", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 193, "span_ids": ["gen_str_int_data"], "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": "def gen_str_int_data(nrows: int, ncols: int, rand_low: int, rand_high: int) -> dict:\n \"\"\"\n Generate int data and string data with caching.\n\n The generated data are saved in the dictionary and on a subsequent call,\n if the keys match, saved data will be returned. Therefore, we need\n to carefully monitor the changing of saved data and make its copy if needed.\n\n Parameters\n ----------\n nrows : int\n Number of rows.\n ncols : int\n Number of columns.\n rand_low : int\n Low bound for random generator.\n rand_high : int\n High bound for random generator.\n\n Returns\n -------\n dict\n Number of keys - `ncols`, each of them store np.ndarray of `nrows` length.\n One of the columns with string values.\n \"\"\"\n cache_key = (\"str_int\", nrows, ncols, rand_low, rand_high)\n if cache_key in data_cache:\n return data_cache[cache_key]\n\n logging.info(\n \"Generating str_int data {} rows and {} columns [{}-{}]\".format(\n nrows, ncols, rand_low, rand_high\n )\n )\n data = gen_int_data(nrows, ncols, rand_low, rand_high).copy()\n # convert values in arbitary column to string type\n key = list(data.keys())[0]\n data[key] = [f\"str_{x}\" for x in data[key]]\n data_cache[cache_key] = weakdict(data)\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_true_false_int_data_gen_true_false_int_data.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_true_false_int_data_gen_true_false_int_data.return.data", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 241, "span_ids": ["gen_true_false_int_data"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_true_false_int_data(nrows, ncols, rand_low, rand_high):\n \"\"\"\n Generate int data and string data \"true\" and \"false\" values with caching.\n\n The generated data are saved in the dictionary and on a subsequent call,\n if the keys match, saved data will be returned. Therefore, we need\n to carefully monitor the changing of saved data and make its copy if needed.\n\n Parameters\n ----------\n nrows : int\n Number of rows.\n ncols : int\n Number of columns.\n rand_low : int\n Low bound for random generator.\n rand_high : int\n High bound for random generator.\n\n Returns\n -------\n dict\n Number of keys - `ncols`, each of them store np.ndarray of `nrows` length.\n One half of the columns with integer values, another half - with \"true\" and\n \"false\" string values.\n \"\"\"\n cache_key = (\"true_false_int\", nrows, ncols, rand_low, rand_high)\n if cache_key in data_cache:\n return data_cache[cache_key]\n\n logging.info(\n \"Generating true_false_int data {} rows and {} columns [{}-{}]\".format(\n nrows, ncols, rand_low, rand_high\n )\n )\n data = gen_int_data(nrows // 2, ncols // 2, rand_low, rand_high)\n\n data_true_false = {\n \"tf_col{}\".format(i): np.random.choice(\n [\"Yes\", \"true\", \"No\", \"false\"], size=(nrows - nrows // 2)\n )\n for i in range(ncols - ncols // 2)\n }\n data.update(data_true_false)\n data_cache[cache_key] = weakdict(data)\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_data_gen_data.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_gen_data_gen_data.return.data", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 295, "span_ids": ["gen_data"], "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 gen_data(\n data_type: str,\n nrows: int,\n ncols: int,\n rand_low: int,\n rand_high: int,\n) -> dict:\n \"\"\"\n Generate data with caching.\n\n The generated data are saved in the dictionary and on a subsequent call,\n if the keys match, saved data will be returned. Therefore, we need\n to carefully monitor the changing of saved data and make its copy if needed.\n\n Parameters\n ----------\n data_type : {\"int\", \"str_int\", \"true_false_int\"}\n Type of data generation.\n nrows : int\n Number of rows.\n ncols : int\n Number of columns.\n rand_low : int\n Low bound for random generator.\n rand_high : int\n High bound for random generator.\n\n Returns\n -------\n dict\n Number of keys - `ncols`, each of them store np.ndarray of `nrows` length.\n\n Notes\n -----\n Returned data type depends on the `data_type` parameter in the next way:\n - `data_type`==\"int\" - all columns will be contain only integer values;\n - `data_type`==\"str_int\" some of the columns will be of string type;\n - `data_type`==\"true_false_int\" half of the columns will be filled with\n string values representing \"true\" and \"false\" values and another half - with\n integers.\n \"\"\"\n type_to_generator = {\n \"int\": gen_int_data,\n \"str_int\": gen_str_int_data,\n \"true_false_int\": gen_true_false_int_data,\n }\n assert data_type in type_to_generator\n data_generator = type_to_generator[data_type]\n\n data = data_generator(nrows, ncols, rand_low, rand_high)\n\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_generate_dataframe_generate_dataframe.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_generate_dataframe_generate_dataframe.return.df", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 402, "span_ids": ["generate_dataframe"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_dataframe(\n data_type: str,\n nrows: int,\n ncols: int,\n rand_low: int,\n rand_high: int,\n groupby_ncols: Optional[int] = None,\n count_groups: Optional[int] = None,\n gen_unique_key: bool = False,\n cache_prefix: str = None,\n impl: str = None,\n) -> Union[modin.pandas.DataFrame, pandas.DataFrame]:\n \"\"\"\n Generate DataFrame with caching.\n\n The generated dataframes are saved in the dictionary and on a subsequent call,\n if the keys match, one of the saved dataframes will be returned. Therefore, we need\n to carefully monitor that operations that change the dataframe work with its copy.\n\n Parameters\n ----------\n data_type : str\n Type of data generation;\n supported types: {\"int\", \"str_int\"}.\n nrows : int\n Number of rows.\n ncols : int\n Number of columns.\n rand_low : int\n Low bound for random generator.\n rand_high : int\n High bound for random generator.\n groupby_ncols : int, default: None\n Number of columns for which `groupby` will be called in the future;\n to get more stable performance results, we need to have the same number of values\n in each group every benchmarking time.\n count_groups : int, default: None\n Count of groups in groupby columns.\n gen_unique_key : bool, default: False\n Generate `col1` column where all elements are unique.\n cache_prefix : str, optional\n Prefix to add to the cache key of the requested frame.\n impl : str, optional\n Implementation used to create the dataframe;\n supported implemetations: {\"modin\", \"pandas\"}.\n\n Returns\n -------\n modin.pandas.DataFrame or pandas.DataFrame [and list]\n\n Notes\n -----\n The list of groupby columns names returns when groupby columns are generated.\n \"\"\"\n assert not (\n (groupby_ncols is None) ^ (count_groups is None)\n ), \"You must either specify both parameters 'groupby_ncols' and 'count_groups' or none of them.\"\n\n if groupby_ncols and count_groups:\n ncols -= groupby_ncols\n\n if impl is None:\n impl = ASV_USE_IMPL\n\n cache_key = (\n impl,\n data_type,\n nrows,\n ncols,\n rand_low,\n rand_high,\n groupby_ncols,\n count_groups,\n gen_unique_key,\n )\n\n if cache_prefix is not None:\n cache_key = (cache_prefix, *cache_key)\n\n if cache_key in dataframes_cache:\n return dataframes_cache[cache_key]\n\n logging.info(\n \"Allocating {} DataFrame {}: {} rows and {} columns [{}-{}]\".format(\n impl, data_type, nrows, ncols, rand_low, rand_high\n )\n )\n data = gen_data(data_type, nrows, ncols, rand_low, rand_high)\n\n if groupby_ncols and count_groups:\n groupby_columns = [f\"groupby_col{x}\" for x in range(groupby_ncols)]\n for groupby_col in groupby_columns:\n data[groupby_col] = np.tile(np.arange(count_groups), nrows // count_groups)\n\n if gen_unique_key:\n data[\"col1\"] = np.arange(nrows)\n\n df = POSSIBLE_IMPL[impl].DataFrame(data)\n\n if groupby_ncols and count_groups:\n dataframes_cache[cache_key] = df, groupby_columns\n return df, groupby_columns\n\n dataframes_cache[cache_key] = df\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_random_string_random_booleans.return.list_np_random_choice_Tr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_random_string_random_booleans.return.list_np_random_choice_Tr", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 405, "end_line": 447, "span_ids": ["random_columns", "random_string", "random_booleans"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def random_string() -> str:\n \"\"\"\n Create a 36-character random string.\n\n Returns\n -------\n str\n \"\"\"\n return str(uuid.uuid4())\n\n\ndef random_columns(df_columns: list, columns_number: int) -> list:\n \"\"\"\n Pick sublist of random columns from a given sequence.\n\n Parameters\n ----------\n df_columns : list\n Columns to choose from.\n columns_number : int\n How many columns to pick.\n\n Returns\n -------\n list\n \"\"\"\n return list(np.random.choice(df_columns, size=columns_number))\n\n\ndef random_booleans(number: int) -> list:\n \"\"\"\n Create random list of booleans with `number` elements.\n\n Parameters\n ----------\n number : int\n Count of booleans in result list.\n\n Returns\n -------\n list\n \"\"\"\n return list(np.random.choice([True, False], size=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_modin-project__modin/asv_bench/benchmarks/utils/common.py_trigger_import_trigger_import.for_df_in_dfs_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_trigger_import_trigger_import.for_df_in_dfs_.None_1", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 450, "end_line": 472, "span_ids": ["trigger_import"], "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 trigger_import(*dfs):\n \"\"\"\n Trigger import execution for DataFrames obtained by HDK engine.\n\n Parameters\n ----------\n *dfs : iterable\n DataFrames to trigger import.\n \"\"\"\n if ASV_USE_STORAGE_FORMAT != \"hdk\" or ASV_USE_IMPL == \"pandas\":\n return\n\n from modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import (\n DbWorker,\n )\n\n for df in dfs:\n df.shape # to trigger real execution\n df._query_compiler._modin_frame._partitions[0][\n 0\n ].frame_id = DbWorker().import_arrow_table(\n df._query_compiler._modin_frame._partitions[0][0].get()\n ) # to trigger real execution", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_execute_execute.if_ASV_USE_IMPL_modin.elif_ASV_USE_IMPL_pan.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_execute_execute.if_ASV_USE_IMPL_modin.elif_ASV_USE_IMPL_pan.pass", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 475, "end_line": 521, "span_ids": ["execute"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def execute(\n df: Union[modin.pandas.DataFrame, pandas.DataFrame],\n trigger_hdk_import: bool = False,\n):\n \"\"\"\n Make sure the calculations are finished.\n\n Parameters\n ----------\n df : modin.pandas.DataFrame or pandas.Datarame\n DataFrame to be executed.\n trigger_hdk_import : bool, default: False\n Whether `df` are obtained by import with HDK engine.\n \"\"\"\n if trigger_hdk_import:\n trigger_import(df)\n return\n if ASV_USE_IMPL == \"modin\":\n if ASV_USE_STORAGE_FORMAT == \"hdk\":\n df._query_compiler._modin_frame._execute()\n return\n partitions = df._query_compiler._modin_frame._partitions.flatten()\n mgr_cls = df._query_compiler._modin_frame._partition_mgr_cls\n if len(partitions) and hasattr(mgr_cls, \"wait_partitions\"):\n mgr_cls.wait_partitions(partitions)\n return\n\n # compatibility with old Modin versions\n all(\n map(\n lambda partition: partition.drain_call_queue() or True,\n partitions,\n )\n )\n if ASV_USE_ENGINE == \"ray\":\n from ray import wait\n\n all(map(lambda partition: wait([partition._data]), partitions))\n elif ASV_USE_ENGINE == \"dask\":\n from dask.distributed import wait\n\n all(map(lambda partition: wait(partition._data), partitions))\n elif ASV_USE_ENGINE == \"python\":\n pass\n\n elif ASV_USE_IMPL == \"pandas\":\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_modin-project__modin/asv_bench/benchmarks/utils/common.py_get_shape_id_prepare_io_data.return.test_filenames": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_get_shape_id_prepare_io_data.return.test_filenames", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 524, "end_line": 566, "span_ids": ["get_shape_id", "prepare_io_data"], "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 get_shape_id(shape: tuple) -> str:\n \"\"\"\n Join shape numbers into a string with `_` delimiters.\n\n Parameters\n ----------\n shape : tuple\n Same as pandas.Dataframe.shape.\n\n Returns\n -------\n str\n \"\"\"\n return \"_\".join([str(element) for element in shape])\n\n\ndef prepare_io_data(test_filename: str, data_type: str, shapes: list):\n \"\"\"\n Prepare data for IO tests with caching.\n\n Parameters\n ----------\n test_filename : str\n Unique file identifier that is used to distinguish data\n for different tests.\n data_type : {\"int\", \"str_int\", \"true_false_int\"}\n Type of data generation.\n shapes : list\n Data shapes to prepare.\n\n Returns\n -------\n test_filenames : dict\n Dictionary that maps dataset shape to the file on disk.\n \"\"\"\n test_filenames = {}\n for shape in shapes:\n shape_id = get_shape_id(shape)\n test_filenames[shape_id] = f\"{test_filename}_{shape_id}_{data_type}.csv\"\n df = generate_dataframe(data_type, *shape, RAND_LOW, RAND_HIGH, impl=\"pandas\")\n df.to_csv(test_filenames[shape_id], index=False)\n\n return test_filenames", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_prepare_io_data_parquet_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/common.py_prepare_io_data_parquet_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 569, "end_line": 603, "span_ids": ["prepare_io_data_parquet", "setup"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def prepare_io_data_parquet(test_filename: str, data_type: str, shapes: list):\n \"\"\"\n Prepare data for IO tests with caching.\n\n Parameters\n ----------\n test_filename : str\n Unique file identifier that is used to distinguish data\n for different tests.\n data_type : \"str_int\"\n Type of data generation.\n shapes : list\n Data shapes to prepare.\n\n Returns\n -------\n test_filenames : dict\n Dictionary that maps dataset shape to the file on disk.\n \"\"\"\n test_filenames = {}\n for shape in shapes:\n shape_id = get_shape_id(shape)\n test_filenames[shape_id] = f\"{test_filename}_{shape_id}_{data_type}.parquet\"\n df = generate_dataframe(data_type, *shape, RAND_LOW, RAND_HIGH, impl=\"pandas\")\n df.to_parquet(test_filenames[shape_id], index=False)\n\n return test_filenames\n\n\ndef setup(*args, **kwargs): # noqa: GL08\n # This function just needs to be imported into each benchmark file to\n # set up the random seed before each function. ASV run it automatically.\n # https://asv.readthedocs.io/en/latest/writing_benchmarks.html\n np.random.seed(42)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/compatibility.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/compatibility.py_os_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/compatibility.py", "file_name": "compatibility.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 50, "span_ids": ["docstring"], "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": "import os\nimport modin.pandas as pd\n\ntry:\n from modin.config import NPartitions\n\n NPARTITIONS = NPartitions.get()\nexcept ImportError:\n NPARTITIONS = pd.DEFAULT_NPARTITIONS\n\ntry:\n from modin.config import TestDatasetSize, AsvImplementation, Engine, StorageFormat\n\n ASV_USE_IMPL = AsvImplementation.get()\n ASV_DATASET_SIZE = TestDatasetSize.get() or \"Small\"\n ASV_USE_ENGINE = Engine.get()\n ASV_USE_STORAGE_FORMAT = StorageFormat.get()\nexcept ImportError:\n # The same benchmarking code can be run for different versions of Modin, so in\n # case of an error importing important variables, we'll just use predefined values\n ASV_USE_IMPL = os.environ.get(\"MODIN_ASV_USE_IMPL\", \"modin\")\n ASV_DATASET_SIZE = os.environ.get(\"MODIN_TEST_DATASET_SIZE\", \"Small\")\n ASV_USE_ENGINE = os.environ.get(\"MODIN_ENGINE\", \"Ray\")\n ASV_USE_STORAGE_FORMAT = os.environ.get(\"MODIN_STORAGE_FORMAT\", \"Pandas\")\n\nASV_USE_IMPL = ASV_USE_IMPL.lower()\nASV_DATASET_SIZE = ASV_DATASET_SIZE.lower()\nASV_USE_ENGINE = ASV_USE_ENGINE.lower()\nASV_USE_STORAGE_FORMAT = ASV_USE_STORAGE_FORMAT.lower()\n\nassert ASV_USE_IMPL in (\"modin\", \"pandas\")\nassert ASV_DATASET_SIZE in (\"big\", \"small\")\nassert ASV_USE_ENGINE in (\"ray\", \"dask\", \"python\", \"native\", \"unidist\")\nassert ASV_USE_STORAGE_FORMAT in (\"pandas\", \"hdk\", \"pyarrow\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_os_GROUPBY_NGROUPS.DEFAULT_GROUPBY_NGROUPS_A": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_os_GROUPBY_NGROUPS.DEFAULT_GROUPBY_NGROUPS_A", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/data_shapes.py", "file_name": "data_shapes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 72, "span_ids": ["impl:13", "docstring"], "tokens": 514}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 .compatibility import ASV_USE_STORAGE_FORMAT, ASV_DATASET_SIZE\n\nRAND_LOW = 0\nRAND_HIGH = 1_000_000_000 if ASV_USE_STORAGE_FORMAT == \"hdk\" else 100\n\nBINARY_OP_DATA_SIZE = {\n \"big\": [\n [[5000, 5000], [5000, 5000]],\n # the case extremely inefficient\n # [[20, 500_000], [10, 1_000_000]],\n [[500_000, 20], [1_000_000, 10]],\n ],\n \"small\": [[[250, 250], [250, 250]], [[10_000, 20], [25_000, 10]]],\n}\nUNARY_OP_DATA_SIZE = {\n \"big\": [\n [5000, 5000],\n # the case extremely inefficient\n # [10, 1_000_000],\n [1_000_000, 10],\n ],\n \"small\": [[250, 250], [10_000, 10]],\n}\nSERIES_DATA_SIZE = {\n \"big\": [[100_000, 1]],\n \"small\": [[10_000, 1]],\n}\nBINARY_OP_SERIES_DATA_SIZE = {\n \"big\": [\n [[500_000, 1], [1_000_000, 1]],\n [[500_000, 1], [500_000, 1]],\n ],\n \"small\": [[[5_000, 1], [10_000, 1]]],\n}\n\n\nHDK_BINARY_OP_DATA_SIZE = {\n \"big\": [[[500_000, 20], [1_000_000, 10]]],\n \"small\": [[[10_000, 20], [25_000, 10]]],\n}\nHDK_UNARY_OP_DATA_SIZE = {\n \"big\": [[1_000_000, 10]],\n \"small\": [[10_000, 10]],\n}\nHDK_SERIES_DATA_SIZE = {\n \"big\": [[10_000_000, 1]],\n \"small\": [[100_000, 1]],\n}\n\nDEFAULT_GROUPBY_NGROUPS = {\n \"big\": [100, \"huge_amount_groups\"],\n \"small\": [5],\n}\nGROUPBY_NGROUPS = DEFAULT_GROUPBY_NGROUPS[ASV_DATASET_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_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py__DEFAULT_CONFIG_T_DEFAULT_CONFIG._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py__DEFAULT_CONFIG_T_DEFAULT_CONFIG._", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/data_shapes.py", "file_name": "data_shapes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 188, "span_ids": ["impl:13", "impl:25"], "tokens": 714}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "_DEFAULT_CONFIG_T = [\n (\n UNARY_OP_DATA_SIZE[ASV_DATASET_SIZE],\n [\n # Pandas storage format benchmarks\n \"TimeGroupByMultiColumn\",\n \"TimeGroupByDefaultAggregations\",\n \"TimeGroupByDictionaryAggregation\",\n \"TimeSetItem\",\n \"TimeInsert\",\n \"TimeArithmetic\",\n \"TimeSortValues\",\n \"TimeDrop\",\n \"TimeHead\",\n \"TimeTail\",\n \"TimeExplode\",\n \"TimeFillna\",\n \"TimeFillnaDataFrame\",\n \"TimeValueCountsFrame\",\n \"TimeValueCountsSeries\",\n \"TimeIndexing\",\n \"TimeMultiIndexing\",\n \"TimeResetIndex\",\n \"TimeAstype\",\n \"TimeDescribe\",\n \"TimeProperties\",\n \"TimeReindex\",\n \"TimeReindexMethod\",\n \"TimeFillnaMethodDataframe\",\n \"TimeDropDuplicatesDataframe\",\n \"TimeStack\",\n \"TimeUnstack\",\n \"TimeRepr\",\n \"TimeMaskBool\",\n \"TimeIsnull\",\n \"TimeDropna\",\n \"TimeEquals\",\n # IO benchmarks\n \"TimeReadCsvSkiprows\",\n \"TimeReadCsvTrueFalseValues\",\n \"TimeReadCsvNamesDtype\",\n \"TimeReadParquet\",\n # Scalability benchmarks\n \"TimeFromPandas\",\n \"TimeToPandas\",\n ],\n ),\n (\n BINARY_OP_DATA_SIZE[ASV_DATASET_SIZE],\n [\n # Pandas storage format benchmarks\n \"TimeJoin\",\n \"TimeMerge\",\n \"TimeMergeDefault\",\n \"TimeConcat\",\n \"TimeAppend\",\n \"TimeBinaryOp\",\n \"TimeLevelAlign\",\n ],\n ),\n (\n SERIES_DATA_SIZE[ASV_DATASET_SIZE],\n [\n # Pandas storage format benchmarks\n \"TimeFillnaSeries\",\n \"TimeGroups\",\n \"TimeIndexingNumericSeries\",\n \"TimeFillnaMethodSeries\",\n \"TimeDatetimeAccessor\",\n \"TimeSetCategories\",\n \"TimeRemoveCategories\",\n \"TimeDropDuplicatesSeries\",\n ],\n ),\n (\n BINARY_OP_SERIES_DATA_SIZE[ASV_DATASET_SIZE],\n [\n # Pandas storage format benchmarks\n \"TimeBinaryOpSeries\",\n ],\n ),\n]\n\n_DEFAULT_HDK_CONFIG_T = [\n (\n HDK_UNARY_OP_DATA_SIZE[ASV_DATASET_SIZE],\n [\n \"hdk.TimeJoin\",\n \"hdk.TimeBinaryOpDataFrame\",\n \"hdk.TimeArithmetic\",\n \"hdk.TimeSortValues\",\n \"hdk.TimeDrop\",\n \"hdk.TimeHead\",\n \"hdk.TimeFillna\",\n \"hdk.TimeIndexing\",\n \"hdk.TimeResetIndex\",\n \"hdk.TimeAstype\",\n \"hdk.TimeDescribe\",\n \"hdk.TimeProperties\",\n \"hdk.TimeGroupByDefaultAggregations\",\n \"hdk.TimeGroupByMultiColumn\",\n \"hdk.TimeValueCountsDataFrame\",\n \"hdk.TimeReadCsvNames\",\n ],\n ),\n (\n HDK_BINARY_OP_DATA_SIZE[ASV_DATASET_SIZE],\n [\"hdk.TimeMerge\", \"hdk.TimeAppend\"],\n ),\n (\n HDK_SERIES_DATA_SIZE[ASV_DATASET_SIZE],\n [\"hdk.TimeBinaryOpSeries\", \"hdk.TimeValueCountsSeries\"],\n ),\n]\nDEFAULT_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_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_DEFAULT_CONFIG_MergeCate_CONFIG_FROM_FILE.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_DEFAULT_CONFIG_MergeCate_CONFIG_FROM_FILE.None", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/data_shapes.py", "file_name": "data_shapes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 218, "span_ids": ["impl:25", "impl:40"], "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": "DEFAULT_CONFIG[\"MergeCategoricals\"] = (\n [[10_000, 2]] if ASV_DATASET_SIZE == \"big\" else [[1_000, 2]]\n)\nDEFAULT_CONFIG[\"TimeJoinStringIndex\"] = (\n [[100_000, 64]] if ASV_DATASET_SIZE == \"big\" else [[1_000, 4]]\n)\nDEFAULT_CONFIG[\"TimeReplace\"] = (\n [[10_000, 2]] if ASV_DATASET_SIZE == \"big\" else [[1_000, 2]]\n)\nfor config in (_DEFAULT_CONFIG_T, _DEFAULT_HDK_CONFIG_T):\n for _shape, _names in config:\n DEFAULT_CONFIG.update({_name: _shape for _name in _names})\n\n# Correct shapes in the case when the operation ended with a timeout error\nif ASV_DATASET_SIZE == \"big\":\n DEFAULT_CONFIG[\"TimeMergeDefault\"] = [\n [[1000, 1000], [1000, 1000]],\n [[500_000, 20], [1_000_000, 10]],\n ]\n DEFAULT_CONFIG[\"TimeLevelAlign\"] = [\n [[2500, 2500], [2500, 2500]],\n [[250_000, 20], [500_000, 10]],\n ]\n DEFAULT_CONFIG[\"TimeStack\"] = [\n [1500, 1500],\n [100_000, 10],\n ]\n DEFAULT_CONFIG[\"TimeUnstack\"] = DEFAULT_CONFIG[\"TimeStack\"]\n\nCONFIG_FROM_FILE = 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_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_get_benchmark_shapes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/benchmarks/utils/data_shapes.py_get_benchmark_shapes_", "embedding": null, "metadata": {"file_path": "asv_bench/benchmarks/utils/data_shapes.py", "file_name": "data_shapes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 221, "end_line": 255, "span_ids": ["get_benchmark_shapes"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_benchmark_shapes(bench_id: str):\n \"\"\"\n Get custom benchmark shapes from a json file stored in MODIN_ASV_DATASIZE_CONFIG.\n\n If `bench_id` benchmark is not found in the file, then the default value will\n be used.\n\n Parameters\n ----------\n bench_id : str\n Unique benchmark identifier that is used to get shapes.\n\n Returns\n -------\n list\n Benchmark shapes.\n \"\"\"\n global CONFIG_FROM_FILE\n if not CONFIG_FROM_FILE:\n try:\n from modin.config import AsvDataSizeConfig\n\n filename = AsvDataSizeConfig.get()\n except ImportError:\n filename = os.environ.get(\"MODIN_ASV_DATASIZE_CONFIG\", None)\n if filename:\n # should be json\n with open(filename) as _f:\n CONFIG_FROM_FILE = json.load(_f)\n\n if CONFIG_FROM_FILE and bench_id in CONFIG_FROM_FILE:\n # example: \"hdk.TimeReadCsvNames\": [[5555, 55], [3333, 33]]\n return CONFIG_FROM_FILE[bench_id]\n return DEFAULT_CONFIG[bench_id]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/__init__.py__", "embedding": null, "metadata": {"file_path": "asv_bench/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/asv_bench/test/test_utils.py_pytest_test_get_benchmark_shapes.with_patch_builtins_open.assert_result_1_get_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/test_utils.py_pytest_test_get_benchmark_shapes.with_patch_builtins_open.assert_result_1_get_b", "embedding": null, "metadata": {"file_path": "asv_bench/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 50, "span_ids": ["test_get_benchmark_shapes", "docstring"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nfrom unittest.mock import patch, mock_open, Mock\nimport numpy as np\n\nfrom benchmarks.utils import data_shapes, get_benchmark_shapes, execute\n\nfrom modin.config import AsvDataSizeConfig\nimport modin.pandas as pd\n\n\n@pytest.mark.parametrize(\n \"asv_config_content, result\",\n [\n (\n '{\"TimeJoin\": [[[10, 10], [15, 15]], [[11, 11], [13, 13]]], \\\n \"TimeGroupBy\": [[11, 11], [13, 13]]}',\n [\n [\n # binary shapes\n [[10, 10], [15, 15]],\n [[11, 11], [13, 13]]\n ],\n [\n # unary shapes\n [11, 11],\n [13, 13]\n ],\n ],\n ),\n ],\n)\n@patch.object(data_shapes, \"CONFIG_FROM_FILE\", new=None)\ndef test_get_benchmark_shapes(asv_config_content, result):\n AsvDataSizeConfig.put(\"mock_filename\")\n with patch(\"builtins.open\", mock_open(read_data=asv_config_content)):\n assert result[0] == get_benchmark_shapes(\"TimeJoin\")\n assert result[1] == get_benchmark_shapes(\"TimeGroupBy\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/test_utils.py_test_get_benchmark_shapes_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/asv_bench/test/test_utils.py_test_get_benchmark_shapes_default_", "embedding": null, "metadata": {"file_path": "asv_bench/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 77, "span_ids": ["test_execute", "test_get_benchmark_shapes_default"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"asv_config_content, result\",\n [\n (\n '{\"TimeJoin\": [[[10, 10], [15, 15]]]',\n [[100, 100]],\n ),\n ],\n)\n@patch.object(data_shapes, \"CONFIG_FROM_FILE\", new=None)\ndef test_get_benchmark_shapes_default(asv_config_content, result):\n AsvDataSizeConfig.put(None)\n with patch.object(data_shapes, \"DEFAULT_CONFIG\", new={\"TimeJoin\": result}):\n assert result == get_benchmark_shapes(\"TimeJoin\")\n\n\ndef test_execute():\n df = pd.DataFrame(np.random.rand(100, 64))\n partitions = df._query_compiler._modin_frame._partitions.flatten()\n mgr_cls = df._query_compiler._modin_frame._partition_mgr_cls\n with patch.object(mgr_cls, \"wait_partitions\", new=Mock()):\n execute(df)\n mgr_cls.wait_partitions.assert_called_once()\n assert (mgr_cls.wait_partitions.call_args[0] == partitions).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_modin-project__modin/ci/teamcity/build-docker.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/ci/teamcity/build-docker.py_os_", "embedding": null, "metadata": {"file_path": "ci/teamcity/build-docker.py", "file_name": "build-docker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["imports", "execute_command", "impl"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\n\n\ndef execute_command(cmd):\n status = os.system(cmd)\n ec = os.WEXITSTATUS(status)\n if ec != 0:\n raise SystemExit('Command \"{}\" failed'.format(cmd))\n\n\nif sys.platform.startswith(\"linux\"):\n execute_command(\"git rev-parse HEAD > git-rev\")\n execute_command(\n \"(cd ../.. && git archive -o ci/teamcity/modin.tar $(cat ci/teamcity/git-rev))\"\n )\n base_image = \"ray-project/deploy\"\n requirements = \"requirements-dev.txt\"\n execute_command(\n \"docker build -f Dockerfile.modin-base --build-arg BASE_IMAGE={} -t modin-project/modin-base .\".format(\n base_image\n )\n )\nelse:\n raise SystemExit(\n \"TeamCity CI in Docker containers is supported only on Linux at the moment.\"\n )\n\nexecute_command(\n \"docker build -f Dockerfile.teamcity-ci --build-arg REQUIREMENTS={} -t modin-project/teamcity-ci .\".format(\n requirements\n )\n)\n\nif sys.platform.startswith(\"linux\"):\n execute_command(\"rm ./modin.tar ./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_modin-project__modin/ci/teamcity/comment_on_pr.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/ci/teamcity/comment_on_pr.py___", "embedding": null, "metadata": {"file_path": "ci/teamcity/comment_on_pr.py", "file_name": "comment_on_pr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 89, "span_ids": ["impl:51", "docstring"], "tokens": 681}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nPost the comment like the following to the PR:\n```\n:robot: TeamCity test results bot :robot:\n\n\n```\n\"\"\"\n\nfrom github import Github\nimport os\nimport sys\n\n# Check if this is a pull request or not based on the environment variable\ntry:\n pr_id = int(os.environ[\"GITHUB_PR_NUMBER\"].split(\"/\")[-1])\nexcept Exception:\n sys.exit(0)\n\nengine = os.environ[\"MODIN_ENGINE\"]\n\nheader = \"\"\"

\"\"\n TeamCity {} test results bot

\\n\\n\"\"\".format(\n engine.title()\n)\nif engine == \"ray\":\n pytest_outputs = [\"ray_tests.log\"]\nelif engine == \"dask\":\n pytest_outputs = [\"dask_tests.log\"]\nelif engine == \"python\":\n pytest_outputs = [\"python_tests.log\"]\nelse:\n raise Exception(\"Unknown Engine, set `MODIN_ENGINE` environment variable\")\n\nfull_comment = \"\"\n# Do not include coverage info in PR comment\nsplit_by_first = (\n \"----------- coverage: platform linux, python 3.7.5-final-0 -----------\"\n)\nsplit_by_second = \"--------------------------------------------------------------------------------------\"\n\ntests_failed = False\nfor out in pytest_outputs:\n content = open(out, \"r\").read()\n full_comment += \"\".join(\n \"\".join(\n [\n i.split(split_by_first)[0],\n i.split(split_by_first)[-1].split(split_by_second)[-1],\n ]\n )\n for i in content.split(\"+ python3 -m pytest \")\n )\n tests_failed = tests_failed or (\"FAILURES\" in full_comment)\n if len(full_comment) > 65_000:\n full_comment = (\n full_comment[-65_000:] + \"\\n\\nRemaining output truncated\\n\\n\"\n )\n full_comment = \"
Tests Logs\\n\\n\\n```\\n\" + full_comment\n full_comment += \"\\n```\\n\\n
\\n\"\n\nif not tests_failed:\n header += '

Tests PASSed

\\n\\n'\nelse:\n header += '

Tests FAILed

\\n\\n'\n\nfull_comment = header + full_comment\n\ntoken = os.environ[\"GITHUB_TOKEN\"]\ng = Github(token)\nrepo = g.get_repo(\"modin-project/modin\")\n\npr = repo.get_pull(pr_id)\nif any(\n i.user.login == \"modin-bot\"\n and \"TeamCity {} test results bot\".format(engine).lower() in i.body.lower()\n for i in pr.get_issue_comments()\n):\n pr_comment_list = [\n i\n for i in list(pr.get_issue_comments())\n if i.user.login == \"modin-bot\"\n and \"TeamCity {} test results bot\".format(engine).lower() in i.body.lower()\n ]\n assert len(pr_comment_list) == 1, \"Too many comments from modin-bot already\"\n pr_comment_list[0].edit(full_comment)\nelse:\n pr.create_issue_comment(full_comment)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/docs/conf.py__coding_utf_8___The_name_of_the_Pygment": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/docs/conf.py__coding_utf_8___The_name_of_the_Pygment", "embedding": null, "metadata": {"file_path": "docs/conf.py", "file_name": "conf.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 108, "span_ids": ["impl:37", "noop_decorator", "impl", "docstring"], "tokens": 830}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# -*- coding: utf-8 -*-\n#\n# Configuration file for the Sphinx documentation builder.\n#\n# This file does only contain a selection of the most common options. For a\n# full list see the documentation:\n# http://www.sphinx-doc.org/en/stable/config\n\n# -- Project information -----------------------------------------------------\nimport sys\nimport os\nimport types\n\nimport ray\n\n# stub ray.remote to be a no-op so it doesn't shadow docstrings\ndef noop_decorator(*args, **kwargs):\n if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):\n # This is the case where the decorator is just @ray.remote without parameters.\n return args[0]\n return lambda cls_or_func: cls_or_func\n\n\nray.remote = noop_decorator\n\n# fake modules if they're missing\nfor mod_name in (\"cudf\", \"cupy\", \"pyarrow.gandiva\", \"pyhdk\"):\n try:\n __import__(mod_name)\n except ImportError:\n sys.modules[mod_name] = types.ModuleType(\n mod_name, f\"fake {mod_name} for building docs\"\n )\nif not hasattr(sys.modules[\"cudf\"], \"DataFrame\"):\n sys.modules[\"cudf\"].DataFrame = type(\"DataFrame\", (object,), {})\nif not hasattr(sys.modules[\"cupy\"], \"ndarray\"):\n sys.modules[\"cupy\"].ndarray = type(\"ndarray\", (object,), {})\nif not hasattr(sys.modules[\"pyhdk\"], \"PyDbEngine\"):\n sys.modules[\"pyhdk\"].PyDbEngine = type(\"PyDbEngine\", (object,), {})\n\nsys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\")))\nimport modin\n\nfrom modin.config.__main__ import export_config_help\n\nconfigs_file_path = os.path.abspath(\n os.path.join(os.path.dirname(__file__), \"flow/modin/configs_help.csv\")\n)\n# Export configs help to create configs table in the docs/flow/modin/config.rst\nexport_config_help(configs_file_path)\n\nproject = \"Modin\"\ncopyright = \"2018-2022, Modin Developers.\"\nauthor = \"Modin contributors\"\n\n# The short X.Y version\nversion = \"{}\".format(modin.__version__)\n# The full version, including alpha/beta/rc tags\nrelease = version\n\n\n# -- General configuration ---------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\n# needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n \"sphinx.ext.autodoc\",\n \"sphinx.ext.napoleon\",\n \"sphinx.ext.intersphinx\",\n \"sphinx.ext.todo\",\n \"sphinx.ext.mathjax\",\n \"sphinx.ext.githubpages\",\n \"sphinx.ext.graphviz\",\n \"sphinxcontrib.plantuml\",\n \"sphinx_issues\",\n]\n\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = \".rst\"\n\n# The master toctree document.\nmaster_doc = \"index\"\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = \"en\"\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path .\nexclude_patterns = [\"_build\", \"Thumbs.db\", \".DS_Store\"]\n\n# The name of the Pygments (syntax highlighting) style to use.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/docs/conf.py_pygments_style_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/docs/conf.py_pygments_style_", "embedding": null, "metadata": {"file_path": "docs/conf.py", "file_name": "conf.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 182, "span_ids": ["impl:61", "impl:37"], "tokens": 531}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "pygments_style = \"sphinx\"\n\n\n# -- Options for HTML output -------------------------------------------------\n\n# Maps git branches to Sphinx themes\ndefault_html_theme = \"pydata_sphinx_theme\"\ncurrent_branch = \"nature\"\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"pydata_sphinx_theme\"\n\nhtml_favicon = \"img/MODIN_ver2.ico\"\n\nhtml_logo = \"img/MODIN_ver2.png\"\n\nhtml_context = {\"default_mode\": \"light\"}\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#\nhtml_theme_options = {\n \"navbar_end\": [\"navbar-icon-links\"],\n \"sidebarwidth\": 270,\n \"collapse_navigation\": False,\n \"navigation_depth\": 4,\n \"show_toc_level\": 2,\n \"github_url\": \"https://github.com/modin-project/modin\",\n \"icon_links\": [\n {\n \"name\": \"PyPI\",\n \"url\": \"https://pypi.org/project/modin\",\n \"icon\": \"fab fa-python\",\n },\n {\n \"name\": \"conda-forge\",\n \"url\": \"https://anaconda.org/conda-forge/modin\",\n \"icon\": \"fas fa-circle-notch\",\n },\n {\n \"name\": \"Join the Slack\",\n \"url\": \"https://modin.org/slack.html\",\n \"icon\": \"fab fa-slack\",\n },\n {\n \"name\": \"Discourse\",\n \"url\": \"https://discuss.modin.org/\",\n \"icon\": \"fab fa-discourse\",\n },\n {\n \"name\": \"Mailing List\",\n \"url\": \"https://groups.google.com/forum/#!forum/modin-dev\",\n \"icon\": \"fas fa-envelope-square\",\n },\n ],\n}\n\n# Custom sidebar templates, must be a dictionary that maps document names\n# to template names.\n#\n# The default sidebars (for documents that don't match any pattern) are\n# defined by theme itself. Builtin themes are using these templates by\n# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',\n# 'searchbox.html']``.\n#\n# The default pydata_sphinx_theme sidebar templates are\n# sidebar-nav-bs.html and search-field.html.\nhtml_sidebars = {}\n\nissues_github_path = \"modin-project/modin\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/experimental_cloud.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/experimental_cloud.py_logging_", "embedding": null, "metadata": {"file_path": "examples/cloud/experimental_cloud.py", "file_name": "experimental_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 36, "span_ids": ["docstring"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nimport modin.pandas as pd\nfrom modin.experimental.cloud import cluster\n\n# set up verbose logging so Ray autoscaler would print a lot of things\n# and we'll see that stuff is alive and kicking\nlogging.basicConfig(format=\"%(asctime)s %(message)s\")\nlogger = logging.getLogger()\nlogger.setLevel(logging.DEBUG)\n\nexample_cluster = cluster.create(\"aws\", \"aws_credentials\")\nwith example_cluster:\n remote_df = pd.DataFrame([1, 2, 3, 4])\n print(len(remote_df)) # len() is executed remotely", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/h2o-runner.py_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/h2o-runner.py_pd_", "embedding": null, "metadata": {"file_path": "examples/cloud/h2o-runner.py", "file_name": "h2o-runner.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 52, "span_ids": ["docstring"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import modin.experimental.pandas as pd # noqa: F401\nfrom modin.experimental.cloud import create_cluster\n\nfrom h2o import run_benchmark\n\ntest_cluster = create_cluster(\n \"aws\",\n \"aws_credentials\",\n cluster_name=\"rayscale-test\",\n region=\"eu-central-1\",\n zone=\"eu-central-1b\",\n image=\"ami-05f7491af5eef733a\",\n)\nwith test_cluster:\n parameters = {\n \"no_pandas\": False,\n \"pandas_mode\": \"Modin_on_ray\",\n \"ray_tmpdir\": \"/tmp\",\n \"ray_memory\": 1024 * 1024 * 1024,\n \"extended_functionality\": False,\n }\n\n # G1... - for groupby queries; J1... - for join queries;\n # Additional required files inside h2o-data folder:\n # - J1_1e6_1e0_0_0.csv\n # - J1_1e6_1e3_0_0.csv\n # - J1_1e6_1e6_0_0.csv\n for data_file in [\"G1_5e5_1e2_0_0.csv\", \"J1_1e6_NA_0_0.csv\"]:\n parameters[\"data_file\"] = f\"s3://modin-datasets/cloud/h2o/{data_file}\"\n run_benchmark(parameters)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/taxi-runner.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/cloud/taxi-runner.py_sys_", "embedding": null, "metadata": {"file_path": "examples/cloud/taxi-runner.py", "file_name": "taxi-runner.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 78, "span_ids": ["docstring"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\n\nUSE_HDK = \"--hdk\" in sys.argv\n\n# the following import turns on experimental mode in Modin,\n# including enabling running things in remote cloud\nimport modin.experimental.pandas as pd # noqa: F401\nfrom modin.experimental.cloud import create_cluster\n\nfrom taxi import run_benchmark as run_benchmark\n\ncluster_params = {}\nif USE_HDK:\n cluster_params[\"cluster_type\"] = \"hdk\"\ntest_cluster = create_cluster(\n \"aws\",\n \"aws_credentials\",\n cluster_name=\"rayscale-test\",\n region=\"eu-central-1\",\n zone=\"eu-central-1b\",\n image=\"ami-05f7491af5eef733a\",\n **cluster_params,\n)\nwith test_cluster:\n if USE_HDK:\n from modin.experimental.cloud import get_connection\n\n # We should move omniscripts trigger in remote conext\n # https://github.com/intel-ai/omniscripts/blob/7d4599bcacf51de876952c658048571d32275ac1/taxi/taxibench_pandas_ibis.py#L482\n import modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker\n\n DbWorker = (\n get_connection()\n .modules[\"modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker\"]\n .DbWorker\n )\n modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker.DbWorker = (\n DbWorker\n )\n\n # Omniscripts check for files being present when given local file paths,\n # so replace \"glob\" there with a remote one\n import utils\n\n utils.glob = get_connection().modules[\"glob\"]\n\n parameters = {\n \"data_file\": \"s3://modin-datasets/cloud/taxi/trips_xaa.csv\",\n \"dfiles_num\": 1,\n \"validation\": False,\n \"no_ibis\": True,\n \"no_pandas\": False,\n \"pandas_mode\": \"Modin_on_hdk\" if USE_HDK else \"Modin_on_ray\",\n \"ray_tmpdir\": \"/tmp\",\n \"ray_memory\": 1024 * 1024 * 1024,\n }\n\n run_benchmark(parameters)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_sys_read.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_sys_read.return.df", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/census-hdk.py", "file_name": "census-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 140, "span_ids": ["read", "docstring"], "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": "import sys\nfrom utils import measure\nimport modin.pandas as pd\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import (\n DbWorker,\n)\n\nfrom sklearn import config_context\nimport sklearnex\n\nsklearnex.patch_sklearn()\nfrom sklearn.model_selection import train_test_split\nimport sklearn.linear_model as lm\nimport numpy as np\n\n\ndef read(filename):\n columns_names = [\n \"YEAR0\",\n \"DATANUM\",\n \"SERIAL\",\n \"CBSERIAL\",\n \"HHWT\",\n \"CPI99\",\n \"GQ\",\n \"QGQ\",\n \"PERNUM\",\n \"PERWT\",\n \"SEX\",\n \"AGE\",\n \"EDUC\",\n \"EDUCD\",\n \"INCTOT\",\n \"SEX_HEAD\",\n \"SEX_MOM\",\n \"SEX_POP\",\n \"SEX_SP\",\n \"SEX_MOM2\",\n \"SEX_POP2\",\n \"AGE_HEAD\",\n \"AGE_MOM\",\n \"AGE_POP\",\n \"AGE_SP\",\n \"AGE_MOM2\",\n \"AGE_POP2\",\n \"EDUC_HEAD\",\n \"EDUC_MOM\",\n \"EDUC_POP\",\n \"EDUC_SP\",\n \"EDUC_MOM2\",\n \"EDUC_POP2\",\n \"EDUCD_HEAD\",\n \"EDUCD_MOM\",\n \"EDUCD_POP\",\n \"EDUCD_SP\",\n \"EDUCD_MOM2\",\n \"EDUCD_POP2\",\n \"INCTOT_HEAD\",\n \"INCTOT_MOM\",\n \"INCTOT_POP\",\n \"INCTOT_SP\",\n \"INCTOT_MOM2\",\n \"INCTOT_POP2\",\n ]\n columns_types = [\n \"int64\",\n \"int64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n ]\n dtypes = {columns_names[i]: columns_types[i] for i in range(len(columns_names))}\n\n df = pd.read_csv(\n filename,\n names=columns_names,\n dtype=dtypes,\n skiprows=1,\n )\n\n df.shape # to trigger real execution\n df._query_compiler._modin_frame._partitions[0][\n 0\n ].frame_id = DbWorker().import_arrow_table(\n df._query_compiler._modin_frame._partitions[0][0].get()\n ) # to trigger real execution\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_etl_cod.return.1_residuals_total_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_etl_cod.return.1_residuals_total_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/census-hdk.py", "file_name": "census-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 202, "span_ids": ["mse", "cod", "etl"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def etl(df):\n keep_cols = [\n \"YEAR0\",\n \"DATANUM\",\n \"SERIAL\",\n \"CBSERIAL\",\n \"HHWT\",\n \"CPI99\",\n \"GQ\",\n \"PERNUM\",\n \"SEX\",\n \"AGE\",\n \"INCTOT\",\n \"EDUC\",\n \"EDUCD\",\n \"EDUC_HEAD\",\n \"EDUC_POP\",\n \"EDUC_MOM\",\n \"EDUCD_MOM2\",\n \"EDUCD_POP2\",\n \"INCTOT_MOM\",\n \"INCTOT_POP\",\n \"INCTOT_MOM2\",\n \"INCTOT_POP2\",\n \"INCTOT_HEAD\",\n \"SEX_HEAD\",\n ]\n df = df[keep_cols]\n\n df = df[df[\"INCTOT\"] != 9999999]\n df = df[df[\"EDUC\"] != -1]\n df = df[df[\"EDUCD\"] != -1]\n\n df[\"INCTOT\"] = df[\"INCTOT\"] * df[\"CPI99\"]\n\n for column in keep_cols:\n df[column] = df[column].fillna(-1)\n\n df[column] = df[column].astype(\"float64\")\n\n y = df[\"EDUC\"]\n X = df.drop(columns=[\"EDUC\", \"CPI99\"])\n\n # to trigger real execution\n df.shape\n y.shape\n X.shape\n\n return (df, X, y)\n\n\ndef mse(y_test, y_pred):\n return ((y_test - y_pred) ** 2).mean()\n\n\ndef cod(y_test, y_pred):\n y_bar = y_test.mean()\n total = ((y_test - y_bar) ** 2).sum()\n residuals = ((y_test - y_pred) ** 2).sum()\n return 1 - (residuals / 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_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_ml_ml.return.ml_scores": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_ml_ml.return.ml_scores", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/census-hdk.py", "file_name": "census-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 205, "end_line": 242, "span_ids": ["ml"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ml(X, y, random_state, n_runs, test_size):\n clf = lm.Ridge()\n\n X = np.ascontiguousarray(X, dtype=np.float64)\n y = np.ascontiguousarray(y, dtype=np.float64)\n\n mse_values, cod_values = [], []\n ml_scores = {}\n\n print(\"ML runs: \", n_runs)\n for i in range(n_runs):\n (X_train, X_test, y_train, y_test) = train_test_split(\n X, y, test_size=test_size, random_state=random_state\n )\n random_state += 777\n\n with config_context(assume_finite=True):\n model = clf.fit(X_train, y_train)\n\n y_pred = model.predict(X_test)\n\n mse_values.append(mse(y_test, y_pred))\n cod_values.append(cod(y_test, y_pred))\n\n ml_scores[\"mse_mean\"] = sum(mse_values) / len(mse_values)\n ml_scores[\"cod_mean\"] = sum(cod_values) / len(cod_values)\n ml_scores[\"mse_dev\"] = pow(\n sum([(mse_value - ml_scores[\"mse_mean\"]) ** 2 for mse_value in mse_values])\n / (len(mse_values) - 1),\n 0.5,\n )\n ml_scores[\"cod_dev\"] = pow(\n sum([(cod_value - ml_scores[\"cod_mean\"]) ** 2 for cod_value in cod_values])\n / (len(cod_values) - 1),\n 0.5,\n )\n\n return ml_scores", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/census-hdk.py_main_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/census-hdk.py", "file_name": "census-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 245, "end_line": 275, "span_ids": ["impl:2", "main"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n if len(sys.argv) < 2:\n print(\n \"USAGE: docker run --rm -v /path/to/dataset:/dataset python census-hdk.py\"\n + \" \"\n + \" [-no-ml]\"\n )\n return\n # ML specific\n N_RUNS = 50\n TEST_SIZE = 0.1\n RANDOM_STATE = 777\n\n df = measure(\"Reading\", read, sys.argv[1])\n _, X, y = measure(\"ETL\", etl, df)\n\n if \"-no-ml\" not in sys.argv[2:]:\n measure(\n \"ML\",\n ml,\n X,\n y,\n random_state=RANDOM_STATE,\n n_runs=N_RUNS,\n test_size=TEST_SIZE,\n )\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_sys_read.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_sys_read.return.df", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/nyc-taxi-hdk.py", "file_name": "nyc-taxi-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 154, "span_ids": ["read", "docstring"], "tokens": 834}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nfrom utils import measure\nimport modin.pandas as pd\nfrom modin.pandas.test.utils import df_equals\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import (\n DbWorker,\n)\nfrom modin.experimental.sql import query\n\n\ndef read(filename):\n columns_names = [\n \"trip_id\",\n \"vendor_id\",\n \"pickup_datetime\",\n \"dropoff_datetime\",\n \"store_and_fwd_flag\",\n \"rate_code_id\",\n \"pickup_longitude\",\n \"pickup_latitude\",\n \"dropoff_longitude\",\n \"dropoff_latitude\",\n \"passenger_count\",\n \"trip_distance\",\n \"fare_amount\",\n \"extra\",\n \"mta_tax\",\n \"tip_amount\",\n \"tolls_amount\",\n \"ehail_fee\",\n \"improvement_surcharge\",\n \"total_amount\",\n \"payment_type\",\n \"trip_type\",\n \"pickup\",\n \"dropoff\",\n \"cab_type\",\n \"precipitation\",\n \"snow_depth\",\n \"snowfall\",\n \"max_temperature\",\n \"min_temperature\",\n \"average_wind_speed\",\n \"pickup_nyct2010_gid\",\n \"pickup_ctlabel\",\n \"pickup_borocode\",\n \"pickup_boroname\",\n \"pickup_ct2010\",\n \"pickup_boroct2010\",\n \"pickup_cdeligibil\",\n \"pickup_ntacode\",\n \"pickup_ntaname\",\n \"pickup_puma\",\n \"dropoff_nyct2010_gid\",\n \"dropoff_ctlabel\",\n \"dropoff_borocode\",\n \"dropoff_boroname\",\n \"dropoff_ct2010\",\n \"dropoff_boroct2010\",\n \"dropoff_cdeligibil\",\n \"dropoff_ntacode\",\n \"dropoff_ntaname\",\n \"dropoff_puma\",\n ]\n # use string instead of category\n columns_types = [\n \"int64\",\n \"string\",\n \"timestamp\",\n \"timestamp\",\n \"string\",\n \"int64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"int64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"string\",\n \"float64\",\n \"string\",\n \"string\",\n \"string\",\n \"float64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"int64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"string\",\n \"float64\",\n \"float64\",\n \"string\",\n \"string\",\n \"string\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"string\",\n \"float64\",\n \"float64\",\n \"string\",\n \"string\",\n \"string\",\n \"float64\",\n ]\n\n dtypes = {columns_names[i]: columns_types[i] for i in range(len(columns_names))}\n all_but_dates = {\n col: valtype\n for (col, valtype) in dtypes.items()\n if valtype not in [\"timestamp\"]\n }\n dates_only = [col for (col, valtype) in dtypes.items() if valtype in [\"timestamp\"]]\n\n df = pd.read_csv(\n filename,\n names=columns_names,\n dtype=all_but_dates,\n parse_dates=dates_only,\n )\n\n df.shape # to trigger real execution\n df._query_compiler._modin_frame._partitions[0][\n 0\n ].frame_id = DbWorker().import_arrow_table(\n df._query_compiler._modin_frame._partitions[0][0].get()\n ) # to trigger real execution\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q1_hdk_q3_sql.return.query_sql_trips_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q1_hdk_q3_sql.return.query_sql_trips_df_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/nyc-taxi-hdk.py", "file_name": "nyc-taxi-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 212, "span_ids": ["q1_sql", "q3_hdk", "q2_hdk", "q2_sql", "q1_hdk", "q3_sql"], "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": "def q1_hdk(df):\n q1_pandas_output = df.groupby(\"cab_type\").size()\n q1_pandas_output.shape # to trigger real execution\n return q1_pandas_output\n\n\ndef q1_sql(df):\n sql = \"\"\"\n SELECT\n cab_type,\n COUNT(*) AS 'count'\n FROM trips\n GROUP BY\n cab_type\n \"\"\"\n return query(sql, trips=df)\n\n\ndef q2_hdk(df):\n q2_pandas_output = df.groupby(\"passenger_count\").agg({\"total_amount\": \"mean\"})\n q2_pandas_output.shape # to trigger real execution\n return q2_pandas_output\n\n\ndef q2_sql(df):\n sql = \"\"\"\n SELECT\n passenger_count,\n AVG(total_amount) AS 'total_amount'\n FROM trips\n GROUP BY\n passenger_count\n \"\"\"\n return query(sql, trips=df)\n\n\ndef q3_hdk(df):\n df[\"pickup_datetime\"] = df[\"pickup_datetime\"].dt.year\n q3_pandas_output = df.groupby([\"passenger_count\", \"pickup_datetime\"]).size()\n q3_pandas_output.shape # to trigger real execution\n return q3_pandas_output\n\n\ndef q3_sql(df):\n sql = \"\"\"\n SELECT\n passenger_count,\n pickup_datetime,\n COUNT(*) AS 'count'\n FROM trips\n GROUP BY\n passenger_count,\n pickup_datetime\n \"\"\"\n df[\"pickup_datetime\"] = df[\"pickup_datetime\"].dt.year\n return query(sql, trips=df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q4_hdk_q4_hdk.return.q4_pandas_output": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q4_hdk_q4_hdk.return.q4_pandas_output", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/nyc-taxi-hdk.py", "file_name": "nyc-taxi-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 227, "span_ids": ["q4_hdk"], "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 q4_hdk(df):\n df[\"pickup_datetime\"] = df[\"pickup_datetime\"].dt.year\n df[\"trip_distance\"] = df[\"trip_distance\"].astype(\"int64\")\n q4_pandas_output = (\n df.groupby([\"passenger_count\", \"pickup_datetime\", \"trip_distance\"], sort=False)\n .size()\n .reset_index()\n .sort_values(\n by=[\"pickup_datetime\", 0], ignore_index=True, ascending=[True, False]\n )\n )\n q4_pandas_output.shape # to trigger real execution\n return q4_pandas_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_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q4_sql_q4_sql.return.query_sql_trips_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_q4_sql_q4_sql.return.query_sql_trips_df_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/nyc-taxi-hdk.py", "file_name": "nyc-taxi-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 248, "span_ids": ["q4_sql"], "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 q4_sql(df):\n sql = \"\"\"\n SELECT\n passenger_count,\n pickup_datetime,\n CAST(trip_distance AS int) AS trip_distance,\n COUNT(*) AS the_count\n FROM trips\n GROUP BY\n passenger_count,\n pickup_datetime,\n trip_distance\n ORDER BY\n pickup_datetime,\n the_count desc\n \"\"\"\n df[\"pickup_datetime\"] = df[\"pickup_datetime\"].dt.year\n df[\"trip_distance\"] = df[\"trip_distance\"].astype(\"int64\")\n return query(sql, trips=df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_validate_validate.df_equals_hdk_result_sql": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_validate_validate.df_equals_hdk_result_sql", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/nyc-taxi-hdk.py", "file_name": "nyc-taxi-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 260, "span_ids": ["validate"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def validate(df, hdk_func, sql_func, copy_df=False, reset_index=True, sort_by=None):\n hdk_result = hdk_func(df.copy() if copy_df else df)\n sql_result = sql_func(df.copy() if copy_df else df)\n if reset_index:\n hdk_result = hdk_result.reset_index()\n hdk_result.columns = sql_result.columns\n if sort_by is not None:\n hdk_result = hdk_result.sort_values(by=sort_by)\n sql_result = hdk_result.sort_values(by=sort_by)\n df_equals(hdk_result, sql_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_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/nyc-taxi-hdk.py_main_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/nyc-taxi-hdk.py", "file_name": "nyc-taxi-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 291, "span_ids": ["impl", "main"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n if len(sys.argv) != 2:\n print(\n f\"USAGE: docker run --rm -v /path/to/dataset:/dataset python nyc-taxi-hdk.py \"\n )\n return\n df = measure(\"Reading\", read, sys.argv[1])\n measure(\"Q1H\", q1_hdk, df)\n measure(\"Q1S\", q1_sql, df)\n measure(\"Q2H\", q2_hdk, df)\n measure(\"Q2S\", q2_sql, df)\n # The data frame is modified by some tests, therefore a copy should be used for these tests.\n measure(\"Q3H\", q3_hdk, df.copy())\n measure(\"Q3S\", q3_sql, df.copy())\n measure(\"Q4H\", q4_hdk, df.copy())\n measure(\"Q4S\", q4_sql, df.copy())\n\n validate(df, q1_hdk, q1_sql)\n validate(df, q2_hdk, q2_sql)\n validate(df, q3_hdk, q3_sql, copy_df=True)\n # Additional sorting is required here to make the results identical\n validate(\n df, q4_hdk, q4_sql, copy_df=True, reset_index=False, sort_by=[\"trip_distance\"]\n )\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_sys_create_dtypes.return.dtypes_meta_dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_sys_create_dtypes.return.dtypes_meta_dtypes", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 62, "span_ids": ["create_dtypes", "docstring"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nfrom collections import OrderedDict\nfrom functools import partial\nfrom utils import measure\nimport modin.pandas as pd\n\nimport numpy as np\nimport xgboost as xgb\n\nimport sklearnex\n\nsklearnex.patch_sklearn()\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\n\n\n################ helper functions ###############################\ndef create_dtypes():\n dtypes = OrderedDict(\n [\n (\"object_id\", \"int32\"),\n (\"mjd\", \"float32\"),\n (\"passband\", \"int32\"),\n (\"flux\", \"float32\"),\n (\"flux_err\", \"float32\"),\n (\"detected\", \"int32\"),\n ]\n )\n\n # load metadata\n columns_names = [\n \"object_id\",\n \"ra\",\n \"decl\",\n \"gal_l\",\n \"gal_b\",\n \"ddf\",\n \"hostgal_specz\",\n \"hostgal_photoz\",\n \"hostgal_photoz_err\",\n \"distmod\",\n \"mwebv\",\n \"target\",\n ]\n meta_dtypes = [\"int32\"] + [\"float32\"] * 4 + [\"int32\"] + [\"float32\"] * 5 + [\"int32\"]\n meta_dtypes = OrderedDict(\n [(columns_names[i], meta_dtypes[i]) for i in range(len(meta_dtypes))]\n )\n return dtypes, meta_dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_trigger_read_op_all_etl.return._train_final_test_final_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_trigger_read_op_all_etl.return._train_final_test_final_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 80, "span_ids": ["ravel_column_names", "all_etl", "trigger_read_op"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def trigger_read_op(dfs: tuple):\n for df in dfs:\n df.shape # to trigger real execution\n return dfs\n\n\ndef ravel_column_names(cols):\n d0 = cols.get_level_values(0)\n d1 = cols.get_level_values(1)\n return [\"%s_%s\" % (i, j) for i, j in zip(d0, d1)]\n\n\ndef all_etl(train, train_meta, test, test_meta):\n train_final = etl(train, train_meta)\n test_final = etl(test, test_meta)\n return (train_final, test_final)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_split_step_split_step.return.X_train_y_train_X_test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_split_step_split_step.return.X_train_y_train_X_test_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 101, "span_ids": ["split_step"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_step(train_final, test_final):\n X = train_final.drop([\"object_id\", \"target\"], axis=1).values\n Xt = test_final.drop([\"object_id\"], axis=1).values\n\n y = train_final[\"target\"]\n assert X.shape[1] == Xt.shape[1]\n classes = sorted(y.unique())\n\n class_weights = {c: 1 for c in classes}\n class_weights.update({c: 2 for c in [64, 15]})\n\n lbl = LabelEncoder()\n y = lbl.fit_transform(y)\n\n X_train, X_test, y_train, y_test = train_test_split(\n X, y, test_size=0.1, stratify=y, random_state=126\n )\n\n return X_train, y_train, X_test, y_test, Xt, classes, class_weights", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_multi_weighted_logloss_multi_weighted_logloss.return.loss": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_multi_weighted_logloss_multi_weighted_logloss.return.loss", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 120, "span_ids": ["multi_weighted_logloss"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def multi_weighted_logloss(y_true, y_preds, classes, class_weights):\n y_p = y_preds.reshape(y_true.shape[0], len(classes), order=\"F\")\n y_ohe = pd.get_dummies(y_true)\n y_p = np.clip(a=y_p, a_min=1e-15, a_max=1 - 1e-15)\n y_p_log = np.log(y_p)\n y_log_ones = np.sum(y_ohe.values * y_p_log, axis=0)\n nb_pos = y_ohe.sum(axis=0).values.astype(float)\n class_arr = np.array([class_weights[k] for k in sorted(class_weights.keys())])\n y_w = y_log_ones * class_arr / nb_pos\n\n loss = -np.sum(y_w) / np.sum(class_arr)\n return loss", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_xgb_multi_weighted_logloss_read.return.dfs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_xgb_multi_weighted_logloss_read.return.dfs", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 156, "span_ids": ["read", "xgb_multi_weighted_logloss"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def xgb_multi_weighted_logloss(y_predicted, y_true, classes, class_weights):\n loss = multi_weighted_logloss(\n y_true.get_label(), y_predicted, classes, class_weights\n )\n return \"wloss\", loss\n\n\n################ helper functions ###############################\n\n\ndef read(\n training_set_filename,\n test_set_filename,\n training_set_metadata_filename,\n test_set_metadata_filename,\n dtypes,\n meta_dtypes,\n):\n train = pd.read_csv(training_set_filename, dtype=dtypes)\n test = pd.read_csv(\n test_set_filename,\n names=list(dtypes.keys()),\n dtype=dtypes,\n header=0,\n )\n\n train_meta = pd.read_csv(training_set_metadata_filename, dtype=meta_dtypes)\n target = meta_dtypes.pop(\"target\")\n test_meta = pd.read_csv(test_set_metadata_filename, dtype=meta_dtypes)\n meta_dtypes[\"target\"] = target\n\n dfs = (train, train_meta, test, test_meta)\n trigger_read_op(dfs)\n return dfs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_etl_etl.return.df_meta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_etl_etl.return.df_meta", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 196, "span_ids": ["etl"], "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": "def etl(df, df_meta):\n # workaround for both Modin_on_ray and Modin_on_hdk modes. Eventually this should be fixed\n df[\"flux_ratio_sq\"] = (df[\"flux\"] / df[\"flux_err\"]) * (\n df[\"flux\"] / df[\"flux_err\"]\n ) # np.power(df[\"flux\"] / df[\"flux_err\"], 2.0)\n df[\"flux_by_flux_ratio_sq\"] = df[\"flux\"] * df[\"flux_ratio_sq\"]\n\n aggs = {\n \"passband\": [\"mean\"],\n \"flux\": [\"min\", \"max\", \"mean\", \"skew\"],\n \"flux_err\": [\"min\", \"max\", \"mean\"],\n \"detected\": [\"mean\"],\n \"mjd\": [\"max\", \"min\"],\n \"flux_ratio_sq\": [\"sum\"],\n \"flux_by_flux_ratio_sq\": [\"sum\"],\n }\n agg_df = df.groupby(\"object_id\", sort=False).agg(aggs)\n\n agg_df.columns = ravel_column_names(agg_df.columns)\n\n agg_df[\"flux_diff\"] = agg_df[\"flux_max\"] - agg_df[\"flux_min\"]\n agg_df[\"flux_dif2\"] = agg_df[\"flux_diff\"] / agg_df[\"flux_mean\"]\n agg_df[\"flux_w_mean\"] = (\n agg_df[\"flux_by_flux_ratio_sq_sum\"] / agg_df[\"flux_ratio_sq_sum\"]\n )\n agg_df[\"flux_dif3\"] = agg_df[\"flux_diff\"] / agg_df[\"flux_w_mean\"]\n agg_df[\"mjd_diff\"] = agg_df[\"mjd_max\"] - agg_df[\"mjd_min\"]\n\n agg_df = agg_df.drop([\"mjd_max\", \"mjd_min\"], axis=1)\n\n agg_df = agg_df.reset_index()\n\n df_meta = df_meta.drop([\"ra\", \"decl\", \"gal_l\", \"gal_b\"], axis=1)\n\n df_meta = df_meta.merge(agg_df, on=\"object_id\", how=\"left\")\n\n df_meta.shape # to trigger real execution\n return df_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_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_ml_ml.return.cpu_loss": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_ml_ml.return.cpu_loss", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 240, "span_ids": ["ml"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ml(train_final, test_final):\n X_train, y_train, X_test, y_test, Xt, classes, class_weights = split_step(\n train_final, test_final\n )\n\n cpu_params = {\n \"objective\": \"multi:softprob\",\n \"eval_metric\": \"merror\",\n \"tree_method\": \"hist\",\n \"nthread\": 16,\n \"num_class\": 14,\n \"max_depth\": 7,\n \"verbosity\": 1,\n \"subsample\": 0.7,\n \"colsample_bytree\": 0.7,\n }\n\n func_loss = partial(\n xgb_multi_weighted_logloss, classes=classes, class_weights=class_weights\n )\n\n dtrain = xgb.DMatrix(data=X_train, label=y_train)\n dvalid = xgb.DMatrix(data=X_test, label=y_test)\n dtest = xgb.DMatrix(data=Xt)\n\n watchlist = [(dvalid, \"eval\"), (dtrain, \"train\")]\n\n clf = xgb.train(\n cpu_params,\n dtrain=dtrain,\n num_boost_round=60,\n evals=watchlist,\n feval=func_loss,\n early_stopping_rounds=10,\n verbose_eval=None,\n )\n\n yp = clf.predict(dvalid)\n cpu_loss = multi_weighted_logloss(y_test, yp, classes, class_weights)\n ysub = clf.predict(dtest) # noqa: F841 (unused variable)\n\n return cpu_loss", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/plasticc-hdk.py_main_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/plasticc-hdk.py", "file_name": "plasticc-hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 243, "end_line": 278, "span_ids": ["impl:2", "main"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n if len(sys.argv) < 5:\n print(\n \"USAGE: docker run --rm -v /path/to/dataset:/dataset python plasticc-hdk.py\"\n + \" \"\n + \" \"\n + \" \"\n + \" \"\n + \" [-no-ml]\"\n )\n return\n\n dtypes, meta_dtypes = create_dtypes()\n\n train, train_meta, test, test_meta = measure(\n \"Reading\",\n read,\n sys.argv[1],\n sys.argv[2],\n sys.argv[3],\n sys.argv[4],\n dtypes,\n meta_dtypes,\n )\n train_final, test_final = measure(\n \"ETL\", all_etl, train, train_meta, test, test_meta\n )\n\n if \"-no-ml\" not in sys.argv[5:]:\n cpu_loss = measure(\"ML\", ml, train_final, test_final)\n print(\"validation cpu_loss:\", cpu_loss)\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/utils.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-hdk/utils.py_sys_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 29, "span_ids": ["measure", "docstring"], "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": "import sys\nimport time\nfrom os.path import abspath, join, dirname\n\nMODIN_DIR = abspath(join(dirname(__file__), *[\"..\" for _ in range(3)]))\nif MODIN_DIR not in sys.path:\n sys.path.insert(0, MODIN_DIR)\n\n\ndef measure(name, func, *args, **kwargs):\n t0 = time.time()\n res = func(*args, **kwargs)\n t1 = time.time()\n print(f\"{name}: {t1 - t0} sec\")\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_modin-project__modin/examples/docker/modin-ray/census.py_sys_read.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_sys_read.return.df", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/census.py", "file_name": "census.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 131, "span_ids": ["read", "docstring"], "tokens": 622}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport time\nimport modin.pandas as pd\n\nfrom sklearn import config_context\nimport sklearnex\n\nsklearnex.patch_sklearn()\nfrom sklearn.model_selection import train_test_split\nimport sklearn.linear_model as lm\nimport numpy as np\n\n\ndef read(filename):\n columns_names = [\n \"YEAR0\",\n \"DATANUM\",\n \"SERIAL\",\n \"CBSERIAL\",\n \"HHWT\",\n \"CPI99\",\n \"GQ\",\n \"QGQ\",\n \"PERNUM\",\n \"PERWT\",\n \"SEX\",\n \"AGE\",\n \"EDUC\",\n \"EDUCD\",\n \"INCTOT\",\n \"SEX_HEAD\",\n \"SEX_MOM\",\n \"SEX_POP\",\n \"SEX_SP\",\n \"SEX_MOM2\",\n \"SEX_POP2\",\n \"AGE_HEAD\",\n \"AGE_MOM\",\n \"AGE_POP\",\n \"AGE_SP\",\n \"AGE_MOM2\",\n \"AGE_POP2\",\n \"EDUC_HEAD\",\n \"EDUC_MOM\",\n \"EDUC_POP\",\n \"EDUC_SP\",\n \"EDUC_MOM2\",\n \"EDUC_POP2\",\n \"EDUCD_HEAD\",\n \"EDUCD_MOM\",\n \"EDUCD_POP\",\n \"EDUCD_SP\",\n \"EDUCD_MOM2\",\n \"EDUCD_POP2\",\n \"INCTOT_HEAD\",\n \"INCTOT_MOM\",\n \"INCTOT_POP\",\n \"INCTOT_SP\",\n \"INCTOT_MOM2\",\n \"INCTOT_POP2\",\n ]\n columns_types = [\n \"int64\",\n \"int64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"float64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"int64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n \"float64\",\n ]\n dtypes = {columns_names[i]: columns_types[i] for i in range(len(columns_names))}\n\n df = pd.read_csv(\n filename,\n names=columns_names,\n dtype=dtypes,\n skiprows=1,\n )\n\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_etl_cod.return.1_residuals_total_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_etl_cod.return.1_residuals_total_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/census.py", "file_name": "census.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 188, "span_ids": ["mse", "cod", "etl"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def etl(df):\n keep_cols = [\n \"YEAR0\",\n \"DATANUM\",\n \"SERIAL\",\n \"CBSERIAL\",\n \"HHWT\",\n \"CPI99\",\n \"GQ\",\n \"PERNUM\",\n \"SEX\",\n \"AGE\",\n \"INCTOT\",\n \"EDUC\",\n \"EDUCD\",\n \"EDUC_HEAD\",\n \"EDUC_POP\",\n \"EDUC_MOM\",\n \"EDUCD_MOM2\",\n \"EDUCD_POP2\",\n \"INCTOT_MOM\",\n \"INCTOT_POP\",\n \"INCTOT_MOM2\",\n \"INCTOT_POP2\",\n \"INCTOT_HEAD\",\n \"SEX_HEAD\",\n ]\n df = df[keep_cols]\n\n df = df[df[\"INCTOT\"] != 9999999]\n df = df[df[\"EDUC\"] != -1]\n df = df[df[\"EDUCD\"] != -1]\n\n df[\"INCTOT\"] = df[\"INCTOT\"] * df[\"CPI99\"]\n\n for column in keep_cols:\n df[column] = df[column].fillna(-1)\n\n df[column] = df[column].astype(\"float64\")\n\n y = df[\"EDUC\"]\n X = df.drop(columns=[\"EDUC\", \"CPI99\"])\n\n return (df, X, y)\n\n\ndef mse(y_test, y_pred):\n return ((y_test - y_pred) ** 2).mean()\n\n\ndef cod(y_test, y_pred):\n y_bar = y_test.mean()\n total = ((y_test - y_bar) ** 2).sum()\n residuals = ((y_test - y_pred) ** 2).sum()\n return 1 - (residuals / 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_modin-project__modin/examples/docker/modin-ray/census.py_ml_ml.return.ml_scores": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_ml_ml.return.ml_scores", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/census.py", "file_name": "census.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 228, "span_ids": ["ml"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ml(X, y, random_state, n_runs, test_size):\n clf = lm.Ridge()\n\n X = np.ascontiguousarray(X, dtype=np.float64)\n y = np.ascontiguousarray(y, dtype=np.float64)\n\n mse_values, cod_values = [], []\n ml_scores = {}\n\n print(\"ML runs: \", n_runs)\n for i in range(n_runs):\n (X_train, X_test, y_train, y_test) = train_test_split(\n X, y, test_size=test_size, random_state=random_state\n )\n random_state += 777\n\n with config_context(assume_finite=True):\n model = clf.fit(X_train, y_train)\n\n y_pred = model.predict(X_test)\n\n mse_values.append(mse(y_test, y_pred))\n cod_values.append(cod(y_test, y_pred))\n\n ml_scores[\"mse_mean\"] = sum(mse_values) / len(mse_values)\n ml_scores[\"cod_mean\"] = sum(cod_values) / len(cod_values)\n ml_scores[\"mse_dev\"] = pow(\n sum([(mse_value - ml_scores[\"mse_mean\"]) ** 2 for mse_value in mse_values])\n / (len(mse_values) - 1),\n 0.5,\n )\n ml_scores[\"cod_dev\"] = pow(\n sum([(cod_value - ml_scores[\"cod_mean\"]) ** 2 for cod_value in cod_values])\n / (len(cod_values) - 1),\n 0.5,\n )\n\n return ml_scores", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_measure_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/census.py_measure_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/census.py", "file_name": "census.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 259, "span_ids": ["impl:2", "measure", "main"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def measure(name, func, *args, **kw):\n t0 = time.time()\n res = func(*args, **kw)\n t1 = time.time()\n print(f\"{name}: {t1 - t0} sec\")\n return res\n\n\ndef main():\n if len(sys.argv) != 2:\n print(\n f\"USAGE: docker run --rm -v /path/to/dataset:/dataset python census.py \"\n )\n return\n # ML specific\n N_RUNS = 50\n TEST_SIZE = 0.1\n RANDOM_STATE = 777\n\n df = measure(\"Reading\", read, sys.argv[1])\n _, X, y = measure(\"ETL\", etl, df)\n measure(\n \"ML\", ml, X, y, random_state=RANDOM_STATE, n_runs=N_RUNS, test_size=TEST_SIZE\n )\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_sys_read.return.pd_read_csv_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_sys_read.return.pd_read_csv_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/nyc-taxi.py", "file_name": "nyc-taxi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 76, "span_ids": ["read", "docstring"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport time\nimport modin.pandas as pd\n\n\ndef read(filename):\n columns_names = [\n \"trip_id\",\n \"vendor_id\",\n \"pickup_datetime\",\n \"dropoff_datetime\",\n \"store_and_fwd_flag\",\n \"rate_code_id\",\n \"pickup_longitude\",\n \"pickup_latitude\",\n \"dropoff_longitude\",\n \"dropoff_latitude\",\n \"passenger_count\",\n \"trip_distance\",\n \"fare_amount\",\n \"extra\",\n \"mta_tax\",\n \"tip_amount\",\n \"tolls_amount\",\n \"ehail_fee\",\n \"improvement_surcharge\",\n \"total_amount\",\n \"payment_type\",\n \"trip_type\",\n \"pickup\",\n \"dropoff\",\n \"cab_type\",\n \"precipitation\",\n \"snow_depth\",\n \"snowfall\",\n \"max_temperature\",\n \"min_temperature\",\n \"average_wind_speed\",\n \"pickup_nyct2010_gid\",\n \"pickup_ctlabel\",\n \"pickup_borocode\",\n \"pickup_boroname\",\n \"pickup_ct2010\",\n \"pickup_boroct2010\",\n \"pickup_cdeligibil\",\n \"pickup_ntacode\",\n \"pickup_ntaname\",\n \"pickup_puma\",\n \"dropoff_nyct2010_gid\",\n \"dropoff_ctlabel\",\n \"dropoff_borocode\",\n \"dropoff_boroname\",\n \"dropoff_ct2010\",\n \"dropoff_boroct2010\",\n \"dropoff_cdeligibil\",\n \"dropoff_ntacode\",\n \"dropoff_ntaname\",\n \"dropoff_puma\",\n ]\n parse_dates = [\"pickup_datetime\", \"dropoff_datetime\"]\n return pd.read_csv(\n filename, names=columns_names, header=None, parse_dates=parse_dates\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_q1_q3.return.transformed_groupby_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_q1_q3.return.transformed_groupby_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/nyc-taxi.py", "file_name": "nyc-taxi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 98, "span_ids": ["q1", "q3", "q2"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def q1(df):\n return df.groupby(\"cab_type\")[\"cab_type\"].count()\n\n\ndef q2(df):\n return df.groupby(\"passenger_count\", as_index=False).mean()[\n [\"passenger_count\", \"total_amount\"]\n ]\n\n\ndef q3(df):\n transformed = pd.DataFrame(\n {\n \"pickup_datetime\": df[\"pickup_datetime\"].dt.year,\n \"passenger_count\": df[\"passenger_count\"],\n }\n )\n return transformed.groupby(\n [\"pickup_datetime\", \"passenger_count\"], as_index=False\n ).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_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_q4_measure.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_q4_measure.return.res", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/nyc-taxi.py", "file_name": "nyc-taxi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 123, "span_ids": ["q4", "measure"], "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 q4(df):\n transformed = pd.DataFrame(\n {\n \"passenger_count\": df[\"passenger_count\"],\n \"pickup_datetime\": df[\"pickup_datetime\"].dt.year,\n \"trip_distance\": df[\"trip_distance\"].astype(\"int64\"),\n }\n )\n return (\n transformed.groupby(\n [\"passenger_count\", \"pickup_datetime\", \"trip_distance\"], as_index=False\n )\n .size()\n .sort_values(by=[\"pickup_datetime\", \"size\"], ascending=[True, False])\n )\n\n\ndef measure(name, func, *args, **kw):\n t0 = time.time()\n res = func(*args, **kw)\n t1 = time.time()\n print(f\"{name}: {t1 - t0} sec\")\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_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/nyc-taxi.py_main_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/nyc-taxi.py", "file_name": "nyc-taxi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 141, "span_ids": ["impl", "main"], "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 main():\n if len(sys.argv) != 2:\n print(\n f\"USAGE: docker run --rm -v /path/to/dataset:/dataset python nyc-taxi.py \"\n )\n return\n df = measure(\"Reading\", read, sys.argv[1])\n measure(\"Q1\", q1, df)\n measure(\"Q2\", q2, df)\n measure(\"Q3\", q3, df)\n measure(\"Q4\", q4, df)\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_sys_create_dtypes.return.dtypes_meta_dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_sys_create_dtypes.return.dtypes_meta_dtypes", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 62, "span_ids": ["create_dtypes", "docstring"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport time\nfrom collections import OrderedDict\nfrom functools import partial\nimport modin.pandas as pd\n\nimport numpy as np\nimport xgboost as xgb\n\nimport sklearnex\n\nsklearnex.patch_sklearn()\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\n\n\n################ helper functions ###############################\ndef create_dtypes():\n dtypes = OrderedDict(\n [\n (\"object_id\", \"int32\"),\n (\"mjd\", \"float32\"),\n (\"passband\", \"int32\"),\n (\"flux\", \"float32\"),\n (\"flux_err\", \"float32\"),\n (\"detected\", \"int32\"),\n ]\n )\n\n # load metadata\n columns_names = [\n \"object_id\",\n \"ra\",\n \"decl\",\n \"gal_l\",\n \"gal_b\",\n \"ddf\",\n \"hostgal_specz\",\n \"hostgal_photoz\",\n \"hostgal_photoz_err\",\n \"distmod\",\n \"mwebv\",\n \"target\",\n ]\n meta_dtypes = [\"int32\"] + [\"float32\"] * 4 + [\"int32\"] + [\"float32\"] * 5 + [\"int32\"]\n meta_dtypes = OrderedDict(\n [(columns_names[i], meta_dtypes[i]) for i in range(len(meta_dtypes))]\n )\n return dtypes, meta_dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_ravel_column_names_all_etl.return._train_final_test_final_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_ravel_column_names_all_etl.return._train_final_test_final_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 82, "span_ids": ["ravel_column_names", "all_etl", "measure"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ravel_column_names(cols):\n d0 = cols.get_level_values(0)\n d1 = cols.get_level_values(1)\n return [\"%s_%s\" % (i, j) for i, j in zip(d0, d1)]\n\n\ndef measure(name, func, *args, **kw):\n t0 = time.time()\n res = func(*args, **kw)\n t1 = time.time()\n print(f\"{name}: {t1 - t0} sec\")\n return res\n\n\ndef all_etl(train, train_meta, test, test_meta):\n train_final = etl(train, train_meta)\n test_final = etl(test, test_meta)\n return (train_final, test_final)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_split_step_split_step.return.X_train_y_train_X_test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_split_step_split_step.return.X_train_y_train_X_test_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 103, "span_ids": ["split_step"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_step(train_final, test_final):\n X = train_final.drop([\"object_id\", \"target\"], axis=1).values\n Xt = test_final.drop([\"object_id\"], axis=1).values\n\n y = train_final[\"target\"]\n assert X.shape[1] == Xt.shape[1]\n classes = sorted(y.unique())\n\n class_weights = {c: 1 for c in classes}\n class_weights.update({c: 2 for c in [64, 15]})\n\n lbl = LabelEncoder()\n y = lbl.fit_transform(y)\n\n X_train, X_test, y_train, y_test = train_test_split(\n X, y, test_size=0.1, stratify=y, random_state=126\n )\n\n return X_train, y_train, X_test, y_test, Xt, classes, class_weights", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_multi_weighted_logloss_multi_weighted_logloss.return.loss": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_multi_weighted_logloss_multi_weighted_logloss.return.loss", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 122, "span_ids": ["multi_weighted_logloss"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def multi_weighted_logloss(y_true, y_preds, classes, class_weights):\n y_p = y_preds.reshape(y_true.shape[0], len(classes), order=\"F\")\n y_ohe = pd.get_dummies(y_true)\n y_p = np.clip(a=y_p, a_min=1e-15, a_max=1 - 1e-15)\n y_p_log = np.log(y_p)\n y_log_ones = np.sum(y_ohe.values * y_p_log, axis=0)\n nb_pos = y_ohe.sum(axis=0).values.astype(float)\n class_arr = np.array([class_weights[k] for k in sorted(class_weights.keys())])\n y_w = y_log_ones * class_arr / nb_pos\n\n loss = -np.sum(y_w) / np.sum(class_arr)\n return loss", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_xgb_multi_weighted_logloss_read.return.dfs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_xgb_multi_weighted_logloss_read.return.dfs", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 157, "span_ids": ["read", "xgb_multi_weighted_logloss"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def xgb_multi_weighted_logloss(y_predicted, y_true, classes, class_weights):\n loss = multi_weighted_logloss(\n y_true.get_label(), y_predicted, classes, class_weights\n )\n return \"wloss\", loss\n\n\n################ helper functions ###############################\n\n\ndef read(\n training_set_filename,\n test_set_filename,\n training_set_metadata_filename,\n test_set_metadata_filename,\n dtypes,\n meta_dtypes,\n):\n train = pd.read_csv(training_set_filename, dtype=dtypes)\n test = pd.read_csv(\n test_set_filename,\n names=list(dtypes.keys()),\n dtype=dtypes,\n header=0,\n )\n\n train_meta = pd.read_csv(training_set_metadata_filename, dtype=meta_dtypes)\n target = meta_dtypes.pop(\"target\")\n test_meta = pd.read_csv(test_set_metadata_filename, dtype=meta_dtypes)\n meta_dtypes[\"target\"] = target\n\n dfs = (train, train_meta, test, test_meta)\n return dfs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_etl_etl.return.df_meta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_etl_etl.return.df_meta", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 196, "span_ids": ["etl"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def etl(df, df_meta):\n # workaround for both Modin_on_ray and Modin_on_hdk modes. Eventually this should be fixed\n df[\"flux_ratio_sq\"] = (df[\"flux\"] / df[\"flux_err\"]) * (\n df[\"flux\"] / df[\"flux_err\"]\n ) # np.power(df[\"flux\"] / df[\"flux_err\"], 2.0)\n df[\"flux_by_flux_ratio_sq\"] = df[\"flux\"] * df[\"flux_ratio_sq\"]\n\n aggs = {\n \"passband\": [\"mean\"],\n \"flux\": [\"min\", \"max\", \"mean\", \"skew\"],\n \"flux_err\": [\"min\", \"max\", \"mean\"],\n \"detected\": [\"mean\"],\n \"mjd\": [\"max\", \"min\"],\n \"flux_ratio_sq\": [\"sum\"],\n \"flux_by_flux_ratio_sq\": [\"sum\"],\n }\n agg_df = df.groupby(\"object_id\", sort=False).agg(aggs)\n\n agg_df.columns = ravel_column_names(agg_df.columns)\n\n agg_df[\"flux_diff\"] = agg_df[\"flux_max\"] - agg_df[\"flux_min\"]\n agg_df[\"flux_dif2\"] = agg_df[\"flux_diff\"] / agg_df[\"flux_mean\"]\n agg_df[\"flux_w_mean\"] = (\n agg_df[\"flux_by_flux_ratio_sq_sum\"] / agg_df[\"flux_ratio_sq_sum\"]\n )\n agg_df[\"flux_dif3\"] = agg_df[\"flux_diff\"] / agg_df[\"flux_w_mean\"]\n agg_df[\"mjd_diff\"] = agg_df[\"mjd_max\"] - agg_df[\"mjd_min\"]\n\n agg_df = agg_df.drop([\"mjd_max\", \"mjd_min\"], axis=1)\n\n agg_df = agg_df.reset_index()\n\n df_meta = df_meta.drop([\"ra\", \"decl\", \"gal_l\", \"gal_b\"], axis=1)\n\n df_meta = df_meta.merge(agg_df, on=\"object_id\", how=\"left\")\n\n return df_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_modin-project__modin/examples/docker/modin-ray/plasticc.py_ml_ml.return.cpu_loss": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_ml_ml.return.cpu_loss", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 240, "span_ids": ["ml"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ml(train_final, test_final):\n X_train, y_train, X_test, y_test, Xt, classes, class_weights = split_step(\n train_final, test_final\n )\n\n cpu_params = {\n \"objective\": \"multi:softprob\",\n \"eval_metric\": \"merror\",\n \"tree_method\": \"hist\",\n \"nthread\": 16,\n \"num_class\": 14,\n \"max_depth\": 7,\n \"verbosity\": 1,\n \"subsample\": 0.7,\n \"colsample_bytree\": 0.7,\n }\n\n func_loss = partial(\n xgb_multi_weighted_logloss, classes=classes, class_weights=class_weights\n )\n\n dtrain = xgb.DMatrix(data=X_train, label=y_train)\n dvalid = xgb.DMatrix(data=X_test, label=y_test)\n dtest = xgb.DMatrix(data=Xt)\n\n watchlist = [(dvalid, \"eval\"), (dtrain, \"train\")]\n\n clf = xgb.train(\n cpu_params,\n dtrain=dtrain,\n num_boost_round=60,\n evals=watchlist,\n feval=func_loss,\n early_stopping_rounds=10,\n verbose_eval=None,\n )\n\n yp = clf.predict(dvalid)\n cpu_loss = multi_weighted_logloss(y_test, yp, classes, class_weights)\n ysub = clf.predict(dtest) # noqa: F841 (unused variable)\n\n return cpu_loss", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/docker/modin-ray/plasticc.py_main_", "embedding": null, "metadata": {"file_path": "examples/docker/modin-ray/plasticc.py", "file_name": "plasticc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 243, "end_line": 272, "span_ids": ["impl:2", "main"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n if len(sys.argv) != 5:\n print(\n f\"USAGE: docker run --rm -v /path/to/dataset:/dataset python plasticc.py \"\n )\n return\n\n dtypes, meta_dtypes = create_dtypes()\n\n train, train_meta, test, test_meta = measure(\n \"Reading\",\n read,\n sys.argv[1],\n sys.argv[2],\n sys.argv[3],\n sys.argv[4],\n dtypes,\n meta_dtypes,\n )\n train_final, test_final = measure(\n \"ETL\", all_etl, train, train_meta, test, test_meta\n )\n cpu_loss = measure(\"ML\", ml, train_final, test_final)\n\n print(\"validation cpu_loss:\", cpu_loss)\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py_os_test_exercise_1._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py_os_test_exercise_1._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 43, "span_ids": ["test_exercise_1", "docstring"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\n\nimport nbformat\n\nMODIN_DIR = os.path.abspath(\n os.path.join(os.path.dirname(__file__), *[\"..\" for _ in range(6)])\n)\nsys.path.insert(0, MODIN_DIR)\nfrom examples.tutorial.jupyter.execution.test.utils import ( # noqa: E402\n _replace_str,\n _execute_notebook,\n)\n\nlocal_notebooks_dir = \"examples/tutorial/jupyter/execution/hdk_on_native/local\"\n\n\n# in this notebook user should replace 'import pandas as pd' with\n# 'import modin.pandas as pd' to make notebook work\ndef test_exercise_1():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_1_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_1.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n _replace_str(nb, \"import pandas as pd\", \"import modin.pandas as pd\")\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py__this_notebook_works_as_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py__this_notebook_works_as_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/hdk_on_native/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 68, "span_ids": ["test_exercise_3", "test_exercise_1", "test_exercise_2"], "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": "# this notebook works \"as is\"\ndef test_exercise_2():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_2_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_2.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_path)\n\n\n# this notebook works \"as is\"\ndef test_exercise_3():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_3_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_3.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 30, "span_ids": ["docstring"], "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 os\nimport sys\n\nimport nbformat\n\nMODIN_DIR = os.path.abspath(\n os.path.join(os.path.dirname(__file__), *[\"..\" for _ in range(6)])\n)\nsys.path.insert(0, MODIN_DIR)\nfrom examples.tutorial.jupyter.execution.test.utils import ( # noqa: E402\n _replace_str,\n _execute_notebook,\n test_dataset_path,\n download_taxi_dataset,\n)\n\nlocal_notebooks_dir = \"examples/tutorial/jupyter/execution/pandas_on_dask/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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 45, "span_ids": ["test_exercise_1", "docstring"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# in this notebook user should replace 'import pandas as pd' with\n# 'import modin.pandas as pd' to make notebook work\ndef test_exercise_1():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_1_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_1.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n _replace_str(nb, \"import pandas as pd\", \"import modin.pandas as pd\")\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 65, "span_ids": ["test_exercise_1", "test_exercise_2"], "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": "# this notebook works \"as is\" but for testing purposes we can use smaller dataset\ndef test_exercise_2():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_2_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_2.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n new_cell = f'path = \"{test_dataset_path}\"\\n' + download_taxi_dataset\n\n _replace_str(\n nb,\n 'path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n new_cell,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_None_15_test_exercise_3.__execute_notebook_modif": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_None_15_test_exercise_3.__execute_notebook_modif", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 99, "span_ids": ["test_exercise_3", "test_exercise_2"], "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": "# in this notebook user should add custom mad implementation\n# to make notebook work\ndef test_exercise_3():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_3_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_3.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n user_mad_implementation = \"\"\"PandasQueryCompiler.sq_mad_custom = TreeReduce.register(lambda cell_value, **kwargs: cell_value ** 2,\n pandas.DataFrame.mad)\n\ndef sq_mad_func(self, axis=None, skipna=True, level=None, **kwargs):\n if axis is None:\n axis = 0\n\n return self._reduce_dimension(\n self._query_compiler.sq_mad_custom(\n axis=axis, skipna=skipna, level=level, **kwargs\n )\n )\n\npd.DataFrame.sq_mad_custom = sq_mad_func\n\nmodin_mad_custom = df.sq_mad_custom()\n \"\"\"\n\n _replace_str(nb, \"modin_mad_custom = ...\", user_mad_implementation)\n\n nbformat.write(nb, modified_notebook_path)\n # need to update example, `.mad` doesn't exist\n # _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_None_17_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py_None_17_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_dask/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 119, "span_ids": ["test_exercise_3", "test_exercise_4"], "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": "# this notebook works \"as is\" but for testing purposes we can use smaller dataset\ndef test_exercise_4():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_4_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_4.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n s3_path_cell = f's3_path = \"{test_dataset_path}\"\\n' + download_taxi_dataset\n _replace_str(\n nb,\n 's3_path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n s3_path_cell,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 31, "span_ids": ["docstring"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\n\nimport nbformat\n\nMODIN_DIR = os.path.abspath(\n os.path.join(os.path.dirname(__file__), *[\"..\" for _ in range(6)])\n)\nsys.path.insert(0, MODIN_DIR)\nfrom examples.tutorial.jupyter.execution.test.utils import ( # noqa: E402\n _replace_str,\n _execute_notebook,\n _find_code_cell_idx,\n test_dataset_path,\n download_taxi_dataset,\n)\n\nlocal_notebooks_dir = \"examples/tutorial/jupyter/execution/pandas_on_ray/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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 46, "span_ids": ["test_exercise_1", "docstring"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# in this notebook user should replace 'import pandas as pd' with\n# 'import modin.pandas as pd' to make notebook work\ndef test_exercise_1():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_1_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_1.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n _replace_str(nb, \"import pandas as pd\", \"import modin.pandas as pd\")\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 69, "span_ids": ["test_exercise_1", "test_exercise_2"], "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": "# this notebook works \"as is\" but for testing purposes we can use smaller dataset\ndef test_exercise_2():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_2_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_2.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n _replace_str(\n nb,\n 'path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n '# path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n )\n\n new_optional_cell = f'path = \"{test_dataset_path}\"\\n' + download_taxi_dataset\n\n optional_cell_idx = _find_code_cell_idx(nb, \"[Optional] Download data locally.\")\n nb[\"cells\"][optional_cell_idx][\"source\"] = new_optional_cell\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_None_15_test_exercise_3.__execute_notebook_modif": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_None_15_test_exercise_3.__execute_notebook_modif", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 103, "span_ids": ["test_exercise_3", "test_exercise_2"], "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": "# in this notebook user should add custom mad implementation\n# to make notebook work\ndef test_exercise_3():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_3_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_3.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n user_mad_implementation = \"\"\"PandasQueryCompiler.sq_mad_custom = TreeReduce.register(lambda cell_value, **kwargs: cell_value ** 2,\n pandas.DataFrame.mad)\n\ndef sq_mad_func(self, axis=None, skipna=True, level=None, **kwargs):\n if axis is None:\n axis = 0\n\n return self._reduce_dimension(\n self._query_compiler.sq_mad_custom(\n axis=axis, skipna=skipna, level=level, **kwargs\n )\n )\n\npd.DataFrame.sq_mad_custom = sq_mad_func\n\nmodin_mad_custom = df.sq_mad_custom()\n \"\"\"\n\n _replace_str(nb, \"modin_mad_custom = ...\", user_mad_implementation)\n\n nbformat.write(nb, modified_notebook_path)\n # need to update example, `.mad` doesn't exist\n # _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_None_17_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py_None_17_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_ray/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 106, "end_line": 123, "span_ids": ["test_exercise_3", "test_exercise_4"], "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": "# this notebook works \"as is\" but for testing purposes we can use smaller dataset\ndef test_exercise_4():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_4_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_4.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n s3_path_cell = f's3_path = \"{test_dataset_path}\"\\n' + download_taxi_dataset\n _replace_str(\n nb,\n 's3_path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n s3_path_cell,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/setup_kernel.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/setup_kernel.py_sys_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_unidist/setup_kernel.py", "file_name": "setup_kernel.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 55, "span_ids": ["impl:3", "custom_make_ipkernel_cmd", "docstring"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nfrom ipykernel import kernelspec\n\n\ndefault_make_ipkernel_cmd = kernelspec.make_ipkernel_cmd\n\n\ndef custom_make_ipkernel_cmd(*args, **kwargs):\n \"\"\"\n Build modified Popen command list for launching an IPython kernel with MPI.\n\n Parameters\n ----------\n *args : iterable\n Additional positional arguments to be passed in `default_make_ipkernel_cmd`.\n **kwargs : dict\n Additional keyword arguments to be passed in `default_make_ipkernel_cmd`.\n\n Returns\n -------\n array\n A Popen command list.\n\n Notes\n -----\n The parameters of the function should be kept in sync with the ones of the original function.\n \"\"\"\n mpi_arguments = [\"mpiexec\", \"-n\", \"1\"]\n arguments = default_make_ipkernel_cmd(*args, **kwargs)\n return mpi_arguments + arguments\n\n\nkernelspec.make_ipkernel_cmd = custom_make_ipkernel_cmd\n\nif __name__ == \"__main__\":\n kernel_name = \"python3mpi\"\n display_name = \"Python 3 (ipykernel) with MPI\"\n dest = kernelspec.install(\n kernel_name=kernel_name, display_name=display_name, prefix=sys.prefix\n )\n print(f\"Installed kernelspec {kernel_name} in {dest}\") # noqa: T201", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_os_local_notebooks_dir._examples_tutorial_jupyte", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 36, "span_ids": ["docstring"], "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\nimport sys\n\nimport nbformat\n\nMODIN_DIR = os.path.abspath(\n os.path.join(os.path.dirname(__file__), *[\"..\" for _ in range(6)])\n)\nsys.path.insert(0, MODIN_DIR)\nfrom examples.tutorial.jupyter.execution.test.utils import ( # noqa: E402\n _replace_str,\n _execute_notebook,\n test_dataset_path,\n download_taxi_dataset,\n set_kernel,\n)\n\n# the kernel name \"python3mpi\" must match the one\n# that is set up in `examples/tutorial/jupyter/execution/pandas_on_unidist/setup_kernel.py`\n# for `Unidist` engine\nset_kernel(kernel_name=\"python3mpi\")\n\nlocal_notebooks_dir = \"examples/tutorial/jupyter/execution/pandas_on_unidist/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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py__in_this_notebook_user_s_test_exercise_1._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 39, "end_line": 51, "span_ids": ["test_exercise_1", "docstring"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# in this notebook user should replace 'import pandas as pd' with\n# 'import modin.pandas as pd' to make notebook work\ndef test_exercise_1():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_1_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_1.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n _replace_str(nb, \"import pandas as pd\", \"import modin.pandas as pd\")\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py__this_notebook_works_as_test_exercise_2._execute_notebook_modifie", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 54, "end_line": 71, "span_ids": ["test_exercise_1", "test_exercise_2"], "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": "# this notebook works \"as is\" but for testing purposes we can use smaller dataset\ndef test_exercise_2():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_2_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_2.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n new_cell = f'path = \"{test_dataset_path}\"\\n' + download_taxi_dataset\n\n _replace_str(\n nb,\n 'path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n new_cell,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_None_18_test_exercise_3.__execute_notebook_modif": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_None_18_test_exercise_3.__execute_notebook_modif", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 105, "span_ids": ["test_exercise_3", "test_exercise_2"], "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": "# in this notebook user should add custom mad implementation\n# to make notebook work\ndef test_exercise_3():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_3_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_3.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n user_mad_implementation = \"\"\"PandasQueryCompiler.sq_mad_custom = TreeReduce.register(lambda cell_value, **kwargs: cell_value ** 2,\n pandas.DataFrame.mad)\n\ndef sq_mad_func(self, axis=None, skipna=True, level=None, **kwargs):\n if axis is None:\n axis = 0\n\n return self._reduce_dimension(\n self._query_compiler.sq_mad_custom(\n axis=axis, skipna=skipna, level=level, **kwargs\n )\n )\n\npd.DataFrame.sq_mad_custom = sq_mad_func\n\nmodin_mad_custom = df.sq_mad_custom()\n \"\"\"\n\n _replace_str(nb, \"modin_mad_custom = ...\", user_mad_implementation)\n\n nbformat.write(nb, modified_notebook_path)\n # need to update example, `.mad` doesn't exist\n # _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_None_20_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py_None_20_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/pandas_on_unidist/test/test_notebooks.py", "file_name": "test_notebooks.py", "file_type": "text/x-python", "category": "test", "start_line": 108, "end_line": 125, "span_ids": ["test_exercise_3", "test_exercise_4"], "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": "# this notebook works \"as is\" but for testing purposes we can use smaller dataset\ndef test_exercise_4():\n modified_notebook_path = os.path.join(local_notebooks_dir, \"exercise_4_test.ipynb\")\n nb = nbformat.read(\n os.path.join(local_notebooks_dir, \"exercise_4.ipynb\"),\n as_version=nbformat.NO_CONVERT,\n )\n\n s3_path_cell = f's3_path = \"{test_dataset_path}\"\\n' + download_taxi_dataset\n _replace_str(\n nb,\n 's3_path = \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\"',\n s3_path_cell,\n )\n\n nbformat.write(nb, modified_notebook_path)\n _execute_notebook(modified_notebook_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_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py_nbformat__execute_notebook.ep_preprocess_nb_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py_nbformat__execute_notebook.ep_preprocess_nb_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 71, "span_ids": ["make_execute_preprocessor", "_execute_notebook", "set_kernel", "docstring"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import nbformat\nfrom nbconvert.preprocessors import ExecutePreprocessor\n\ntest_dataset_path = \"taxi.csv\"\ndownload_taxi_dataset = f\"\"\"import os\nimport urllib.request\nif not os.path.exists(\"{test_dataset_path}\"):\n url_path = \"https://modin-datasets.s3.amazonaws.com/testing/yellow_tripdata_2015-01.csv\"\n urllib.request.urlretrieve(url_path, \"{test_dataset_path}\")\n \"\"\"\n\n\n# Default kernel name for ``ExecutePreprocessor`` to be created\n_default_kernel_name = \"python3\"\n\n\ndef set_kernel(kernel_name):\n \"\"\"\n Set custom kernel for ``ExecutePreprocessor`` to be created.\n\n Parameters\n ----------\n kernel_name : str\n Kernel name.\n \"\"\"\n global _default_kernel_name\n _default_kernel_name = kernel_name\n\n\ndef make_execute_preprocessor():\n \"\"\"\n Make ``ExecutePreprocessor`` with the `_default_kernel_name`.\n\n Returns\n -------\n nbconvert.preprocessors.ExecutePreprocessor\n Execute processor entity.\n\n Notes\n -----\n Note that `_default_kernel_name` can be changed for the concrete executions\n (e.g., ``PandasOnUnidist`` with MPI backend).\n \"\"\"\n return ExecutePreprocessor(timeout=600, kernel_name=_default_kernel_name)\n\n\ndef _execute_notebook(notebook):\n \"\"\"\n Execute a jupyter notebook.\n\n Parameters\n ----------\n notebook : file-like or str\n File-like object or path to the notebook to execute.\n \"\"\"\n nb = nbformat.read(notebook, as_version=nbformat.NO_CONVERT)\n ep = make_execute_preprocessor()\n ep.preprocess(nb)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py__find_code_cell_idx__find_code_cell_idx.return.import_cell_idx_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py__find_code_cell_idx__find_code_cell_idx.return.import_cell_idx_0_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 101, "span_ids": ["_find_code_cell_idx"], "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 _find_code_cell_idx(nb, identifier):\n \"\"\"\n Find code cell index by provided ``identifier``.\n\n Parameters\n ----------\n nb : dict\n Dictionary representation of the notebook to look for.\n identifier : str\n Unique string which target code cell should contain.\n\n Returns\n -------\n int\n Code cell index by provided ``identifier``.\n\n Notes\n -----\n Assertion will be raised if ``identifier`` is found in\n several code cells or isn't found at all.\n \"\"\"\n import_cell_idx = [\n idx\n for idx, cell in enumerate(nb[\"cells\"])\n if cell[\"cell_type\"] == \"code\" and identifier in cell[\"source\"]\n ]\n assert len(import_cell_idx) == 1\n return import_cell_idx[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_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py__replace_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/examples/tutorial/jupyter/execution/test/utils.py__replace_str_", "embedding": null, "metadata": {"file_path": "examples/tutorial/jupyter/execution/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 126, "span_ids": ["_replace_str"], "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 _replace_str(nb, original_str, str_to_replace):\n \"\"\"\n Replace ``original_str`` with ``str_to_replace`` in the provided notebook.\n\n Parameters\n ----------\n nb : dict\n Dictionary representation of the notebook which requires replacement.\n original_str : str\n Original string which should be replaced.\n str_to_replace : str\n String to replace original string.\n\n Notes\n -----\n Assertion will be raised if ``original_str`` is found in\n several code cells or isn't found at all.\n \"\"\"\n import_cell_idx = _find_code_cell_idx(nb, original_str)\n nb[\"cells\"][import_cell_idx][\"source\"] = nb[\"cells\"][import_cell_idx][\n \"source\"\n ].replace(original_str, str_to_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_modin-project__modin/modin/__init__.py_from_typing_import_Any_O_None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__init__.py_from_typing_import_Any_O_None_1", "embedding": null, "metadata": {"file_path": "modin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 37, "span_ids": ["impl:2", "custom_formatwarning", "docstring"], "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 typing import Any, Optional, Tuple, Union, Type, TYPE_CHECKING\nimport warnings\n\nif TYPE_CHECKING:\n from .config import Engine, StorageFormat\n\nfrom ._version import get_versions\n\n\ndef custom_formatwarning(\n message: Union[Warning, str],\n category: Type[Warning],\n filename: str,\n lineno: int,\n line: Optional[str] = None,\n) -> str:\n # ignore everything except the message\n return \"{}: {}\\n\".format(category.__name__, message)\n\n\nwarnings.formatwarning = custom_formatwarning\n# Filter numpy version warnings because they are not relevant\nwarnings.filterwarnings(\"ignore\", message=\"numpy.dtype size changed\")\nwarnings.filterwarnings(\"ignore\", message=\"Large object of 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_modin-project__modin/modin/__init__.py_set_execution_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__init__.py_set_execution_", "embedding": null, "metadata": {"file_path": "modin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 69, "span_ids": ["set_execution", "impl:6"], "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 set_execution(\n engine: Any = None, storage_format: Any = None\n) -> Tuple[\"Engine\", \"StorageFormat\"]:\n \"\"\"\n Method to set the _pair_ of execution engine and storage format format simultaneously.\n This is needed because there might be cases where switching one by one would be\n impossible, as not all pairs of values are meaningful.\n\n The method returns pair of old values, so it is easy to return back.\n \"\"\"\n from .config import Engine, StorageFormat\n\n old_engine, old_storage_format = None, None\n # defer callbacks until both entities are set\n if engine is not None:\n old_engine = Engine._put_nocallback(engine)\n if storage_format is not None:\n old_storage_format = StorageFormat._put_nocallback(storage_format)\n # execute callbacks if something was changed\n if old_engine is not None:\n Engine._check_callbacks(old_engine)\n if old_storage_format is not None:\n StorageFormat._check_callbacks(old_storage_format)\n\n return old_engine, old_storage_format\n\n\n__version__ = get_versions()[\"version\"]\ndel get_versions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__main__.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/__main__.py_argparse_", "embedding": null, "metadata": {"file_path": "modin/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 40, "span_ids": ["main", "impl", "docstring"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\n\n\ndef main() -> None:\n parser = argparse.ArgumentParser(\n \"python -m modin\",\n description=\"Drop-in pandas replacement; refer to https://modin.readthedocs.io/ for details.\",\n )\n parser.add_argument(\n \"--versions\",\n action=\"store_true\",\n default=False,\n help=\"Show versions of all known components\",\n )\n\n args = parser.parse_args()\n if args.versions:\n from modin.utils import show_versions\n\n show_versions()\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py__This_file_helps_to_comp_VcsPieces.Dict_str_Any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py__This_file_helps_to_comp_VcsPieces.Dict_str_Any_", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["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": "# This file helps to compute a version number in source trees obtained from\n# git-archive tarball (such as those provided by githubs download-from-tag\n# feature). Distribution tarballs (built by setup.py sdist) and build\n# directories (produced by setup.py build) will contain a much shorter file\n# that just contains the computed version number.\n\n# This file is released into the public domain. Generated by\n# versioneer-0.18 (https://github.com/warner/python-versioneer)\n\n\"\"\"Git implementation of _version.py.\"\"\"\n\nimport errno\nimport os\nimport re\nimport subprocess\nimport sys\nfrom typing import Any, Callable, Dict, Optional, List, Tuple\n\nVcsPieces = Dict[str, Any]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_get_keywords_get_keywords.return.keywords": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_get_keywords_get_keywords.return.keywords", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 32, "span_ids": ["get_keywords"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_keywords() -> Dict[str, str]:\n \"\"\"Get the keywords needed to look up the version information.\"\"\"\n # these strings will be replaced by git during git-archive.\n # setup.py/versioneer.py will grep for the variable names, so they must\n # each be defined on a line of their own. _version.py will just call\n # get_keywords().\n git_refnames = \"$Format:%d$\"\n git_full = \"$Format:%H$\"\n git_date = \"$Format:%ci$\"\n keywords = {\"refnames\": git_refnames, \"full\": git_full, \"date\": git_date}\n return keywords", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_VersioneerConfig_register_vcs_handler.return.decorate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_VersioneerConfig_register_vcs_handler.return.decorate", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 77, "span_ids": ["VersioneerConfig", "impl:3", "NotThisMethod", "register_vcs_handler", "get_config"], "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 VersioneerConfig:\n \"\"\"Container for Versioneer configuration parameters.\"\"\"\n\n VCS: str\n style: str\n tag_prefix: str\n parentdir_prefix: str\n versionfile_source: str\n verbose: bool\n\n\ndef get_config() -> VersioneerConfig:\n \"\"\"Create, populate and return the VersioneerConfig() object.\"\"\"\n # these strings are filled in when 'setup.py versioneer' creates\n # _version.py\n cfg = VersioneerConfig()\n cfg.VCS = \"git\"\n cfg.style = \"pep440\"\n cfg.tag_prefix = \"\"\n cfg.parentdir_prefix = \"modin-\"\n cfg.versionfile_source = \"modin/_version.py\"\n cfg.verbose = False\n return cfg\n\n\nclass NotThisMethod(Exception):\n \"\"\"Exception raised if a method is not valid for the current scenario.\"\"\"\n\n\nHANDLERS: Dict[str, Dict[str, Callable]] = {}\n\n\ndef register_vcs_handler(vcs: str, method: str) -> Callable: # decorator\n \"\"\"Decorator to mark a method as the handler for a particular VCS.\"\"\"\n\n def decorate(f: Callable) -> Callable:\n \"\"\"Store f in HANDLERS[vcs][method].\"\"\"\n if vcs not in HANDLERS:\n HANDLERS[vcs] = {}\n HANDLERS[vcs][method] = f\n return f\n\n return decorate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_run_command_run_command.return.stdout_p_returncode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_run_command_run_command.return.stdout_p_returncode", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 121, "span_ids": ["run_command"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_command(\n commands: List[str],\n args: List[Any],\n cwd: Optional[str] = None,\n verbose: bool = False,\n hide_stderr: bool = False,\n env: Optional[Dict[str, str]] = None,\n) -> Tuple[Optional[str], Optional[int]]:\n \"\"\"Call the given command(s).\"\"\"\n assert isinstance(commands, list)\n p = None\n for c in commands:\n try:\n dispcmd = str([c] + args)\n # remember shell=False, so use git.cmd on windows, not just git\n p = subprocess.Popen(\n [c] + args,\n cwd=cwd,\n env=env,\n stdout=subprocess.PIPE,\n stderr=(subprocess.PIPE if hide_stderr else None),\n )\n break\n except EnvironmentError:\n e = sys.exc_info()[1]\n if e.errno == errno.ENOENT: # type: ignore[union-attr]\n continue\n if verbose:\n print(\"unable to run %s\" % dispcmd)\n print(e)\n return None, None\n else:\n if verbose:\n print(\"unable to find command, tried %s\" % (commands,))\n return None, None\n stdout = p.communicate()[0].strip().decode()\n if p.returncode != 0:\n if verbose:\n print(f\"unable to run {dispcmd} (error)\")\n print(f\"stdout was {stdout}\")\n return None, p.returncode\n return stdout, p.returncode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_versions_from_parentdir_versions_from_parentdir.raise_NotThisMethod_root": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_versions_from_parentdir_versions_from_parentdir.raise_NotThisMethod_root", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 152, "span_ids": ["versions_from_parentdir"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def versions_from_parentdir(parentdir_prefix: str, root: str, verbose: bool) -> Dict:\n \"\"\"Try to determine the version from the parent directory name.\n\n Source tarballs conventionally unpack into a directory that includes both\n the project name and a version string. We will also support searching up\n two directory levels for an appropriately named parent directory\n \"\"\"\n rootdirs = []\n\n for i in range(3):\n dirname = os.path.basename(root)\n if dirname.startswith(parentdir_prefix):\n return {\n \"version\": dirname[len(parentdir_prefix) :],\n \"full-revisionid\": None,\n \"dirty\": False,\n \"error\": None,\n \"date\": None,\n }\n else:\n rootdirs.append(root)\n root = os.path.dirname(root) # up a level\n\n if verbose:\n print(\n \"Tried directories %s but none started with prefix %s\"\n % (str(rootdirs), parentdir_prefix)\n )\n raise NotThisMethod(\"rootdir doesn't start with parentdir_prefix\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_get_keywords_git_get_keywords.return.keywords": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_get_keywords_git_get_keywords.return.keywords", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 180, "span_ids": ["git_get_keywords"], "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": "@register_vcs_handler(\"git\", \"get_keywords\")\ndef git_get_keywords(versionfile_abs: str) -> Dict:\n \"\"\"Extract version information from the given file.\"\"\"\n # the code embedded in _version.py can just fetch the value of these\n # keywords. When used from setup.py, we don't want to import _version.py,\n # so we do it with a regexp instead. This function is not used from\n # _version.py.\n keywords = {}\n try:\n with open(versionfile_abs, \"r\") as _f:\n for line in _f.readlines():\n if line.strip().startswith(\"git_refnames =\"):\n mo = re.search(r'=\\s*\"(.*)\"', line)\n if mo:\n keywords[\"refnames\"] = mo.group(1)\n if line.strip().startswith(\"git_full =\"):\n mo = re.search(r'=\\s*\"(.*)\"', line)\n if mo:\n keywords[\"full\"] = mo.group(1)\n if line.strip().startswith(\"git_date =\"):\n mo = re.search(r'=\\s*\"(.*)\"', line)\n if mo:\n keywords[\"date\"] = mo.group(1)\n except EnvironmentError:\n pass\n return keywords", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_versions_from_keywords_git_versions_from_keywords.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_versions_from_keywords_git_versions_from_keywords.return._", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 244, "span_ids": ["git_versions_from_keywords"], "tokens": 739}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@register_vcs_handler(\"git\", \"keywords\")\ndef git_versions_from_keywords(\n keywords: Dict[str, str], tag_prefix: str, verbose: bool\n) -> Dict:\n \"\"\"Get version information from git keywords.\"\"\"\n if not keywords:\n raise NotThisMethod(\"no keywords at all, weird\")\n date = keywords.get(\"date\")\n if date is not None:\n # git-2.2.0 added \"%cI\", which expands to an ISO-8601 -compliant\n # datestamp. However we prefer \"%ci\" (which expands to an \"ISO-8601\n # -like\" string, which we must then edit to make compliant), because\n # it's been around since git-1.5.3, and it's too difficult to\n # discover which version we're using, or to work around using an\n # older one.\n date = date.strip().replace(\" \", \"T\", 1).replace(\" \", \"\", 1)\n refnames = keywords[\"refnames\"].strip()\n if refnames.startswith(\"$Format\"):\n if verbose:\n print(\"keywords are unexpanded, not using\")\n raise NotThisMethod(\"unexpanded keywords, not a git-archive tarball\")\n refs = set([r.strip() for r in refnames.strip(\"()\").split(\",\")])\n # starting in git-1.8.3, tags are listed as \"tag: foo-1.0\" instead of\n # just \"foo-1.0\". If we see a \"tag: \" prefix, prefer those.\n TAG = \"tag: \"\n tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)])\n if not tags:\n # Either we're using git < 1.8.3, or there really are no tags. We use\n # a heuristic: assume all version tags have a digit. The old git %d\n # expansion behaves like git log --decorate=short and strips out the\n # refs/heads/ and refs/tags/ prefixes that would let us distinguish\n # between branches and tags. By ignoring refnames without digits, we\n # filter out many common branch names like \"release\" and\n # \"stabilization\", as well as \"HEAD\" and \"master\".\n tags = set([r for r in refs if re.search(r\"\\d\", r)])\n if verbose:\n print(\"discarding '%s', no digits\" % \",\".join(refs - tags))\n if verbose:\n print(\"likely tags: %s\" % \",\".join(sorted(tags)))\n for ref in sorted(tags):\n # sorting will prefer e.g. \"2.0\" over \"2.0rc1\"\n if ref.startswith(tag_prefix):\n r = ref[len(tag_prefix) :]\n if verbose:\n print(\"picking %s\" % r)\n return {\n \"version\": r,\n \"full-revisionid\": keywords[\"full\"].strip(),\n \"dirty\": False,\n \"error\": None,\n \"date\": date,\n }\n # no suitable tags, so version is \"0+unknown\", but full hex is still there\n if verbose:\n print(\"no suitable tags, using unknown + full revision id\")\n return {\n \"version\": \"0+unknown\",\n \"full-revisionid\": keywords[\"full\"].strip(),\n \"dirty\": False,\n \"error\": \"no suitable tags\",\n \"date\": None,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_pieces_from_vcs_git_pieces_from_vcs._now_we_have_TAG_NUM_gHE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_pieces_from_vcs_git_pieces_from_vcs._now_we_have_TAG_NUM_gHE", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 247, "end_line": 306, "span_ids": ["git_pieces_from_vcs"], "tokens": 535}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@register_vcs_handler(\"git\", \"pieces_from_vcs\")\ndef git_pieces_from_vcs(\n tag_prefix: str, root: str, verbose: bool, run_command: Callable = run_command\n) -> Dict:\n \"\"\"Get version from 'git describe' in the root of the source tree.\n\n This only gets called if the git-archive 'subst' keywords were *not*\n expanded, and _version.py hasn't already been rewritten with a short\n version string, meaning we're inside a checked out source tree.\n \"\"\"\n GITS = [\"git\"]\n if sys.platform == \"win32\":\n GITS = [\"git.cmd\", \"git.exe\"]\n\n out, rc = run_command(GITS, [\"rev-parse\", \"--git-dir\"], cwd=root, hide_stderr=True)\n if rc != 0:\n if verbose:\n print(\"Directory %s not under git control\" % root)\n raise NotThisMethod(\"'git rev-parse --git-dir' returned error\")\n\n # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]\n # if there isn't one, this yields HEX[-dirty] (no NUM)\n describe_out, rc = run_command(\n GITS,\n [\n \"describe\",\n \"--tags\",\n \"--dirty\",\n \"--always\",\n \"--long\",\n \"--match\",\n \"%s*\" % tag_prefix,\n ],\n cwd=root,\n )\n # --long was added in git-1.5.5\n if describe_out is None:\n raise NotThisMethod(\"'git describe' failed\")\n describe_out = describe_out.strip()\n full_out, rc = run_command(GITS, [\"rev-parse\", \"HEAD\"], cwd=root)\n if full_out is None:\n raise NotThisMethod(\"'git rev-parse' failed\")\n full_out = full_out.strip()\n\n pieces = {}\n pieces[\"long\"] = full_out\n pieces[\"short\"] = full_out[:7] # maybe improved later\n pieces[\"error\"] = None\n\n # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]\n # TAG might have hyphens.\n git_describe = describe_out\n\n # look for -dirty suffix\n dirty = git_describe.endswith(\"-dirty\")\n pieces[\"dirty\"] = dirty\n if dirty:\n git_describe = git_describe[: git_describe.rindex(\"-dirty\")]\n\n # now we have TAG-NUM-gHEX or HEX\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_modin-project__modin/modin/_version.py_git_pieces_from_vcs.if_in_git_describe__git_pieces_from_vcs.return.pieces": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_git_pieces_from_vcs.if_in_git_describe__git_pieces_from_vcs.return.pieces", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 347, "span_ids": ["git_pieces_from_vcs"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@register_vcs_handler(\"git\", \"pieces_from_vcs\")\ndef git_pieces_from_vcs(\n tag_prefix: str, root: str, verbose: bool, run_command: Callable = run_command\n) -> Dict:\n # ... other code\n\n if \"-\" in git_describe:\n # TAG-NUM-gHEX\n mo = re.search(r\"^(.+)-(\\d+)-g([0-9a-f]+)$\", git_describe)\n if not mo:\n # unparseable. Maybe git-describe is misbehaving?\n pieces[\"error\"] = \"unable to parse git-describe output: '%s'\" % describe_out\n return pieces\n\n # tag\n full_tag = mo.group(1)\n if not full_tag.startswith(tag_prefix):\n if verbose:\n fmt = \"tag '%s' doesn't start with prefix '%s'\"\n print(fmt % (full_tag, tag_prefix))\n pieces[\"error\"] = \"tag '%s' doesn't start with prefix '%s'\" % (\n full_tag,\n tag_prefix,\n )\n return pieces\n pieces[\"closest-tag\"] = full_tag[len(tag_prefix) :]\n\n # distance: number of commits since tag\n pieces[\"distance\"] = int(mo.group(2))\n\n # commit: short hex revision ID\n pieces[\"short\"] = mo.group(3)\n\n else:\n # HEX: no tags\n pieces[\"closest-tag\"] = None\n count_out, rc = run_command(GITS, [\"rev-list\", \"HEAD\", \"--count\"], cwd=root)\n pieces[\"distance\"] = int(count_out) # total number of commits\n\n # commit date: see ISO-8601 comment in git_versions_from_keywords()\n date = run_command(GITS, [\"show\", \"-s\", \"--format=%ci\", \"HEAD\"], cwd=root)[\n 0\n ].strip()\n pieces[\"date\"] = date.strip().replace(\" \", \"T\", 1).replace(\" \", \"\", 1)\n\n return pieces", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_plus_or_dot_render_pep440.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_plus_or_dot_render_pep440.return.rendered", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 378, "span_ids": ["plus_or_dot", "render_pep440"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def plus_or_dot(pieces: VcsPieces) -> str:\n \"\"\"Return a + if we don't already have one, else return a .\"\"\"\n if \"+\" in pieces.get(\"closest-tag\", \"\"):\n return \".\"\n return \"+\"\n\n\ndef render_pep440(pieces: VcsPieces) -> str:\n \"\"\"Build up version string, with post-release \"local version identifier\".\n\n Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you\n get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty\n\n Exceptions:\n 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"] or pieces[\"dirty\"]:\n rendered += plus_or_dot(pieces)\n rendered += \"%d.g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n if pieces[\"dirty\"]:\n rendered += \".dirty\"\n else:\n # exception #1\n rendered = \"0+untagged.%d.g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n if pieces[\"dirty\"]:\n rendered += \".dirty\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_pre_render_pep440_pre.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_pre_render_pep440_pre.return.rendered", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 381, "end_line": 394, "span_ids": ["render_pep440_pre"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render_pep440_pre(pieces: VcsPieces) -> str:\n \"\"\"TAG[.post.devDISTANCE] -- No -dirty.\n\n Exceptions:\n 1: no tags. 0.post.devDISTANCE\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"]:\n rendered += \".post.dev%d\" % pieces[\"distance\"]\n else:\n # exception #1\n rendered = \"0.post.dev%d\" % pieces[\"distance\"]\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_post_render_pep440_post.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_post_render_pep440_post.return.rendered", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 397, "end_line": 421, "span_ids": ["render_pep440_post"], "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 render_pep440_post(pieces: VcsPieces) -> str:\n \"\"\"TAG[.postDISTANCE[.dev0]+gHEX] .\n\n The \".dev0\" means dirty. Note that .dev0 sorts backwards\n (a dirty tree will appear \"older\" than the corresponding clean one),\n but you shouldn't be releasing software with -dirty anyways.\n\n Exceptions:\n 1: no tags. 0.postDISTANCE[.dev0]\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"] or pieces[\"dirty\"]:\n rendered += \".post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n rendered += plus_or_dot(pieces)\n rendered += \"g%s\" % pieces[\"short\"]\n else:\n # exception #1\n rendered = \"0.post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n rendered += \"+g%s\" % pieces[\"short\"]\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_old_render_pep440_old.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_pep440_old_render_pep440_old.return.rendered", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 424, "end_line": 443, "span_ids": ["render_pep440_old"], "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 render_pep440_old(pieces: VcsPieces) -> str:\n \"\"\"TAG[.postDISTANCE[.dev0]] .\n\n The \".dev0\" means dirty.\n\n Eexceptions:\n 1: no tags. 0.postDISTANCE[.dev0]\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"] or pieces[\"dirty\"]:\n rendered += \".post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n else:\n # exception #1\n rendered = \"0.post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_git_describe_render_git_describe.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_git_describe_render_git_describe.return.rendered", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 463, "span_ids": ["render_git_describe"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render_git_describe(pieces: VcsPieces) -> str:\n \"\"\"TAG[-DISTANCE-gHEX][-dirty].\n\n Like 'git describe --tags --dirty --always'.\n\n Exceptions:\n 1: no tags. HEX[-dirty] (note: no 'g' prefix)\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"]:\n rendered += \"-%d-g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n else:\n # exception #1\n rendered = pieces[\"short\"]\n if pieces[\"dirty\"]:\n rendered += \"-dirty\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_git_describe_long_render_git_describe_long.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_git_describe_long_render_git_describe_long.return.rendered", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 483, "span_ids": ["render_git_describe_long"], "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 render_git_describe_long(pieces: VcsPieces) -> str:\n \"\"\"TAG-DISTANCE-gHEX[-dirty].\n\n Like 'git describe --tags --dirty --always -long'.\n The distance/hash is unconditional.\n\n Exceptions:\n 1: no tags. HEX[-dirty] (note: no 'g' prefix)\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n rendered += \"-%d-g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n else:\n # exception #1\n rendered = pieces[\"short\"]\n if pieces[\"dirty\"]:\n rendered += \"-dirty\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_render.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_render_render.return._", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 486, "end_line": 521, "span_ids": ["render"], "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": "def render(pieces: VcsPieces, style: str) -> Dict[str, Optional[str]]:\n \"\"\"Render the given version pieces into the requested style.\"\"\"\n if pieces[\"error\"]:\n return {\n \"version\": \"unknown\",\n \"full-revisionid\": pieces.get(\"long\"),\n \"dirty\": None,\n \"error\": pieces[\"error\"],\n \"date\": None,\n }\n\n if not style or style == \"default\":\n style = \"pep440\" # the default\n\n if style == \"pep440\":\n rendered = render_pep440(pieces)\n elif style == \"pep440-pre\":\n rendered = render_pep440_pre(pieces)\n elif style == \"pep440-post\":\n rendered = render_pep440_post(pieces)\n elif style == \"pep440-old\":\n rendered = render_pep440_old(pieces)\n elif style == \"git-describe\":\n rendered = render_git_describe(pieces)\n elif style == \"git-describe-long\":\n rendered = render_git_describe_long(pieces)\n else:\n raise ValueError(\"unknown style '%s'\" % style)\n\n return {\n \"version\": rendered,\n \"full-revisionid\": pieces[\"long\"],\n \"dirty\": pieces[\"dirty\"],\n \"error\": None,\n \"date\": pieces.get(\"date\"),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_get_versions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/_version.py_get_versions_", "embedding": null, "metadata": {"file_path": "modin/_version.py", "file_name": "_version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 524, "end_line": 574, "span_ids": ["get_versions"], "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": "def get_versions() -> Dict[str, Optional[str]]:\n \"\"\"Get version information or return default if unable to do so.\"\"\"\n # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have\n # __file__, we can work backwards from there to the root. Some\n # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which\n # case we can only use expanded keywords.\n\n cfg = get_config()\n verbose = cfg.verbose\n\n try:\n return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose)\n except NotThisMethod:\n pass\n\n try:\n root = os.path.realpath(__file__)\n # versionfile_source is the relative path from the top of the source\n # tree (where the .git directory might live) to this file. Invert\n # this to find the root from __file__.\n for _ in cfg.versionfile_source.split(\"/\"):\n root = os.path.dirname(root)\n except NameError:\n return {\n \"version\": \"0+unknown\",\n \"full-revisionid\": None,\n \"dirty\": None,\n \"error\": \"unable to find root of source tree\",\n \"date\": None,\n }\n\n try:\n pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)\n return render(pieces, cfg.style)\n except NotThisMethod:\n pass\n\n try:\n if cfg.parentdir_prefix:\n return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)\n except NotThisMethod:\n pass\n\n return {\n \"version\": \"0+unknown\",\n \"full-revisionid\": None,\n \"dirty\": None,\n \"error\": \"unable to compute version\",\n \"date\": None,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/__init__.py_Parameter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/__init__.py_Parameter_", "embedding": null, "metadata": {"file_path": "modin/config/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 18, "span_ids": ["docstring"], "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 .pubsub import Parameter # noqa: F401\nfrom .envvars import * # noqa: F403, F401", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/__main__.py_from_textwrap_import_dede_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/__main__.py_from_textwrap_import_dede_", "embedding": null, "metadata": {"file_path": "modin/config/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 97, "span_ids": ["export_config_help", "impl:2", "print_config_help", "docstring"], "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": "from textwrap import dedent\n\nfrom . import * # noqa: F403, F401\nfrom .pubsub import Parameter\nimport pandas\nimport argparse\n\n\ndef print_config_help() -> None:\n \"\"\"Print configs help messages.\"\"\"\n for objname in sorted(globals()):\n obj = globals()[objname]\n if isinstance(obj, type) and issubclass(obj, Parameter) and not obj.is_abstract:\n print(f\"{obj.get_help()}\\n\\tCurrent value: {obj.get()}\") # noqa: T201\n\n\ndef export_config_help(filename: str) -> None:\n \"\"\"\n Export all configs help messages to the CSV file.\n\n Parameters\n ----------\n filename : str\n Name of the file to export configs data.\n \"\"\"\n configs_data = []\n default_values = dict(\n RayRedisPassword=\"random string\",\n CpuCount=\"multiprocessing.cpu_count()\",\n NPartitions=\"equals to MODIN_CPUS env\",\n )\n for objname in sorted(globals()):\n obj = globals()[objname]\n if isinstance(obj, type) and issubclass(obj, Parameter) and not obj.is_abstract:\n data = {\n \"Config Name\": obj.__name__,\n \"Env. Variable Name\": getattr(\n obj, \"varname\", \"not backed by environment\"\n ),\n \"Default Value\": default_values.get(obj.__name__, obj._get_default()),\n # `Notes` `-` underlining can't be correctly parsed inside csv table by sphinx\n \"Description\": dedent(obj.__doc__ or \"\").replace(\n \"Notes\\n-----\", \"Notes:\\n\"\n ),\n \"Options\": obj.choices,\n }\n configs_data.append(data)\n\n pandas.DataFrame(\n configs_data,\n columns=[\n \"Config Name\",\n \"Env. Variable Name\",\n \"Default Value\",\n \"Description\",\n \"Options\",\n ],\n ).to_csv(filename, index=False)\n\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argument(\n \"--export-path\",\n dest=\"export_path\",\n type=str,\n required=False,\n default=None,\n help=\"File path to export configs data.\",\n )\n export_path = parser.parse_args().export_path\n if export_path:\n export_config_help(export_path)\n else:\n print_config_help()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_os_IsDebug.varname._MODIN_DEBUG_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_os_IsDebug.varname._MODIN_DEBUG_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 73, "span_ids": ["EnvironmentVariable._get_raw_from_config", "IsDebug", "EnvironmentVariable", "docstring", "EnvironmentVariable.get_help"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 textwrap import dedent\nimport warnings\nfrom packaging import version\nimport secrets\n\nfrom pandas.util._decorators import doc # type: ignore[attr-defined]\n\nfrom .pubsub import Parameter, _TYPE_PARAMS, ExactStr, ValueSource\nfrom typing import Any, Optional\n\n\nclass EnvironmentVariable(Parameter, type=str, abstract=True):\n \"\"\"Base class for environment variables-based configuration.\"\"\"\n\n varname: Optional[str] = None\n\n @classmethod\n def _get_raw_from_config(cls) -> str:\n \"\"\"\n Read the value from environment variable.\n\n Returns\n -------\n str\n Config raw value.\n\n Raises\n ------\n TypeError\n If `varname` is None.\n KeyError\n If value is absent.\n \"\"\"\n if cls.varname is None:\n raise TypeError(\"varname should not be None\")\n return os.environ[cls.varname]\n\n @classmethod\n def get_help(cls) -> str:\n \"\"\"\n Generate user-presentable help for the config.\n\n Returns\n -------\n str\n \"\"\"\n help = f\"{cls.varname}: {dedent(cls.__doc__ or 'Unknown').strip()}\\n\\tProvide {_TYPE_PARAMS[cls.type].help}\"\n if cls.choices:\n help += f\" (valid examples are: {', '.join(str(c) for c in cls.choices)})\"\n return help\n\n\nclass IsDebug(EnvironmentVariable, type=bool):\n \"\"\"Force Modin engine to be \"Python\" unless specified by $MODIN_ENGINE.\"\"\"\n\n varname = \"MODIN_DEBUG\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_Engine_Engine.add_option.return.choice": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_Engine_Engine.add_option.return.choice", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 168, "span_ids": ["Engine", "Engine.add_option", "Engine._get_default"], "tokens": 616}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Engine(EnvironmentVariable, type=str):\n \"\"\"Distribution engine to run queries by.\"\"\"\n\n varname = \"MODIN_ENGINE\"\n choices = (\"Ray\", \"Dask\", \"Python\", \"Native\", \"Unidist\")\n\n NOINIT_ENGINES = {\n \"Python\",\n } # engines that don't require initialization, useful for unit tests\n\n has_custom_engine = False\n\n @classmethod\n def _get_default(cls) -> str:\n \"\"\"\n Get default value of the config.\n\n Returns\n -------\n str\n \"\"\"\n from modin.utils import (\n MIN_RAY_VERSION,\n MIN_DASK_VERSION,\n MIN_UNIDIST_VERSION,\n )\n\n # If there's a custom engine, we don't need to check for any engine\n # dependencies. Return the default \"Python\" engine.\n if IsDebug.get() or cls.has_custom_engine:\n return \"Python\"\n try:\n import ray\n\n except ImportError:\n pass\n else:\n if version.parse(ray.__version__) < MIN_RAY_VERSION:\n raise ImportError(\n 'Please `pip install \"modin[ray]\"` to install compatible Ray '\n + \"version \"\n + f\"(>={MIN_RAY_VERSION}).\"\n )\n return \"Ray\"\n try:\n import dask\n import distributed\n\n except ImportError:\n pass\n else:\n if (\n version.parse(dask.__version__) < MIN_DASK_VERSION\n or version.parse(distributed.__version__) < MIN_DASK_VERSION\n ):\n raise ImportError(\n f'Please `pip install \"modin[dask]\"` to install compatible Dask version (>={MIN_DASK_VERSION}).'\n )\n return \"Dask\"\n try:\n # We import ``DbWorker`` from this module since correct import of ``DbWorker`` itself\n # from HDK is located in it with all the necessary options for dlopen.\n from modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import ( # noqa\n DbWorker,\n )\n except ImportError:\n pass\n else:\n return \"Native\"\n try:\n import unidist\n\n except ImportError:\n pass\n else:\n if version.parse(unidist.__version__) < MIN_UNIDIST_VERSION:\n raise ImportError(\n 'Please `pip install \"unidist[mpi]\"` to install compatible unidist on MPI '\n + \"version \"\n + f\"(>={MIN_UNIDIST_VERSION}).\"\n )\n return \"Unidist\"\n raise ImportError(\n \"Please refer to installation documentation page to install an engine\"\n )\n\n @classmethod\n @doc(Parameter.add_option.__doc__)\n def add_option(cls, choice: Any) -> Any:\n choice = super().add_option(choice)\n cls.NOINIT_ENGINES.add(choice)\n cls.has_custom_engine = True\n return choice", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_StorageFormat_Memory.varname._MODIN_MEMORY_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_StorageFormat_Memory.varname._MODIN_MEMORY_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 239, "span_ids": ["Memory", "StorageFormat", "CpuCount._get_default", "RayRedisPassword", "IsExperimental", "IsRayCluster", "CpuCount", "RayRedisAddress", "GpuCount"], "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 StorageFormat(EnvironmentVariable, type=str):\n \"\"\"Engine to run on a single node of distribution.\"\"\"\n\n varname = \"MODIN_STORAGE_FORMAT\"\n default = \"Pandas\"\n choices = (\"Pandas\", \"Hdk\", \"Pyarrow\", \"Cudf\")\n\n\nclass IsExperimental(EnvironmentVariable, type=bool):\n \"\"\"Whether to Turn on experimental features.\"\"\"\n\n varname = \"MODIN_EXPERIMENTAL\"\n\n\nclass IsRayCluster(EnvironmentVariable, type=bool):\n \"\"\"Whether Modin is running on pre-initialized Ray cluster.\"\"\"\n\n varname = \"MODIN_RAY_CLUSTER\"\n\n\nclass RayRedisAddress(EnvironmentVariable, type=ExactStr):\n \"\"\"Redis address to connect to when running in Ray cluster.\"\"\"\n\n varname = \"MODIN_REDIS_ADDRESS\"\n\n\nclass RayRedisPassword(EnvironmentVariable, type=ExactStr):\n \"\"\"What password to use for connecting to Redis.\"\"\"\n\n varname = \"MODIN_REDIS_PASSWORD\"\n default = secrets.token_hex(32)\n\n\nclass CpuCount(EnvironmentVariable, type=int):\n \"\"\"How many CPU cores to use during initialization of the Modin engine.\"\"\"\n\n varname = \"MODIN_CPUS\"\n\n @classmethod\n def _get_default(cls) -> int:\n \"\"\"\n Get default value of the config.\n\n Returns\n -------\n int\n \"\"\"\n import multiprocessing\n\n return multiprocessing.cpu_count()\n\n\nclass GpuCount(EnvironmentVariable, type=int):\n \"\"\"How may GPU devices to utilize across the whole distribution.\"\"\"\n\n varname = \"MODIN_GPUS\"\n\n\nclass Memory(EnvironmentVariable, type=int):\n \"\"\"\n How much memory (in bytes) give to an execution engine.\n\n Notes\n -----\n * In Ray case: the amount of memory to start the Plasma object store with.\n * In Dask case: the amount of memory that is given to each worker depending on CPUs used.\n \"\"\"\n\n varname = \"MODIN_MEMORY\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_NPartitions_NPartitions._get_default.if_StorageFormat_get_.else_.return.CpuCount_get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_NPartitions_NPartitions._get_default.if_StorageFormat_get_.else_.return.CpuCount_get_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 277, "span_ids": ["NPartitions._put", "NPartitions._get_default", "NPartitions"], "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 NPartitions(EnvironmentVariable, type=int):\n \"\"\"How many partitions to use for a Modin DataFrame (along each axis).\"\"\"\n\n varname = \"MODIN_NPARTITIONS\"\n\n @classmethod\n def _put(cls, value: int) -> None:\n \"\"\"\n Put specific value if NPartitions wasn't set by a user yet.\n\n Parameters\n ----------\n value : int\n Config value to set.\n\n Notes\n -----\n This method is used to set NPartitions from cluster resources internally\n and should not be called by a user.\n \"\"\"\n if cls.get_value_source() == ValueSource.DEFAULT:\n cls.put(value)\n\n @classmethod\n def _get_default(cls) -> int:\n \"\"\"\n Get default value of the config.\n\n Returns\n -------\n int\n \"\"\"\n if StorageFormat.get() == \"Cudf\":\n return GpuCount.get()\n else:\n return CpuCount.get()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_SocksProxy_AsvDataSizeConfig.default.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_SocksProxy_AsvDataSizeConfig.default.None", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 354, "span_ids": ["OmnisciFragmentSize", "DoTraceRpyc", "TestRayClient", "AsvImplementation", "TrackFileLeaks", "AsvDataSizeConfig", "SocksProxy", "HdkFragmentSize", "DoLogRpyc", "DoUseCalcite", "TestDatasetSize"], "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 SocksProxy(EnvironmentVariable, type=ExactStr):\n \"\"\"SOCKS proxy address if it is needed for SSH to work.\"\"\"\n\n varname = \"MODIN_SOCKS_PROXY\"\n\n\nclass DoLogRpyc(EnvironmentVariable, type=bool):\n \"\"\"Whether to gather RPyC logs (applicable for remote context).\"\"\"\n\n varname = \"MODIN_LOG_RPYC\"\n\n\nclass DoTraceRpyc(EnvironmentVariable, type=bool):\n \"\"\"Whether to trace RPyC calls (applicable for remote context).\"\"\"\n\n varname = \"MODIN_TRACE_RPYC\"\n\n\nclass HdkFragmentSize(EnvironmentVariable, type=int):\n \"\"\"How big a fragment in HDK should be when creating a table (in rows).\"\"\"\n\n varname = \"MODIN_HDK_FRAGMENT_SIZE\"\n\n\nclass OmnisciFragmentSize(EnvironmentVariable, type=int):\n \"\"\"How big a fragment in OmniSci should be when creating a table (in rows).\"\"\"\n\n varname = \"MODIN_OMNISCI_FRAGMENT_SIZE\"\n\n\nclass DoUseCalcite(EnvironmentVariable, type=bool):\n \"\"\"Whether to use Calcite for OmniSci queries execution.\"\"\"\n\n varname = \"MODIN_USE_CALCITE\"\n default = True\n\n\nclass TestDatasetSize(EnvironmentVariable, type=str):\n \"\"\"Dataset size for running some tests.\"\"\"\n\n varname = \"MODIN_TEST_DATASET_SIZE\"\n choices = (\"Small\", \"Normal\", \"Big\")\n\n\nclass TestRayClient(EnvironmentVariable, type=bool):\n \"\"\"Set to true to start and connect Ray client before a testing session starts.\"\"\"\n\n varname = \"MODIN_TEST_RAY_CLIENT\"\n default = False\n\n\nclass TrackFileLeaks(EnvironmentVariable, type=bool):\n \"\"\"Whether to track for open file handles leakage during testing.\"\"\"\n\n varname = \"MODIN_TEST_TRACK_FILE_LEAKS\"\n # Turn off tracking on Windows by default because\n # psutil's open_files() can be extremely slow on Windows (up to adding a few hours).\n # see https://github.com/giampaolo/psutil/pull/597\n default = sys.platform != \"win32\"\n\n\nclass AsvImplementation(EnvironmentVariable, type=ExactStr):\n \"\"\"Allows to select a library that we will use for testing performance.\"\"\"\n\n varname = \"MODIN_ASV_USE_IMPL\"\n choices = (\"modin\", \"pandas\")\n\n default = \"modin\"\n\n\nclass AsvDataSizeConfig(EnvironmentVariable, type=ExactStr):\n \"\"\"Allows to override default size of data (shapes).\"\"\"\n\n varname = \"MODIN_ASV_DATASIZE_CONFIG\"\n 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_modin-project__modin/modin/config/envvars.py_ProgressBar_ProgressBar.put.super_put_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_ProgressBar_ProgressBar.put.super_put_value_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 357, "end_line": 385, "span_ids": ["ProgressBar.enable", "ProgressBar.disable", "ProgressBar", "ProgressBar.put"], "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 ProgressBar(EnvironmentVariable, type=bool):\n \"\"\"Whether or not to show the progress bar.\"\"\"\n\n varname = \"MODIN_PROGRESS_BAR\"\n default = False\n\n @classmethod\n def enable(cls) -> None:\n \"\"\"Enable ``ProgressBar`` feature.\"\"\"\n cls.put(True)\n\n @classmethod\n def disable(cls) -> None:\n \"\"\"Disable ``ProgressBar`` feature.\"\"\"\n cls.put(False)\n\n @classmethod\n def put(cls, value: bool) -> None:\n \"\"\"\n Set ``ProgressBar`` value only if synchronous benchmarking is disabled.\n\n Parameters\n ----------\n value : bool\n Config value to set.\n \"\"\"\n if value and BenchmarkMode.get():\n raise ValueError(\"ProgressBar isn't compatible with BenchmarkMode\")\n super().put(value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_BenchmarkMode_BenchmarkMode.put.super_put_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_BenchmarkMode_BenchmarkMode.put.super_put_value_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 388, "end_line": 406, "span_ids": ["BenchmarkMode.put", "BenchmarkMode"], "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 BenchmarkMode(EnvironmentVariable, type=bool):\n \"\"\"Whether or not to perform computations synchronously.\"\"\"\n\n varname = \"MODIN_BENCHMARK_MODE\"\n default = False\n\n @classmethod\n def put(cls, value: bool) -> None:\n \"\"\"\n Set ``BenchmarkMode`` value only if progress bar feature is disabled.\n\n Parameters\n ----------\n value : bool\n Config value to set.\n \"\"\"\n if value and ProgressBar.get():\n raise ValueError(\"BenchmarkMode isn't compatible with ProgressBar\")\n super().put(value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogMode_LogMode.enable_api_only.cls_put_enable_api_only_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogMode_LogMode.enable_api_only.cls_put_enable_api_only_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 429, "span_ids": ["LogMode.enable", "LogMode", "LogMode.enable_api_only", "LogMode.disable"], "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 LogMode(EnvironmentVariable, type=ExactStr):\n \"\"\"Set ``LogMode`` value if users want to opt-in.\"\"\"\n\n varname = \"MODIN_LOG_MODE\"\n choices = (\"enable\", \"disable\", \"enable_api_only\")\n default = \"disable\"\n\n @classmethod\n def enable(cls) -> None:\n \"\"\"Enable all logging levels.\"\"\"\n cls.put(\"enable\")\n\n @classmethod\n def disable(cls) -> None:\n \"\"\"Disable logging feature.\"\"\"\n cls.put(\"disable\")\n\n @classmethod\n def enable_api_only(cls) -> None:\n \"\"\"Enable API level logging.\"\"\"\n cls.put(\"enable_api_only\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogMemoryInterval_LogMemoryInterval.get.return.log_memory_interval": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogMemoryInterval_LogMemoryInterval.get.return.log_memory_interval", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 432, "end_line": 463, "span_ids": ["LogMemoryInterval", "LogMemoryInterval.get", "LogMemoryInterval.put"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LogMemoryInterval(EnvironmentVariable, type=int):\n \"\"\"Interval (in seconds) to profile memory utilization for logging.\"\"\"\n\n varname = \"MODIN_LOG_MEMORY_INTERVAL\"\n default = 5\n\n @classmethod\n def put(cls, value: int) -> None:\n \"\"\"\n Set ``LogMemoryInterval`` with extra checks.\n\n Parameters\n ----------\n value : int\n Config value to set.\n \"\"\"\n if value <= 0:\n raise ValueError(f\"Log memory Interval should be > 0, passed value {value}\")\n super().put(value)\n\n @classmethod\n def get(cls) -> int:\n \"\"\"\n Get ``LogMemoryInterval`` with extra checks.\n\n Returns\n -------\n int\n \"\"\"\n log_memory_interval = super().get()\n assert log_memory_interval > 0, \"`LogMemoryInterval` should be > 0\"\n return log_memory_interval", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogFileSize_LogFileSize.get.return.log_file_size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_LogFileSize_LogFileSize.get.return.log_file_size", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 497, "span_ids": ["LogFileSize.put", "LogFileSize", "LogFileSize.get"], "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 LogFileSize(EnvironmentVariable, type=int):\n \"\"\"Max size of logs (in MBs) to store per Modin job.\"\"\"\n\n varname = \"MODIN_LOG_FILE_SIZE\"\n default = 10\n\n @classmethod\n def put(cls, value: int) -> None:\n \"\"\"\n Set ``LogFileSize`` with extra checks.\n\n Parameters\n ----------\n value : int\n Config value to set.\n \"\"\"\n if value <= 0:\n raise ValueError(f\"Log file size should be > 0 MB, passed value {value}\")\n super().put(value)\n\n @classmethod\n def get(cls) -> int:\n \"\"\"\n Get ``LogFileSize`` with extra checks.\n\n Returns\n -------\n int\n \"\"\"\n log_file_size = super().get()\n assert log_file_size > 0, \"`LogFileSize` should be > 0\"\n return log_file_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_modin-project__modin/modin/config/envvars.py_PersistentPickle_HdkLaunchParameters.default._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_PersistentPickle_HdkLaunchParameters.default._", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 500, "end_line": 527, "span_ids": ["PersistentPickle", "HdkLaunchParameters"], "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 PersistentPickle(EnvironmentVariable, type=bool):\n \"\"\"Whether serialization should be persistent.\"\"\"\n\n varname = \"MODIN_PERSISTENT_PICKLE\"\n # When set to off, it allows faster serialization which is only\n # valid in current run (i.e. useless for saving to disk).\n # When set to on, Modin objects could be saved to disk and loaded\n # but serialization/deserialization could take more time.\n default = False\n\n\nclass HdkLaunchParameters(EnvironmentVariable, type=dict):\n \"\"\"\n Additional command line options for the HDK engine.\n\n Please visit OmniSci documentation for the description of available parameters:\n https://docs.omnisci.com/installation-and-configuration/config-parameters#configuration-parameters-for-omniscidb\n \"\"\"\n\n varname = \"MODIN_HDK_LAUNCH_PARAMETERS\"\n default = {\n \"enable_union\": 1,\n \"enable_columnar_output\": 1,\n \"enable_lazy_fetch\": 0,\n \"null_div_by_zero\": 1,\n \"enable_watchdog\": 0,\n \"enable_thrift_logs\": 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_modin-project__modin/modin/config/envvars.py_HdkLaunchParameters.get_OmnisciLaunchParameters.varname._MODIN_OMNISCI_LAUNCH_PAR": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_HdkLaunchParameters.get_OmnisciLaunchParameters.varname._MODIN_OMNISCI_LAUNCH_PAR", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 529, "end_line": 575, "span_ids": ["OmnisciLaunchParameters", "HdkLaunchParameters._get", "HdkLaunchParameters.get"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkLaunchParameters(EnvironmentVariable, type=dict):\n\n @classmethod\n def get(cls) -> dict:\n \"\"\"\n Get the resulted command-line options.\n\n Decode and merge specified command-line options with the default one.\n\n Returns\n -------\n dict\n Decoded and verified config value.\n \"\"\"\n if cls == OmnisciLaunchParameters or (\n OmnisciLaunchParameters.varname in os.environ\n and HdkLaunchParameters.varname not in os.environ\n ):\n return OmnisciLaunchParameters._get()\n else:\n return HdkLaunchParameters._get()\n\n @classmethod\n def _get(cls) -> dict:\n \"\"\"\n Get the resulted command-line options.\n\n Returns\n -------\n dict\n Decoded and verified config value.\n \"\"\"\n custom_parameters = super().get()\n result = cls.default.copy()\n result.update(\n {key.replace(\"-\", \"_\"): value for key, value in custom_parameters.items()}\n )\n return result\n\n\nclass OmnisciLaunchParameters(HdkLaunchParameters, type=dict):\n \"\"\"\n Additional command line options for the OmniSci engine.\n\n Please visit OmniSci documentation for the description of available parameters:\n https://docs.omnisci.com/installation-and-configuration/config-parameters#configuration-parameters-for-omniscidb\n \"\"\"\n\n varname = \"MODIN_OMNISCI_LAUNCH_PARAMETERS\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_MinPartitionSize_MinPartitionSize.get.return.min_partition_size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_MinPartitionSize_MinPartitionSize.get.return.min_partition_size", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 578, "end_line": 614, "span_ids": ["MinPartitionSize", "MinPartitionSize.put", "MinPartitionSize.get"], "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 MinPartitionSize(EnvironmentVariable, type=int):\n \"\"\"\n Minimum number of rows/columns in a single pandas partition split.\n\n Once a partition for a pandas dataframe has more than this many elements,\n Modin adds another partition.\n \"\"\"\n\n varname = \"MODIN_MIN_PARTITION_SIZE\"\n default = 32\n\n @classmethod\n def put(cls, value: int) -> None:\n \"\"\"\n Set ``MinPartitionSize`` with extra checks.\n\n Parameters\n ----------\n value : int\n Config value to set.\n \"\"\"\n if value <= 0:\n raise ValueError(f\"Min partition size should be > 0, passed value {value}\")\n super().put(value)\n\n @classmethod\n def get(cls) -> int:\n \"\"\"\n Get ``MinPartitionSize`` with extra checks.\n\n Returns\n -------\n int\n \"\"\"\n min_partition_size = super().get()\n assert min_partition_size > 0, \"`min_partition_size` should be > 0\"\n return min_partition_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_modin-project__modin/modin/config/envvars.py_TestReadFromSqlServer_ExperimentalNumPyAPI.default.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_TestReadFromSqlServer_ExperimentalNumPyAPI.default.False", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 617, "end_line": 642, "span_ids": ["GithubCI", "ExperimentalNumPyAPI", "TestReadFromSqlServer", "TestReadFromPostgres"], "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 TestReadFromSqlServer(EnvironmentVariable, type=bool):\n \"\"\"Set to true to test reading from SQL server.\"\"\"\n\n varname = \"MODIN_TEST_READ_FROM_SQL_SERVER\"\n default = False\n\n\nclass TestReadFromPostgres(EnvironmentVariable, type=bool):\n \"\"\"Set to true to test reading from Postgres.\"\"\"\n\n varname = \"MODIN_TEST_READ_FROM_POSTGRES\"\n default = False\n\n\nclass GithubCI(EnvironmentVariable, type=bool):\n \"\"\"Set to true when running Modin in GitHub CI.\"\"\"\n\n varname = \"MODIN_GITHUB_CI\"\n default = False\n\n\nclass ExperimentalNumPyAPI(EnvironmentVariable, type=bool):\n \"\"\"Set to true to use Modin's experimental NumPy API.\"\"\"\n\n varname = \"MODIN_EXPERIMENTAL_NUMPY_API\"\n default = 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_modin-project__modin/modin/config/envvars.py_ExperimentalGroupbyImpl_ExperimentalGroupbyImpl.default.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_ExperimentalGroupbyImpl_ExperimentalGroupbyImpl.default.False", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 645, "end_line": 656, "span_ids": ["ExperimentalGroupbyImpl"], "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 ExperimentalGroupbyImpl(EnvironmentVariable, type=bool):\n \"\"\"\n Set to true to use Modin's experimental group by implementation.\n\n Experimental groupby is implemented using a range-partitioning technique,\n note that it may not always work better than the original Modin's TreeReduce\n and FullAxis implementations. For more information visit the according section\n of Modin's documentation: TODO: add a link to the section once it's written.\n \"\"\"\n\n varname = \"MODIN_EXPERIMENTAL_GROUPBY\"\n default = 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_modin-project__modin/modin/config/envvars.py_CIAWSSecretAccessKey_ReadSqlEngine.choices._Pandas_Connectorx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py_CIAWSSecretAccessKey_ReadSqlEngine.choices._Pandas_Connectorx_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 659, "end_line": 690, "span_ids": ["CIAWSSecretAccessKey", "CIAWSAccessKeyID", "AsyncReadMode", "ReadSqlEngine"], "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 CIAWSSecretAccessKey(EnvironmentVariable, type=str):\n \"\"\"Set to AWS_SECRET_ACCESS_KEY when running mock S3 tests for Modin in GitHub CI.\"\"\"\n\n varname = \"AWS_SECRET_ACCESS_KEY\"\n default = \"foobar_secret\"\n\n\nclass CIAWSAccessKeyID(EnvironmentVariable, type=str):\n \"\"\"Set to AWS_ACCESS_KEY_ID when running mock S3 tests for Modin in GitHub CI.\"\"\"\n\n varname = \"AWS_ACCESS_KEY_ID\"\n default = \"foobar_key\"\n\n\nclass AsyncReadMode(EnvironmentVariable, type=bool):\n \"\"\"\n It does not wait for the end of reading information from the source.\n\n Can break situations when reading occurs in a context, when exiting\n from which the source is deleted.\n \"\"\"\n\n varname = \"MODIN_ASYNC_READ_MODE\"\n default = False\n\n\nclass ReadSqlEngine(EnvironmentVariable, type=str):\n \"\"\"Engine to run `read_sql`.\"\"\"\n\n varname = \"MODIN_READ_SQL_ENGINE\"\n default = \"Pandas\"\n choices = (\"Pandas\", \"Connectorx\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py__check_vars_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/envvars.py__check_vars_", "embedding": null, "metadata": {"file_path": "modin/config/envvars.py", "file_name": "envvars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 693, "end_line": 718, "span_ids": ["_check_vars", "impl"], "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 _check_vars() -> None:\n \"\"\"\n Check validity of environment variables.\n\n Look out for any environment variables that start with \"MODIN_\" prefix\n that are unknown - they might be a typo, so warn a user.\n \"\"\"\n valid_names = {\n obj.varname\n for obj in globals().values()\n if isinstance(obj, type)\n and issubclass(obj, EnvironmentVariable)\n and not obj.is_abstract\n }\n found_names = {name for name in os.environ if name.startswith(\"MODIN_\")}\n unknown = found_names - valid_names\n if unknown:\n warnings.warn(\n f\"Found unknown environment variable{'s' if len(unknown) > 1 else ''},\"\n + f\" please check {'their' if len(unknown) > 1 else 'its'} spelling: \"\n + \", \".join(sorted(unknown))\n )\n\n\n_check_vars()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_from_collections_import_d_TypeDescriptor.help": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_from_collections_import_d_TypeDescriptor.help", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 42, "span_ids": ["TypeDescriptor", "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": "from collections import defaultdict\nfrom enum import IntEnum\nfrom typing import Any, Callable, DefaultDict, NamedTuple, Optional, Tuple\n\n\nclass TypeDescriptor(NamedTuple):\n \"\"\"\n Class for config data manipulating of exact type.\n\n Parameters\n ----------\n decode : callable\n Callable to decode config value from the raw data.\n normalize : callable\n Callable to bring different config value variations to\n the single form.\n verify : callable\n Callable to check that config value satisfies given config\n type requirements.\n help : str\n Class description string.\n \"\"\"\n\n decode: Callable[[str], object]\n normalize: Callable[[object], object]\n verify: Callable[[object], bool]\n help: 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_modin-project__modin/modin/config/pubsub.py_ExactStr_ValueSource.GOT_FROM_CFG_SOURCE.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_ExactStr_ValueSource.GOT_FROM_CFG_SOURCE.2", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 117, "span_ids": ["ExactStr", "impl", "ValueSource"], "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 ExactStr(str):\n \"\"\"Class to be used in type params where no transformations are needed.\"\"\"\n\n\n_TYPE_PARAMS = {\n str: TypeDescriptor(\n decode=lambda value: value.strip().title(),\n normalize=lambda value: str(value).strip().title(),\n verify=lambda value: True,\n help=\"a case-insensitive string\",\n ),\n ExactStr: TypeDescriptor(\n decode=lambda value: value,\n normalize=lambda value: value,\n verify=lambda value: True,\n help=\"a string\",\n ),\n bool: TypeDescriptor(\n decode=lambda value: value.strip().lower() in {\"true\", \"yes\", \"1\"},\n normalize=bool,\n verify=lambda value: isinstance(value, bool)\n or (\n isinstance(value, str)\n and value.strip().lower() in {\"true\", \"yes\", \"1\", \"false\", \"no\", \"0\"}\n ),\n help=\"a boolean flag (any of 'true', 'yes' or '1' in case insensitive manner is considered positive)\",\n ),\n int: TypeDescriptor(\n decode=lambda value: int(value.strip()),\n normalize=int, # type: ignore\n verify=lambda value: isinstance(value, int)\n or (isinstance(value, str) and value.strip().isdigit()),\n help=\"an integer value\",\n ),\n dict: TypeDescriptor(\n decode=lambda value: {\n key: int(val) if val.isdigit() else val\n for key_value in value.split(\",\")\n for key, val in [[v.strip() for v in key_value.split(\"=\", maxsplit=1)]]\n },\n normalize=lambda value: value\n if isinstance(value, dict)\n else {\n key: int(val) if val.isdigit() else val\n for key_value in str(value).split(\",\")\n for key, val in [[v.strip() for v in key_value.split(\"=\", maxsplit=1)]]\n },\n verify=lambda value: isinstance(value, dict)\n or (\n isinstance(value, str)\n and all(\n key_value.find(\"=\") not in (-1, len(key_value) - 1)\n for key_value in value.split(\",\")\n )\n ),\n help=\"a sequence of KEY=VALUE values separated by comma (Example: 'KEY1=VALUE1,KEY2=VALUE2,KEY3=VALUE3')\",\n ),\n}\n\n# special marker to distinguish unset value from None value\n# as someone may want to use None as a real value for a parameter\n_UNSET = object()\n\n\nclass ValueSource(IntEnum): # noqa: PR01\n \"\"\"Class that describes the method of getting the value for a parameter.\"\"\"\n\n # got from default, i.e. neither user nor configuration source had the value\n DEFAULT = 0\n # set by user\n SET_BY_USER = 1\n # got from parameter configuration source, like environment variable\n GOT_FROM_CFG_SOURCE = 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_modin-project__modin/modin/config/pubsub.py_Parameter_Parameter.get_help.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter_Parameter.get_help.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 183, "span_ids": ["Parameter.get_help", "Parameter", "Parameter._get_raw_from_config"], "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 Parameter(object):\n \"\"\"\n Base class describing interface for configuration entities.\n\n Attributes\n ----------\n choices : Optional[Sequence[str]]\n Array with possible options of ``Parameter`` values.\n type : str\n String that denotes ``Parameter`` type.\n default : Optional[Any]\n ``Parameter`` default value.\n is_abstract : bool, default: True\n Whether or not ``Parameter`` is abstract.\n _value_source : Optional[ValueSource]\n Source of the ``Parameter`` value, should be set by\n ``ValueSource``.\n \"\"\"\n\n choices: Optional[Tuple[str, ...]] = None\n type = str\n default: Optional[Any] = None\n is_abstract = True\n _value_source: Optional[ValueSource] = None\n _value: Any = _UNSET\n _subs: list = []\n _once: DefaultDict[Any, list] = defaultdict(list)\n\n @classmethod\n def _get_raw_from_config(cls) -> str:\n \"\"\"\n Read the value from config storage.\n\n Returns\n -------\n str\n Config raw value.\n\n Raises\n ------\n KeyError\n If value is absent.\n\n Notes\n -----\n Config storage can be config file or environment variable or whatever.\n Method should be implemented in the child class.\n \"\"\"\n raise NotImplementedError()\n\n @classmethod\n def get_help(cls) -> str:\n \"\"\"\n Generate user-presentable help for the option.\n\n Returns\n -------\n str\n\n Notes\n -----\n Method should be implemented in the child class.\n \"\"\"\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_modin-project__modin/modin/config/pubsub.py_Parameter.__init_subclass___Parameter.__init_subclass__.super___init_subclass__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.__init_subclass___Parameter.__init_subclass__.super___init_subclass__", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 204, "span_ids": ["Parameter.__init_subclass__"], "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 Parameter(object):\n\n def __init_subclass__(cls, type: Any, abstract: bool = False, **kw: dict):\n \"\"\"\n Initialize subclass.\n\n Parameters\n ----------\n type : Any\n Type of the config.\n abstract : bool, default: False\n Whether config is abstract.\n **kw : dict\n Optional arguments for config initialization.\n \"\"\"\n assert type in _TYPE_PARAMS, f\"Unsupported variable type: {type}\"\n cls.type = type\n cls.is_abstract = abstract\n cls._value = _UNSET\n cls._subs = []\n cls._once = defaultdict(list)\n super().__init_subclass__(**kw)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.subscribe_Parameter.get_value_source.return.cls__value_source": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.subscribe_Parameter.get_value_source.return.cls__value_source", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 245, "span_ids": ["Parameter._get_default", "Parameter.get_value_source", "Parameter.subscribe"], "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 Parameter(object):\n\n @classmethod\n def subscribe(cls, callback: Callable) -> None:\n \"\"\"\n Add `callback` to the `_subs` list and then execute it.\n\n Parameters\n ----------\n callback : callable\n Callable to execute.\n \"\"\"\n cls._subs.append(callback)\n callback(cls)\n\n @classmethod\n def _get_default(cls) -> Any:\n \"\"\"\n Get default value of the config.\n\n Returns\n -------\n Any\n \"\"\"\n return cls.default\n\n @classmethod\n def get_value_source(cls) -> ValueSource:\n \"\"\"\n Get value source of the config.\n\n Returns\n -------\n ValueSource\n \"\"\"\n if cls._value_source is None:\n # dummy call to .get() to initialize the value\n cls.get()\n assert (\n cls._value_source is not None\n ), \"_value_source must be initialized by now in get()\"\n return cls._value_source", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.get_Parameter.get.return.cls__value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.get_Parameter.get.return.cls__value", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 247, "end_line": 269, "span_ids": ["Parameter.get"], "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 Parameter(object):\n\n @classmethod\n def get(cls) -> Any:\n \"\"\"\n Get config value.\n\n Returns\n -------\n Any\n Decoded and verified config value.\n \"\"\"\n if cls._value is _UNSET:\n # get the value from env\n try:\n raw = cls._get_raw_from_config()\n except KeyError:\n cls._value = cls._get_default()\n cls._value_source = ValueSource.DEFAULT\n else:\n if not _TYPE_PARAMS[cls.type].verify(raw):\n raise ValueError(f\"Unsupported raw value: {raw}\")\n cls._value = _TYPE_PARAMS[cls.type].decode(raw)\n cls._value_source = ValueSource.GOT_FROM_CFG_SOURCE\n return cls._value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.put_Parameter.once.if_onvalue_cls_get_.else_.cls__once_onvalue_append": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.put_Parameter.once.if_onvalue_cls_get_.else_.cls__once_onvalue_append", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 303, "span_ids": ["Parameter.once", "Parameter.put"], "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 Parameter(object):\n\n @classmethod\n def put(cls, value: Any) -> None:\n \"\"\"\n Set config value.\n\n Parameters\n ----------\n value : Any\n Config value to set.\n \"\"\"\n cls._check_callbacks(cls._put_nocallback(value))\n cls._value_source = ValueSource.SET_BY_USER\n\n @classmethod\n def once(cls, onvalue: Any, callback: Callable) -> None:\n \"\"\"\n Execute `callback` if config value matches `onvalue` value.\n\n Otherwise accumulate callbacks associated with the given `onvalue`\n in the `_once` container.\n\n Parameters\n ----------\n onvalue : Any\n Config value to set.\n callback : callable\n Callable that should be executed if config value matches `onvalue`.\n \"\"\"\n onvalue = _TYPE_PARAMS[cls.type].normalize(onvalue)\n if onvalue == cls.get():\n callback(cls)\n else:\n cls._once[onvalue].append(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_modin-project__modin/modin/config/pubsub.py_Parameter._put_nocallback_Parameter._check_callbacks.for_callback_in_cls__once.callback_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter._put_nocallback_Parameter._check_callbacks.for_callback_in_cls__once.callback_cls_", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 305, "end_line": 341, "span_ids": ["Parameter._check_callbacks", "Parameter._put_nocallback"], "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 Parameter(object):\n\n @classmethod\n def _put_nocallback(cls, value: Any) -> Any:\n \"\"\"\n Set config value without executing callbacks.\n\n Parameters\n ----------\n value : Any\n Config value to set.\n\n Returns\n -------\n Any\n Replaced (old) config value.\n \"\"\"\n if not _TYPE_PARAMS[cls.type].verify(value):\n raise ValueError(f\"Unsupported value: {value}\")\n value = _TYPE_PARAMS[cls.type].normalize(value)\n oldvalue, cls._value = cls.get(), value\n return oldvalue\n\n @classmethod\n def _check_callbacks(cls, oldvalue: Any) -> None:\n \"\"\"\n Execute all needed callbacks if config value was changed.\n\n Parameters\n ----------\n oldvalue : Any\n Previous (old) config value.\n \"\"\"\n if oldvalue == cls.get():\n return\n for callback in cls._subs:\n callback(cls)\n for callback in cls._once.pop(cls.get(), ()):\n callback(cls)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.add_option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/pubsub.py_Parameter.add_option_", "embedding": null, "metadata": {"file_path": "modin/config/pubsub.py", "file_name": "pubsub.py", "file_type": "text/x-python", "category": "implementation", "start_line": 343, "end_line": 369, "span_ids": ["impl:5", "Parameter.add_option"], "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 Parameter(object):\n\n @classmethod\n def add_option(cls, choice: Any) -> Any:\n \"\"\"\n Add a new choice for the parameter.\n\n Parameters\n ----------\n choice : Any\n New choice to add to the available choices.\n\n Returns\n -------\n Any\n Added choice normalized according to the parameter type.\n \"\"\"\n if cls.choices is not None:\n if not _TYPE_PARAMS[cls.type].verify(choice):\n raise ValueError(f\"Unsupported choice value: {choice}\")\n choice = _TYPE_PARAMS[cls.type].normalize(choice)\n if choice not in cls.choices:\n cls.choices += (choice,)\n return choice\n raise TypeError(\"Cannot add a choice to a parameter where choices is None\")\n\n\n__all__ = [\"Parameter\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/config/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/config/test/test_envvars.py_os_test_custom_help.assert_custom_var_in_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_envvars.py_os_test_custom_help.assert_custom_var_in_ma", "embedding": null, "metadata": {"file_path": "modin/config/test/test_envvars.py", "file_name": "test_envvars.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 62, "span_ids": ["test_unknown", "test_custom_set", "set_custom_envvar", "make_unknown_env", "make_custom_envvar", "test_custom_help", "docstring", "test_custom_default"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport pytest\nimport modin.config as cfg\nfrom modin.config.envvars import EnvironmentVariable, _check_vars, ExactStr\n\n\n@pytest.fixture\ndef make_unknown_env():\n varname = \"MODIN_UNKNOWN\"\n os.environ[varname] = \"foo\"\n yield varname\n del os.environ[varname]\n\n\n@pytest.fixture(params=[str, ExactStr])\ndef make_custom_envvar(request):\n class CustomVar(EnvironmentVariable, type=request.param):\n \"\"\"custom var\"\"\"\n\n default = 10\n varname = \"MODIN_CUSTOM\"\n choices = (1, 5, 10)\n\n return CustomVar\n\n\n@pytest.fixture\ndef set_custom_envvar(make_custom_envvar):\n os.environ[make_custom_envvar.varname] = \" custom \"\n yield \"Custom\" if make_custom_envvar.type is str else \" custom \"\n del os.environ[make_custom_envvar.varname]\n\n\ndef test_unknown(make_unknown_env):\n with pytest.warns(UserWarning, match=f\"Found unknown .*{make_unknown_env}.*\"):\n _check_vars()\n\n\ndef test_custom_default(make_custom_envvar):\n assert make_custom_envvar.get() == 10\n\n\ndef test_custom_set(make_custom_envvar, set_custom_envvar):\n assert make_custom_envvar.get() == set_custom_envvar\n\n\ndef test_custom_help(make_custom_envvar):\n assert \"MODIN_CUSTOM\" in make_custom_envvar.get_help()\n assert \"custom var\" in make_custom_envvar.get_help()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_envvars.py_test_hdk_envvar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_envvars.py_test_hdk_envvar_", "embedding": null, "metadata": {"file_path": "modin/config/test/test_envvars.py", "file_name": "test_envvars.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 92, "span_ids": ["test_hdk_envvar"], "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": "def test_hdk_envvar():\n os.environ[\n cfg.OmnisciLaunchParameters.varname\n ] = \"enable_union=2,enable_thrift_logs=3\"\n params = cfg.OmnisciLaunchParameters.get()\n assert params[\"enable_union\"] == 2\n assert params[\"enable_thrift_logs\"] == 3\n\n params = cfg.HdkLaunchParameters.get()\n assert params[\"enable_union\"] == 2\n assert params[\"enable_thrift_logs\"] == 3\n\n os.environ[cfg.HdkLaunchParameters.varname] = \"enable_union=4,enable_thrift_logs=5\"\n del cfg.HdkLaunchParameters._value\n params = cfg.HdkLaunchParameters.get()\n assert params[\"enable_union\"] == 4\n assert params[\"enable_thrift_logs\"] == 5\n\n params = cfg.OmnisciLaunchParameters.get()\n assert params[\"enable_union\"] == 2\n assert params[\"enable_thrift_logs\"] == 3\n\n del os.environ[cfg.OmnisciLaunchParameters.varname]\n del cfg.OmnisciLaunchParameters._value\n params = cfg.OmnisciLaunchParameters.get()\n assert params[\"enable_union\"] == 4\n assert params[\"enable_thrift_logs\"] == 5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_from_collections_import_d_test_equals.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_from_collections_import_d_test_equals.None_1", "embedding": null, "metadata": {"file_path": "modin/config/test/test_parameter.py", "file_name": "test_parameter.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 38, "span_ids": ["prefilled_parameter", "make_prefilled", "test_equals", "docstring"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import defaultdict\nimport pytest\n\nfrom modin.config.pubsub import Parameter\n\n\ndef make_prefilled(vartype, varinit):\n class Prefilled(Parameter, type=vartype):\n @classmethod\n def _get_raw_from_config(cls):\n return varinit\n\n return Prefilled\n\n\n@pytest.fixture\ndef prefilled_parameter():\n return make_prefilled(str, \"init\")\n\n\ndef test_equals(prefilled_parameter):\n assert prefilled_parameter.get() == \"Init\"\n\n prefilled_parameter.put(\"value2\")\n assert prefilled_parameter.get() == \"Value2\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_test_triggers_test_triggers.for_name_val_in_expected.assert_results_name_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_test_triggers_test_triggers.for_name_val_in_expected.assert_results_name_v", "embedding": null, "metadata": {"file_path": "modin/config/test/test_parameter.py", "file_name": "test_parameter.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 67, "span_ids": ["test_triggers"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_triggers(prefilled_parameter):\n results = defaultdict(int)\n callbacks = []\n\n def make_callback(name, res=results):\n def callback(p: Parameter):\n res[name] += 1\n\n # keep reference to callbacks so they won't be removed by GC\n callbacks.append(callback)\n return callback\n\n prefilled_parameter.once(\"init\", make_callback(\"init\"))\n assert results[\"init\"] == 1\n\n prefilled_parameter.once(\"never\", make_callback(\"never\"))\n prefilled_parameter.once(\"once\", make_callback(\"once\"))\n prefilled_parameter.subscribe(make_callback(\"subscribe\"))\n\n prefilled_parameter.put(\"multi\")\n prefilled_parameter.put(\"once\")\n prefilled_parameter.put(\"multi\")\n prefilled_parameter.put(\"once\")\n\n expected = [(\"init\", 1), (\"never\", 0), (\"once\", 1), (\"subscribe\", 5)]\n for name, val in expected:\n assert results[name] == val, \"{} has wrong count\".format(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_modin-project__modin/modin/config/test/test_parameter.py_test_validation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/config/test/test_parameter.py_test_validation_", "embedding": null, "metadata": {"file_path": "modin/config/test/test_parameter.py", "file_name": "test_parameter.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 103, "span_ids": ["test_validation", "test_init_validation"], "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": "@pytest.mark.parametrize(\n \"parameter,good,bad\",\n [\n (make_prefilled(bool, \"false\"), {\"1\": True, False: False}, [\"nope\", 2]),\n (make_prefilled(int, \"10\"), {\" 15\\t\": 15, 25: 25}, [\"-10\", 1.0, \"foo\"]),\n (\n make_prefilled(dict, \"key = value\"),\n {\n \"KEY1 = VALUE1, KEY2=VALUE2=VALUE3,KEY3=0\": {\n \"KEY1\": \"VALUE1\",\n \"KEY2\": \"VALUE2=VALUE3\",\n \"KEY3\": 0,\n },\n \"KEY=1\": {\"KEY\": 1},\n },\n [\"key1=some,string\", \"key1=value1,key2=\", \"random string\"],\n ),\n ],\n)\ndef test_validation(parameter, good, bad):\n for inval, outval in good.items():\n parameter.put(inval)\n assert parameter.get() == outval\n for inval in bad:\n with pytest.raises(ValueError):\n parameter.put(inval)\n\n\n@pytest.mark.parametrize(\"vartype\", [bool, int, dict])\ndef test_init_validation(vartype):\n parameter = make_prefilled(vartype, \"bad value\")\n with pytest.raises(ValueError):\n parameter.get()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_boto3_from_modin_pandas_test_ut": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_boto3_from_modin_pandas_test_ut", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 83, "span_ids": ["impl:4", "_saving_make_api_url", "docstring"], "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": "import boto3\nimport s3fs\nimport os\nimport platform\nimport subprocess\nimport time\n\nimport shlex\nimport requests\nimport sys\nimport pytest\nimport pandas\nfrom pandas.util._decorators import doc\nimport numpy as np\nimport shutil\nfrom typing import Optional\n\nassert (\n \"modin.utils\" not in sys.modules\n), \"Do not import modin.utils before patching, or tests could fail\"\n# every import under this assert has to be postfixed with 'noqa: E402'\n# as flake8 complains about that... but we _have_ to make sure we\n# monkey-patch at the right spot, otherwise testing doc URLs might\n# not catch all of them\nimport modin.utils # noqa: E402\n\n_generated_doc_urls = set()\n\n\ndef _saving_make_api_url(token, _make_api_url=modin.utils._make_api_url):\n url = _make_api_url(token)\n _generated_doc_urls.add(url)\n return url\n\n\nmodin.utils._make_api_url = _saving_make_api_url\n\nimport modin # noqa: E402\nimport modin.config # noqa: E402\nfrom modin.config import ( # noqa: E402\n NPartitions,\n MinPartitionSize,\n IsExperimental,\n TestRayClient,\n GithubCI,\n CIAWSAccessKeyID,\n CIAWSSecretAccessKey,\n AsyncReadMode,\n)\nimport uuid # noqa: E402\n\nfrom modin.core.storage_formats import ( # noqa: E402\n PandasQueryCompiler,\n BaseQueryCompiler,\n)\nfrom modin.core.execution.python.implementations.pandas_on_python.io import ( # noqa: E402\n PandasOnPythonIO,\n)\nfrom modin.core.execution.dispatching.factories import factories # noqa: E402\nfrom modin.utils import get_current_execution # noqa: E402\nfrom modin.pandas.test.utils import ( # noqa: E402\n _make_csv_file,\n get_unique_filename,\n make_default_file,\n teardown_test_files,\n NROWS,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_addoption_pytest_addoption.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_addoption_pytest_addoption.None_2", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 104, "span_ids": ["pytest_addoption"], "tokens": 106}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pytest_addoption(parser):\n parser.addoption(\n \"--simulate-cloud\",\n action=\"store\",\n default=\"off\",\n help=\"simulate cloud for testing: off|normal|experimental\",\n )\n parser.addoption(\n \"--execution\",\n action=\"store\",\n default=None,\n help=\"specifies execution to run tests on\",\n )\n parser.addoption(\n \"--extra-test-parameters\",\n action=\"store_true\",\n help=\"activate extra test parameter combinations\",\n default=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_modin-project__modin/modin/conftest.py_Patcher_set_experimental_env.IsExperimental_put_mode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_Patcher_set_experimental_env.IsExperimental_put_mode_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 138, "span_ids": ["Patcher.__wrap", "Patcher", "Patcher.__init__", "Patcher.__exit__", "Patcher.__enter__", "set_experimental_env"], "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 Patcher:\n def __init__(self, conn, *pairs):\n self.pairs = pairs\n self.originals = None\n self.conn = conn\n\n def __wrap(self, func):\n def wrapper(*a, **kw):\n return func(\n *(tuple(self.conn.obtain(x) for x in a)),\n **({k: self.conn.obtain(v) for k, v in kw.items()}),\n )\n\n return func, wrapper\n\n def __enter__(self):\n self.originals = []\n for module, attrname in self.pairs:\n orig, wrapped = self.__wrap(getattr(module, attrname))\n self.originals.append((module, attrname, orig))\n setattr(module, attrname, wrapped)\n return self\n\n def __exit__(self, *a, **kw):\n for module, attrname, orig in self.originals:\n setattr(module, attrname, orig)\n\n\ndef set_experimental_env(mode):\n from modin.config import IsExperimental\n\n IsExperimental.put(mode == \"experimental\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_simulate_cloud_simulate_cloud.with_create_cluster_loca.with_Patcher_.yield": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_simulate_cloud_simulate_cloud.with_create_cluster_loca.with_Patcher_.yield", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 177, "span_ids": ["simulate_cloud"], "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": "@pytest.fixture(scope=\"session\", autouse=True)\ndef simulate_cloud(request):\n mode = request.config.getoption(\"--simulate-cloud\").lower()\n if mode == \"off\":\n yield\n return\n if (\n request.config.getoption(\"usepdb\")\n and request.config.getoption(\"capture\") != \"no\"\n ):\n with request.config.pluginmanager.getplugin(\n \"capturemanager\"\n ).global_and_fixture_disabled():\n sys.stderr.write(\n \"WARNING! You're running tests in simulate-cloud mode. \"\n + \"To enable pdb in remote side please disable output capturing \"\n + \"by passing '-s' or '--capture=no' to pytest command line\\n\"\n )\n\n if mode not in (\"normal\", \"experimental\"):\n raise ValueError(f\"Unsupported --simulate-cloud mode: {mode}\")\n assert IsExperimental.get(), \"Simulated cloud must be started in experimental mode\"\n\n from modin.experimental.cloud import create_cluster, get_connection\n import modin.pandas.test.utils\n\n with create_cluster(\"local\", cluster_type=\"local\"):\n get_connection().teleport(set_experimental_env)(mode)\n with Patcher(\n get_connection(),\n (modin.pandas.test.utils, \"assert_index_equal\"),\n (modin.pandas.test.utils, \"assert_series_equal\"),\n (modin.pandas.test.utils, \"assert_frame_equal\"),\n (modin.pandas.test.utils, \"assert_extension_array_equal\"),\n (modin.pandas.test.utils, \"assert_empty_frame_equal\"),\n ):\n yield", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_enforce_config_enforce_config.PatchedEnv.__check_var.if_name_upper_startswit.if_pkg_name_startswith_mo.assert_any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_enforce_config_enforce_config.PatchedEnv.__check_var.if_name_upper_startswit.if_pkg_name_startswith_mo.assert_any_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 206, "span_ids": ["enforce_config"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture(scope=\"session\", autouse=True)\ndef enforce_config():\n \"\"\"\n A fixture that ensures that all checks for MODIN_* variables\n are done using modin.config to prevent leakage\n \"\"\"\n orig_env = os.environ\n modin_start = os.path.dirname(modin.__file__)\n modin_exclude = [os.path.dirname(modin.config.__file__)]\n\n class PatchedEnv:\n @staticmethod\n def __check_var(name):\n if name.upper().startswith(\"MODIN_\"):\n frame = sys._getframe()\n try:\n # get the path to module where caller of caller is defined;\n # caller of this function is inside PatchedEnv, and we're\n # interested in whomever called a method on PatchedEnv\n caller_file = frame.f_back.f_back.f_code.co_filename\n finally:\n del frame\n pkg_name = os.path.dirname(caller_file)\n if pkg_name.startswith(modin_start):\n assert any(\n pkg_name.startswith(excl) for excl in modin_exclude\n ), \"Do not access MODIN_ environment variable bypassing modin.config\"\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_modin-project__modin/modin/conftest.py_enforce_config.PatchedEnv.__getitem___BASE_EXECUTION_NAME._BaseOnPython_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_enforce_config.PatchedEnv.__getitem___BASE_EXECUTION_NAME._BaseOnPython_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 243, "span_ids": ["enforce_config", "impl:15"], "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": "@pytest.fixture(scope=\"session\", autouse=True)\ndef enforce_config():\n\n class PatchedEnv:\n\n def __getitem__(self, name):\n self.__check_var(name)\n return orig_env[name]\n\n def __setitem__(self, name, value):\n self.__check_var(name)\n orig_env[name] = value\n\n def __delitem__(self, name):\n self.__check_var(name)\n del orig_env[name]\n\n def pop(self, name, default=object()):\n self.__check_var(name)\n return orig_env.pop(name, default)\n\n def get(self, name, default=None):\n self.__check_var(name)\n return orig_env.get(name, default)\n\n def __contains__(self, name):\n self.__check_var(name)\n return name in orig_env\n\n def __getattr__(self, name):\n return getattr(orig_env, name)\n\n def __iter__(self):\n return iter(orig_env)\n\n os.environ = PatchedEnv()\n yield\n os.environ = orig_env\n\n\nBASE_EXECUTION_NAME = \"BaseOnPython\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestQC_set_base_execution.modin_set_execution_engin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestQC_set_base_execution.modin_set_execution_engin", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 291, "span_ids": ["TestQC.from_pandas", "TestQC", "TestQC.from_arrow", "BaseOnPythonFactory.prepare", "TestQC.__init__", "TestQC.from_dataframe", "TestQC.finalize", "TestQC.to_dataframe", "TestQC.free", "TestQC:2", "set_base_execution", "BaseOnPythonFactory", "BaseOnPythonIO"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestQC(BaseQueryCompiler):\n def __init__(self, modin_frame):\n self._modin_frame = modin_frame\n\n def finalize(self):\n self._modin_frame.finalize()\n\n @classmethod\n def from_pandas(cls, df, data_cls):\n return cls(data_cls.from_pandas(df))\n\n @classmethod\n def from_arrow(cls, at, data_cls):\n return cls(data_cls.from_arrow(at))\n\n def free(self):\n pass\n\n def to_dataframe(self, nan_as_null: bool = False, allow_copy: bool = True):\n raise NotImplementedError(\n \"The selected execution does not implement the DataFrame exchange protocol.\"\n )\n\n @classmethod\n def from_dataframe(cls, df, data_cls):\n raise NotImplementedError(\n \"The selected execution does not implement the DataFrame exchange protocol.\"\n )\n\n to_pandas = PandasQueryCompiler.to_pandas\n default_to_pandas = PandasQueryCompiler.default_to_pandas\n\n\nclass BaseOnPythonIO(PandasOnPythonIO):\n query_compiler_cls = TestQC\n\n\nclass BaseOnPythonFactory(factories.BaseFactory):\n @classmethod\n def prepare(cls):\n cls.io_cls = BaseOnPythonIO\n\n\ndef set_base_execution(name=BASE_EXECUTION_NAME):\n setattr(factories, f\"{name}Factory\", BaseOnPythonFactory)\n modin.set_execution(engine=\"python\", storage_format=name.split(\"On\")[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_modin-project__modin/modin/conftest.py_get_unique_base_execution_get_unique_base_execution.try_.except_AttributeError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_get_unique_base_execution_get_unique_base_execution.try_.except_AttributeError_.pass", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 294, "end_line": 326, "span_ids": ["get_unique_base_execution"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture(scope=\"function\")\ndef get_unique_base_execution():\n \"\"\"Setup unique execution for a single function and yield its QueryCompiler that's suitable for inplace modifications.\"\"\"\n # It's better to use decimal IDs rather than hex ones due to factory names formatting\n execution_id = int(uuid.uuid4().hex, 16)\n format_name = f\"Base{execution_id}\"\n engine_name = \"Python\"\n execution_name = f\"{format_name}On{engine_name}\"\n\n # Dynamically building all the required classes to form a new execution\n base_qc = type(format_name, (TestQC,), {})\n base_io = type(\n f\"{execution_name}IO\", (BaseOnPythonIO,), {\"query_compiler_cls\": base_qc}\n )\n base_factory = type(\n f\"{execution_name}Factory\",\n (BaseOnPythonFactory,),\n {\"prepare\": classmethod(lambda cls: setattr(cls, \"io_cls\", base_io))},\n )\n\n # Setting up the new execution\n setattr(factories, f\"{execution_name}Factory\", base_factory)\n old_engine, old_format = modin.set_execution(\n engine=engine_name, storage_format=format_name\n )\n yield base_qc\n\n # Teardown the new execution\n modin.set_execution(engine=old_engine, storage_format=old_format)\n try:\n delattr(factories, f\"{execution_name}Factory\")\n except AttributeError:\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_modin-project__modin/modin/conftest.py_pytest_configure_pytest_configure.if_execution_BASE_EXEC.else_.modin_set_execution_engin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_configure_pytest_configure.if_execution_BASE_EXEC.else_.modin_set_execution_engin", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 329, "end_line": 346, "span_ids": ["pytest_configure"], "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 pytest_configure(config):\n import modin.pandas.test.utils as utils\n\n utils.extra_test_parameters = config.getoption(\"--extra-test-parameters\")\n\n execution = config.option.execution\n\n if execution is None:\n return\n\n if execution == BASE_EXECUTION_NAME:\n set_base_execution(BASE_EXECUTION_NAME)\n config.addinivalue_line(\n \"filterwarnings\", \"default:.*defaulting to pandas.*:UserWarning\"\n )\n else:\n partition, engine = execution.split(\"On\")\n modin.set_execution(engine=engine, storage_format=partition)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_runtest_call__doc_pytest_fixture._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_runtest_call__doc_pytest_fixture._", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 376, "span_ids": ["pytest_runtest_call", "impl:17"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pytest_runtest_call(item):\n custom_markers = [\"xfail\", \"skip\"]\n\n # dynamicly adding custom markers to tests\n for custom_marker in custom_markers:\n for marker in item.iter_markers(name=f\"{custom_marker}_executions\"):\n executions = marker.args[0]\n if not isinstance(executions, list):\n executions = [executions]\n\n current_execution = get_current_execution()\n reason = marker.kwargs.pop(\"reason\", \"\")\n\n item.add_marker(\n getattr(pytest.mark, custom_marker)(\n condition=current_execution in executions,\n reason=f\"Execution {current_execution} does not pass this test. {reason}\",\n **marker.kwargs,\n )\n )\n\n\n_doc_pytest_fixture = \"\"\"\nPytest fixture factory that makes temp {file_type} files for testing.\n\nYields:\n Function that generates {file_type} files\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestReadCSVFixture_TestReadCSVFixture.teardown_test_files_filen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestReadCSVFixture_TestReadCSVFixture.teardown_test_files_filen", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 379, "end_line": 419, "span_ids": ["TestReadCSVFixture"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture(scope=\"class\")\ndef TestReadCSVFixture():\n filenames = []\n files_ids = [\n \"test_read_csv_regular\",\n \"test_read_csv_blank_lines\",\n \"test_read_csv_yes_no\",\n \"test_read_csv_nans\",\n \"test_read_csv_bad_lines\",\n ]\n # each xdist worker spawned in separate process with separate namespace and dataset\n pytest.csvs_names = {file_id: get_unique_filename() for file_id in files_ids}\n # test_read_csv_col_handling, test_read_csv_parsing\n _make_csv_file(filenames)(\n filename=pytest.csvs_names[\"test_read_csv_regular\"],\n )\n # test_read_csv_parsing\n _make_csv_file(filenames)(\n filename=pytest.csvs_names[\"test_read_csv_yes_no\"],\n additional_col_values=[\"Yes\", \"true\", \"No\", \"false\"],\n )\n # test_read_csv_col_handling\n _make_csv_file(filenames)(\n filename=pytest.csvs_names[\"test_read_csv_blank_lines\"],\n add_blank_lines=True,\n )\n # test_read_csv_nans_handling\n _make_csv_file(filenames)(\n filename=pytest.csvs_names[\"test_read_csv_nans\"],\n add_blank_lines=True,\n additional_col_values=[\"\", \"N/A\", \"NA\", \"NULL\", \"custom_nan\", \"73\"],\n )\n # test_read_csv_error_handling\n _make_csv_file(filenames)(\n filename=pytest.csvs_names[\"test_read_csv_bad_lines\"],\n add_bad_lines=True,\n )\n\n yield\n # Delete csv files that were created\n teardown_test_files(filenames)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_csv_file_for_file_type_in_json_.globals_fixture___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_csv_file_for_file_type_in_json_.globals_fixture___name_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 422, "end_line": 446, "span_ids": ["make_csv_file", "impl:19", "create_fixture"], "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.fixture\n@doc(_doc_pytest_fixture, file_type=\"csv\")\ndef make_csv_file():\n filenames = []\n\n yield _make_csv_file(filenames)\n\n # Delete csv files that were created\n teardown_test_files(filenames)\n\n\ndef create_fixture(file_type):\n @doc(_doc_pytest_fixture, file_type=file_type)\n def fixture():\n func, filenames = make_default_file(file_type=file_type)\n yield func\n teardown_test_files(filenames)\n\n return fixture\n\n\nfor file_type in (\"json\", \"html\", \"excel\", \"feather\", \"stata\", \"hdf\", \"pickle\", \"fwf\"):\n fixture = create_fixture(file_type)\n fixture.__name__ = f\"make_{file_type}_file\"\n globals()[fixture.__name__] = pytest.fixture(fixture)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_parquet_file_make_parquet_file.for_path_in_filenames_.if_os_path_exists_path_.if_os_path_isdir_path_.else_.os_remove_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_parquet_file_make_parquet_file.for_path_in_filenames_.if_os_path_exists_path_.if_os_path_isdir_path_.else_.os_remove_path_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 499, "span_ids": ["make_parquet_file"], "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": "@pytest.fixture\ndef make_parquet_file():\n \"\"\"Pytest fixture factory that makes a parquet file/dir for testing.\n\n Yields:\n Function that generates a parquet file/dir\n \"\"\"\n filenames = []\n\n def _make_parquet_file(\n filename,\n nrows=NROWS,\n ncols=2,\n force=True,\n partitioned_columns=[],\n row_group_size: Optional[int] = None,\n ):\n \"\"\"Helper function to generate parquet files/directories.\n\n Args:\n filename: The name of test file, that should be created.\n nrows: Number of rows for the dataframe.\n ncols: Number of cols for the dataframe.\n force: Create a new file/directory even if one already exists.\n partitioned_columns: Create a partitioned directory using pandas.\n row_group_size: Maximum size of each row group.\n \"\"\"\n if force or not os.path.exists(filename):\n df = pandas.DataFrame(\n {f\"col{x + 1}\": np.arange(nrows) for x in range(ncols)}\n )\n if len(partitioned_columns) > 0:\n df.to_parquet(\n filename,\n partition_cols=partitioned_columns,\n row_group_size=row_group_size,\n )\n else:\n df.to_parquet(filename, row_group_size=row_group_size)\n filenames.append(filename)\n\n # Return function that generates parquet files\n yield _make_parquet_file\n\n # Delete parquet file that was created\n for path in filenames:\n if os.path.exists(path):\n if os.path.isdir(path):\n shutil.rmtree(path)\n else:\n os.remove(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_sql_connection_make_sql_connection.yield__sql_connection": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_make_sql_connection_make_sql_connection.yield__sql_connection", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 502, "end_line": 529, "span_ids": ["make_sql_connection"], "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.fixture\ndef make_sql_connection():\n \"\"\"Sets up sql connections and takes them down after the caller is done.\n\n Yields:\n Factory that generates sql connection objects\n \"\"\"\n\n def _sql_connection(filename, table=\"\"):\n # Remove file if exists\n if os.path.exists(filename):\n os.remove(filename)\n # Create connection and, if needed, table\n conn = \"sqlite:///{}\".format(filename)\n if table:\n df = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3, 4, 5, 6],\n \"col2\": [7, 8, 9, 10, 11, 12, 13],\n \"col3\": [14, 15, 16, 17, 18, 19, 20],\n \"col4\": [21, 22, 23, 24, 25, 26, 27],\n \"col5\": [0, 0, 0, 0, 0, 0, 0],\n }\n )\n df.to_sql(table, conn)\n return conn\n\n yield _sql_connection", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestReadGlobCSVFixture_TestReadGlobCSVFixture.teardown_test_files_filen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_TestReadGlobCSVFixture_TestReadGlobCSVFixture.teardown_test_files_filen", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 532, "end_line": 545, "span_ids": ["TestReadGlobCSVFixture"], "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.fixture(scope=\"class\")\ndef TestReadGlobCSVFixture():\n filenames = []\n\n base_name = get_unique_filename(extension=\"\")\n pytest.glob_path = \"{}_*.csv\".format(base_name)\n pytest.files = [\"{}_{}.csv\".format(base_name, i) for i in range(11)]\n for fname in pytest.files:\n # Glob does not guarantee ordering so we have to remove the randomness in the generated csvs.\n _make_csv_file(filenames)(fname, row_size=11, remove_randomness=True)\n\n yield\n\n teardown_test_files(filenames)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_get_generated_doc_urls_ray_client_server.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_get_generated_doc_urls_ray_client_server.None", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 548, "end_line": 577, "span_ids": ["set_num_partitions", "set_min_partition_size", "impl:25", "set_async_read_mode", "get_generated_doc_urls"], "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": "@pytest.fixture\ndef get_generated_doc_urls():\n return lambda: _generated_doc_urls\n\n\n@pytest.fixture\ndef set_num_partitions(request):\n old_num_partitions = NPartitions.get()\n NPartitions.put(request.param)\n yield\n NPartitions.put(old_num_partitions)\n\n\n@pytest.fixture\ndef set_async_read_mode(request):\n old_async_read_mode = AsyncReadMode.get()\n AsyncReadMode.put(request.param)\n yield\n AsyncReadMode.put(old_async_read_mode)\n\n\n@pytest.fixture\ndef set_min_partition_size(request):\n old_min_partition_size = MinPartitionSize.get()\n MinPartitionSize.put(request.param)\n yield\n MinPartitionSize.put(old_min_partition_size)\n\n\nray_client_server = 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_modin-project__modin/modin/conftest.py_pytest_sessionstart_pytest_sessionfinish.if_TestRayClient_get_.if_ray_client_server_.ray_client_server_stop_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_pytest_sessionstart_pytest_sessionfinish.if_TestRayClient_get_.if_ray_client_server_.ray_client_server_stop_0_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 580, "end_line": 602, "span_ids": ["pytest_sessionstart", "pytest_sessionfinish"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pytest_sessionstart(session):\n if TestRayClient.get():\n import ray\n import ray.util.client.server.server as ray_server\n\n addr = \"localhost:50051\"\n global ray_client_server\n ray_client_server = ray_server.serve(addr)\n env_vars = {\n \"AWS_ACCESS_KEY_ID\": CIAWSAccessKeyID.get(),\n \"AWS_SECRET_ACCESS_KEY\": CIAWSSecretAccessKey.get(),\n }\n extra_init_kw = {\"runtime_env\": {\"env_vars\": env_vars}}\n ray.util.connect(addr, ray_init_kwargs=extra_init_kw)\n\n\ndef pytest_sessionfinish(session, exitstatus):\n if TestRayClient.get():\n import ray\n\n ray.util.disconnect()\n if ray_client_server:\n ray_client_server.stop(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_modin-project__modin/modin/conftest.py_s3_storage_options_s3_storage_options.return._client_kwargs_endpo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_storage_options_s3_storage_options.return._client_kwargs_endpo", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 605, "end_line": 620, "span_ids": ["s3_storage_options"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef s3_storage_options(worker_id):\n # # copied from pandas conftest.py:\n # https://github.com/pandas-dev/pandas/blob/32f789fbc5d5a72d9d1ac14935635289eeac9009/pandas/tests/io/conftest.py#L45\n # worker_id is a pytest fixture\n if GithubCI.get():\n url = \"http://localhost:5000/\"\n else:\n # If we hit this else-case, this test is being run locally. In that case, we want\n # each worker to point to a different port for its mock S3 service. The easiest way\n # to do that is to use the `worker_id`, which is unique, to determine what port to point\n # to. We arbitrarily assign `5` as a worker id to the master worker, since we need a number\n # for each worker, and we never run tests with more than `pytest -n 4`.\n worker_id = \"5\" if worker_id == \"master\" else worker_id.lstrip(\"gw\")\n url = f\"http://127.0.0.1:555{worker_id}/\"\n return {\"client_kwargs\": {\"endpoint_url\": url}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_base_s3_base.with_pandas__testing_ensu.if_GithubCI_get_.else_.with_subprocess_Popen_.proc_terminate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_base_s3_base.with_pandas__testing_ensu.if_GithubCI_get_.else_.with_subprocess_Popen_.proc_terminate_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 623, "end_line": 705, "span_ids": ["s3_base"], "tokens": 825}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(scope=\"session\")\ndef s3_base(worker_id):\n \"\"\"\n Fixture for mocking S3 interaction.\n\n Sets up moto server in separate process locally.\n\n Yields\n ------\n str\n URL for motoserver/moto CI service.\n \"\"\"\n # copied from pandas conftest.py\n with pandas._testing.ensure_safe_environment_variables():\n # still need access keys for https://github.com/getmoto/moto/issues/1924\n os.environ.setdefault(\"AWS_ACCESS_KEY_ID\", CIAWSAccessKeyID.get())\n os.environ.setdefault(\"AWS_SECRET_ACCESS_KEY\", CIAWSSecretAccessKey.get())\n os.environ[\"AWS_REGION\"] = \"us-west-2\"\n if GithubCI.get():\n if sys.platform in (\"darwin\", \"win32\", \"cygwin\") or (\n platform.machine() in (\"arm64\", \"aarch64\")\n or platform.machine().startswith(\"armv\")\n ):\n # pandas comments say:\n # DO NOT RUN on Windows/macOS/ARM, only Ubuntu\n # - subprocess in CI can cause timeouts\n # - GitHub Actions do not support\n # container services for the above OSs\n pytest.skip(\n (\n \"S3 tests do not have a corresponding service in Windows, macOS \"\n + \"or ARM platforms\"\n )\n )\n else:\n # assume CI has started moto in docker container:\n # https://docs.getmoto.org/en/latest/docs/server_mode.html#run-using-docker\n # It would be nice to start moto on another thread as in the\n # instructions here:\n # https://docs.getmoto.org/en/latest/docs/server_mode.html#start-within-python\n # but that gives 403 forbidden error when we try to create the bucket\n yield \"http://localhost:5000\"\n else:\n # Launching moto in server mode, i.e., as a separate process\n # with an S3 endpoint on localhost\n\n # If we hit this else-case, this test is being run locally. In that case, we want\n # each worker to point to a different port for its mock S3 service. The easiest way\n # to do that is to use the `worker_id`, which is unique, to determine what port to point\n # to. We arbitrarily assign `5` as a worker id to the master worker, since we need a number\n # for each worker, and we never run tests with more than `pytest -n 4`.\n worker_id = \"5\" if worker_id == \"master\" else worker_id.lstrip(\"gw\")\n endpoint_port = f\"555{worker_id}\"\n endpoint_uri = f\"http://127.0.0.1:{endpoint_port}/\"\n\n # pipe to null to avoid logging in terminal\n # TODO any way to throw the error from here? e.g. i had an annoying problem\n # where I didn't have flask-cors and moto just failed .if there's an error\n # in the popen command and we throw an error within the body of the context\n # manager, the test just hangs forever.\n with subprocess.Popen(\n # try this https://stackoverflow.com/a/72084867/17554722 ?\n shlex.split(f\"moto_server s3 -p {endpoint_port}\"),\n stdout=subprocess.DEVNULL,\n stderr=subprocess.DEVNULL,\n ) as proc:\n made_connection = False\n for _ in range(50):\n try:\n # OK to go once server is accepting connections\n if requests.get(endpoint_uri).ok:\n made_connection = True\n break\n except Exception:\n # try again while we still have retries\n time.sleep(0.1)\n if not made_connection:\n raise RuntimeError(\n \"Could not connect to moto server after 50 tries.\"\n )\n yield endpoint_uri\n\n proc.terminate()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_resource_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/conftest.py_s3_resource_", "embedding": null, "metadata": {"file_path": "modin/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 762, "span_ids": ["s3_resource"], "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": "@pytest.fixture\ndef s3_resource(s3_base):\n \"\"\"\n Set up S3 bucket with contents. The primary bucket name is \"modin-test\".\n\n When running locally, this function should be safe even if there are multiple pytest\n workers running in parallel because each worker gets its own endpoint. When running\n in CI, we use a single endpoint for all workers, so we can't have multiple pytest\n workers running in parallel.\n \"\"\"\n bucket = \"modin-test\"\n conn = boto3.resource(\"s3\", endpoint_url=s3_base)\n cli = boto3.client(\"s3\", endpoint_url=s3_base)\n\n # https://github.com/getmoto/moto/issues/3292\n # without location, I get\n # botocore.exceptions.ClientError: An error occurred\n # (IllegalLocationConstraintException) when calling the CreateBucket operation:\n # The unspecified location constraint is incompatible for the region specific\n # endpoint this request was sent to.\n # even if I delete os.environ['AWS_REGION'] but somehow pandas can get away with\n # this.\n try:\n cli.create_bucket(\n Bucket=bucket, CreateBucketConfiguration={\"LocationConstraint\": \"us-west-2\"}\n )\n except Exception as e:\n # OK if bucket already exists, but want to raise other exceptions.\n # The exception raised by `create_bucket` is made using a factory,\n # so we need to check using this method of reading the response rather\n # than just checking the type of the exception.\n response = getattr(e, \"response\", {})\n error_code = response.get(\"Error\", {}).get(\"Code\", \"\")\n if error_code not in (\"BucketAlreadyOwnedByYou\", \"BucketAlreadyExists\"):\n raise\n for _ in range(20):\n # We want to wait until bucket creation is finished.\n if cli.list_buckets()[\"Buckets\"]:\n break\n time.sleep(0.1)\n if not cli.list_buckets()[\"Buckets\"]:\n raise RuntimeError(\"Could not create bucket\")\n\n s3fs.S3FileSystem.clear_instance_cache()\n yield conn\n\n s3 = s3fs.S3FileSystem(client_kwargs={\"endpoint_url\": s3_base})\n\n s3.rm(bucket, recursive=True)\n for _ in range(20):\n # We want to wait until the deletion finishes.\n if not cli.list_buckets()[\"Buckets\"]:\n break\n time.sleep(0.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_modin-project__modin/modin/core/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/algebra/__init__.py_Operator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/__init__.py_Operator_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 33, "span_ids": ["docstring"], "tokens": 84}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .operator import Operator\nfrom .map import Map\nfrom .tree_reduce import TreeReduce\nfrom .reduce import Reduce\nfrom .fold import Fold\nfrom .binary import Binary\nfrom .groupby import GroupByReduce\n\n__all__ = [\n \"Operator\",\n \"Map\",\n \"TreeReduce\",\n \"Reduce\",\n \"Fold\",\n \"Binary\",\n \"GroupByReduce\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_np_coerce_int_to_float64.if_dtype_in_np_sctypes_i.else_.return.dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_np_coerce_int_to_float64.if_dtype_in_np_sctypes_i.else_.return.dtype", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 50, "span_ids": ["coerce_int_to_float64", "docstring"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pandas\nfrom pandas.api.types import is_scalar, is_bool_dtype\nfrom typing import Optional\n\nfrom .operator import Operator\nfrom modin.error_message import ErrorMessage\n\n\ndef coerce_int_to_float64(dtype: np.dtype) -> np.dtype:\n \"\"\"\n Coerce dtype to float64 if it is a variant of integer.\n\n If dtype is integer, function returns float64 datatype.\n If not, returns the datatype argument itself.\n\n Parameters\n ----------\n dtype : np.dtype\n NumPy datatype.\n\n Returns\n -------\n dtype : np.dtype\n Returns float64 for all int datatypes or returns the datatype itself\n for other types.\n\n Notes\n -----\n Used to precompute datatype in case of division in pandas.\n \"\"\"\n if dtype in np.sctypes[\"int\"] + np.sctypes[\"uint\"]:\n return np.dtype(np.float64)\n else:\n return dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_maybe_compute_dtypes_common_cast_maybe_compute_dtypes_common_cast.return.dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_maybe_compute_dtypes_common_cast_maybe_compute_dtypes_common_cast.return.dtypes", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 160, "span_ids": ["maybe_compute_dtypes_common_cast"], "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": "def maybe_compute_dtypes_common_cast(\n first, second, trigger_computations=False, axis=0\n) -> Optional[pandas.Series]:\n \"\"\"\n Precompute data types for binary operations by finding common type between operands.\n\n Parameters\n ----------\n first : PandasQueryCompiler\n First operand for which the binary operation would be performed later.\n second : PandasQueryCompiler, list-like or scalar\n Second operand for which the binary operation would be performed later.\n trigger_computations : bool, default: False\n Whether to trigger computation of the lazy metadata for `first` and `second`.\n If False is specified this method will return None if any of the operands doesn't\n have materialized dtypes.\n axis : int, default: 0\n Axis to perform the binary operation along.\n\n Returns\n -------\n pandas.Series\n The pandas series with precomputed dtypes or None if there's not enough metadata to compute it.\n\n Notes\n -----\n The dtypes of the operands are supposed to be known.\n \"\"\"\n if not trigger_computations:\n if not first._modin_frame.has_materialized_dtypes:\n return None\n\n if (\n isinstance(second, type(first))\n and not second._modin_frame.has_materialized_dtypes\n ):\n return None\n\n dtypes_first = first._modin_frame.dtypes.to_dict()\n if isinstance(second, type(first)):\n dtypes_second = second._modin_frame.dtypes.to_dict()\n columns_first = set(first.columns)\n columns_second = set(second.columns)\n common_columns = columns_first.intersection(columns_second)\n # Here we want to XOR the sets in order to find the columns that do not\n # belong to the intersection, these will be NaN columns in the result\n mismatch_columns = columns_first ^ columns_second\n elif isinstance(second, dict):\n dtypes_second = {key: type(value) for key, value in second.items()}\n columns_first = set(first.columns)\n columns_second = set(second.keys())\n common_columns = columns_first.intersection(columns_second)\n # Here we want to find the difference between the sets in order to find columns\n # that are missing in the dictionary, this will be NaN columns in the result\n mismatch_columns = columns_first.difference(columns_second)\n else:\n if isinstance(second, (list, tuple)):\n second_dtypes_list = (\n [type(value) for value in second]\n if axis == 1\n # Here we've been given a column so it has only one dtype,\n # Infering the dtype using `np.array`, TODO: maybe there's more efficient way?\n else [np.array(second).dtype] * len(dtypes_first)\n )\n elif is_scalar(second) or isinstance(second, np.ndarray):\n second_dtypes_list = [getattr(second, \"dtype\", type(second))] * len(\n dtypes_first\n )\n else:\n raise NotImplementedError(\n f\"Can't compute common type for {type(first)} and {type(second)}.\"\n )\n # We verify operands shapes at the front-end, invalid operands shouldn't be\n # propagated to the query compiler level\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=len(second_dtypes_list) != len(dtypes_first),\n extra_log=\"Shapes of the operands of a binary operation don't match\",\n )\n dtypes_second = {\n key: second_dtypes_list[idx] for idx, key in enumerate(dtypes_first.keys())\n }\n common_columns = first.columns\n mismatch_columns = []\n\n # If at least one column doesn't match, the result of the non matching column would be nan.\n nan_dtype = np.dtype(type(np.nan))\n dtypes = pandas.Series(\n [\n pandas.core.dtypes.cast.find_common_type(\n [\n dtypes_first[x],\n dtypes_second[x],\n ]\n )\n for x in common_columns\n ],\n index=common_columns,\n )\n dtypes = pandas.concat(\n [\n dtypes,\n pandas.Series(\n [nan_dtype] * (len(mismatch_columns)),\n index=mismatch_columns,\n ),\n ]\n )\n return dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_maybe_build_dtypes_series_maybe_build_dtypes_series.return.dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_maybe_build_dtypes_series_maybe_build_dtypes_series.return.dtypes", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 209, "span_ids": ["maybe_build_dtypes_series"], "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": "def maybe_build_dtypes_series(\n first, second, dtype, trigger_computations=False\n) -> Optional[pandas.Series]:\n \"\"\"\n Build a ``pandas.Series`` describing dtypes of the result of a binary operation.\n\n Parameters\n ----------\n first : PandasQueryCompiler\n First operand for which the binary operation would be performed later.\n second : PandasQueryCompiler, list-like or scalar\n Second operand for which the binary operation would be performed later.\n dtype : np.dtype\n Dtype of the result.\n trigger_computations : bool, default: False\n Whether to trigger computation of the lazy metadata for `first` and `second`.\n If False is specified this method will return None if any of the operands doesn't\n have materialized columns.\n\n Returns\n -------\n pandas.Series or None\n The pandas series with precomputed dtypes or None if there's not enough metadata to compute it.\n\n Notes\n -----\n Finds a union of columns and finds dtypes for all these columns.\n \"\"\"\n if not trigger_computations:\n if not first._modin_frame.has_columns_cache:\n return None\n\n if (\n isinstance(second, type(first))\n and not second._modin_frame.has_columns_cache\n ):\n return None\n\n columns_first = set(first.columns)\n if isinstance(second, type(first)):\n columns_second = set(second.columns)\n columns_union = columns_first.union(columns_second)\n else:\n columns_union = columns_first\n\n dtypes = pandas.Series([dtype] * len(columns_union), index=columns_union)\n return dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_try_compute_new_dtypes_try_compute_new_dtypes.return.dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_try_compute_new_dtypes_try_compute_new_dtypes.return.dtypes", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 258, "span_ids": ["try_compute_new_dtypes"], "tokens": 459}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_compute_new_dtypes(first, second, infer_dtypes=None, result_dtype=None, axis=0):\n \"\"\"\n Precompute resulting dtypes of the binary operation if possible.\n\n The dtypes won't be precomputed if any of the operands doesn't have their dtypes materialized\n or if the second operand type is not supported. Supported types: PandasQueryCompiler, list,\n dict, tuple, np.ndarray.\n\n Parameters\n ----------\n first : PandasQueryCompiler\n First operand of the binary operation.\n second : PandasQueryCompiler, list-like or scalar\n Second operand of the binary operation.\n infer_dtypes : {\"common_cast\", \"float\", \"bool\", None}, default: None\n How dtypes should be infered (see ``Binary.register`` doc for more info).\n result_dtype : np.dtype, optional\n NumPy dtype of the result. If not specified it will be inferred from the `infer_dtypes` parameter.\n axis : int, default: 0\n Axis to perform the binary operation along.\n\n Returns\n -------\n pandas.Series or None\n \"\"\"\n if infer_dtypes is None and result_dtype is None:\n return None\n\n try:\n if infer_dtypes == \"bool\" or is_bool_dtype(result_dtype):\n dtypes = maybe_build_dtypes_series(first, second, dtype=np.dtype(bool))\n elif infer_dtypes == \"common_cast\":\n dtypes = maybe_compute_dtypes_common_cast(first, second, axis=axis)\n elif infer_dtypes == \"float\":\n dtypes = maybe_compute_dtypes_common_cast(first, second, axis=axis)\n if dtypes is not None:\n dtypes = dtypes.apply(coerce_int_to_float64)\n else:\n # For now we only know how to handle `result_dtype == bool` as that's\n # the only value that is being passed here right now, it's unclear\n # how we should behave in case of an arbitrary dtype, so let's wait\n # for at least one case to appear for this regard.\n dtypes = None\n except NotImplementedError:\n dtypes = None\n\n return dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary_Binary.register._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary_Binary.register._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 297, "span_ids": ["Binary", "Binary.register"], "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 Binary(Operator):\n \"\"\"Builder class for Binary operator.\"\"\"\n\n @classmethod\n def register(\n cls,\n func,\n join_type=\"outer\",\n labels=\"replace\",\n infer_dtypes=None,\n ):\n \"\"\"\n Build template binary operator.\n\n Parameters\n ----------\n func : callable(pandas.DataFrame, [pandas.DataFrame, list-like, scalar]) -> pandas.DataFrame\n Binary function to execute. Have to be able to accept at least two arguments.\n join_type : {'left', 'right', 'outer', 'inner', None}, default: 'outer'\n Type of join that will be used if indices of operands are not aligned.\n labels : {\"keep\", \"replace\", \"drop\"}, default: \"replace\"\n Whether keep labels from left Modin DataFrame, replace them with labels\n from joined DataFrame or drop altogether to make them be computed lazily later.\n infer_dtypes : {\"common_cast\", \"float\", \"bool\", None}, default: None\n How dtypes should be inferred.\n * If \"common_cast\", casts to common dtype of operand columns.\n * If \"float\", performs type casting by finding common dtype.\n If the common dtype is any of the integer types, perform type casting to float.\n Used in case of truediv.\n * If \"bool\", dtypes would be a boolean series with same size as that of operands.\n * If ``None``, do not infer new dtypes (they will be computed manually once accessed).\n\n Returns\n -------\n callable\n Function that takes query compiler and executes binary operation.\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_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary.register.caller_Binary.register.caller.shape_hint.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary.register.caller_Binary.register.caller.shape_hint.None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 343, "span_ids": ["Binary.register"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Binary(Operator):\n\n @classmethod\n def register(\n cls,\n func,\n join_type=\"outer\",\n labels=\"replace\",\n infer_dtypes=None,\n ):\n\n def caller(\n query_compiler, other, broadcast=False, *args, dtypes=None, **kwargs\n ):\n \"\"\"\n Apply binary `func` to passed operands.\n\n Parameters\n ----------\n query_compiler : QueryCompiler\n Left operand of `func`.\n other : QueryCompiler, list-like object or scalar\n Right operand of `func`.\n broadcast : bool, default: False\n If `other` is a one-column query compiler, indicates whether it is a Series or not.\n Frames and Series have to be processed differently, however we can't distinguish them\n at the query compiler level, so this parameter is a hint that passed from a high level API.\n *args : args,\n Arguments that will be passed to `func`.\n dtypes : \"copy\", scalar dtype or None, default: None\n Dtypes of the result. \"copy\" to keep old dtypes and None to compute them on demand.\n **kwargs : kwargs,\n Arguments that will be passed to `func`.\n\n Returns\n -------\n QueryCompiler\n Result of binary function.\n \"\"\"\n axis = kwargs.get(\"axis\", 0)\n if isinstance(other, type(query_compiler)) and broadcast:\n assert (\n len(other.columns) == 1\n ), \"Invalid broadcast argument for `broadcast_apply`, too many columns: {}\".format(\n len(other.columns)\n )\n # Transpose on `axis=1` because we always represent an individual\n # column or row as a single-column Modin DataFrame\n if axis == 1:\n other = other.transpose()\n if dtypes != \"copy\":\n dtypes = try_compute_new_dtypes(\n query_compiler, other, infer_dtypes, dtypes, axis\n )\n\n shape_hint = None\n # ... other code\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_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary.register.caller.None_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/binary.py_Binary.register.caller.None_2_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 344, "end_line": 416, "span_ids": ["Binary.register"], "tokens": 600}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Binary(Operator):\n\n @classmethod\n def register(\n cls,\n func,\n join_type=\"outer\",\n labels=\"replace\",\n infer_dtypes=None,\n ):\n\n def caller(\n query_compiler, other, broadcast=False, *args, dtypes=None, **kwargs\n ):\n # ... other code\n if isinstance(other, type(query_compiler)):\n if broadcast:\n if (\n query_compiler._modin_frame.has_materialized_columns\n and other._modin_frame.has_materialized_columns\n ):\n if (\n len(query_compiler.columns) == 1\n and len(other.columns) == 1\n and query_compiler.columns.equals(other.columns)\n ):\n shape_hint = \"column\"\n return query_compiler.__constructor__(\n query_compiler._modin_frame.broadcast_apply(\n axis,\n lambda left, right: func(\n left, right.squeeze(), *args, **kwargs\n ),\n other._modin_frame,\n join_type=join_type,\n labels=labels,\n dtypes=dtypes,\n ),\n shape_hint=shape_hint,\n )\n else:\n if (\n query_compiler._modin_frame.has_materialized_columns\n and other._modin_frame.has_materialized_columns\n ):\n if (\n len(query_compiler.columns) == 1\n and len(other.columns) == 1\n and query_compiler.columns.equals(other.columns)\n ):\n shape_hint = \"column\"\n return query_compiler.__constructor__(\n query_compiler._modin_frame.n_ary_op(\n lambda x, y: func(x, y, *args, **kwargs),\n [other._modin_frame],\n join_type=join_type,\n dtypes=dtypes,\n ),\n shape_hint=shape_hint,\n )\n else:\n # TODO: it's possible to chunk the `other` and broadcast them to partitions\n # accordingly, in that way we will be able to use more efficient `._modin_frame.map()`\n if isinstance(other, (dict, list, np.ndarray, pandas.Series)):\n new_modin_frame = query_compiler._modin_frame.apply_full_axis(\n axis,\n lambda df: func(df, other, *args, **kwargs),\n new_index=query_compiler.index,\n new_columns=query_compiler.columns,\n dtypes=dtypes,\n )\n else:\n if (\n query_compiler._modin_frame.has_materialized_columns\n and len(query_compiler._modin_frame.columns) == 1\n and is_scalar(other)\n ):\n shape_hint = \"column\"\n new_modin_frame = query_compiler._modin_frame.map(\n lambda df: func(df, other, *args, **kwargs),\n dtypes=dtypes,\n )\n return query_compiler.__constructor__(\n new_modin_frame, shape_hint=shape_hint\n )\n\n return caller", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/__init__.py_DataFrameDefault_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/__init__.py_DataFrameDefault_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 41, "span_ids": ["docstring"], "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 .dataframe import DataFrameDefault\nfrom .datetime import DateTimeDefault\nfrom .series import SeriesDefault\nfrom .str import StrDefault\nfrom .binary import BinaryDefault\nfrom .resample import ResampleDefault\nfrom .rolling import RollingDefault, ExpandingDefault\nfrom .default import DefaultMethod\nfrom .cat import CatDefault\nfrom .groupby import GroupByDefault, SeriesGroupByDefault\n\n__all__ = [\n \"DataFrameDefault\",\n \"DateTimeDefault\",\n \"SeriesDefault\",\n \"StrDefault\",\n \"BinaryDefault\",\n \"ResampleDefault\",\n \"RollingDefault\",\n \"ExpandingDefault\",\n \"DefaultMethod\",\n \"CatDefault\",\n \"GroupByDefault\",\n \"SeriesGroupByDefault\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/binary.py_DefaultMethod_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/binary.py_DefaultMethod_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/binary.py", "file_name": "binary.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 67, "span_ids": ["BinaryDefault", "BinaryDefault.build_default_to_pandas", "docstring"], "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": "from .default import DefaultMethod\n\nimport pandas\nfrom pandas.core.dtypes.common import is_list_like\n\n\nclass BinaryDefault(DefaultMethod):\n \"\"\"Build default-to-pandas methods which executes binary functions.\"\"\"\n\n @classmethod\n def build_default_to_pandas(cls, fn, fn_name):\n \"\"\"\n Build function that do fallback to pandas for passed binary `fn`.\n\n Parameters\n ----------\n fn : callable\n Binary function to apply to the casted to pandas frame and other operand.\n fn_name : str\n Function name which will be shown in default-to-pandas warning message.\n\n Returns\n -------\n callable\n Function that takes query compiler, does fallback to pandas and applies binary `fn`\n to the casted to pandas frame.\n \"\"\"\n\n def bin_ops_wrapper(df, other, *args, **kwargs):\n \"\"\"Apply specified binary function to the passed operands.\"\"\"\n squeeze_other = kwargs.pop(\"broadcast\", False) or kwargs.pop(\n \"squeeze_other\", False\n )\n squeeze_self = kwargs.pop(\"squeeze_self\", False)\n\n if squeeze_other:\n other = other.squeeze(axis=1)\n\n if squeeze_self:\n df = df.squeeze(axis=1)\n\n result = fn(df, other, *args, **kwargs)\n if (\n not isinstance(result, pandas.Series)\n and not isinstance(result, pandas.DataFrame)\n and is_list_like(result)\n ):\n result = pandas.DataFrame(result)\n return result\n\n return super().build_default_to_pandas(bin_ops_wrapper, fn_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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/cat.py_SeriesDefault_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/cat.py_SeriesDefault_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/cat.py", "file_name": "cat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 36, "span_ids": ["CatDefault", "CatDefault.frame_wrapper", "docstring"], "tokens": 91}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .series import SeriesDefault\n\n\nclass CatDefault(SeriesDefault):\n \"\"\"Builder for default-to-pandas methods which is executed under category accessor.\"\"\"\n\n @classmethod\n def frame_wrapper(cls, df):\n \"\"\"\n Get category accessor of the passed frame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n\n Returns\n -------\n pandas.core.arrays.categorical.CategoricalAccessor\n \"\"\"\n return df.squeeze(axis=1).cat", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/dataframe.py_DefaultMethod_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/dataframe.py_DefaultMethod_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 25, "span_ids": ["DataFrameDefault", "docstring"], "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 .default import DefaultMethod\nfrom modin.utils import _inherit_docstrings\n\nimport pandas\n\n\n@_inherit_docstrings(DefaultMethod)\nclass DataFrameDefault(DefaultMethod):\n DEFAULT_OBJECT_TYPE = pandas.DataFrame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/datetime.py_SeriesDefault_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/datetime.py_SeriesDefault_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/datetime.py", "file_name": "datetime.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 36, "span_ids": ["DateTimeDefault.frame_wrapper", "DateTimeDefault", "docstring"], "tokens": 91}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .series import SeriesDefault\n\n\nclass DateTimeDefault(SeriesDefault):\n \"\"\"Builder for default-to-pandas methods which is executed under datetime accessor.\"\"\"\n\n @classmethod\n def frame_wrapper(cls, df):\n \"\"\"\n Get datetime accessor of the passed frame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n\n Returns\n -------\n pandas.core.indexes.accessors.DatetimeProperties\n \"\"\"\n return df.squeeze(axis=1).dt", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_from_modin_core_dataframe_ObjTypeDeterminer.__getattr__.return.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_from_modin_core_dataframe_ObjTypeDeterminer.__getattr__.return.func", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 53, "span_ids": ["ObjTypeDeterminer.__getattr__", "ObjTypeDeterminer", "docstring"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.dataframe.algebra import Operator\nfrom modin.utils import try_cast_to_pandas, MODIN_UNNAMED_SERIES_LABEL\n\nfrom pandas.core.dtypes.common import is_list_like\nimport pandas\n\n\nclass ObjTypeDeterminer:\n \"\"\"\n Class that routes work to the frame.\n\n Provides an instance which forwards all of the `__getattribute__` calls\n to an object under which `key` function is applied.\n \"\"\"\n\n def __getattr__(self, key):\n \"\"\"\n Build function that executes `key` function over passed frame.\n\n Parameters\n ----------\n key : str\n\n Returns\n -------\n callable\n Function that takes DataFrame and executes `key` function on it.\n \"\"\"\n\n def func(df, *args, **kwargs):\n \"\"\"Access specified attribute of the passed object and call it if it's callable.\"\"\"\n prop = getattr(df, key)\n if callable(prop):\n return prop(*args, **kwargs)\n else:\n return prop\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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod_DefaultMethod.register.if_type_fn_property_.fn.cls_build_property_wrappe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod_DefaultMethod.register.if_type_fn_property_.fn.cls_build_property_wrappe", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 107, "span_ids": ["DefaultMethod", "DefaultMethod.register"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DefaultMethod(Operator):\n \"\"\"\n Builder for default-to-pandas methods.\n\n Attributes\n ----------\n OBJECT_TYPE : str\n Object type name that will be shown in default-to-pandas warning message.\n DEFAULT_OBJECT_TYPE : object\n Default place to search for a function.\n \"\"\"\n\n OBJECT_TYPE = \"DataFrame\"\n DEFAULT_OBJECT_TYPE = ObjTypeDeterminer\n\n @classmethod\n def register(cls, func, obj_type=None, inplace=None, fn_name=None):\n \"\"\"\n Build function that do fallback to default pandas implementation for passed `func`.\n\n Parameters\n ----------\n func : callable or str,\n Function to apply to the casted to pandas frame or its property accesed\n by ``cls.frame_wrapper``.\n obj_type : object, optional\n If `func` is a string with a function name then `obj_type` provides an\n object to search function in.\n inplace : bool, optional\n If True return an object to which `func` was applied, otherwise return\n the result of `func`.\n fn_name : str, optional\n Function name which will be shown in default-to-pandas warning message.\n If not specified, name will be deducted from `func`.\n\n Returns\n -------\n callable\n Function that takes query compiler, does fallback to pandas and applies `func`\n to the casted to pandas frame or its property accesed by ``cls.frame_wrapper``.\n \"\"\"\n fn_name = getattr(func, \"__name__\", str(func)) if fn_name is None else fn_name\n\n if isinstance(func, str):\n if obj_type is None:\n obj_type = cls.DEFAULT_OBJECT_TYPE\n fn = getattr(obj_type, func)\n else:\n fn = func\n\n if type(fn) == property:\n fn = cls.build_property_wrapper(fn)\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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.register.applyier_DefaultMethod.register.return.cls_build_wrapper_applyie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.register.applyier_DefaultMethod.register.return.cls_build_wrapper_applyie", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 165, "span_ids": ["DefaultMethod.register"], "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 DefaultMethod(Operator):\n\n @classmethod\n def register(cls, func, obj_type=None, inplace=None, fn_name=None):\n # ... other code\n\n def applyier(df, *args, **kwargs):\n \"\"\"\n Apply target function to the casted to pandas frame.\n\n This function is directly applied to the casted to pandas frame, executes target\n function under it and processes result so it is possible to create a valid\n query compiler from it.\n \"\"\"\n # pandas default implementation doesn't know how to handle `dtypes` keyword argument\n kwargs.pop(\"dtypes\", None)\n df = cls.frame_wrapper(df)\n result = fn(df, *args, **kwargs)\n\n if (\n not isinstance(result, pandas.Series)\n and not isinstance(result, pandas.DataFrame)\n and func not in (\"to_numpy\", pandas.DataFrame.to_numpy)\n and func not in (\"align\", pandas.DataFrame.align)\n and func not in (\"divmod\", pandas.Series.divmod)\n and func not in (\"rdivmod\", pandas.Series.rdivmod)\n and func not in (\"to_list\", pandas.Series.to_list)\n and func not in (\"to_dict\", pandas.Series.to_dict)\n and func not in (\"mean\", pandas.DataFrame.mean)\n and func not in (\"median\", pandas.DataFrame.median)\n and func not in (\"skew\", pandas.DataFrame.skew)\n and func not in (\"kurt\", pandas.DataFrame.kurt)\n ):\n # When applying a DatetimeProperties or TimedeltaProperties function,\n # if we don't specify the dtype for the DataFrame, the frame might\n # get the wrong dtype, e.g. for to_pydatetime in\n # https://github.com/modin-project/modin/issues/4436\n astype_kwargs = {}\n dtype = getattr(result, \"dtype\", None)\n if dtype and isinstance(\n df,\n (\n pandas.core.indexes.accessors.DatetimeProperties,\n pandas.core.indexes.accessors.TimedeltaProperties,\n ),\n ):\n astype_kwargs[\"dtype\"] = dtype\n result = (\n pandas.DataFrame(result, **astype_kwargs)\n if is_list_like(result)\n else pandas.DataFrame([result], **astype_kwargs)\n )\n if isinstance(result, pandas.Series):\n if result.name is None:\n result.name = MODIN_UNNAMED_SERIES_LABEL\n result = result.to_frame()\n\n inplace_method = kwargs.get(\"inplace\", False)\n if inplace is not None:\n inplace_method = inplace\n return result if not inplace_method else df\n\n return cls.build_wrapper(applyier, fn_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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.build_wrapper_DefaultMethod.build_wrapper.return.args_cast": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.build_wrapper_DefaultMethod.build_wrapper.return.args_cast", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 201, "span_ids": ["DefaultMethod.build_wrapper"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DefaultMethod(Operator):\n\n @classmethod\n # FIXME: this method is almost a duplicate of `cls.build_default_to_pandas`.\n # Those two methods should be merged into a single one.\n def build_wrapper(cls, fn, fn_name):\n \"\"\"\n Build function that do fallback to pandas for passed `fn`.\n\n In comparison with ``cls.build_default_to_pandas`` this method also\n casts function arguments to pandas before doing fallback.\n\n Parameters\n ----------\n fn : callable\n Function to apply to the defaulted frame.\n fn_name : str\n Function name which will be shown in default-to-pandas warning message.\n\n Returns\n -------\n callable\n Method that does fallback to pandas and applies `fn` to the pandas frame.\n \"\"\"\n wrapper = cls.build_default_to_pandas(fn, fn_name)\n\n def args_cast(self, *args, **kwargs):\n \"\"\"\n Preprocess `default_to_pandas` function arguments and apply default function.\n\n Cast all Modin objects that function arguments contain to its pandas representation.\n \"\"\"\n args = try_cast_to_pandas(args)\n kwargs = try_cast_to_pandas(kwargs)\n return wrapper(self, *args, **kwargs)\n\n return args_cast", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.build_property_wrapper_DefaultMethod.build_default_to_pandas.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.build_property_wrapper_DefaultMethod.build_default_to_pandas.return.wrapper", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 203, "end_line": 248, "span_ids": ["DefaultMethod.build_default_to_pandas", "DefaultMethod.build_property_wrapper"], "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 DefaultMethod(Operator):\n\n @classmethod\n def build_property_wrapper(cls, prop):\n \"\"\"\n Build function that accesses specified property of the frame.\n\n Parameters\n ----------\n prop : str\n Property name to access.\n\n Returns\n -------\n callable\n Function that takes DataFrame and returns its value of `prop` property.\n \"\"\"\n\n def property_wrapper(df):\n \"\"\"Get specified property of the passed object.\"\"\"\n return prop.fget(df)\n\n return property_wrapper\n\n @classmethod\n def build_default_to_pandas(cls, fn, fn_name):\n \"\"\"\n Build function that do fallback to pandas for passed `fn`.\n\n Parameters\n ----------\n fn : callable\n Function to apply to the defaulted frame.\n fn_name : str\n Function name which will be shown in default-to-pandas warning message.\n\n Returns\n -------\n callable\n Method that does fallback to pandas and applies `fn` to the pandas frame.\n \"\"\"\n fn.__name__ = f\"\"\n\n def wrapper(self, *args, **kwargs):\n \"\"\"Do fallback to pandas for the specified function.\"\"\"\n return self.default_to_pandas(fn, *args, **kwargs)\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.frame_wrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/default.py_DefaultMethod.frame_wrapper_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 250, "end_line": 272, "span_ids": ["DefaultMethod.frame_wrapper"], "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 DefaultMethod(Operator):\n\n @classmethod\n def frame_wrapper(cls, df):\n \"\"\"\n Extract frame property to apply function on.\n\n This method is executed under casted to pandas frame right before applying\n a function passed to `register`, which gives an ability to transform frame somehow\n or access its properties, by overriding this method in a child class.\n\n Parameters\n ----------\n df : pandas.DataFrame\n\n Returns\n -------\n pandas.DataFrame\n\n Notes\n -----\n Being a base implementation, this particular method does nothing with passed frame.\n \"\"\"\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_DefaultMethod_GroupBy._call_groupby.return.df_groupby_args_kwarg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_DefaultMethod_GroupBy._call_groupby.return.df_groupby_args_kwarg", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 61, "span_ids": ["GroupBy._call_groupby", "GroupBy", "GroupBy.is_transformation_kernel", "docstring"], "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": "from .default import DefaultMethod\n\nimport pandas\nfrom pandas.core.dtypes.common import is_list_like\n\n# Defines a set of string names of functions that are executed in a transform-way in groupby\nfrom pandas.core.groupby.base import transformation_kernels\nfrom typing import Any\n\nfrom modin.utils import MODIN_UNNAMED_SERIES_LABEL, hashable\n\n\n# FIXME: there is no sence of keeping `GroupBy` and `GroupByDefault` logic in a different\n# classes. They should be combined.\nclass GroupBy:\n \"\"\"Builder for GroupBy aggregation functions.\"\"\"\n\n agg_aliases = [\n \"agg\",\n \"dict_agg\",\n pandas.core.groupby.DataFrameGroupBy.agg,\n pandas.core.groupby.DataFrameGroupBy.aggregate,\n ]\n\n @staticmethod\n def is_transformation_kernel(agg_func: Any) -> bool:\n \"\"\"\n Check whether a passed aggregation function is a transformation.\n\n Transformation means that the result of the function will be broadcasted\n to the frame's original shape.\n\n Parameters\n ----------\n agg_func : Any\n\n Returns\n -------\n bool\n \"\"\"\n return hashable(agg_func) and agg_func in transformation_kernels\n\n @classmethod\n def _call_groupby(cls, df, *args, **kwargs): # noqa: PR01\n \"\"\"Call .groupby() on passed `df`.\"\"\"\n return df.groupby(*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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.validate_by_GroupBy.validate_by.return.by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.validate_by_GroupBy.validate_by.return.by", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 98, "span_ids": ["GroupBy.validate_by"], "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 GroupBy:\n\n @classmethod\n def validate_by(cls, by):\n \"\"\"\n Build valid `by` parameter for `pandas.DataFrame.groupby`.\n\n Cast all DataFrames in `by` parameter to Series or list of Series in case\n of multi-column frame.\n\n Parameters\n ----------\n by : DateFrame, Series, index label or list of such\n Object which indicates groups for GroupBy.\n\n Returns\n -------\n Series, index label or list of such\n By parameter with all DataFrames casted to Series.\n \"\"\"\n\n def try_cast_series(df):\n \"\"\"Cast one-column frame to Series.\"\"\"\n if isinstance(df, pandas.DataFrame):\n df = df.squeeze(axis=1)\n if not isinstance(df, pandas.Series):\n return df\n if df.name == MODIN_UNNAMED_SERIES_LABEL:\n df.name = None\n return df\n\n if isinstance(by, pandas.DataFrame):\n by = [try_cast_series(column) for _, column in by.items()]\n elif isinstance(by, pandas.Series):\n by = [try_cast_series(by)]\n elif isinstance(by, list):\n by = [try_cast_series(o) for o in by]\n return by", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.inplace_applyier_builder_GroupBy.inplace_applyier_builder.return.inplace_applyier": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.inplace_applyier_builder_GroupBy.inplace_applyier_builder.return.inplace_applyier", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 123, "span_ids": ["GroupBy.inplace_applyier_builder"], "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 GroupBy:\n\n @classmethod\n def inplace_applyier_builder(cls, key, func=None):\n \"\"\"\n Bind actual aggregation function to the GroupBy aggregation method.\n\n Parameters\n ----------\n key : callable\n Function that takes GroupBy object and evaluates passed aggregation function.\n func : callable or str, optional\n Function that takes DataFrame and aggregate its data. Will be applied\n to each group at the grouped frame.\n\n Returns\n -------\n callable,\n Function that executes aggregation under GroupBy object.\n \"\"\"\n inplace_args = [] if func is None else [func]\n\n def inplace_applyier(grp, *func_args, **func_kwargs):\n return key(grp, *inplace_args, *func_args, **func_kwargs)\n\n return inplace_applyier", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.get_func_GroupBy.get_func.if_agg_func_in_kwargs_.else_.return.cls_inplace_applyier_buil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.get_func_GroupBy.get_func.if_agg_func_in_kwargs_.else_.return.cls_inplace_applyier_buil", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 156, "span_ids": ["GroupBy.get_func"], "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 GroupBy:\n\n @classmethod\n def get_func(cls, key, **kwargs):\n \"\"\"\n Extract aggregation function from groupby arguments.\n\n Parameters\n ----------\n key : callable or str\n Default aggregation function. If aggregation function is not specified\n via groupby arguments, then `key` function is used.\n **kwargs : dict\n GroupBy arguments that may contain aggregation function.\n\n Returns\n -------\n callable\n Aggregation function.\n\n Notes\n -----\n There are two ways of how groupby aggregation can be invoked:\n 1. Explicitly with query compiler method: `qc.groupby_sum()`.\n 2. By passing aggregation function as an argument: `qc.groupby_agg(\"sum\")`.\n Both are going to produce the same result, however in the first case actual aggregation\n function can be extracted from the method name, while for the second only from the method arguments.\n \"\"\"\n if \"agg_func\" in kwargs:\n return cls.inplace_applyier_builder(key, kwargs[\"agg_func\"])\n elif \"func_dict\" in kwargs:\n return cls.inplace_applyier_builder(key, kwargs[\"func_dict\"])\n else:\n return cls.inplace_applyier_builder(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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.build_aggregate_method_GroupBy.build_aggregate_method.return.fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.build_aggregate_method_GroupBy.build_aggregate_method.return.fn", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 194, "span_ids": ["GroupBy.build_aggregate_method"], "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 GroupBy:\n\n @classmethod\n def build_aggregate_method(cls, key):\n \"\"\"\n Build function for `QueryCompiler.groupby_agg` that can be executed as default-to-pandas.\n\n Parameters\n ----------\n key : callable or str\n Default aggregation function. If aggregation function is not specified\n via groupby arguments, then `key` function is used.\n\n Returns\n -------\n callable\n Function that executes groupby aggregation.\n \"\"\"\n\n def fn(\n df,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n **kwargs,\n ):\n \"\"\"Group DataFrame and apply aggregation function to each group.\"\"\"\n by = cls.validate_by(by)\n\n grp = cls._call_groupby(df, by, axis=axis, **groupby_kwargs)\n agg_func = cls.get_func(key, **kwargs)\n result = agg_func(grp, *agg_args, **agg_kwargs)\n\n return result\n\n return fn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.build_groupby_reduce_method_GroupBy.build_groupby_reduce_method.return.fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.build_groupby_reduce_method_GroupBy.build_groupby_reduce_method.return.fn", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 284, "span_ids": ["GroupBy.build_groupby_reduce_method"], "tokens": 680}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupBy:\n\n @classmethod\n def build_groupby_reduce_method(cls, agg_func):\n \"\"\"\n Build function for `QueryCompiler.groupby_*` that can be executed as default-to-pandas.\n\n Parameters\n ----------\n agg_func : callable or str\n Default aggregation function. If aggregation function is not specified\n via groupby arguments, then `agg_func` function is used.\n\n Returns\n -------\n callable\n Function that executes groupby aggregation.\n \"\"\"\n\n def fn(\n df, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False, **kwargs\n ):\n \"\"\"Group DataFrame and apply aggregation function to each group.\"\"\"\n if not isinstance(by, (pandas.Series, pandas.DataFrame)):\n by = cls.validate_by(by)\n grp = cls._call_groupby(df, by, axis=axis, **groupby_kwargs)\n grp_agg_func = cls.get_func(agg_func, **kwargs)\n return grp_agg_func(\n grp,\n *agg_args,\n **agg_kwargs,\n )\n\n if isinstance(by, pandas.DataFrame):\n by = by.squeeze(axis=1)\n if (\n drop\n and isinstance(by, pandas.Series)\n and by.name in df\n and df[by.name].equals(by)\n ):\n by = [by.name]\n if isinstance(by, pandas.DataFrame):\n df = pandas.concat([df] + [by[[o for o in by if o not in df]]], axis=1)\n by = list(by.columns)\n\n groupby_kwargs = groupby_kwargs.copy()\n as_index = groupby_kwargs.pop(\"as_index\", True)\n groupby_kwargs[\"as_index\"] = True\n\n grp = cls._call_groupby(df, by, axis=axis, **groupby_kwargs)\n func = cls.get_func(agg_func, **kwargs)\n result = func(grp, *agg_args, **agg_kwargs)\n method = kwargs.get(\"method\")\n\n if isinstance(result, pandas.Series):\n result = result.to_frame(\n MODIN_UNNAMED_SERIES_LABEL if result.name is None else result.name\n )\n\n if not as_index:\n if isinstance(by, pandas.Series):\n # 1. If `drop` is True then 'by' Series represents a column from the\n # source frame and so the 'by' is internal.\n # 2. If method is 'size' then any 'by' is considered to be internal.\n # This is a hacky legacy from the ``groupby_size`` implementation:\n # https://github.com/modin-project/modin/issues/3739\n internal_by = (by.name,) if drop or method == \"size\" else tuple()\n else:\n internal_by = by\n\n cls.handle_as_index_for_dataframe(\n result,\n internal_by,\n by_cols_dtypes=(\n df.index.dtypes.values\n if isinstance(df.index, pandas.MultiIndex)\n else (df.index.dtype,)\n ),\n by_length=len(by),\n drop=drop,\n method=method,\n inplace=True,\n )\n\n if result.index.name == MODIN_UNNAMED_SERIES_LABEL:\n result.index.name = None\n\n return result\n\n return fn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.is_aggregate_GroupBy.build_groupby.return.cls_build_groupby_reduce_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.is_aggregate_GroupBy.build_groupby.return.cls_build_groupby_reduce_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 286, "end_line": 309, "span_ids": ["GroupBy.is_aggregate", "GroupBy.build_groupby"], "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 GroupBy:\n\n @classmethod\n def is_aggregate(cls, key): # noqa: PR01\n \"\"\"Check whether `key` is an alias for pandas.GroupBy.aggregation method.\"\"\"\n return key in cls.agg_aliases\n\n @classmethod\n def build_groupby(cls, func):\n \"\"\"\n Build function that groups DataFrame and applies aggregation function to the every group.\n\n Parameters\n ----------\n func : callable or str\n Default aggregation function. If aggregation function is not specified\n via groupby arguments, then `func` function is used.\n\n Returns\n -------\n callable\n Function that takes pandas DataFrame and does GroupBy aggregation.\n \"\"\"\n if cls.is_aggregate(func):\n return cls.build_aggregate_method(func)\n return cls.build_groupby_reduce_method(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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index_for_dataframe_GroupBy.handle_as_index_for_dataframe.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index_for_dataframe_GroupBy.handle_as_index_for_dataframe.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 382, "span_ids": ["GroupBy.handle_as_index_for_dataframe"], "tokens": 619}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupBy:\n\n @classmethod\n def handle_as_index_for_dataframe(\n cls,\n result,\n internal_by_cols,\n by_cols_dtypes=None,\n by_length=None,\n selection=None,\n partition_idx=0,\n drop=True,\n method=None,\n inplace=False,\n ):\n \"\"\"\n Handle `as_index=False` parameter for the passed GroupBy aggregation result.\n\n Parameters\n ----------\n result : DataFrame\n Frame containing GroupBy aggregation result computed with `as_index=True`\n parameter (group names are located at the frame's index).\n internal_by_cols : list-like\n Internal 'by' columns.\n by_cols_dtypes : list-like, optional\n Data types of the internal 'by' columns. Required to do special casing\n in case of categorical 'by'. If not specified, assume that there is no\n categorical data in 'by'.\n by_length : int, optional\n Amount of keys to group on (including frame columns and external objects like list, Series, etc.)\n If not specified, consider `by_length` to be equal ``len(internal_by_cols)``.\n selection : label or list of labels, optional\n Set of columns that were explicitly selected for aggregation (for example\n via dict-aggregation). If not specified assuming that aggregation was\n applied to all of the available columns.\n partition_idx : int, default: 0\n Positional index of the current partition.\n drop : bool, default: True\n Indicates whether or not any of the `by` data came from the same frame.\n method : str, optional\n Name of the groupby function. This is a hint to be able to do special casing.\n Note: this parameter is a legacy from the ``groupby_size`` implementation,\n it's a hacky one and probably will be removed in the future: https://github.com/modin-project/modin/issues/3739.\n inplace : bool, default: False\n Modify the DataFrame in place (do not create a new object).\n\n Returns\n -------\n DataFrame\n GroupBy aggregation result with the considered `as_index=False` parameter.\n \"\"\"\n if not inplace:\n result = result.copy()\n\n reset_index, drop, lvls_to_drop, cols_to_drop = cls.handle_as_index(\n result_cols=result.columns,\n result_index_names=result.index.names,\n internal_by_cols=internal_by_cols,\n by_cols_dtypes=by_cols_dtypes,\n by_length=by_length,\n selection=selection,\n partition_idx=partition_idx,\n drop=drop,\n method=method,\n )\n\n if len(lvls_to_drop) > 0:\n result.index = result.index.droplevel(lvls_to_drop)\n if len(cols_to_drop) > 0:\n result.drop(columns=cols_to_drop, inplace=True)\n if reset_index:\n result.reset_index(drop=drop, inplace=True)\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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index_GroupBy.handle_as_index._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index_GroupBy.handle_as_index._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 456, "span_ids": ["GroupBy.handle_as_index"], "tokens": 750}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupBy:\n\n @staticmethod\n def handle_as_index(\n result_cols,\n result_index_names,\n internal_by_cols,\n by_cols_dtypes=None,\n by_length=None,\n selection=None,\n partition_idx=0,\n drop=True,\n method=None,\n ):\n \"\"\"\n Compute hints to process ``as_index=False`` parameter for the GroupBy result.\n\n This function resolves naming conflicts of the index levels to insert and the column labels\n for the GroupBy result. The logic of this function assumes that the initial GroupBy result\n was computed as ``as_index=True``.\n\n Parameters\n ----------\n result_cols : pandas.Index\n Columns of the GroupBy result.\n result_index_names : list-like\n Index names of the GroupBy result.\n internal_by_cols : list-like\n Internal 'by' columns.\n by_cols_dtypes : list-like, optional\n Data types of the internal 'by' columns. Required to do special casing\n in case of categorical 'by'. If not specified, assume that there is no\n categorical data in 'by'.\n by_length : int, optional\n Amount of keys to group on (including frame columns and external objects like list, Series, etc.)\n If not specified, consider `by_length` to be equal ``len(internal_by_cols)``.\n selection : label or list of labels, optional\n Set of columns that were explicitly selected for aggregation (for example\n via dict-aggregation). If not specified assuming that aggregation was\n applied to all of the available columns.\n partition_idx : int, default: 0\n Positional index of the current partition.\n drop : bool, default: True\n Indicates whether or not any of the `by` data came from the same frame.\n method : str, optional\n Name of the groupby function. This is a hint to be able to do special casing.\n Note: this parameter is a legacy from the ``groupby_size`` implementation,\n it's a hacky one and probably will be removed in the future: https://github.com/modin-project/modin/issues/3739.\n\n Returns\n -------\n reset_index : bool\n Indicates whether to reset index to the default one (0, 1, 2 ... n) at this partition.\n drop_index : bool\n If `reset_index` is True, indicates whether to drop all index levels (True) or insert them into the\n resulting columns (False).\n lvls_to_drop : list of ints\n Contains numeric indices of the levels of the result index to drop as intersected.\n cols_to_drop : list of labels\n Contains labels of the columns to drop from the result as intersected.\n\n Examples\n --------\n >>> groupby_result = compute_groupby_without_processing_as_index_parameter()\n >>> if not as_index:\n >>> reset_index, drop, lvls_to_drop, cols_to_drop = handle_as_index(**extract_required_params(groupby_result))\n >>> if len(lvls_to_drop) > 0:\n >>> groupby_result.index = groupby_result.index.droplevel(lvls_to_drop)\n >>> if len(cols_to_drop) > 0:\n >>> groupby_result = groupby_result.drop(columns=cols_to_drop)\n >>> if reset_index:\n >>> groupby_result_with_processed_as_index_parameter = groupby_result.reset_index(drop=drop)\n >>> else:\n >>> groupby_result_with_processed_as_index_parameter = groupby_result\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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index.if_by_length_is_None__GroupBy.handle_as_index.cols_to_drop._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index.if_by_length_is_None__GroupBy.handle_as_index.cols_to_drop._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 511, "span_ids": ["GroupBy.handle_as_index"], "tokens": 653}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupBy:\n\n @staticmethod\n def handle_as_index(\n result_cols,\n result_index_names,\n internal_by_cols,\n by_cols_dtypes=None,\n by_length=None,\n selection=None,\n partition_idx=0,\n drop=True,\n method=None,\n ):\n if by_length is None:\n by_length = len(internal_by_cols)\n\n reset_index = method != \"transform\" and (by_length > 0 or selection is not None)\n\n # If the method is \"size\" then the result contains only one unique named column\n # and we don't have to worry about any naming conflicts, so inserting all of\n # the \"by\" into the result (just a fast-path)\n if method == \"size\":\n return reset_index, False, [], []\n\n # Pandas logic of resolving naming conflicts is the following:\n # 1. If any categorical is in 'by' and 'by' is multi-column, then the categorical\n # index is prioritized: drop intersected columns and insert all of the 'by' index\n # levels to the frame as columns.\n # 2. Otherwise, aggregation result is prioritized: drop intersected index levels and\n # insert the filtered ones to the frame as columns.\n if by_cols_dtypes is not None:\n keep_index_levels = (\n by_length > 1\n and selection is None\n and any(isinstance(x, pandas.CategoricalDtype) for x in by_cols_dtypes)\n )\n else:\n keep_index_levels = False\n\n # 1. We insert 'by'-columns to the result at the beginning of the frame and so only to the\n # first partition, if partition_idx != 0 we just drop the index. If there are no columns\n # that are required to drop (keep_index_levels is True) then we can exit here.\n # 2. We don't insert 'by'-columns to the result if 'by'-data came from a different\n # frame (drop is False), there's only one exception for this rule: if the `method` is \"size\",\n # so if (drop is False) and method is not \"size\" we just drop the index and so can exit here.\n if (not keep_index_levels and partition_idx != 0) or (\n not drop and method != \"size\"\n ):\n return reset_index, True, [], []\n\n if not isinstance(internal_by_cols, pandas.Index):\n if not is_list_like(internal_by_cols):\n internal_by_cols = [internal_by_cols]\n internal_by_cols = pandas.Index(internal_by_cols)\n\n internal_by_cols = (\n internal_by_cols[\n ~internal_by_cols.str.startswith(MODIN_UNNAMED_SERIES_LABEL, na=False)\n ]\n if hasattr(internal_by_cols, \"str\")\n else internal_by_cols\n )\n\n if selection is not None and not isinstance(selection, pandas.Index):\n selection = pandas.Index(selection)\n\n lvls_to_drop = []\n cols_to_drop = []\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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index.if_not_keep_index_levels__GroupBy.handle_as_index.return.reset_index_drop_lvls_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupBy.handle_as_index.if_not_keep_index_levels__GroupBy.handle_as_index.return.reset_index_drop_lvls_t", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 513, "end_line": 547, "span_ids": ["GroupBy.handle_as_index"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupBy:\n\n @staticmethod\n def handle_as_index(\n result_cols,\n result_index_names,\n internal_by_cols,\n by_cols_dtypes=None,\n by_length=None,\n selection=None,\n partition_idx=0,\n drop=True,\n method=None,\n ):\n # ... other code\n\n if not keep_index_levels:\n # We want to insert only these internal-by-cols that are not presented\n # in the result in order to not create naming conflicts\n if selection is None:\n cols_to_insert = frozenset(internal_by_cols) - frozenset(result_cols)\n else:\n cols_to_insert = frozenset(\n # We have to use explicit 'not in' check and not just difference\n # of sets because of specific '__contains__' operator in case of\n # scalar 'col' and MultiIndex 'selection'.\n col\n for col in internal_by_cols\n if col not in selection\n )\n else:\n cols_to_insert = internal_by_cols\n # We want to drop such internal-by-cols that are presented\n # in the result in order to not create naming conflicts\n cols_to_drop = frozenset(internal_by_cols) & frozenset(result_cols)\n\n if partition_idx == 0:\n lvls_to_drop = [\n i\n for i, name in enumerate(result_index_names)\n if name not in cols_to_insert\n ]\n else:\n lvls_to_drop = result_index_names\n\n drop = False\n if len(lvls_to_drop) == len(result_index_names):\n drop = True\n lvls_to_drop = []\n\n return reset_index, drop, lvls_to_drop, cols_to_drop", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_SeriesGroupBy_SeriesGroupBy._call_groupby.return.df_groupby_args_kwarg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_SeriesGroupBy_SeriesGroupBy._call_groupby.return.df_groupby_args_kwarg", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 565, "span_ids": ["SeriesGroupBy._call_groupby", "SeriesGroupBy"], "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 SeriesGroupBy(GroupBy):\n \"\"\"Builder for GroupBy aggregation functions for Series.\"\"\"\n\n @classmethod\n def _call_groupby(cls, df, *args, **kwargs): # noqa: PR01\n \"\"\"Call .groupby() on passed `df` squeezed to Series.\"\"\"\n # We can end up here by two means - either by \"true\" call\n # like Series().groupby() or by df.groupby()[item].\n\n if len(df.columns) == 1:\n # Series().groupby() case\n return df.squeeze(axis=1).groupby(*args, **kwargs)\n # In second case surrounding logic will supplement grouping columns,\n # so we need to drop them after grouping is over; our originally\n # selected column is always the first, so use it\n return df.groupby(*args, **kwargs)[df.columns[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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault_GroupByDefault.register.return.super_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault_GroupByDefault.register.return.super_register_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 568, "end_line": 596, "span_ids": ["GroupByDefault", "GroupByDefault.register"], "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 GroupByDefault(DefaultMethod):\n \"\"\"Builder for default-to-pandas GroupBy aggregation functions.\"\"\"\n\n _groupby_cls = GroupBy\n\n OBJECT_TYPE = \"GroupBy\"\n\n @classmethod\n def register(cls, func, **kwargs):\n \"\"\"\n Build default-to-pandas GroupBy aggregation function.\n\n Parameters\n ----------\n func : callable or str\n Default aggregation function. If aggregation function is not specified\n via groupby arguments, then `func` function is used.\n **kwargs : kwargs\n Additional arguments that will be passed to function builder.\n\n Returns\n -------\n callable\n Functiom that takes query compiler and defaults to pandas to do GroupBy\n aggregation.\n \"\"\"\n return super().register(\n cls._groupby_cls.build_groupby(func), fn_name=func.__name__, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault._This_specifies_a_panda_GroupByDefault._aggregation_methods_dict._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault._This_specifies_a_panda_GroupByDefault._aggregation_methods_dict._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 598, "end_line": 608, "span_ids": ["GroupByDefault:7", "GroupByDefault.register"], "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 GroupByDefault(DefaultMethod):\n\n # This specifies a `pandas.DataFrameGroupBy` method to pass the `agg_func` to,\n # it's based on `how` to apply it. Going by pandas documentation:\n # 1. `.aggregate(func)` applies func row/column wise.\n # 2. `.apply(func)` applies func to a DataFrames, holding a whole group (group-wise).\n # 3. `.transform(func)` is the same as `.apply()` but also broadcast the `func`\n # result to the group's original shape.\n _aggregation_methods_dict = {\n \"axis_wise\": pandas.core.groupby.DataFrameGroupBy.aggregate,\n \"group_wise\": pandas.core.groupby.DataFrameGroupBy.apply,\n \"transform\": pandas.core.groupby.DataFrameGroupBy.transform,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault.get_aggregation_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/groupby.py_GroupByDefault.get_aggregation_method_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 610, "end_line": 641, "span_ids": ["GroupByDefault.get_aggregation_method", "SeriesGroupByDefault"], "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 GroupByDefault(DefaultMethod):\n\n @classmethod\n def get_aggregation_method(cls, how):\n \"\"\"\n Return `pandas.DataFrameGroupBy` method that implements the passed `how` UDF applying strategy.\n\n Parameters\n ----------\n how : {\"axis_wise\", \"group_wise\", \"transform\"}\n `how` parameter of the ``BaseQueryCompiler.groupby_agg``.\n\n Returns\n -------\n callable(pandas.DataFrameGroupBy, callable, *args, **kwargs) -> [pandas.DataFrame | pandas.Series]\n\n Notes\n -----\n Visit ``BaseQueryCompiler.groupby_agg`` doc-string for more information about `how` parameter.\n \"\"\"\n return cls._aggregation_methods_dict[how]\n\n\nclass SeriesGroupByDefault(GroupByDefault):\n \"\"\"Builder for default-to-pandas GroupBy aggregation functions for Series.\"\"\"\n\n _groupby_cls = SeriesGroupBy\n\n _aggregation_methods_dict = {\n \"axis_wise\": pandas.core.groupby.SeriesGroupBy.aggregate,\n \"group_wise\": pandas.core.groupby.SeriesGroupBy.apply,\n \"transform\": pandas.core.groupby.SeriesGroupBy.transform,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/resample.py_DefaultMethod_Resampler.build_resample.return.fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/resample.py_DefaultMethod_Resampler.build_resample.return.fn", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 54, "span_ids": ["Resampler.build_resample", "Resampler", "docstring"], "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 .default import DefaultMethod\n\n\n# FIXME: there is no sence of keeping `Resampler` and `ResampleDefault` logic in a different\n# classes. They should be combined.\nclass Resampler:\n \"\"\"Builder class for resampled aggregation functions.\"\"\"\n\n @classmethod\n def build_resample(cls, func, squeeze_self):\n \"\"\"\n Build function that resamples time-series data and does aggregation.\n\n Parameters\n ----------\n func : callable\n Aggregation function to execute under resampled frame.\n squeeze_self : bool\n Whether or not to squeeze frame before resampling.\n\n Returns\n -------\n callable\n Function that takes pandas DataFrame and applies aggregation\n to resampled time-series data.\n \"\"\"\n\n def fn(df, resample_kwargs, *args, **kwargs):\n \"\"\"Resample time-series data of the passed frame and apply specified aggregation.\"\"\"\n if squeeze_self:\n df = df.squeeze(axis=1)\n resampler = df.resample(**resample_kwargs)\n\n if type(func) == property:\n return func.fget(resampler)\n\n return func(resampler, *args, **kwargs)\n\n return fn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/resample.py_ResampleDefault_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/resample.py_ResampleDefault_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 87, "span_ids": ["ResampleDefault", "ResampleDefault.register"], "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 ResampleDefault(DefaultMethod):\n \"\"\"Builder for default-to-pandas resampled aggregation functions.\"\"\"\n\n OBJECT_TYPE = \"Resampler\"\n\n @classmethod\n def register(cls, func, squeeze_self=False, **kwargs):\n \"\"\"\n Build function that do fallback to pandas and aggregate resampled data.\n\n Parameters\n ----------\n func : callable\n Aggregation function to execute under resampled frame.\n squeeze_self : bool, default: False\n Whether or not to squeeze frame before resampling.\n **kwargs : kwargs\n Additional arguments that will be passed to function builder.\n\n Returns\n -------\n callable\n Function that takes query compiler and does fallback to pandas to resample\n time-series data and apply aggregation on it.\n \"\"\"\n return super().register(\n Resampler.build_resample(func, squeeze_self),\n fn_name=func.__name__,\n **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_DefaultMethod_RollingDefault._build_rolling.return.fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_DefaultMethod_RollingDefault._build_rolling.return.fn", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/rolling.py", "file_name": "rolling.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 49, "span_ids": ["RollingDefault", "RollingDefault._build_rolling", "docstring"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .default import DefaultMethod\n\n\nclass RollingDefault(DefaultMethod):\n \"\"\"Builder for default-to-pandas aggregation on a rolling window functions.\"\"\"\n\n OBJECT_TYPE = \"Rolling\"\n\n @classmethod\n def _build_rolling(cls, func):\n \"\"\"\n Build function that creates a rolling window and executes `func` on it.\n\n Parameters\n ----------\n func : callable\n Function to execute on a rolling window.\n\n Returns\n -------\n callable\n Function that takes pandas DataFrame and applies `func` on a rolling window.\n \"\"\"\n\n def fn(df, rolling_args, *args, **kwargs):\n \"\"\"Create rolling window for the passed frame and execute specified `func` on it.\"\"\"\n roller = df.rolling(*rolling_args)\n\n if type(func) == property:\n return func.fget(roller)\n\n return func(roller, *args, **kwargs)\n\n return fn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_RollingDefault.register_RollingDefault.register.return.super_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_RollingDefault.register_RollingDefault.register.return.super_register_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/rolling.py", "file_name": "rolling.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 71, "span_ids": ["RollingDefault.register"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RollingDefault(DefaultMethod):\n\n @classmethod\n def register(cls, func, **kwargs):\n \"\"\"\n Build function that do fallback to pandas to apply `func` on a rolling window.\n\n Parameters\n ----------\n func : callable\n Function to execute on a rolling window.\n **kwargs : kwargs\n Additional arguments that will be passed to function builder.\n\n Returns\n -------\n callable\n Function that takes query compiler and defaults to pandas to apply aggregation\n `func` on a rolling window.\n \"\"\"\n return super().register(\n cls._build_rolling(func), fn_name=func.__name__, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_ExpandingDefault_ExpandingDefault._build_expanding.return.fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_ExpandingDefault_ExpandingDefault._build_expanding.return.fn", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/rolling.py", "file_name": "rolling.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 108, "span_ids": ["ExpandingDefault._build_expanding", "ExpandingDefault"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpandingDefault(DefaultMethod):\n \"\"\"Builder for default-to-pandas aggregation on an expanding window functions.\"\"\"\n\n OBJECT_TYPE = \"Expanding\"\n\n @classmethod\n def _build_expanding(cls, func, squeeze_self):\n \"\"\"\n Build function that creates an expanding window and executes `func` on it.\n\n Parameters\n ----------\n func : callable\n Function to execute on a expanding window.\n squeeze_self : bool\n Whether or not to squeeze frame before executing the window function.\n\n Returns\n -------\n callable\n Function that takes pandas DataFrame and applies `func` on a expanding window.\n \"\"\"\n\n def fn(df, rolling_args, *args, **kwargs):\n \"\"\"Create rolling window for the passed frame and execute specified `func` on it.\"\"\"\n if squeeze_self:\n df = df.squeeze(axis=1)\n roller = df.expanding(*rolling_args)\n\n if type(func) == property:\n return func.fget(roller)\n\n return func(roller, *args, **kwargs)\n\n return fn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_ExpandingDefault.register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/rolling.py_ExpandingDefault.register_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/rolling.py", "file_name": "rolling.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 135, "span_ids": ["ExpandingDefault.register"], "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 ExpandingDefault(DefaultMethod):\n\n @classmethod\n def register(cls, func, squeeze_self=False, **kwargs):\n \"\"\"\n Build function that do fallback to pandas to apply `func` on a expanding window.\n\n Parameters\n ----------\n func : callable\n Function to execute on an expanding window.\n squeeze_self : bool, default: False\n Whether or not to squeeze frame before executing the window function.\n **kwargs : kwargs\n Additional arguments that will be passed to function builder.\n\n Returns\n -------\n callable\n Function that takes query compiler and defaults to pandas to apply aggregation\n `func` on an expanding window.\n \"\"\"\n return super().register(\n cls._build_expanding(func, squeeze_self=squeeze_self),\n fn_name=func.__name__,\n **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/series.py_DefaultMethod_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/series.py_DefaultMethod_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 39, "span_ids": ["SeriesDefault", "SeriesDefault.frame_wrapper", "docstring"], "tokens": 102}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .default import DefaultMethod\n\n\nclass SeriesDefault(DefaultMethod):\n \"\"\"Builder for default-to-pandas methods which is executed under Series.\"\"\"\n\n OBJECT_TYPE = \"Series\"\n\n @classmethod\n def frame_wrapper(cls, df):\n \"\"\"\n Squeeze passed DataFrame to be able to process Series-specific functions on it.\n\n Parameters\n ----------\n df : pandas.DataFrame\n One-column DataFrame to squeeze.\n\n Returns\n -------\n pandas.Series\n \"\"\"\n return df.squeeze(axis=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_modin-project__modin/modin/core/dataframe/algebra/default2pandas/str.py_SeriesDefault_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/default2pandas/str.py_SeriesDefault_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/default2pandas/str.py", "file_name": "str.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 36, "span_ids": ["StrDefault", "StrDefault.frame_wrapper", "docstring"], "tokens": 93}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .series import SeriesDefault\n\n\nclass StrDefault(SeriesDefault):\n \"\"\"Builder for default-to-pandas methods which is executed under `str` accessor.\"\"\"\n\n @classmethod\n def frame_wrapper(cls, df):\n \"\"\"\n Get `str` accessor of the passed frame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n\n Returns\n -------\n pandas.core.strings.accessor.StringMethods\n \"\"\"\n return df.squeeze(axis=1).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_modin-project__modin/modin/core/dataframe/algebra/fold.py_Operator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/fold.py_Operator_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/fold.py", "file_name": "fold.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 68, "span_ids": ["Fold.register", "Fold", "docstring"], "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": "from .operator import Operator\n\n\nclass Fold(Operator):\n \"\"\"Builder class for Fold functions.\"\"\"\n\n @classmethod\n def register(cls, fold_function):\n \"\"\"\n Build Fold operator that will be performed across rows/columns.\n\n Parameters\n ----------\n fold_function : callable(pandas.DataFrame) -> pandas.DataFrame\n Function to apply across rows/columns.\n\n Returns\n -------\n callable\n Function that takes query compiler and executes Fold function.\n \"\"\"\n\n def caller(query_compiler, fold_axis=None, *args, **kwargs):\n \"\"\"\n Execute Fold function against passed query compiler.\n\n Parameters\n ----------\n query_compiler : BaseQueryCompiler\n The query compiler to execute the function on.\n fold_axis : int, optional\n 0 or None means apply across full column partitions. 1 means\n apply across full row partitions.\n *args : iterable\n Additional arguments passed to fold_function.\n **kwargs: dict\n Additional keyword arguments passed to fold_function.\n\n Returns\n -------\n BaseQueryCompiler\n A new query compiler representing the result of executing the\n function.\n \"\"\"\n return query_compiler.__constructor__(\n query_compiler._modin_frame.fold(\n cls.validate_axis(fold_axis),\n lambda x: fold_function(x, *args, **kwargs),\n )\n )\n\n return caller", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_pandas_GroupByReduce._GROUPBY_REDUCE_IMPL_FLAG.___groupby_reduce_impl_fu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_pandas_GroupByReduce._GROUPBY_REDUCE_IMPL_FLAG.___groupby_reduce_impl_fu", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 43, "span_ids": ["GroupByReduce", "docstring"], "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": "import pandas\n\nfrom .tree_reduce import TreeReduce\nfrom .default2pandas.groupby import GroupBy, GroupByDefault\nfrom modin.utils import hashable, MODIN_UNNAMED_SERIES_LABEL\nfrom modin.error_message import ErrorMessage\n\n\nclass GroupByReduce(TreeReduce):\n \"\"\"\n Builder class for GroupBy aggregation functions.\n\n Attributes\n ----------\n ID_LEVEL_NAME : str\n It's supposed that implementations may produce multiple temporary\n columns per one source column in an intermediate phase. In order\n for these columns to be processed accordingly at the Reduce phase,\n an implementation must store unique names for such temporary\n columns in the ``ID_LEVEL_NAME`` level. Duplicated names are not allowed.\n _GROUPBY_REDUCE_IMPL_FLAG : str\n Attribute indicating that a callable should be treated as an\n implementation for one of the TreeReduce phases rather than an\n arbitrary aggregation. Note: this attribute should be considered private.\n \"\"\"\n\n ID_LEVEL_NAME = \"__ID_LEVEL_NAME__\"\n _GROUPBY_REDUCE_IMPL_FLAG = \"__groupby_reduce_impl_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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.register_GroupByReduce.register.return.lambda_args_kwargs_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.register_GroupByReduce.register.return.lambda_args_kwargs_c", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 88, "span_ids": ["GroupByReduce.register"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def register(cls, map_func, reduce_func=None, **call_kwds):\n \"\"\"\n Build template GroupBy aggregation function.\n\n Resulted function is applied in parallel via TreeReduce algorithm.\n\n Parameters\n ----------\n map_func : str, dict or callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject` at the map phase. If ``str`` was passed it will\n be treated as a DataFrameGroupBy's method name.\n reduce_func : str, dict or callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame, optional\n Function to apply to the ``DataFrameGroupBy`` at the reduce phase. If not specified\n will be set the same as 'map_func'.\n **call_kwds : kwargs\n Kwargs that will be passed to the returned function.\n\n Returns\n -------\n callable\n Function that takes query compiler and executes GroupBy aggregation\n with TreeReduce algorithm.\n \"\"\"\n if reduce_func is None:\n reduce_func = map_func\n\n def build_fn(name):\n return lambda df, *args, **kwargs: getattr(df, name)(*args, **kwargs)\n\n if isinstance(map_func, str):\n map_func = build_fn(map_func)\n if isinstance(reduce_func, str):\n reduce_func = build_fn(reduce_func)\n\n assert not (\n isinstance(map_func, dict) ^ isinstance(reduce_func, dict)\n ) and not (\n callable(map_func) ^ callable(reduce_func)\n ), \"Map and reduce functions must be either both dict or both callable.\"\n\n return lambda *args, **kwargs: cls.caller(\n *args, map_func=map_func, reduce_func=reduce_func, **kwargs, **call_kwds\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.register_implementation_GroupByReduce.register_implementation.setattr_reduce_func_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.register_implementation_GroupByReduce.register_implementation.setattr_reduce_func_cls_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 103, "span_ids": ["GroupByReduce.register_implementation"], "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 GroupByReduce(TreeReduce):\n\n @classmethod\n def register_implementation(cls, map_func, reduce_func):\n \"\"\"\n Register callables to be recognized as an implementations of tree-reduce phases.\n\n Parameters\n ----------\n map_func : callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame\n Callable to register.\n reduce_func : callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame\n Callable to register.\n \"\"\"\n setattr(map_func, cls._GROUPBY_REDUCE_IMPL_FLAG, True)\n setattr(reduce_func, cls._GROUPBY_REDUCE_IMPL_FLAG, 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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.map_GroupByReduce.map.return.pandas_DataFrame_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.map_GroupByReduce.map.return.pandas_DataFrame_result_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 190, "span_ids": ["GroupByReduce.map"], "tokens": 721}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def map(\n cls,\n df,\n map_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n other=None,\n by=None,\n drop=False,\n ):\n \"\"\"\n Execute Map phase of GroupByReduce.\n\n Groups DataFrame and applies map function. Groups will be\n preserved in the results index for the following reduce phase.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Serialized frame to group.\n map_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject`.\n axis : {0, 1}\n Axis to group and apply aggregation function along. 0 means index axis\n when 1 means column axis.\n groupby_kwargs : dict\n Dictionary which carries arguments for `pandas.DataFrame.groupby`.\n agg_args : list-like\n Positional arguments to pass to the aggregation functions.\n agg_kwargs : dict\n Keyword arguments to pass to the aggregation functions.\n other : pandas.DataFrame, optional\n Serialized frame, whose columns are used to determine the groups.\n If not specified, `by` parameter is used.\n by : level index name or list of such labels, optional\n Index levels, that is used to determine groups.\n If not specified, `other` parameter is used.\n drop : bool, default: False\n Indicates whether or not by-data came from the `self` frame.\n\n Returns\n -------\n pandas.DataFrame\n GroupBy aggregation result for one particular partition.\n \"\"\"\n # Set `as_index` to True to track the metadata of the grouping object\n # It is used to make sure that between phases we are constructing the\n # right index and placing columns in the correct order.\n groupby_kwargs[\"as_index\"] = True\n groupby_kwargs[\"observed\"] = True\n # We have to filter func-dict BEFORE inserting broadcasted 'by' columns\n # to avoid multiple aggregation results for 'by' cols in case they're\n # present in the func-dict:\n apply_func = cls.get_callable(\n map_func,\n df,\n # We won't be able to preserve the order as the Map phase would likely\n # produce some temporary columns that won't fit into the original\n # aggregation order. It doesn't matter much as we restore the original\n # order at the Reduce phase.\n preserve_aggregation_order=False,\n )\n if other is not None:\n # Other is a broadcasted partition that represents 'by' data to group on.\n # If 'drop' then the 'by' data came from the 'self' frame, thus\n # inserting missed columns to the partition to group on them.\n if drop or isinstance(\n other := other.squeeze(axis=axis ^ 1), pandas.DataFrame\n ):\n df = pandas.concat(\n [df] + [other[[o for o in other if o not in df]]],\n axis=1,\n )\n other = list(other.columns)\n by_part = other\n else:\n by_part = by\n\n result = apply_func(\n df.groupby(by=by_part, axis=axis, **groupby_kwargs), *agg_args, **agg_kwargs\n )\n # Result could not always be a frame, so wrapping it into DataFrame\n return pandas.DataFrame(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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.get_callable_GroupByReduce.get_callable.return.cls__build_callable_for_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.get_callable_GroupByReduce.get_callable.return.cls__build_callable_for_d", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 408, "end_line": 444, "span_ids": ["GroupByReduce.get_callable"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def get_callable(cls, agg_func, df, preserve_aggregation_order=True):\n \"\"\"\n Build aggregation function to apply to each group at this particular partition.\n\n If it's dictionary aggregation \u2014 filters aggregation dictionary for keys which\n this particular partition contains, otherwise do nothing with passed function.\n\n Parameters\n ----------\n agg_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Aggregation function.\n df : pandas.DataFrame\n Serialized partition which contains available columns.\n preserve_aggregation_order : bool, default: True\n Whether to manually restore the order of columns for the result specified\n by the `agg_func` keys (only makes sense when `agg_func` is a dictionary).\n\n Returns\n -------\n callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame\n Aggregation function that can be safely applied to this particular partition.\n \"\"\"\n if not isinstance(agg_func, dict):\n return agg_func\n\n grp_has_id_level = df.columns.names[0] == cls.ID_LEVEL_NAME\n # The 'id' level prevents us from a lookup for the original\n # partition's columns. So dropping the level.\n partition_columns = frozenset(\n df.columns.droplevel(0) if grp_has_id_level else df.columns\n )\n\n partition_dict = {k: v for k, v in agg_func.items() if k in partition_columns}\n return cls._build_callable_for_dict(\n partition_dict, preserve_aggregation_order, grp_has_id_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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce._build_callable_for_dict_GroupByReduce._build_callable_for_dict.result_columns_3.pandas_Index_result_colum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce._build_callable_for_dict_GroupByReduce._build_callable_for_dict.result_columns_3.pandas_Index_result_colum", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 513, "span_ids": ["GroupByReduce._build_callable_for_dict"], "tokens": 596}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def _build_callable_for_dict(\n cls, agg_dict, preserve_aggregation_order=True, grp_has_id_level=False\n ):\n \"\"\"\n Build callable for an aggregation dictionary.\n\n Parameters\n ----------\n agg_dict : dict\n Aggregation dictionary.\n preserve_aggregation_order : bool, default: True\n Whether to manually restore the order of columns for the result specified\n by the `agg_func` keys (only makes sense when `agg_func` is a dictionary).\n grp_has_id_level : bool, default: False\n Whether the frame we're grouping on has intermediate columns\n (see ``cls.ID_LEVEL_NAME``).\n\n Returns\n -------\n callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame\n \"\"\"\n # We have to keep this import away from the module level to avoid circular import\n from modin.pandas.utils import walk_aggregation_dict\n\n # We now filter aggregation functions into those that could be applied natively\n # using pandas (pandas_grp_obj.agg(**native_aggs)) and those that require\n # special treatment (custom_aggs).\n custom_aggs = {}\n native_aggs = {}\n\n result_columns = []\n for col, func, func_name, col_renaming_required in walk_aggregation_dict(\n agg_dict\n ):\n # Filter dictionary\n dict_to_add = (\n custom_aggs if cls.is_registered_implementation(func) else native_aggs\n )\n\n new_value = func if func_name is None else (func_name, func)\n old_value = dict_to_add.get(col, None)\n\n if old_value is not None:\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=not isinstance(old_value, list),\n extra_log=\"Expected for all aggregation values to be a list when at least \"\n + f\"one column has multiple aggregations. Got: {old_value} {type(old_value)}\",\n )\n old_value.append(new_value)\n else:\n # Pandas knows that it has to modify the resulting columns if it meets\n # a function wrapped into a list. Renaming is required if either a new\n # column name was explicitly specified, or multiple functions were\n # specified per one column, or if any other column in the aggregation\n # is going to be renamed.\n dict_to_add[col] = [new_value] if col_renaming_required else new_value\n\n # Construct resulting columns\n if col_renaming_required:\n func_name = str(func) if func_name is None else func_name\n result_columns.append(\n (*(col if isinstance(col, tuple) else (col,)), func_name)\n )\n else:\n result_columns.append(col)\n\n result_columns = pandas.Index(result_columns)\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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce._build_callable_for_dict.aggregate_on_dict_GroupByReduce._build_callable_for_dict.return.aggregate_on_dict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce._build_callable_for_dict.aggregate_on_dict_GroupByReduce._build_callable_for_dict.return.aggregate_on_dict", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 515, "end_line": 615, "span_ids": ["GroupByReduce._build_callable_for_dict"], "tokens": 863}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def _build_callable_for_dict(\n cls, agg_dict, preserve_aggregation_order=True, grp_has_id_level=False\n ):\n # ... other code\n\n def aggregate_on_dict(grp_obj, *args, **kwargs):\n \"\"\"Aggregate the passed groupby object.\"\"\"\n if len(native_aggs) == 0:\n native_agg_res = None\n elif grp_has_id_level:\n # Adding the 'id' level to the aggregation keys so they match `grp_obj` columns\n native_aggs_modified = {\n (\n cls.ID_LEVEL_NAME,\n *(key if isinstance(key, tuple) else (key,)),\n ): value\n for key, value in native_aggs.items()\n }\n native_agg_res = grp_obj.agg(native_aggs_modified)\n # Dropping the 'id' level from the resulted frame\n native_agg_res.columns = native_agg_res.columns.droplevel(0)\n else:\n native_agg_res = grp_obj.agg(native_aggs)\n\n custom_results = []\n insert_id_levels = False\n\n for col, func, func_name, col_renaming_required in walk_aggregation_dict(\n custom_aggs\n ):\n if grp_has_id_level:\n cols_without_ids = grp_obj.obj.columns.droplevel(0)\n if isinstance(cols_without_ids, pandas.MultiIndex):\n # We may have multiple columns matching the `col` in\n # a MultiIndex case, that's why use `.get_locs` here\n col_pos = cols_without_ids.get_locs(col)\n else:\n # `pandas.Index` doesn't have `.get_locs` method\n col_pos = cols_without_ids.get_loc(col)\n agg_key = grp_obj.obj.columns[col_pos]\n else:\n agg_key = [col]\n\n result = func(grp_obj[agg_key])\n # The `func` may have discarded an ID-level if there were any.\n # So checking for this again.\n result_has_id_level = result.columns.names[0] == cls.ID_LEVEL_NAME\n insert_id_levels |= result_has_id_level\n\n if col_renaming_required:\n func_name = str(func) if func_name is None else func_name\n if result_has_id_level:\n result.columns = pandas.MultiIndex.from_tuples(\n [\n # `old_col[0]` stores values from the 'id'\n # level, the ones we want to preserve here\n (old_col[0], col, func_name)\n for old_col in result.columns\n ],\n names=[\n result.columns.names[0],\n result.columns.names[1],\n None,\n ],\n )\n else:\n result.columns = pandas.MultiIndex.from_tuples(\n [(col, func_name)] * len(result.columns),\n names=[result.columns.names[0], None],\n )\n\n custom_results.append(result)\n\n if insert_id_levels:\n # As long as any `result` has an id-level we have to insert the level\n # into every `result` so the number of levels matches\n for idx, ext_result in enumerate(custom_results):\n if ext_result.columns.names[0] != cls.ID_LEVEL_NAME:\n custom_results[idx] = pandas.concat(\n [ext_result],\n keys=[cls.ID_LEVEL_NAME],\n names=[cls.ID_LEVEL_NAME],\n axis=1,\n copy=False,\n )\n\n if native_agg_res is not None:\n native_agg_res = pandas.concat(\n [native_agg_res],\n keys=[cls.ID_LEVEL_NAME],\n names=[cls.ID_LEVEL_NAME],\n axis=1,\n copy=False,\n )\n\n native_res_part = [] if native_agg_res is None else [native_agg_res]\n result = pandas.concat(\n [*native_res_part, *custom_results], axis=1, copy=False\n )\n\n # The order is naturally preserved if there's no custom aggregations\n if preserve_aggregation_order and len(custom_aggs):\n result = result.reindex(result_columns, axis=1)\n return result\n\n return aggregate_on_dict", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.is_registered_implementation_GroupByReduce.build_map_reduce_functions.if_hasattr_by__modin_fr.by.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.is_registered_implementation_GroupByReduce.build_map_reduce_functions.if_hasattr_by__modin_fr.by.None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 625, "end_line": 690, "span_ids": ["GroupByReduce.is_registered_implementation", "GroupByReduce.build_map_reduce_functions"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def is_registered_implementation(cls, func):\n \"\"\"\n Check whether the passed `func` was registered as a TreeReduce implementation.\n\n Parameters\n ----------\n func : callable\n\n Returns\n -------\n bool\n \"\"\"\n return callable(func) and hasattr(func, cls._GROUPBY_REDUCE_IMPL_FLAG)\n\n @classmethod\n def build_map_reduce_functions(\n cls,\n by,\n axis,\n groupby_kwargs,\n map_func,\n reduce_func,\n agg_args,\n agg_kwargs,\n drop=False,\n method=None,\n finalizer_fn=None,\n ):\n \"\"\"\n Bind appropriate arguments to map and reduce functions.\n\n Parameters\n ----------\n by : BaseQueryCompiler, column or index label, Grouper or list of such\n Object that determine groups.\n axis : {0, 1}\n Axis to group and apply aggregation function along. 0 means index axis\n when 1 means column axis.\n groupby_kwargs : dict\n Dictionary which carries arguments for pandas.DataFrame.groupby.\n map_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject` at the Map phase.\n reduce_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject` at the Reduce phase.\n agg_args : list-like\n Positional arguments to pass to the aggregation functions.\n agg_kwargs : dict\n Keyword arguments to pass to the aggregation functions.\n drop : bool, default: False\n Indicates whether or not by-data came from the `self` frame.\n method : str, optional\n Name of the GroupBy aggregation function. This is a hint to be able to do special casing.\n finalizer_fn : callable(pandas.DataFrame) -> pandas.DataFrame, default: None\n A callable to execute at the end a groupby kernel against groupby result.\n\n Returns\n -------\n Tuple of callable\n Tuple of map and reduce functions with bound arguments.\n \"\"\"\n # if by is a query compiler, then it will be broadcasted explicit via\n # groupby_reduce method of the modin frame and so we don't want secondary\n # implicit broadcastion via passing it as an function argument.\n if hasattr(by, \"_modin_frame\"):\n by = None\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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.build_map_reduce_functions._map_GroupByReduce.build_map_reduce_functions._map.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.build_map_reduce_functions._map_GroupByReduce.build_map_reduce_functions._map.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 692, "end_line": 713, "span_ids": ["GroupByReduce.build_map_reduce_functions"], "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 GroupByReduce(TreeReduce):\n\n @classmethod\n def build_map_reduce_functions(\n cls,\n by,\n axis,\n groupby_kwargs,\n map_func,\n reduce_func,\n agg_args,\n agg_kwargs,\n drop=False,\n method=None,\n finalizer_fn=None,\n ):\n # ... other code\n\n def _map(df, other=None, **kwargs):\n def wrapper(df, other=None):\n return cls.map(\n df,\n other=other,\n axis=axis,\n by=by,\n groupby_kwargs=groupby_kwargs.copy(),\n map_func=map_func,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n **kwargs,\n )\n\n try:\n result = wrapper(df, other)\n # This will happen with Arrow buffer read-only errors. We don't want to copy\n # all the time, so this will try to fast-path the code first.\n except ValueError:\n result = wrapper(df.copy(), other if other is None else other.copy())\n return result\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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.build_map_reduce_functions._reduce_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.build_map_reduce_functions._reduce_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 715, "end_line": 739, "span_ids": ["GroupByReduce.build_map_reduce_functions"], "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 GroupByReduce(TreeReduce):\n\n @classmethod\n def build_map_reduce_functions(\n cls,\n by,\n axis,\n groupby_kwargs,\n map_func,\n reduce_func,\n agg_args,\n agg_kwargs,\n drop=False,\n method=None,\n finalizer_fn=None,\n ):\n # ... other code\n\n def _reduce(df, **call_kwargs):\n def wrapper(df):\n return cls.reduce(\n df,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n reduce_func=reduce_func,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n method=method,\n finalizer_fn=finalizer_fn,\n **call_kwargs,\n )\n\n try:\n result = wrapper(df)\n # This will happen with Arrow buffer read-only errors. We don't want to copy\n # all the time, so this will try to fast-path the code first.\n except ValueError:\n result = wrapper(df.copy())\n return result\n\n return _map, _reduce", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/map.py_Operator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/map.py_Operator_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/map.py", "file_name": "map.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 57, "span_ids": ["Map.register", "Map", "docstring"], "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": "from .operator import Operator\n\n\nclass Map(Operator):\n \"\"\"Builder class for Map operator.\"\"\"\n\n @classmethod\n def register(cls, function, *call_args, **call_kwds):\n \"\"\"\n Build Map operator that will be performed across each partition.\n\n Parameters\n ----------\n function : callable(pandas.DataFrame) -> pandas.DataFrame\n Function that will be applied to the each partition.\n Function takes `pandas.DataFrame` and returns `pandas.DataFrame`\n of the same shape.\n *call_args : args\n Args that will be passed to the returned function.\n **call_kwds : kwargs\n Kwargs that will be passed to the returned function.\n\n Returns\n -------\n callable\n Function that takes query compiler and executes map function.\n \"\"\"\n\n def caller(query_compiler, *args, **kwargs):\n \"\"\"Execute Map function against passed query compiler.\"\"\"\n shape_hint = call_kwds.pop(\"shape_hint\", None) or kwargs.pop(\n \"shape_hint\", None\n )\n return query_compiler.__constructor__(\n query_compiler._modin_frame.map(\n lambda x: function(x, *args, **kwargs), *call_args, **call_kwds\n ),\n shape_hint=shape_hint,\n )\n\n return caller", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/operator.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/operator.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/operator.py", "file_name": "operator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 63, "span_ids": ["Operator.register", "Operator", "Operator.validate_axis", "docstring", "Operator.__init__"], "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 typing import Optional\n\n\nclass Operator(object):\n \"\"\"Interface for building operators that can execute in parallel across partitions.\"\"\"\n\n def __init__(self):\n raise ValueError(\n \"Please use {}.register instead of the constructor\".format(\n type(self).__name__\n )\n )\n\n @classmethod\n def register(cls, func, **kwargs):\n \"\"\"\n Build operator that applies source function across the entire dataset.\n\n Parameters\n ----------\n func : callable\n Source function.\n **kwargs : kwargs\n Kwargs that will be passed to the builder function.\n\n Returns\n -------\n callable\n \"\"\"\n raise NotImplementedError(\"Please implement in child class\")\n\n @classmethod\n def validate_axis(cls, axis: Optional[int]) -> int:\n \"\"\"\n Ensure that axis to apply function on has valid value.\n\n Parameters\n ----------\n axis : int, optional\n 0 or None means apply on index, 1 means apply on columns.\n\n Returns\n -------\n int\n Integer representation of given axis.\n \"\"\"\n return 0 if axis is None else axis", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/reduce.py_Operator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/reduce.py_Operator_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/reduce.py", "file_name": "reduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 53, "span_ids": ["Reduce", "Reduce.register", "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": "from .operator import Operator\n\n\nclass Reduce(Operator):\n \"\"\"Builder class for Reduce operator.\"\"\"\n\n @classmethod\n def register(cls, reduce_function, axis=None):\n \"\"\"\n Build Reduce operator that will be performed across rows/columns.\n\n It's used if `func` reduces the dimension of partitions in contrast to `Fold`.\n\n Parameters\n ----------\n reduce_function : callable(pandas.DataFrame) -> pandas.Series\n Source function.\n axis : int, optional\n Axis to apply function along.\n\n Returns\n -------\n callable\n Function that takes query compiler and executes Reduce function.\n \"\"\"\n\n def caller(query_compiler, *args, **kwargs):\n \"\"\"Execute Reduce function against passed query compiler.\"\"\"\n _axis = kwargs.get(\"axis\") if axis is None else axis\n return query_compiler.__constructor__(\n query_compiler._modin_frame.reduce(\n cls.validate_axis(_axis),\n lambda x: reduce_function(x, *args, **kwargs),\n )\n )\n\n return caller", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/tree_reduce.py_Operator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/tree_reduce.py_Operator_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/tree_reduce.py", "file_name": "tree_reduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 57, "span_ids": ["TreeReduce.register", "TreeReduce", "docstring"], "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 .operator import Operator\n\n\nclass TreeReduce(Operator):\n \"\"\"Builder class for TreeReduce operator.\"\"\"\n\n @classmethod\n def register(cls, map_function, reduce_function=None, axis=None):\n \"\"\"\n Build TreeReduce operator.\n\n Parameters\n ----------\n map_function : callable(pandas.DataFrame) -> pandas.DataFrame\n Source map function.\n reduce_function : callable(pandas.DataFrame) -> pandas.Series, optional\n Source reduce function.\n axis : int, optional\n Specifies axis to apply function along.\n\n Returns\n -------\n callable\n Function that takes query compiler and executes passed functions\n with TreeReduce algorithm.\n \"\"\"\n if reduce_function is None:\n reduce_function = map_function\n\n def caller(query_compiler, *args, **kwargs):\n \"\"\"Execute TreeReduce function against passed query compiler.\"\"\"\n _axis = kwargs.get(\"axis\") if axis is None else axis\n return query_compiler.__constructor__(\n query_compiler._modin_frame.tree_reduce(\n cls.validate_axis(_axis),\n lambda x: map_function(x, *args, **kwargs),\n lambda y: reduce_function(y, *args, **kwargs),\n )\n )\n\n return caller", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/base/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_from_abc_import_ABC_abst_ModinDataframe.take_2d_labels_or_positional.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_from_abc_import_ABC_abst_ModinDataframe.take_2d_labels_or_positional.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 71, "span_ids": ["ModinDataframe.take_2d_labels_or_positional", "ModinDataframe", "docstring"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from abc import ABC, abstractmethod\nfrom typing import List, Hashable, Optional, Callable, Union, Dict\nfrom modin.core.dataframe.base.dataframe.utils import Axis, JoinType\n\n\nclass ModinDataframe(ABC):\n \"\"\"\n An abstract class that represents the Parent class for any Dataframe class.\n\n This class is intended to specify the behaviors that a Dataframe must implement.\n\n For more details about how these methods were chosen, please refer to this\n (https://people.eecs.berkeley.edu/~totemtang/paper/Modin.pdf) paper, which specifies\n a Dataframe algebra that this class exposes.\n \"\"\"\n\n @abstractmethod\n def take_2d_labels_or_positional(\n self,\n row_labels: Optional[List[Hashable]] = None,\n row_positions: Optional[List[int]] = None,\n col_labels: Optional[List[Hashable]] = None,\n col_positions: Optional[List[int]] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Mask rows and columns in the dataframe.\n\n Allow users to perform selection and projection on the row and column labels (named notation),\n in addition to the row and column number (positional notation).\n\n Parameters\n ----------\n row_labels : list of hashable, optional\n The row labels to extract.\n row_positions : list of int, optional\n The row positions to extract.\n col_labels : list of hashable, optional\n The column labels to extract.\n col_positions : list of int, optional\n The column positions to extract.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe from the mask provided.\n\n Notes\n -----\n If both `row_labels` and `row_positions` are provided, a ValueError is raised.\n The same rule applies for `col_labels` and `col_positions`.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.filter_by_types_ModinDataframe.map.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.filter_by_types_ModinDataframe.map.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 124, "span_ids": ["ModinDataframe.filter_by_types", "ModinDataframe.map"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def filter_by_types(self, types: List[Hashable]) -> \"ModinDataframe\":\n \"\"\"\n Allow the user to specify a type or set of types by which to filter the columns.\n\n Parameters\n ----------\n types : list of hashables\n The types to filter columns by.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with only the columns whose dtypes appear in `types`.\n \"\"\"\n pass\n\n @abstractmethod\n def map(\n self,\n function: Callable,\n axis: Optional[Union[int, Axis]] = None,\n dtypes: Optional[str] = None,\n new_columns: Optional[List[Hashable]] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Apply a user-defined function row-wise if `axis`=0, column-wise if `axis`=1, and cell-wise if `axis` is None.\n\n Parameters\n ----------\n function : callable(row|col|cell) -> row|col|cell\n The function to map across the dataframe.\n axis : int or modin.core.dataframe.base.utils.Axis, optional\n The axis to map over.\n dtypes : str, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n new_columns : List[Hashable], optional\n New column labels of the result, its length has to be identical\n to the older columns. If not specified, old column labels are preserved.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the map applied.\n\n Notes\n -----\n This does not change the shape of the dataframe.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.filter_ModinDataframe.filter.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.filter_ModinDataframe.filter.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 145, "span_ids": ["ModinDataframe.filter"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def filter(self, axis: Union[int, Axis], condition: Callable) -> \"ModinDataframe\":\n \"\"\"\n Filter data based on the function provided along the specified axis.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to filter over.\n condition : callable(row|col) -> bool\n The function to use for the filter. This function should filter the\n data itself. It accepts either a row or column (depending on the axis argument) and\n returns True to keep the row/col, and False to drop it.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe filtered by content according to the filter provided by condition.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.explode_ModinDataframe.explode.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.explode_ModinDataframe.explode.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 179, "span_ids": ["ModinDataframe.explode"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def explode(\n self,\n axis: Union[int, Axis],\n function: Callable,\n result_schema: Optional[Dict[Hashable, type]] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Explode data based on the function provided along the specified axis.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to expand over.\n function : callable\n The function to use to expand the data. This function should accept one\n row/column, and return multiple.\n result_schema : dictionary, optional\n Mapping from column labels to data types that represents the types of the output dataframe.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the specified axis expanded.\n\n Notes\n -----\n Only one axis can be expanded at a time.\n\n The user-defined function may increase the number of rows (columns if axis=1),\n but it should not remove or drop rows.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.window_ModinDataframe.window.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.window_ModinDataframe.window.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 215, "span_ids": ["ModinDataframe.window"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def window(\n self,\n axis: Union[int, Axis],\n reduce_fn: Callable,\n window_size: int,\n result_schema: Optional[Dict[Hashable, type]] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Apply a sliding window operator that acts as a GROUPBY on each window, reducing each window to a single row (column).\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to slide over.\n reduce_fn : callable(rowgroup|colgroup) -> row|col\n The reduce function to apply over the data.\n window_size : int\n The number of row/columns to pass to the function.\n (The size of the sliding window).\n result_schema : dictionary, optional\n Mapping from column labels to data types that represents the types of the output dataframe.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the reduce function applied over windows of the specified\n axis.\n\n Notes\n -----\n The user-defined reduce function must reduce each window\u2019s column\n (row if axis=1) down to a single value.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.groupby_ModinDataframe.groupby.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.groupby_ModinDataframe.groupby.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 258, "span_ids": ["ModinDataframe.groupby"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def groupby(\n self,\n axis: Union[int, Axis],\n by: Union[str, List[str]],\n operator: Callable,\n result_schema: Optional[Dict[Hashable, type]] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Generate groups based on values in the input column(s) and perform the specified operation on each.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to apply the grouping over.\n by : string or list of strings\n One or more column labels to use for grouping.\n operator : callable\n The operation to carry out on each of the groups. The operator is another\n algebraic operator with its own user-defined function parameter, depending\n on the output desired by the user.\n result_schema : dictionary, optional\n Mapping from column labels to data types that represents the types of the output dataframe.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe containing the groupings specified, with the operator\n applied to each group.\n\n Notes\n -----\n No communication between groups is allowed in this algebra implementation.\n\n The number of rows (columns if axis=1) returned by the user-defined function\n passed to the groupby may be at most the number of rows in the group, and\n may be as small as a single row.\n\n Unlike the pandas API, an intermediate \"GROUP BY\" object is not present in this\n algebra implementation.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.reduce_ModinDataframe.reduce.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.reduce_ModinDataframe.reduce.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 290, "span_ids": ["ModinDataframe.reduce"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def reduce(\n self,\n axis: Union[int, Axis],\n function: Callable,\n dtypes: Optional[str] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Perform a user-defined aggregation on the specified axis, where the axis reduces down to a singleton.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the reduce over.\n function : callable(row|col) -> single value\n The reduce function to apply to each column.\n dtypes : str, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the same columns as the previous, with only a single row.\n\n Notes\n -----\n The user-defined function must reduce to a single value.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.tree_reduce_ModinDataframe.tree_reduce.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.tree_reduce_ModinDataframe.tree_reduce.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 292, "end_line": 331, "span_ids": ["ModinDataframe.tree_reduce"], "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": "class ModinDataframe(ABC):\n\n @abstractmethod\n def tree_reduce(\n self,\n axis: Union[int, Axis],\n map_func: Callable,\n reduce_func: Optional[Callable] = None,\n dtypes: Optional[str] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Perform a user-defined aggregation on the specified axis, where the axis reduces down to a singleton using a tree-reduce computation pattern.\n\n The map function is applied first over multiple partitions of a column, and then the reduce\n function (if specified, otherwise the map function is applied again) is applied to the\n results to produce a single value.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the tree reduce over.\n map_func : callable(row|col) -> row|col|single value\n The map function to apply to each column.\n reduce_func : callable(row|col) -> single value, optional\n The reduce function to apply to the results of the map function.\n dtypes : str, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the same columns as the previous, with only a single row.\n\n Notes\n -----\n The user-defined function must reduce to a single value.\n\n If the user-defined function requires access to the entire column, please use reduce instead.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.infer_types_ModinDataframe.join.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.infer_types_ModinDataframe.join.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 387, "span_ids": ["ModinDataframe.join", "ModinDataframe.infer_types"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModinDataframe(ABC):\n\n @abstractmethod\n def infer_types(self, columns_list: List[str]) -> \"ModinDataframe\":\n \"\"\"\n Determine the compatible type shared by all values in the specified columns, and coerce them to that type.\n\n Parameters\n ----------\n columns_list : list of strings\n List of column labels to infer and induce types over.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the inferred schema.\n \"\"\"\n pass\n\n @abstractmethod\n def join(\n self,\n axis: Union[int, Axis],\n condition: Callable,\n other: \"ModinDataframe\",\n join_type: Union[str, JoinType],\n ) -> \"ModinDataframe\":\n \"\"\"\n Join this dataframe with the other.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the join on.\n condition : callable\n Function that determines which rows should be joined. The condition can be a\n simple equality, e.g. \"left.col1 == right.col1\" or can be arbitrarily complex.\n other : ModinDataframe\n The other data to join with, i.e. the right dataframe.\n join_type : string {\"inner\", \"left\", \"right\", \"outer\"} or modin.core.dataframe.base.utils.JoinType\n The type of join to perform.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe that is the result of applying the specified join over the two\n dataframes.\n\n Notes\n -----\n During the join, this dataframe is considered the left, while the other is\n treated as the right.\n\n Only inner joins, left outer, right outer, and full outer joins are currently supported.\n Support for other join types (e.g. natural join) may be implemented in the future.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.concat_ModinDataframe.concat.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.concat_ModinDataframe.concat.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 416, "span_ids": ["ModinDataframe.concat"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def concat(\n self,\n axis: Union[int, Axis],\n others: Union[\"ModinDataframe\", List[\"ModinDataframe\"]],\n ) -> \"ModinDataframe\":\n \"\"\"\n Append rows/columns along the specified axis from multiple dataframes.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis on which to perform the concatenation.\n others : ModinDataframe or list of ModinDataframes\n The other ModinDataframe(s) to concatenate.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe that is the result of concatenating the dataframes over the\n specified axis.\n\n Notes\n -----\n The concat operator incurs fixed overheads, and so this algebra places no\n limit to the number of dataframes that may be concatenated in this way.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.transpose_ModinDataframe.transpose.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.transpose_ModinDataframe.transpose.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 418, "end_line": 434, "span_ids": ["ModinDataframe.transpose"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def transpose(self) -> \"ModinDataframe\":\n \"\"\"\n Swap the row and column axes.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the row and column axes swapped.\n\n Notes\n -----\n Transposing a dataframe is expensive, and so it is performed lazily. The axes are swapped\n logically immediately, but the physical swap does not occur until absolutely necessary,\n which helps motivate the axis argument to the other operators in this algebra.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.to_labels_ModinDataframe.to_labels.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.to_labels_ModinDataframe.to_labels.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 436, "end_line": 456, "span_ids": ["ModinDataframe.to_labels"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def to_labels(self, column_labels: Union[str, List[str]]) -> \"ModinDataframe\":\n \"\"\"\n Replace the row labels with one or more columns of data.\n\n Parameters\n ----------\n column_labels : string or list of strings\n Column label(s) to use as the new row labels.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the row labels replaced by the specified columns.\n\n Notes\n -----\n When multiple column labels are specified, a hierarchical set of labels is created, ordered by the ordering\n of labels in the input.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.from_labels_ModinDataframe.from_labels.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.from_labels_ModinDataframe.from_labels.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 458, "end_line": 473, "span_ids": ["ModinDataframe.from_labels"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def from_labels(self) -> \"ModinDataframe\":\n \"\"\"\n Move the row labels into the data at position 0, and sets the row labels to the positional notation.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the row labels moved into the data.\n\n Notes\n -----\n In the case that the dataframe has hierarchical labels, all label \"levels\u201d are inserted into the dataframe\n in the order they occur in the labels, with the outermost being in position 0.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.rename_ModinDataframe.rename.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.rename_ModinDataframe.rename.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 475, "end_line": 503, "span_ids": ["ModinDataframe.rename"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModinDataframe(ABC):\n\n @abstractmethod\n def rename(\n self,\n new_row_labels: Optional[Union[Dict[Hashable, Hashable], Callable]] = None,\n new_col_labels: Optional[Union[Dict[Hashable, Hashable], Callable]] = None,\n level: Optional[Union[int, List[int]]] = None,\n ) -> \"ModinDataframe\":\n \"\"\"\n Replace the row and column labels with the specified new labels.\n\n Parameters\n ----------\n new_row_labels : dictionary or callable, optional\n Mapping or callable that relates old row labels to new labels.\n new_col_labels : dictionary or callable, optional\n Mapping or callable that relates old col labels to new labels.\n level : int or list of ints, optional\n Level(s) whose row labels to replace.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe with the new row and column labels.\n\n Notes\n -----\n If level is not specified, the default behavior is to replace row labels in all levels.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.sort_by_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/dataframe.py_ModinDataframe.sort_by_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 505, "end_line": 532, "span_ids": ["ModinDataframe.sort_by"], "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 ModinDataframe(ABC):\n\n @abstractmethod\n def sort_by(\n self,\n axis: Union[int, Axis],\n labels: Union[str, List[str]],\n ascending: bool = True,\n ) -> \"ModinDataframe\":\n \"\"\"\n Logically reorder rows (columns if axis=1) lexicographically by the data in a column or set of columns.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the sort over.\n labels : string or list of strings\n Column (row if axis=1) label(s) to use to determine lexicographical ordering. If multiple\n columns (rows if axis=1) are provided, the sort is performed on the first column (row if axis=1),\n with ties broken by the other columns (rows if axis=1) provided.\n ascending : boolean, default: True\n Whether to sort in ascending or descending order.\n\n Returns\n -------\n ModinDataframe\n A new ModinDataframe sorted into lexicographical order by the specified column(s).\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/utils.py_pandas_JoinType.OUTER._outer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/utils.py_pandas_JoinType.OUTER._outer_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 54, "span_ids": ["Axis", "JoinType", "docstring"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nfrom pandas.api.types import is_scalar\nfrom pandas._typing import IndexLabel\nfrom enum import Enum\nfrom typing import cast, Dict, List, Tuple, Sequence\n\n\nclass Axis(Enum): # noqa: PR01\n \"\"\"\n An enum that represents the `axis` argument provided to the algebra operators.\n\n The enum has 3 values - ROW_WISE to represent the row axis, COL_WISE to represent the\n column axis, and CELL_WISE to represent no axis. ROW_WISE operations iterate over the rows\n COL_WISE operations over the columns, and CELL_WISE operations over any of the partitioning\n schemes that are supported in Modin (row-wise, column-wise, or block-wise).\n \"\"\"\n\n ROW_WISE = 0\n COL_WISE = 1\n CELL_WISE = None\n\n\nclass JoinType(Enum): # noqa: PR01\n \"\"\"\n An enum that represents the `join_type` argument provided to the algebra operators.\n\n The enum has 4 values - INNER to represent inner joins, LEFT to represent left joins, RIGHT to\n represent right joins, and OUTER to represent outer joins.\n \"\"\"\n\n INNER = \"inner\"\n LEFT = \"left\"\n RIGHT = \"right\"\n OUTER = \"outer\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/utils.py_join_columns_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/dataframe/utils.py_join_columns_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 139, "span_ids": ["join_columns"], "tokens": 728}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_columns(\n left: pandas.Index,\n right: pandas.Index,\n left_on: IndexLabel,\n right_on: IndexLabel,\n suffixes: Tuple[str, str],\n) -> Tuple[pandas.Index, Dict[IndexLabel, IndexLabel], Dict[IndexLabel, IndexLabel]]:\n \"\"\"\n Compute resulting columns for the two dataframes being merged.\n\n Parameters\n ----------\n left : pandas.Index\n Columns of the left frame to join.\n right : pandas.Index\n Columns of the right frame to join.\n left_on : list-like or scalar\n Column names on which the frames are joined in the left DataFrame.\n right_on : list-like or scalar\n Column names on which the frames are joined in the right DataFrame.\n suffixes : tuple[str, str]\n A 2-length sequence containing suffixes to append to the intersected columns.\n\n Returns\n -------\n pandas.Index, dict[IndexLabel -> IndexLabel], dict[IndexLabel -> IndexLabel]\n Returns columns for the resulting frame and mappings of old to new column\n names for `left` and `right` accordingly.\n\n Raises\n ------\n NotImplementedError\n Raised when one of the keys to join is an index level, pandas behaviour is really\n complicated in this case, so we're not supporting this case for now.\n \"\"\"\n # using `cast` to make `mypy` acknowledged that the variable now ensured to be `Sequence[IndexLabel]`\n left_on = cast(Sequence[IndexLabel], [left_on] if is_scalar(left_on) else left_on)\n right_on = cast(\n Sequence[IndexLabel], [right_on] if is_scalar(right_on) else right_on\n )\n\n if any(col not in left for col in left_on) or any(\n col not in right for col in right_on\n ):\n raise NotImplementedError(\n \"Cases, where one of the keys to join is an index level, are not yet supported.\"\n )\n\n left_conflicts = set(left) & (set(right) - set(right_on))\n right_conflicts = set(right) & (set(left) - set(left_on))\n conflicting_cols = left_conflicts | right_conflicts\n\n def _get_new_name(col: IndexLabel, suffix: str) -> IndexLabel:\n if col in conflicting_cols:\n return (\n (f\"{col[0]}{suffix}\", *col[1:])\n if isinstance(col, tuple)\n else f\"{col}{suffix}\"\n )\n else:\n return col\n\n left_renamer: Dict[IndexLabel, IndexLabel] = {}\n right_renamer: Dict[IndexLabel, IndexLabel] = {}\n new_left: List = []\n new_right: List = []\n\n for col in left:\n new_name = _get_new_name(col, suffixes[0])\n new_left.append(new_name)\n left_renamer[col] = new_name\n\n for col in right:\n # If we're joining on the column that exists in both frames then it was already\n # taken from the 'left', don't want to take it again from the 'right'.\n if not (col in left_on and col in right_on):\n new_name = _get_new_name(col, suffixes[1])\n new_right.append(new_name)\n right_renamer[col] = new_name\n\n new_columns = pandas.Index(new_left + new_right)\n return new_columns, left_renamer, right_renamer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 19, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_from_abc_import_ABC_abst_CategoricalDescription.categories": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_from_abc_import_ABC_abst_CategoricalDescription.categories", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 49, "span_ids": ["ColumnBuffers", "CategoricalDescription", "docstring"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from abc import ABC, abstractmethod\nfrom typing import Any, Dict, Iterable, Optional, Sequence, Tuple, TypedDict\n\nfrom .utils import ColumnNullType, DlpackDeviceType, DTypeKind\n\n\nclass ColumnBuffers(TypedDict): # noqa: GL08\n # first element is a buffer containing the column data;\n # second element is the data buffer's associated dtype\n data: Tuple[\"ProtocolBuffer\", Any]\n\n # first element is a buffer containing mask values indicating missing data;\n # second element is the mask value buffer's associated dtype.\n # None if the null representation is not a bit or byte mask\n validity: Optional[Tuple[\"ProtocolBuffer\", Any]]\n\n # first element is a buffer containing the offset values for\n # variable-size binary data (e.g., variable-length strings);\n # second element is the offsets buffer's associated dtype.\n # None if the data buffer does not have an associated offsets buffer\n offsets: Optional[Tuple[\"ProtocolBuffer\", Any]]\n\n\nclass CategoricalDescription(TypedDict): # noqa: GL08\n # whether the ordering of dictionary indices is semantically meaningful\n is_ordered: bool\n # whether a column-style mapping of categorical values to other objects exists\n is_dictionary: bool\n # None if not a column-style categorical.\n categories: Optional[\"ProtocolColumn\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer_ProtocolBuffer.ptr.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer_ProtocolBuffer.ptr.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 89, "span_ids": ["ProtocolBuffer.bufsize", "ProtocolBuffer", "ProtocolBuffer.ptr"], "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 ProtocolBuffer(ABC):\n \"\"\"\n Data in the buffer is guaranteed to be contiguous in memory.\n\n Note that there is no dtype attribute present, a buffer can be thought of\n as simply a block of memory. However, if the column that the buffer is\n attached to has a dtype that's supported by DLPack and ``__dlpack__`` is\n implemented, then that dtype information will be contained in the return\n value from ``__dlpack__``.\n\n This distinction is useful to support both (a) data exchange via DLPack on a\n buffer and (b) dtypes like variable-length strings which do not have a\n fixed number of bytes per element.\n \"\"\"\n\n @property\n @abstractmethod\n def bufsize(self) -> int:\n \"\"\"\n Buffer size in bytes.\n\n Returns\n -------\n int\n \"\"\"\n pass\n\n @property\n @abstractmethod\n def ptr(self) -> int:\n \"\"\"\n Pointer to start of the buffer as an integer.\n\n Returns\n -------\n int\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer.__dlpack___ProtocolBuffer.__dlpack__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer.__dlpack___ProtocolBuffer.__dlpack__.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 108, "span_ids": ["ProtocolBuffer.__dlpack__"], "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 ProtocolBuffer(ABC):\n\n @abstractmethod\n def __dlpack__(self) -> Any:\n \"\"\"\n Produce DLPack capsule (see array API standard).\n\n DLPack not implemented in NumPy yet, so leave it out here.\n\n Raises\n ------\n ``TypeError`` if the buffer contains unsupported dtypes.\n ``NotImplementedError`` if DLPack support is not implemented.\n\n Notes\n -----\n Useful to have to connect to array libraries. Support optional because\n it's not completely trivial to implement for a Python-only library.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer.__dlpack_device___ProtocolBuffer.__dlpack_device__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolBuffer.__dlpack_device___ProtocolBuffer.__dlpack_device__.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 134, "span_ids": ["ProtocolBuffer.__dlpack_device__"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProtocolBuffer(ABC):\n\n @abstractmethod\n def __dlpack_device__(self) -> Tuple[DlpackDeviceType, Optional[int]]:\n \"\"\"\n Device type and device ID for where the data in the buffer resides.\n\n Uses device type codes matching DLPack. Enum members are:\n - CPU = 1\n - CUDA = 2\n - CPU_PINNED = 3\n - OPENCL = 4\n - VULKAN = 7\n - METAL = 8\n - VPI = 9\n - ROCM = 10\n\n Returns\n -------\n tuple\n Device type and device ID.\n\n Notes\n -----\n Must be implemented even if ``__dlpack__`` is not.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn_ProtocolColumn.offset.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn_ProtocolColumn.offset.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 210, "span_ids": ["ProtocolColumn.size", "ProtocolColumn.offset", "ProtocolColumn"], "tokens": 663}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProtocolColumn(ABC):\n \"\"\"\n A column object, with only the methods and properties required by the interchange protocol defined.\n\n A column can contain one or more chunks. Each chunk can contain up to three\n buffers - a data buffer, a mask buffer (depending on null representation),\n and an offsets buffer (if variable-size binary; e.g., variable-length strings).\n\n TBD: Arrow has a separate \"null\" dtype, and has no separate mask concept.\n Instead, it seems to use \"children\" for both columns with a bit mask,\n and for nested dtypes. Unclear whether this is elegant or confusing.\n This design requires checking the null representation explicitly.\n The Arrow design requires checking:\n 1. the ARROW_FLAG_NULLABLE (for sentinel values)\n 2. if a column has two children, combined with one of those children\n having a null dtype.\n Making the mask concept explicit seems useful. One null dtype would\n not be enough to cover both bit and byte masks, so that would mean\n even more checking if we did it the Arrow way.\n TBD: there's also the \"chunk\" concept here, which is implicit in Arrow as\n multiple buffers per array (= column here). Semantically it may make\n sense to have both: chunks were meant for example for lazy evaluation\n of data which doesn't fit in memory, while multiple buffers per column\n could also come from doing a selection operation on a single\n contiguous buffer.\n Given these concepts, one would expect chunks to be all of the same\n size (say a 10,000 row dataframe could have 10 chunks of 1,000 rows),\n while multiple buffers could have data-dependent lengths. Not an issue\n in pandas if one column is backed by a single NumPy array, but in\n Arrow it seems possible.\n Are multiple chunks *and* multiple buffers per column necessary for\n the purposes of this interchange protocol, or must producers either\n reuse the chunk concept for this or copy the data?\n\n Notes\n -----\n This ProtocolColumn object can only be produced by ``__dataframe__``,\n so doesn't need its own version or ``__column__`` protocol.\n \"\"\"\n\n @abstractmethod\n def size(self) -> int:\n \"\"\"\n Size of the column, in elements.\n\n Corresponds to `DataFrame.num_rows()` if column is a single chunk;\n equal to size of this current chunk otherwise.\n\n Is a method rather than a property because it may cause a (potentially\n expensive) computation for some dataframe implementations.\n\n Returns\n -------\n int\n Size of the column, in elements.\n \"\"\"\n pass\n\n @property\n @abstractmethod\n def offset(self) -> int:\n \"\"\"\n Get the offset of first element.\n\n May be > 0 if using chunks; for example for a column\n with N chunks of equal size M (only the last chunk may be shorter),\n ``offset = n * M``, ``n = 0 .. N-1``.\n\n Returns\n -------\n int\n The offset of first element.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.dtype_ProtocolColumn.dtype.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.dtype_ProtocolColumn.dtype.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 247, "span_ids": ["ProtocolColumn.dtype"], "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": "class ProtocolColumn(ABC):\n\n @property\n @abstractmethod\n def dtype(self) -> Tuple[DTypeKind, int, str, str]:\n \"\"\"\n Dtype description as a tuple ``(kind, bit-width, format string, endianness)``.\n\n * Kind : DTypeKind\n * Bit-width : the number of bits as an integer\n * Format string : data type description format string in Apache Arrow C\n Data Interface format.\n * Endianness : current only native endianness (``=``) is supported\n\n Returns\n -------\n tuple\n ``(kind, bit-width, format string, endianness)``.\n\n Notes\n -----\n - Kind specifiers are aligned with DLPack where possible\n (hence the jump to 20, leave enough room for future extension).\n - Masks must be specified as boolean with either bit width 1 (for bit masks)\n or 8 (for byte masks).\n - Dtype width in bits was preferred over bytes\n - Endianness isn't too useful, but included now in case in the future\n we need to support non-native endianness\n - Went with Apache Arrow format strings over NumPy format strings\n because they're more complete from a dataframe perspective\n - Format strings are mostly useful for datetime specification, and for categoricals.\n - For categoricals, the format string describes the type of the categorical\n in the data buffer. In case of a separate encoding of the categorical\n (e.g. an integer to string mapping), this can be derived from ``self.describe_categorical``.\n - Data types not included: complex, Arrow-style null, binary, decimal,\n and nested (list, struct, map, union) dtypes.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.describe_categorical_ProtocolColumn.describe_categorical.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.describe_categorical_ProtocolColumn.describe_categorical.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 249, "end_line": 276, "span_ids": ["ProtocolColumn.describe_categorical"], "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 ProtocolColumn(ABC):\n\n @property\n @abstractmethod\n def describe_categorical(self) -> CategoricalDescription:\n \"\"\"\n If the dtype is categorical, there are two options.\n\n - There are only values in the data buffer.\n - There is a separate non-categorical Column encoding categorical values.\n\n TBD: are there any other in-memory representations that are needed?\n\n Returns\n -------\n dict\n Content of returned dict:\n - \"is_ordered\" : bool, whether the ordering of dictionary indices is\n semantically meaningful.\n - \"is_dictionary\" : bool, whether a mapping of\n categorical values to other objects exists\n - \"categories\" : Column representing the (implicit) mapping of indices to\n category values (e.g. an array of cat1, cat2, ...).\n None if not a dictionary-style categorical.\n\n Raises\n ------\n ``TypeError`` if the dtype is not categorical.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.describe_null_ProtocolColumn.describe_null.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.describe_null_ProtocolColumn.describe_null.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 295, "span_ids": ["ProtocolColumn.describe_null"], "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 ProtocolColumn(ABC):\n\n @property\n @abstractmethod\n def describe_null(self) -> Tuple[ColumnNullType, Any]:\n \"\"\"\n Return the missing value (or \"null\") representation the column dtype uses.\n\n Return as a tuple ``(kind, value)``.\n * Kind: ColumnNullType\n * Value : if kind is \"sentinel value\", the actual value. If kind is a bit\n mask or a byte mask, the value (0 or 1) indicating a missing value. None\n otherwise.\n\n Returns\n -------\n tuple\n ``(kind, value)``.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.null_count_ProtocolColumn.num_chunks.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.null_count_ProtocolColumn.num_chunks.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 337, "span_ids": ["ProtocolColumn.num_chunks", "ProtocolColumn.null_count", "ProtocolColumn.metadata"], "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 ProtocolColumn(ABC):\n\n @property\n @abstractmethod\n def null_count(self) -> int:\n \"\"\"\n Get number of null elements, if known.\n\n Returns\n -------\n int\n\n Notes\n -----\n Arrow uses -1 to indicate \"unknown\", but None seems cleaner.\n \"\"\"\n pass\n\n @property\n @abstractmethod\n def metadata(self) -> Dict[str, Any]:\n \"\"\"\n Get the metadata for the column.\n\n See `DataFrame.metadata` for more details.\n\n Returns\n -------\n dict\n \"\"\"\n pass\n\n @abstractmethod\n def num_chunks(self) -> int:\n \"\"\"\n Return the number of chunks the column consists of.\n\n Returns\n -------\n int\n The number of chunks the column consists of.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.get_chunks_ProtocolColumn.get_chunks.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.get_chunks_ProtocolColumn.get_chunks.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 362, "span_ids": ["ProtocolColumn.get_chunks"], "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 ProtocolColumn(ABC):\n\n @abstractmethod\n def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable[\"ProtocolColumn\"]:\n \"\"\"\n Return an iterator yielding the chunks.\n\n By default ``n_chunks=None``, yields the chunks that the data is stored as by the producer.\n If given, ``n_chunks`` must be a multiple of ``self.num_chunks()``,\n meaning the producer must subdivide each chunk before yielding it.\n\n Parameters\n ----------\n n_chunks : int, optional\n Number of chunks to yield.\n\n Yields\n ------\n DataFrame\n A ``DataFrame`` object(s).\n\n Raises\n ------\n ``RuntimeError`` if ``n_chunks`` is not a multiple of ``self.num_chunks()``.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.get_buffers_ProtocolColumn.get_buffers.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolColumn.get_buffers_ProtocolColumn.get_buffers.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 364, "end_line": 384, "span_ids": ["ProtocolColumn.get_buffers"], "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 ProtocolColumn(ABC):\n\n @abstractmethod\n def get_buffers(self) -> ColumnBuffers:\n \"\"\"\n Return a dictionary containing the underlying buffers.\n\n Returns\n -------\n dict\n - \"data\": a two-element tuple whose first element is a buffer\n containing the data and whose second element is the data buffer's associated dtype.\n - \"validity\": a two-element tuple whose first element is a buffer\n containing mask values indicating missing data and\n whose second element is the mask value buffer's\n associated dtype. None if the null representation is not a bit or byte mask.\n - \"offsets\": a two-element tuple whose first element is a buffer\n containing the offset values for variable-size binary data\n (e.g., variable-length strings) and whose second element is the offsets\n buffer's associated dtype. None if the data buffer does not have\n an associated offsets buffer.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe_ProtocolDataframe._version_of_the_protocol": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe_ProtocolDataframe._version_of_the_protocol", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 387, "end_line": 403, "span_ids": ["ProtocolDataframe"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProtocolDataframe(ABC):\n \"\"\"\n A data frame class, with only the methods required by the interchange protocol defined.\n\n Instances of this (private) class are returned from\n ``modin.core.dataframe.base.dataframe.dataframe.ModinDataframe.__dataframe__``\n as objects with the methods and attributes defined on this class.\n\n A \"data frame\" represents an ordered collection of named columns.\n A column's \"name\" must be a unique string. Columns may be accessed by name or by position.\n This could be a public data frame class, or an object with the methods and\n attributes defined on this ProtocolDataframe class could be returned from the\n ``__dataframe__`` method of a public data frame class in a library adhering\n to the dataframe interchange protocol specification.\n \"\"\"\n\n version = 0 # version of the protocol", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.__dataframe___ProtocolDataframe.__dataframe__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.__dataframe___ProtocolDataframe.__dataframe__.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 405, "end_line": 432, "span_ids": ["ProtocolDataframe.__dataframe__"], "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 ProtocolDataframe(ABC):\n\n @abstractmethod\n def __dataframe__(\n self, nan_as_null: bool = False, allow_copy: bool = True\n ) -> \"ProtocolDataframe\":\n \"\"\"\n Construct a new dataframe interchange object, potentially changing the parameters.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n nan_as_null : bool, default: False\n A keyword intended for the consumer to tell the producer\n to overwrite null values in the data with ``NaN``.\n This currently has no effect; once support for nullable extension\n dtypes is added, this value should be propagated to columns.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n\n Returns\n -------\n ProtocolDataframe\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.metadata_ProtocolDataframe.metadata.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.metadata_ProtocolDataframe.metadata.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 434, "end_line": 451, "span_ids": ["ProtocolDataframe.metadata"], "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 ProtocolDataframe(ABC):\n\n @property\n @abstractmethod\n def metadata(self) -> Dict[str, Any]:\n \"\"\"\n Get the metadata for the data frame, as a dictionary with string keys.\n\n The contents of `metadata` may be anything, they are meant for a library\n to store information that it needs to, e.g., roundtrip losslessly or\n for two implementations to share data that is not (yet) part of the\n interchange protocol specification. For avoiding collisions with other\n entries, please add name the keys with the name of the library\n followed by a period and the desired name, e.g, ``pandas.indexcol``.\n\n Returns\n -------\n dict\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.num_columns_ProtocolDataframe.select_columns_by_name.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.num_columns_ProtocolDataframe.select_columns_by_name.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 453, "end_line": 579, "span_ids": ["ProtocolDataframe.num_chunks", "ProtocolDataframe.num_rows", "ProtocolDataframe.get_column_by_name", "ProtocolDataframe.get_column", "ProtocolDataframe.column_names", "ProtocolDataframe.select_columns_by_name", "ProtocolDataframe.select_columns", "ProtocolDataframe.get_columns", "ProtocolDataframe.num_columns"], "tokens": 597}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProtocolDataframe(ABC):\n\n @abstractmethod\n def num_columns(self) -> int:\n \"\"\"\n Return the number of columns in the ProtocolDataframe.\n\n Returns\n -------\n int\n The number of columns in the ProtocolDataframe.\n \"\"\"\n pass\n\n @abstractmethod\n def num_rows(self) -> Optional[int]:\n \"\"\"\n Return the number of rows in the ProtocolDataframe, if available.\n\n Returns\n -------\n int\n The number of rows in the ProtocolDataframe.\n \"\"\"\n pass\n\n @abstractmethod\n def num_chunks(self) -> int:\n \"\"\"\n Return the number of chunks the ProtocolDataframe consists of.\n\n Returns\n -------\n int\n The number of chunks the ProtocolDataframe consists of.\n \"\"\"\n pass\n\n @abstractmethod\n def column_names(self) -> Iterable[str]:\n \"\"\"\n Return an iterator yielding the column names.\n\n Yields\n ------\n str\n The name of the column(s).\n \"\"\"\n pass\n\n @abstractmethod\n def get_column(self, i: int) -> ProtocolColumn:\n \"\"\"\n Return the column at the indicated position.\n\n Parameters\n ----------\n i : int\n Positional index of the column to be returned.\n\n Returns\n -------\n Column\n The column at the indicated position.\n \"\"\"\n pass\n\n @abstractmethod\n def get_column_by_name(self, name: str) -> ProtocolColumn:\n \"\"\"\n Return the column whose name is the indicated name.\n\n Parameters\n ----------\n name : str\n String label of the column to be returned.\n\n Returns\n -------\n Column\n The column whose name is the indicated name.\n \"\"\"\n pass\n\n @abstractmethod\n def get_columns(self) -> Iterable[ProtocolColumn]:\n \"\"\"\n Return an iterator yielding the columns.\n\n Yields\n ------\n Column\n The ``Column`` object(s).\n \"\"\"\n pass\n\n @abstractmethod\n def select_columns(self, indices: Sequence[int]) -> \"ProtocolDataframe\":\n \"\"\"\n Create a new ProtocolDataframe by selecting a subset of columns by index.\n\n Parameters\n ----------\n indices : Sequence[int]\n Column indices to be selected out of the ProtocolDataframe.\n\n Returns\n -------\n ProtocolDataframe\n A new ProtocolDataframe with selected a subset of columns by index.\n \"\"\"\n pass\n\n @abstractmethod\n def select_columns_by_name(self, names: Sequence[str]) -> \"ProtocolDataframe\":\n \"\"\"\n Create a new ProtocolDataframe by selecting a subset of columns by name.\n\n Parameters\n ----------\n names : Sequence[str]\n Column names to be selected out of the ProtocolDataframe.\n\n Returns\n -------\n ProtocolDataframe\n A new ProtocolDataframe with selected a subset of columns by name.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.get_chunks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py_ProtocolDataframe.get_chunks_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 581, "end_line": 607, "span_ids": ["ProtocolDataframe.get_chunks"], "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 ProtocolDataframe(ABC):\n\n @abstractmethod\n def get_chunks(\n self, n_chunks: Optional[int] = None\n ) -> Iterable[\"ProtocolDataframe\"]:\n \"\"\"\n Return an iterator yielding the chunks.\n\n By default `n_chunks=None`, yields the chunks that the data is stored as by the producer.\n If given, `n_chunks` must be a multiple of `self.num_chunks()`,\n meaning the producer must subdivide each chunk before yielding it.\n\n Parameters\n ----------\n n_chunks : int, optional\n Number of chunks to yield.\n\n Yields\n ------\n ProtocolDataframe\n A ``ProtocolDataframe`` object(s).\n\n Raises\n ------\n ``RuntimeError`` if ``n_chunks`` is not a multiple of ``self.num_chunks()``.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_enum_DTypeKind.CATEGORICAL.23": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_enum_DTypeKind.CATEGORICAL.23", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 56, "span_ids": ["DTypeKind", "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": "import enum\nimport re\nfrom typing import Optional, Union\n\nimport numpy as np\nimport pandas\nfrom pandas.api.types import is_datetime64_dtype\n\n\nclass DTypeKind(enum.IntEnum): # noqa PR01\n \"\"\"\n Integer enum for data types.\n Attributes\n ----------\n INT : int\n Matches to signed integer data type.\n UINT : int\n Matches to unsigned integer data type.\n FLOAT : int\n Matches to floating point data type.\n BOOL : int\n Matches to boolean data type.\n STRING : int\n Matches to string data type (UTF-8 encoded).\n DATETIME : int\n Matches to datetime data type.\n CATEGORICAL : int\n Matches to categorical data type.\n \"\"\"\n\n INT = 0\n UINT = 1\n FLOAT = 2\n BOOL = 20\n STRING = 21 # UTF-8\n DATETIME = 22\n CATEGORICAL = 23", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_ColumnNullType_DlpackDeviceType.ROCM.10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_ColumnNullType_DlpackDeviceType.ROCM.10", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 93, "span_ids": ["DlpackDeviceType", "ColumnNullType"], "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 ColumnNullType(enum.IntEnum): # noqa PR01\n \"\"\"\n Integer enum for null type representation.\n Attributes\n ----------\n NON_NULLABLE : int\n Non-nullable column.\n USE_NAN : int\n Use explicit float NaN value.\n USE_SENTINEL : int\n Sentinel value besides NaN.\n USE_BITMASK : int\n The bit is set/unset representing a null on a certain position.\n USE_BYTEMASK : int\n The byte is set/unset representing a null on a certain position.\n \"\"\"\n\n NON_NULLABLE = 0\n USE_NAN = 1\n USE_SENTINEL = 2\n USE_BITMASK = 3\n USE_BYTEMASK = 4\n\n\nclass DlpackDeviceType(enum.IntEnum): # noqa PR01\n \"\"\"Integer enum for device type codes matching DLPack.\"\"\"\n\n CPU = 1\n CUDA = 2\n CPU_PINNED = 3\n OPENCL = 4\n VULKAN = 7\n METAL = 8\n VPI = 9\n ROCM = 10", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_ArrowCTypes_Endianness.NA._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_ArrowCTypes_Endianness.NA._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 135, "span_ids": ["ArrowCTypes", "Endianness"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArrowCTypes:\n \"\"\"\n Enum for Apache Arrow C type format strings.\n\n The Arrow C data interface:\n https://arrow.apache.org/docs/format/CDataInterface.html#data-type-description-format-strings\n \"\"\"\n\n NULL = \"n\"\n BOOL = \"b\"\n INT8 = \"c\"\n UINT8 = \"C\"\n INT16 = \"s\"\n UINT16 = \"S\"\n INT32 = \"i\"\n UINT32 = \"I\"\n INT64 = \"l\"\n UINT64 = \"L\"\n FLOAT16 = \"e\"\n FLOAT32 = \"f\"\n FLOAT64 = \"g\"\n STRING = \"u\" # utf-8\n DATE32 = \"tdD\"\n DATE64 = \"tdm\"\n # Resoulution:\n # - seconds -> 's'\n # - miliseconds -> 'm'\n # - microseconds -> 'u'\n # - nanoseconds -> 'n'\n TIMESTAMP = \"ts{resolution}:{tz}\"\n TIME = \"tt{resolution}\"\n\n\nclass Endianness:\n \"\"\"Enum indicating the byte-order of a data-type.\"\"\"\n\n LITTLE = \"<\"\n BIG = \">\"\n NATIVE = \"=\"\n NA = \"|\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_pandas_dtype_to_arrow_c_pandas_dtype_to_arrow_c.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/interchange/dataframe_protocol/utils.py_pandas_dtype_to_arrow_c_pandas_dtype_to_arrow_c.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 169, "span_ids": ["pandas_dtype_to_arrow_c"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pandas_dtype_to_arrow_c(dtype: Union[np.dtype, pandas.CategoricalDtype]) -> str:\n \"\"\"\n Represent pandas `dtype` as a format string in Apache Arrow C notation.\n\n Parameters\n ----------\n dtype : np.dtype\n Datatype of pandas DataFrame to represent.\n\n Returns\n -------\n str\n Format string in Apache Arrow C notation of the given `dtype`.\n \"\"\"\n if isinstance(dtype, pandas.CategoricalDtype):\n return ArrowCTypes.INT64\n elif dtype == np.dtype(\"O\"):\n return ArrowCTypes.STRING\n\n format_str = getattr(ArrowCTypes, dtype.name.upper(), None)\n if format_str is not None:\n return format_str\n\n if is_datetime64_dtype(dtype):\n # Selecting the first char of resolution string:\n # dtype.str -> ' None:\n \"\"\"\n Raise a ``RuntimeError`` mentioning that there's a copy required.\n\n Parameters\n ----------\n copy_reason : str, optional\n The reason of making a copy. Should fit to the following format:\n 'The copy occured due to {copy_reason}.'.\n \"\"\"\n msg = \"Copy required but 'allow_copy=False' is set.\"\n if copy_reason:\n msg += f\" The copy occured due to {copy_reason}.\"\n raise RuntimeError(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_modin-project__modin/modin/core/dataframe/base/partitioning/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_from_abc_import_ABC_abst_BaseDataframeAxisPartition.apply.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_from_abc_import_ABC_abst_BaseDataframeAxisPartition.apply.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 90, "span_ids": ["BaseDataframeAxisPartition.apply", "BaseDataframeAxisPartition.list_of_blocks", "BaseDataframeAxisPartition", "docstring"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from abc import ABC, abstractmethod\nfrom typing import Any, Callable, Iterable, Optional, Tuple, Union\n\n\nclass BaseDataframeAxisPartition(ABC): # pragma: no cover\n \"\"\"\n An abstract class that represents the parent class for any axis partition class.\n\n This class is intended to simplify the way that operations are performed.\n\n Attributes\n ----------\n _PARTITIONS_METADATA_LEN : int\n The number of metadata values that the object of `partition_type` consumes.\n \"\"\"\n\n @property\n @abstractmethod\n def list_of_blocks(self) -> list:\n \"\"\"Get the list of physical partition objects that compose this partition.\"\"\"\n pass\n\n def apply(\n self,\n func: Callable,\n *args: Iterable,\n num_splits: Optional[int] = None,\n other_axis_partition: Optional[\"BaseDataframeAxisPartition\"] = None,\n maintain_partitioning: bool = True,\n lengths: Optional[Iterable] = None,\n manual_partition: bool = False,\n **kwargs: dict,\n ) -> Any:\n \"\"\"\n Apply a function to this axis partition along full axis.\n\n Parameters\n ----------\n func : callable\n The function to apply. This will be preprocessed according to\n the corresponding `BaseDataframePartition` objects.\n *args : iterable\n Positional arguments to pass to `func`.\n num_splits : int, default: None\n The number of times to split the result object.\n other_axis_partition : BaseDataframeAxisPartition, default: None\n Another `BaseDataframeAxisPartition` object to be applied\n to func. This is for operations that are between two data sets.\n maintain_partitioning : bool, default: True\n Whether to keep the partitioning in the same\n orientation as it was previously or not. This is important because we may be\n operating on an individual axis partition and not touching the rest.\n In this case, we have to return the partitioning to its previous\n orientation (the lengths will remain the same). This is ignored between\n two axis partitions.\n lengths : iterable, default: None\n The list of lengths to shuffle the partition into.\n manual_partition : bool, default: False\n If True, partition the result with `lengths`.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n list\n A list of `BaseDataframePartition` objects.\n\n Notes\n -----\n The procedures that invoke this method assume full axis\n knowledge. Implement this method accordingly.\n\n You must return a list of `BaseDataframePartition` objects from this method.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition._Child_classes_must_have_BaseDataframeAxisPartition._wrap_partitions.if_extract_metadata_.else_.return._self_partition_type_obje": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition._Child_classes_must_have_BaseDataframeAxisPartition._wrap_partitions.if_extract_metadata_.else_.return._self_partition_type_obje", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 144, "span_ids": ["BaseDataframeAxisPartition._wrap_partitions", "BaseDataframeAxisPartition.apply", "BaseDataframeAxisPartition:3"], "tokens": 478}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseDataframeAxisPartition(ABC):\n\n # Child classes must have these in order to correctly subclass.\n instance_type = None\n partition_type = None\n _PARTITIONS_METADATA_LEN = 0\n\n def _wrap_partitions(\n self, partitions: list, extract_metadata: Optional[bool] = None\n ) -> list:\n \"\"\"\n Wrap remote partition objects with `BaseDataframePartition` class.\n\n Parameters\n ----------\n partitions : list\n List of remotes partition objects to be wrapped with `BaseDataframePartition` class.\n extract_metadata : bool, optional\n Whether the partitions list contains information about partition's metadata.\n If `None` was passed will take the argument's value from the value of `cls._PARTITIONS_METADATA_LEN`.\n\n Returns\n -------\n list\n List of wrapped remote partition objects.\n \"\"\"\n assert self.partition_type is not None\n assert self.instance_type is not None # type: ignore\n\n if extract_metadata is None:\n # If `_PARTITIONS_METADATA_LEN == 0` then the execution doesn't support metadata\n # and thus we should never try extracting it, otherwise assuming that the common\n # approach of always passing the metadata is used.\n extract_metadata = bool(self._PARTITIONS_METADATA_LEN)\n\n if extract_metadata:\n # Here we recieve a 1D array of futures describing partitions and their metadata as:\n # [object_id{partition_idx}, metadata{partition_idx}_{metadata_idx}, ...]\n # Here's an example of such array:\n # [\n # object_id1, metadata1_1, metadata1_2, ..., metadata1_PARTITIONS_METADATA_LEN,\n # object_id2, metadata2_1, ..., metadata2_PARTITIONS_METADATA_LEN,\n # ...\n # object_idN, metadataN_1, ..., metadataN_PARTITIONS_METADATA_LEN,\n # ]\n return [\n self.partition_type(*init_args)\n for init_args in zip(\n # `partition_type` consumes `(object_id, *metadata)`, thus adding `+1`\n *[iter(partitions)]\n * (1 + self._PARTITIONS_METADATA_LEN)\n )\n ]\n else:\n return [self.partition_type(object_id) for object_id in partitions]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition.force_materialization_BaseDataframeAxisPartition.force_materialization._type_ignore_call_arg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition.force_materialization_BaseDataframeAxisPartition.force_materialization._type_ignore_call_arg_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 165, "span_ids": ["BaseDataframeAxisPartition.force_materialization"], "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 BaseDataframeAxisPartition(ABC):\n\n def force_materialization(\n self, get_ip: bool = False\n ) -> \"BaseDataframeAxisPartition\":\n \"\"\"\n Materialize axis partitions into a single partition.\n\n Parameters\n ----------\n get_ip : bool, default: False\n Whether to get node ip address to a single partition or not.\n\n Returns\n -------\n BaseDataframeAxisPartition\n An axis partition containing only a single materialized partition.\n \"\"\"\n materialized = self.apply(\n lambda x: x, num_splits=1, maintain_partitioning=False\n )\n return type(self)(materialized, get_ip=get_ip) # type: ignore[call-arg]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition.unwrap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/base/partitioning/axis_partition.py_BaseDataframeAxisPartition.unwrap_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/base/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 203, "span_ids": ["BaseDataframeAxisPartition.unwrap"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseDataframeAxisPartition(ABC):\n\n def unwrap(\n self, squeeze: bool = False, get_ip: bool = False\n ) -> Union[list, Tuple[list, list]]:\n \"\"\"\n Unwrap partitions from this axis partition.\n\n Parameters\n ----------\n squeeze : bool, default: False\n Flag used to unwrap only one partition.\n get_ip : bool, default: False\n Whether to get node ip address to each partition or not.\n\n Returns\n -------\n list\n List of partitions from this axis partition.\n\n Notes\n -----\n If `get_ip=True`, a tuple of lists of Ray.ObjectRef/Dask.Future to node ip addresses and\n unwrapped partitions, respectively, is returned if Ray/Dask is used as an engine\n (i.e. [(Ray.ObjectRef/Dask.Future, Ray.ObjectRef/Dask.Future), ...]).\n \"\"\"\n if squeeze and len(self.list_of_blocks) == 1:\n if get_ip:\n # TODO(https://github.com/modin-project/modin/issues/5176): Stop ignoring the list_of_ips\n # check once we know that we're not calling list_of_ips on python axis partitions\n return self.list_of_ips[0], self.list_of_blocks[0] # type: ignore[attr-defined]\n else:\n return self.list_of_blocks[0]\n else:\n if get_ip:\n return list(zip(self.list_of_ips, self.list_of_blocks)) # type: ignore[attr-defined]\n else:\n return self.list_of_blocks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/pandas/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_from_collections_import_O_from_modin_utils_import_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_from_collections_import_O_from_modin_utils_import_M", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 61, "span_ids": ["docstring"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import OrderedDict\nimport numpy as np\nimport pandas\nimport datetime\nfrom pandas.api.types import is_object_dtype\nfrom pandas.core.indexes.api import Index, RangeIndex\nfrom pandas.core.dtypes.common import is_numeric_dtype, is_list_like\nfrom pandas._libs.lib import no_default\nfrom typing import List, Hashable, Optional, Callable, Union, Dict, TYPE_CHECKING\n\nfrom modin.config import Engine\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.storage_formats.pandas.utils import get_length_list\nfrom modin.error_message import ErrorMessage\nfrom modin.core.storage_formats.pandas.parsers import (\n find_common_type_cat as find_common_type,\n)\nfrom modin.core.dataframe.base.dataframe.dataframe import ModinDataframe\nfrom modin.core.dataframe.base.dataframe.utils import (\n Axis,\n JoinType,\n)\nfrom modin.core.dataframe.pandas.dataframe.utils import (\n build_sort_functions,\n lazy_metadata_decorator,\n)\nfrom modin.core.dataframe.pandas.metadata import (\n ModinDtypes,\n ModinIndex,\n LazyProxyCategoricalDtype,\n)\n\nif TYPE_CHECKING:\n from modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolDataframe,\n )\n from pandas._typing import npt\n\nfrom modin.pandas.indexing import is_range_like\nfrom modin.pandas.utils import is_full_grab_slice, check_both_not_none\nfrom modin.logging import ClassLogger\nfrom modin.utils import MODIN_UNNAMED_SERIES_LABEL", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe_PandasDataframe.__init__.self__filter_empties_comp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe_PandasDataframe.__init__.self__filter_empties_comp", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 126, "span_ids": ["PandasDataframe.__init__", "PandasDataframe.__constructor__", "PandasDataframe"], "tokens": 470}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n \"\"\"\n An abstract class that represents the parent class for any pandas storage format dataframe class.\n\n This class provides interfaces to run operations on dataframe partitions.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence or callable, optional\n The index for the dataframe. Converted to a ``pandas.Index``.\n Is computed from partitions on demand if not specified.\n If ``callable() -> (pandas.Index, list of row lengths or None)`` type,\n then the calculation will be delayed until `self.index` is called.\n columns : sequence, optional\n The columns object for the dataframe. Converted to a ``pandas.Index``.\n Is computed from partitions on demand if not specified.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series or callable, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = None\n _query_compiler_cls = PandasQueryCompiler\n # These properties flag whether or not we are deferring the metadata synchronization\n _deferred_index = False\n _deferred_column = False\n\n @pandas.util.cache_readonly\n def __constructor__(self):\n \"\"\"\n Create a new instance of this object.\n\n Returns\n -------\n PandasDataframe\n \"\"\"\n return type(self)\n\n def __init__(\n self,\n partitions,\n index=None,\n columns=None,\n row_lengths=None,\n column_widths=None,\n dtypes=None,\n ):\n self._partitions = partitions\n self.set_index_cache(index)\n self.set_columns_cache(columns)\n self._row_lengths_cache = row_lengths\n self._column_widths_cache = column_widths\n self.set_dtypes_cache(dtypes)\n\n self._validate_axes_lengths()\n self._filter_empties(compute_metadata=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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._validate_axes_lengths_PandasDataframe._validate_axes_lengths.if_self__column_widths_ca.ErrorMessage_catch_bugs_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._validate_axes_lengths_PandasDataframe._validate_axes_lengths.if_self__column_widths_ca.ErrorMessage_catch_bugs_a", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 157, "span_ids": ["PandasDataframe._validate_axes_lengths"], "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 PandasDataframe(ClassLogger):\n\n def _validate_axes_lengths(self):\n \"\"\"Validate that labels are split correctly if split is known.\"\"\"\n if self._row_lengths_cache is not None and len(self.index) > 0:\n # An empty frame can have 0 rows but a nonempty index. If the frame\n # does have rows, the number of rows must equal the size of the\n # index.\n num_rows = sum(self._row_lengths_cache)\n if num_rows > 0:\n ErrorMessage.catch_bugs_and_request_email(\n num_rows != len(self.index),\n f\"Row lengths: {num_rows} != {len(self.index)}\",\n )\n ErrorMessage.catch_bugs_and_request_email(\n any(val < 0 for val in self._row_lengths_cache),\n f\"Row lengths cannot be negative: {self._row_lengths_cache}\",\n )\n if self._column_widths_cache is not None and len(self.columns) > 0:\n # An empty frame can have 0 column but a nonempty column index. If\n # the frame does have columns, the number of columns must equal the\n # size of the columns.\n num_columns = sum(self._column_widths_cache)\n if num_columns > 0:\n ErrorMessage.catch_bugs_and_request_email(\n num_columns != len(self.columns),\n f\"Column widths: {num_columns} != {len(self.columns)}\",\n )\n ErrorMessage.catch_bugs_and_request_email(\n any(val < 0 for val in self._column_widths_cache),\n f\"Column widths cannot be negative: {self._column_widths_cache}\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.row_lengths_PandasDataframe.row_lengths.return.self__row_lengths_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.row_lengths_PandasDataframe.row_lengths.return.self__row_lengths_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 175, "span_ids": ["PandasDataframe.row_lengths"], "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 PandasDataframe(ClassLogger):\n\n @property\n def row_lengths(self):\n \"\"\"\n Compute the row partitions lengths if they are not cached.\n\n Returns\n -------\n list\n A list of row partitions lengths.\n \"\"\"\n if self._row_lengths_cache is None:\n if len(self._partitions.T) > 0:\n row_parts = self._partitions.T[0]\n self._row_lengths_cache = [part.length() for part in row_parts]\n else:\n self._row_lengths_cache = []\n return self._row_lengths_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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.column_widths_PandasDataframe.column_widths.return.self__column_widths_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.column_widths_PandasDataframe.column_widths.return.self__column_widths_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 193, "span_ids": ["PandasDataframe.column_widths"], "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 PandasDataframe(ClassLogger):\n\n @property\n def column_widths(self):\n \"\"\"\n Compute the column partitions widths if they are not cached.\n\n Returns\n -------\n list\n A list of column partitions widths.\n \"\"\"\n if self._column_widths_cache is None:\n if len(self._partitions) > 0:\n col_parts = self._partitions[0]\n self._column_widths_cache = [part.width() for part in col_parts]\n else:\n self._column_widths_cache = []\n return self._column_widths_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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._axes_lengths_PandasDataframe.copy_dtypes_cache.return.dtypes_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._axes_lengths_PandasDataframe.copy_dtypes_cache.return.dtypes_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 256, "span_ids": ["PandasDataframe.has_dtypes_cache", "PandasDataframe.has_materialized_dtypes", "PandasDataframe._set_axis_lengths_cache", "PandasDataframe.copy_dtypes_cache", "PandasDataframe._axes_lengths"], "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 PandasDataframe(ClassLogger):\n\n @property\n def _axes_lengths(self):\n \"\"\"\n Get a pair of row partitions lengths and column partitions widths.\n\n Returns\n -------\n list\n The pair of row partitions lengths and column partitions widths.\n \"\"\"\n return [self.row_lengths, self.column_widths]\n\n def _set_axis_lengths_cache(self, value, axis=0):\n \"\"\"\n Set the row/column lengths cache for the specified axis.\n\n Parameters\n ----------\n value : list of ints\n axis : int, default: 0\n 0 for row lengths and 1 for column widths.\n \"\"\"\n if axis == 0:\n self._row_lengths_cache = value\n else:\n self._column_widths_cache = value\n\n @property\n def has_dtypes_cache(self):\n \"\"\"\n Check if the dtypes cache exists.\n\n Returns\n -------\n bool\n \"\"\"\n return self._dtypes is not None\n\n @property\n def has_materialized_dtypes(self):\n \"\"\"\n Check if dataframe has materialized index cache.\n\n Returns\n -------\n bool\n \"\"\"\n return self.has_dtypes_cache and self._dtypes.is_materialized\n\n def copy_dtypes_cache(self):\n \"\"\"\n Copy the dtypes cache.\n\n Returns\n -------\n pandas.Series, callable or None\n If there is an pandas.Series in the cache, then copying occurs.\n \"\"\"\n dtypes_cache = None\n if self.has_dtypes_cache:\n dtypes_cache = self._dtypes.copy()\n return dtypes_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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._maybe_update_proxies_PandasDataframe._maybe_update_proxies.if_isinstance_dtypes_pan.for_key_value_in_dtypes_.if_isinstance_value_Lazy.dtypes_key_value__upda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._maybe_update_proxies_PandasDataframe._maybe_update_proxies.if_isinstance_dtypes_pan.for_key_value_in_dtypes_.if_isinstance_value_Lazy.dtypes_key_value__upda", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 275, "span_ids": ["PandasDataframe._maybe_update_proxies"], "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 PandasDataframe(ClassLogger):\n\n def _maybe_update_proxies(self, dtypes, new_parent=None):\n \"\"\"\n Update lazy proxies stored inside of `dtypes` with a new parent inplace.\n\n Parameters\n ----------\n dtypes : pandas.Series, ModinDtypes or callable\n new_parent : object, optional\n A new parent to link the proxies to. If not specified\n will consider the `self` to be a new parent.\n \"\"\"\n new_parent = new_parent or self\n if isinstance(dtypes, pandas.Series) or (\n isinstance(dtypes, ModinDtypes) and dtypes.is_materialized\n ):\n for key, value in dtypes.items():\n if isinstance(value, LazyProxyCategoricalDtype):\n dtypes[key] = value._update_proxy(new_parent, column_name=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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.set_dtypes_cache_PandasDataframe.dtypes.return.dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.set_dtypes_cache_PandasDataframe.dtypes.return.dtypes", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 306, "span_ids": ["PandasDataframe.dtypes", "PandasDataframe.set_dtypes_cache"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def set_dtypes_cache(self, dtypes):\n \"\"\"\n Set dtypes cache.\n\n Parameters\n ----------\n dtypes : pandas.Series, ModinDtypes or callable\n \"\"\"\n self._maybe_update_proxies(dtypes)\n if isinstance(dtypes, ModinDtypes) or dtypes is None:\n self._dtypes = dtypes\n else:\n self._dtypes = ModinDtypes(dtypes)\n\n @property\n def dtypes(self):\n \"\"\"\n Compute the data types if they are not cached.\n\n Returns\n -------\n pandas.Series\n A pandas Series containing the data types for this dataframe.\n \"\"\"\n if self.has_dtypes_cache:\n dtypes = self._dtypes.get()\n else:\n dtypes = self._compute_dtypes()\n self.set_dtypes_cache(dtypes)\n return dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_dtypes_PandasDataframe._compute_dtypes.return.dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_dtypes_PandasDataframe._compute_dtypes.return.dtypes", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 345, "span_ids": ["PandasDataframe._compute_dtypes"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _compute_dtypes(self, columns=None):\n \"\"\"\n Compute the data types via TreeReduce pattern for the specified columns.\n\n Parameters\n ----------\n columns : list-like, default: None\n Columns to compute dtypes for. If not specified compute dtypes\n for all the columns in the dataframe.\n\n Returns\n -------\n pandas.Series\n A pandas Series containing the data types for this dataframe.\n \"\"\"\n\n def dtype_builder(df):\n return df.apply(lambda col: find_common_type(col.values), axis=0)\n\n if columns is not None:\n # Sorting positions to request columns in the order they're stored (it's more efficient)\n numeric_indices = sorted(self.columns.get_indexer_for(columns))\n obj = self._take_2d_positional(col_positions=numeric_indices)\n else:\n obj = self\n\n # For now we will use a pandas Series for the dtypes.\n if len(obj.columns) > 0:\n dtypes = (\n obj.tree_reduce(0, lambda df: df.dtypes, dtype_builder)\n .to_pandas()\n .iloc[0]\n )\n else:\n dtypes = pandas.Series([])\n # reset name to None because we use MODIN_UNNAMED_SERIES_LABEL internally\n dtypes.name = None\n return dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._index_cache_PandasDataframe.has_materialized_columns.return.self_has_columns_cache_an": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._index_cache_PandasDataframe.has_materialized_columns.return.self_has_columns_cache_an", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 347, "end_line": 478, "span_ids": ["PandasDataframe.set_index_cache", "PandasDataframe.copy_columns_cache", "PandasDataframe.has_columns_cache", "PandasDataframe.copy_index_cache", "PandasDataframe.has_index_cache", "PandasDataframe.set_columns_cache", "PandasDataframe.copy_axis_cache", "PandasDataframe.has_materialized_index", "PandasDataframe.has_materialized_columns", "PandasDataframe.set_axis_cache", "PandasDataframe:11"], "tokens": 655}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n _index_cache = None\n _columns_cache = None\n\n def set_index_cache(self, index):\n \"\"\"\n Set index cache.\n\n Parameters\n ----------\n index : sequence, callable or None\n \"\"\"\n if isinstance(index, ModinIndex) or index is None:\n self._index_cache = index\n else:\n self._index_cache = ModinIndex(index)\n\n def set_columns_cache(self, columns):\n \"\"\"\n Set columns cache.\n\n Parameters\n ----------\n columns : sequence, callable or None\n \"\"\"\n if isinstance(columns, ModinIndex) or columns is None:\n self._columns_cache = columns\n else:\n self._columns_cache = ModinIndex(columns)\n\n def set_axis_cache(self, value, axis=0):\n \"\"\"\n Set cache for the specified axis (index or columns).\n\n Parameters\n ----------\n value : sequence, callable or None\n axis : int, default: 0\n \"\"\"\n if axis == 0:\n self.set_index_cache(value)\n else:\n self.set_columns_cache(value)\n\n @property\n def has_index_cache(self):\n \"\"\"\n Check if the index cache exists.\n\n Returns\n -------\n bool\n \"\"\"\n return self._index_cache is not None\n\n def copy_index_cache(self):\n \"\"\"\n Copy the index cache.\n\n Returns\n -------\n pandas.Index, callable or None\n If there is an pandas.Index in the cache, then copying occurs.\n \"\"\"\n idx_cache = self._index_cache\n if self.has_index_cache:\n idx_cache = self._index_cache.copy()\n return idx_cache\n\n @property\n def has_columns_cache(self):\n \"\"\"\n Check if the columns cache exists.\n\n Returns\n -------\n bool\n \"\"\"\n return self._columns_cache is not None\n\n def copy_columns_cache(self):\n \"\"\"\n Copy the columns cache.\n\n Returns\n -------\n pandas.Index or None\n If there is an pandas.Index in the cache, then copying occurs.\n \"\"\"\n columns_cache = self._columns_cache\n if columns_cache is not None:\n columns_cache = columns_cache.copy()\n return columns_cache\n\n def copy_axis_cache(self, axis=0):\n \"\"\"\n Copy the axis cache (index or columns).\n\n Parameters\n ----------\n axis : int, default: 0\n\n Returns\n -------\n pandas.Index, callable or None\n If there is an pandas.Index in the cache, then copying occurs.\n \"\"\"\n if axis == 0:\n return self.copy_index_cache()\n else:\n return self.copy_columns_cache()\n\n @property\n def has_materialized_index(self):\n \"\"\"\n Check if dataframe has materialized index cache.\n\n Returns\n -------\n bool\n \"\"\"\n return self.has_index_cache and self._index_cache.is_materialized\n\n @property\n def has_materialized_columns(self):\n \"\"\"\n Check if dataframe has materialized columns cache.\n\n Returns\n -------\n bool\n \"\"\"\n return self.has_columns_cache and self._columns_cache.is_materialized", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._validate_set_axis_PandasDataframe._validate_set_axis.return.new_labels": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._validate_set_axis_PandasDataframe._validate_set_axis.return.new_labels", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 508, "span_ids": ["PandasDataframe._validate_set_axis"], "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 PandasDataframe(ClassLogger):\n\n def _validate_set_axis(self, new_labels, old_labels):\n \"\"\"\n Validate the possibility of replacement of old labels with the new labels.\n\n Parameters\n ----------\n new_labels : list-like\n The labels to replace with.\n old_labels : list-like\n The labels to replace.\n\n Returns\n -------\n list-like\n The validated labels.\n \"\"\"\n new_labels = (\n ModinIndex(new_labels)\n if not isinstance(new_labels, ModinIndex)\n else new_labels\n )\n old_len = len(old_labels)\n new_len = len(new_labels)\n if old_len != new_len:\n raise ValueError(\n f\"Length mismatch: Expected axis has {old_len} elements, \"\n + f\"new values have {new_len} elements\"\n )\n return new_labels", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_index_PandasDataframe._get_columns.return.columns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_index_PandasDataframe._get_columns.return.columns", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 510, "end_line": 544, "span_ids": ["PandasDataframe._get_columns", "PandasDataframe._get_index"], "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 PandasDataframe(ClassLogger):\n\n def _get_index(self):\n \"\"\"\n Get the index from the cache object.\n\n Returns\n -------\n pandas.Index\n An index object containing the row labels.\n \"\"\"\n if self.has_index_cache:\n index, row_lengths = self._index_cache.get(return_lengths=True)\n else:\n index, row_lengths = self._compute_axis_labels_and_lengths(0)\n self.set_index_cache(index)\n if self._row_lengths_cache is None:\n self._row_lengths_cache = row_lengths\n return index\n\n def _get_columns(self):\n \"\"\"\n Get the columns from the cache object.\n\n Returns\n -------\n pandas.Index\n An index object containing the column labels.\n \"\"\"\n if self.has_columns_cache:\n columns, column_widths = self._columns_cache.get(return_lengths=True)\n else:\n columns, column_widths = self._compute_axis_labels_and_lengths(1)\n self.set_columns_cache(columns)\n if self._column_widths_cache is None:\n self._column_widths_cache = column_widths\n return columns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._set_index_PandasDataframe.get_axis.return.self_index_if_axis_0_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._set_index_PandasDataframe.get_axis.return.self_index_if_axis_0_e", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 546, "end_line": 603, "span_ids": ["PandasDataframe.axes", "PandasDataframe:15", "PandasDataframe.get_axis", "PandasDataframe._set_index", "PandasDataframe._set_columns"], "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 PandasDataframe(ClassLogger):\n\n def _set_index(self, new_index):\n \"\"\"\n Replace the current row labels with new labels.\n\n Parameters\n ----------\n new_index : list-like\n The new row labels.\n \"\"\"\n if self.has_materialized_index:\n new_index = self._validate_set_axis(new_index, self._index_cache)\n self.set_index_cache(new_index)\n self.synchronize_labels(axis=0)\n\n def _set_columns(self, new_columns):\n \"\"\"\n Replace the current column labels with new labels.\n\n Parameters\n ----------\n new_columns : list-like\n The new column labels.\n \"\"\"\n if self.has_materialized_columns:\n new_columns = self._validate_set_axis(new_columns, self._columns_cache)\n if self.has_materialized_dtypes:\n self.dtypes.index = new_columns\n self.set_columns_cache(new_columns)\n self.synchronize_labels(axis=1)\n\n columns = property(_get_columns, _set_columns)\n index = property(_get_index, _set_index)\n\n @property\n def axes(self):\n \"\"\"\n Get index and columns that can be accessed with an `axis` integer.\n\n Returns\n -------\n list\n List with two values: index and columns.\n \"\"\"\n return [self.index, self.columns]\n\n def get_axis(self, axis: int = 0) -> pandas.Index:\n \"\"\"\n Get index object for the requested axis.\n\n Parameters\n ----------\n axis : {0, 1}, default: 0\n\n Returns\n -------\n pandas.Index\n \"\"\"\n return self.index if axis == 0 else self.columns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_axis_labels_and_lengths_PandasDataframe._compute_axis_labels_and_lengths.return.new_index_list_map_len_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_axis_labels_and_lengths_PandasDataframe._compute_axis_labels_and_lengths.return.new_index_list_map_len_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 605, "end_line": 627, "span_ids": ["PandasDataframe._compute_axis_labels_and_lengths"], "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 PandasDataframe(ClassLogger):\n\n def _compute_axis_labels_and_lengths(self, axis: int, partitions=None):\n \"\"\"\n Compute the labels for specific `axis`.\n\n Parameters\n ----------\n axis : int\n Axis to compute labels along.\n partitions : np.ndarray, optional\n A 2D NumPy array of partitions from which labels will be grabbed.\n If not specified, partitions will be taken from `self._partitions`.\n\n Returns\n -------\n pandas.Index\n Labels for the specified `axis`.\n List of int\n Size of partitions alongside specified `axis`.\n \"\"\"\n if partitions is None:\n partitions = self._partitions\n new_index, internal_idx = self._partition_mgr_cls.get_indices(axis, partitions)\n return new_index, list(map(len, internal_idx))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._filter_empties_PandasDataframe.synchronize_labels.if_axis_is_None_.else_.self._deferred_column.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._filter_empties_PandasDataframe.synchronize_labels.if_axis_is_None_.else_.self._deferred_column.True", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 629, "end_line": 683, "span_ids": ["PandasDataframe.synchronize_labels", "PandasDataframe._filter_empties"], "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 PandasDataframe(ClassLogger):\n\n def _filter_empties(self, compute_metadata=True):\n \"\"\"\n Remove empty partitions from `self._partitions` to avoid triggering excess computation.\n\n Parameters\n ----------\n compute_metadata : bool, default: True\n Trigger the computations for partition sizes and labels if they're not done already.\n \"\"\"\n if not compute_metadata and (\n not self.has_materialized_index\n or not self.has_materialized_columns\n or self._row_lengths_cache is None\n or self._column_widths_cache is None\n ):\n # do not trigger the computations\n return\n\n if len(self.axes[0]) == 0 or len(self.axes[1]) == 0:\n # This is the case for an empty frame. We don't want to completely remove\n # all metadata and partitions so for the moment, we won't prune if the frame\n # is empty.\n # TODO: Handle empty dataframes better\n return\n self._partitions = np.array(\n [\n [\n self._partitions[i][j]\n for j in range(len(self._partitions[i]))\n if j < len(self.column_widths) and self.column_widths[j] != 0\n ]\n for i in range(len(self._partitions))\n if i < len(self.row_lengths) and self.row_lengths[i] != 0\n ]\n )\n self._column_widths_cache = [w for w in self.column_widths if w != 0]\n self._row_lengths_cache = [r for r in self.row_lengths if r != 0]\n\n def synchronize_labels(self, axis=None):\n \"\"\"\n Set the deferred axes variables for the ``PandasDataframe``.\n\n Parameters\n ----------\n axis : int, default: None\n The deferred axis.\n 0 for the index, 1 for the columns.\n \"\"\"\n if axis is None:\n self._deferred_index = True\n self._deferred_column = True\n elif axis == 0:\n self._deferred_index = True\n else:\n self._deferred_column = 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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._propagate_index_objs_PandasDataframe._propagate_index_objs.if_axis_is_None_.else_.ErrorMessage_catch_bugs_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._propagate_index_objs_PandasDataframe._propagate_index_objs.if_axis_is_None_.else_.ErrorMessage_catch_bugs_a", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 685, "end_line": 776, "span_ids": ["PandasDataframe._propagate_index_objs"], "tokens": 655}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _propagate_index_objs(self, axis=None):\n \"\"\"\n Synchronize labels by applying the index object for specific `axis` to the `self._partitions` lazily.\n\n Adds `set_axis` function to call-queue of each partition from `self._partitions`\n to apply new axis.\n\n Parameters\n ----------\n axis : int, default: None\n The axis to apply to. If it's None applies to both axes.\n \"\"\"\n self._filter_empties()\n if axis is None or axis == 0:\n cum_row_lengths = np.cumsum([0] + self.row_lengths)\n if axis is None or axis == 1:\n cum_col_widths = np.cumsum([0] + self.column_widths)\n\n if axis is None:\n\n def apply_idx_objs(df, idx, cols):\n return df.set_axis(idx, axis=\"index\").set_axis(cols, axis=\"columns\")\n\n self._partitions = np.array(\n [\n [\n self._partitions[i][j].add_to_apply_calls(\n apply_idx_objs,\n idx=self.index[\n slice(cum_row_lengths[i], cum_row_lengths[i + 1])\n ],\n cols=self.columns[\n slice(cum_col_widths[j], cum_col_widths[j + 1])\n ],\n length=self.row_lengths[i],\n width=self.column_widths[j],\n )\n for j in range(len(self._partitions[i]))\n ]\n for i in range(len(self._partitions))\n ]\n )\n self._deferred_index = False\n self._deferred_column = False\n elif axis == 0:\n\n def apply_idx_objs(df, idx):\n return df.set_axis(idx, axis=\"index\")\n\n self._partitions = np.array(\n [\n [\n self._partitions[i][j].add_to_apply_calls(\n apply_idx_objs,\n idx=self.index[\n slice(cum_row_lengths[i], cum_row_lengths[i + 1])\n ],\n length=self.row_lengths[i],\n width=self.column_widths[j],\n )\n for j in range(len(self._partitions[i]))\n ]\n for i in range(len(self._partitions))\n ]\n )\n self._deferred_index = False\n elif axis == 1:\n\n def apply_idx_objs(df, cols):\n return df.set_axis(cols, axis=\"columns\")\n\n self._partitions = np.array(\n [\n [\n self._partitions[i][j].add_to_apply_calls(\n apply_idx_objs,\n cols=self.columns[\n slice(cum_col_widths[j], cum_col_widths[j + 1])\n ],\n length=self.row_lengths[i],\n width=self.column_widths[j],\n )\n for j in range(len(self._partitions[i]))\n ]\n for i in range(len(self._partitions))\n ]\n )\n self._deferred_column = False\n else:\n ErrorMessage.catch_bugs_and_request_email(\n axis is not None and axis not in [0, 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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.take_2d_labels_or_positional_PandasDataframe.take_2d_labels_or_positional.return.self__take_2d_positional_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.take_2d_labels_or_positional_PandasDataframe.take_2d_labels_or_positional.return.self__take_2d_positional_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 778, "end_line": 849, "span_ids": ["PandasDataframe.take_2d_labels_or_positional"], "tokens": 638}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=None)\n def take_2d_labels_or_positional(\n self,\n row_labels: Optional[List[Hashable]] = None,\n row_positions: Optional[List[int]] = None,\n col_labels: Optional[List[Hashable]] = None,\n col_positions: Optional[List[int]] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Lazily select columns or rows from given indices.\n\n Parameters\n ----------\n row_labels : list of hashable, optional\n The row labels to extract.\n row_positions : list-like of ints, optional\n The row positions to extract.\n col_labels : list of hashable, optional\n The column labels to extract.\n col_positions : list-like of ints, optional\n The column positions to extract.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe from the mask provided.\n\n Notes\n -----\n If both `row_labels` and `row_positions` are provided, a ValueError is raised.\n The same rule applies for `col_labels` and `col_positions`.\n \"\"\"\n if check_both_not_none(row_labels, row_positions):\n raise ValueError(\n \"Both row_labels and row_positions were provided - \"\n + \"please provide only one of row_labels and row_positions.\"\n )\n if check_both_not_none(col_labels, col_positions):\n raise ValueError(\n \"Both col_labels and col_positions were provided - \"\n + \"please provide only one of col_labels and col_positions.\"\n )\n\n if row_labels is not None:\n # Get numpy array of positions of values from `row_labels`\n if isinstance(self.index, pandas.MultiIndex):\n row_positions = np.zeros(len(row_labels), dtype=\"int64\")\n # we can't use .get_locs(row_labels) because the function\n # requires a different format for row_labels\n for idx, label in enumerate(row_labels):\n if isinstance(label, str):\n label = [label]\n # get_loc can return slice that _take_2d_positional can't handle\n row_positions[idx] = self.index.get_locs(label)[0]\n else:\n row_positions = self.index.get_indexer_for(row_labels)\n\n if col_labels is not None:\n # Get numpy array of positions of values from `col_labels`\n if isinstance(self.columns, pandas.MultiIndex):\n col_positions = np.zeros(len(col_labels), dtype=\"int64\")\n # we can't use .get_locs(col_labels) because the function\n # requires a different format for row_labels\n for idx, label in enumerate(col_labels):\n if isinstance(label, str):\n label = [label]\n # get_loc can return slice that _take_2d_positional can't handle\n col_positions[idx] = self.columns.get_locs(label)[0]\n else:\n col_positions = self.columns.get_indexer_for(col_labels)\n\n return self._take_2d_positional(row_positions, col_positions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_sorted_positions_PandasDataframe._get_new_lengths.return.new_lengths": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_sorted_positions_PandasDataframe._get_new_lengths.return.new_lengths", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 851, "end_line": 900, "span_ids": ["PandasDataframe._get_sorted_positions", "PandasDataframe._get_new_lengths"], "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 PandasDataframe(ClassLogger):\n\n def _get_sorted_positions(self, positions):\n \"\"\"\n Sort positions if necessary.\n\n Parameters\n ----------\n positions : Sequence[int]\n\n Returns\n -------\n Sequence[int]\n \"\"\"\n # Helper for take_2d_positional\n if is_range_like(positions) and positions.step > 0:\n sorted_positions = positions\n else:\n sorted_positions = np.sort(positions)\n return sorted_positions\n\n def _get_new_lengths(self, partitions_dict, *, axis: int) -> List[int]:\n \"\"\"\n Find lengths of new partitions.\n\n Parameters\n ----------\n partitions_dict : dict\n axis : int\n\n Returns\n -------\n list[int]\n \"\"\"\n # Helper for take_2d_positional\n if axis == 0:\n axis_lengths = self.row_lengths\n else:\n axis_lengths = self.column_widths\n\n new_lengths = [\n len(\n # Row lengths for slice are calculated as the length of the slice\n # on the partition. Often this will be the same length as the current\n # length, but sometimes it is different, thus the extra calculation.\n range(*part_indexer.indices(axis_lengths[part_idx]))\n if isinstance(part_indexer, slice)\n else part_indexer\n )\n for part_idx, part_indexer in partitions_dict.items()\n ]\n return new_lengths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_new_index_obj_PandasDataframe._get_new_index_obj.return.new_idx_monotonic_idx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_new_index_obj_PandasDataframe._get_new_index_obj.return.new_idx_monotonic_idx", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 902, "end_line": 935, "span_ids": ["PandasDataframe._get_new_index_obj"], "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 PandasDataframe(ClassLogger):\n\n def _get_new_index_obj(\n self, positions, sorted_positions, axis: int\n ) -> \"tuple[pandas.Index, slice | npt.NDArray[np.intp]]\":\n \"\"\"\n Find the new Index object for take_2d_positional result.\n\n Parameters\n ----------\n positions : Sequence[int]\n sorted_positions : Sequence[int]\n axis : int\n\n Returns\n -------\n pandas.Index\n slice or Sequence[int]\n \"\"\"\n # Helper for take_2d_positional\n # Use the slice to calculate the new columns\n if axis == 0:\n idx = self.index\n else:\n idx = self.columns\n\n # TODO: Support fast processing of negative-step ranges\n if is_range_like(positions) and positions.step > 0:\n # pandas Index is more likely to preserve its metadata if the indexer\n # is slice\n monotonic_idx = slice(positions.start, positions.stop, positions.step)\n else:\n monotonic_idx = np.asarray(sorted_positions, dtype=np.intp)\n\n new_idx = idx[monotonic_idx]\n return new_idx, monotonic_idx", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._take_2d_positional_PandasDataframe._take_2d_positional.if_col_positions_is_not_N.else_.new_dtypes.self_copy_dtypes_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._take_2d_positional_PandasDataframe._take_2d_positional.if_col_positions_is_not_N.else_.new_dtypes.self_copy_dtypes_cache_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 937, "end_line": 1025, "span_ids": ["PandasDataframe._take_2d_positional"], "tokens": 800}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _take_2d_positional(\n self,\n row_positions: Optional[List[int]] = None,\n col_positions: Optional[List[int]] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Lazily select columns or rows from given indices.\n\n Parameters\n ----------\n row_positions : list-like of ints, optional\n The row positions to extract.\n col_positions : list-like of ints, optional\n The column positions to extract.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe from the mask provided.\n \"\"\"\n indexers = []\n for axis, indexer in enumerate((row_positions, col_positions)):\n if is_range_like(indexer):\n if indexer.step == 1 and len(indexer) == len(self.axes[axis]):\n # By this function semantics, `None` indexer is a full-axis access\n indexer = None\n elif indexer is not None and not isinstance(indexer, pandas.RangeIndex):\n # Pure python's range is not fully compatible with a list of ints,\n # converting it to ``pandas.RangeIndex``` that is compatible.\n indexer = pandas.RangeIndex(\n indexer.start, indexer.stop, indexer.step\n )\n else:\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=not (indexer is None or is_list_like(indexer)),\n extra_log=\"Mask takes only list-like numeric indexers, \"\n + f\"received: {type(indexer)}\",\n )\n indexers.append(indexer)\n row_positions, col_positions = indexers\n\n if col_positions is None and row_positions is None:\n return self.copy()\n\n sorted_row_positions = sorted_col_positions = None\n\n if row_positions is not None:\n sorted_row_positions = self._get_sorted_positions(row_positions)\n # Get dict of row_parts as {row_index: row_internal_indices}\n row_partitions_dict = self._get_dict_of_block_index(\n 0, sorted_row_positions, are_indices_sorted=True\n )\n new_row_lengths = self._get_new_lengths(row_partitions_dict, axis=0)\n new_index, _ = self._get_new_index_obj(\n row_positions, sorted_row_positions, axis=0\n )\n else:\n row_partitions_dict = {i: slice(None) for i in range(len(self._partitions))}\n new_row_lengths = self._row_lengths_cache\n new_index = self.copy_index_cache()\n\n if col_positions is not None:\n sorted_col_positions = self._get_sorted_positions(col_positions)\n # Get dict of col_parts as {col_index: col_internal_indices}\n col_partitions_dict = self._get_dict_of_block_index(\n 1, sorted_col_positions, are_indices_sorted=True\n )\n new_col_widths = self._get_new_lengths(col_partitions_dict, axis=1)\n new_columns, monotonic_col_idx = self._get_new_index_obj(\n col_positions, sorted_col_positions, axis=1\n )\n\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=sum(new_col_widths) != len(new_columns),\n extra_log=f\"{sum(new_col_widths)} != {len(new_columns)}.\\n\"\n + f\"{col_positions}\\n{self.column_widths}\\n{col_partitions_dict}\",\n )\n\n if self.has_materialized_dtypes:\n new_dtypes = self.dtypes.iloc[monotonic_col_idx]\n else:\n new_dtypes = None\n else:\n col_partitions_dict = {\n i: slice(None) for i in range(len(self._partitions.T))\n }\n new_col_widths = self._column_widths_cache\n new_columns = self.copy_columns_cache()\n new_dtypes = self.copy_dtypes_cache()\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._take_2d_positional.new_partitions_PandasDataframe._take_2d_positional.return.self__maybe_reorder_label": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._take_2d_positional.new_partitions_PandasDataframe._take_2d_positional.return.self__maybe_reorder_label", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1027, "end_line": 1053, "span_ids": ["PandasDataframe._take_2d_positional"], "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 PandasDataframe(ClassLogger):\n\n def _take_2d_positional(\n self,\n row_positions: Optional[List[int]] = None,\n col_positions: Optional[List[int]] = None,\n ) -> \"PandasDataframe\":\n # ... other code\n\n new_partitions = np.array(\n [\n [\n self._partitions[row_idx][col_idx].mask(\n row_internal_indices, col_internal_indices\n )\n for col_idx, col_internal_indices in col_partitions_dict.items()\n ]\n for row_idx, row_internal_indices in row_partitions_dict.items()\n ]\n )\n intermediate = self.__constructor__(\n new_partitions,\n new_index,\n new_columns,\n new_row_lengths,\n new_col_widths,\n new_dtypes,\n )\n\n return self._maybe_reorder_labels(\n intermediate,\n row_positions,\n sorted_row_positions,\n col_positions,\n sorted_col_positions,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._maybe_reorder_labels_PandasDataframe._maybe_reorder_labels.return.intermediate__reorder_lab": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._maybe_reorder_labels_PandasDataframe._maybe_reorder_labels.return.intermediate__reorder_lab", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1055, "end_line": 1121, "span_ids": ["PandasDataframe._maybe_reorder_labels"], "tokens": 576}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _maybe_reorder_labels(\n self,\n intermediate: \"PandasDataframe\",\n row_positions,\n sorted_row_positions,\n col_positions,\n sorted_col_positions,\n ) -> \"PandasDataframe\":\n \"\"\"\n Call re-order labels on take_2d_labels_or_positional result if necessary.\n\n Parameters\n ----------\n intermediate : PandasDataFrame\n row_positions : list-like of ints, optional\n The row positions to extract.\n sorted_row_positions : list-like of ints, optional\n Sorted version of row_positions.\n col_positions : list-like of ints, optional\n The column positions to extract.\n sorted_col_positions : list-like of ints, optional\n Sorted version of col_positions.\n\n Returns\n -------\n PandasDataframe\n \"\"\"\n # Check if monotonically increasing, return if it is. Fast track code path for\n # common case to keep it fast.\n if (\n row_positions is None\n # Fast range processing of non-positive-step ranges is not yet supported\n or (is_range_like(row_positions) and row_positions.step > 0)\n or len(row_positions) == 1\n or np.all(row_positions[1:] >= row_positions[:-1])\n ) and (\n col_positions is None\n # Fast range processing of non-positive-step ranges is not yet supported\n or (is_range_like(col_positions) and col_positions.step > 0)\n or len(col_positions) == 1\n or np.all(col_positions[1:] >= col_positions[:-1])\n ):\n return intermediate\n\n # The new labels are often smaller than the old labels, so we can't reuse the\n # original order values because those were mapped to the original data. We have\n # to reorder here based on the expected order from within the data.\n # We create a dictionary mapping the position of the numeric index with respect\n # to all others, then recreate that order by mapping the new order values from\n # the old. This information is sent to `_reorder_labels`.\n if row_positions is not None:\n row_order_mapping = dict(\n zip(sorted_row_positions, range(len(row_positions)))\n )\n new_row_order = [row_order_mapping[idx] for idx in row_positions]\n else:\n new_row_order = None\n if col_positions is not None:\n col_order_mapping = dict(\n zip(sorted_col_positions, range(len(col_positions)))\n )\n new_col_order = [col_order_mapping[idx] for idx in col_positions]\n else:\n new_col_order = None\n return intermediate._reorder_labels(\n row_positions=new_row_order, col_positions=new_col_order\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels_PandasDataframe.from_labels.new_columns.new_column_names_append_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels_PandasDataframe.from_labels.new_columns.new_column_names_append_s", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1123, "end_line": 1177, "span_ids": ["PandasDataframe.from_labels"], "tokens": 510}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"rows\")\n def from_labels(self) -> \"PandasDataframe\":\n \"\"\"\n Convert the row labels to a column of data, inserted at the first position.\n\n Gives result by similar way as `pandas.DataFrame.reset_index`. Each level\n of `self.index` will be added as separate column of data.\n\n Returns\n -------\n PandasDataframe\n A PandasDataframe with new columns from index labels.\n \"\"\"\n new_row_labels = pandas.RangeIndex(len(self.index))\n if self.index.nlevels > 1:\n level_names = [\n self.index.names[i]\n if self.index.names[i] is not None\n else \"level_{}\".format(i)\n for i in range(self.index.nlevels)\n ]\n else:\n level_names = [\n self.index.names[0]\n if self.index.names[0] is not None\n else \"index\"\n if \"index\" not in self.columns\n else \"level_{}\".format(0)\n ]\n new_dtypes = None\n if self.has_materialized_dtypes:\n names = tuple(level_names) if len(level_names) > 1 else level_names[0]\n new_dtypes = self.index.to_frame(name=names).dtypes\n new_dtypes = pandas.concat([new_dtypes, self.dtypes])\n\n # We will also use the `new_column_names` in the calculation of the internal metadata, so this is a\n # lightweight way of ensuring the metadata matches.\n if self.columns.nlevels > 1:\n # Column labels are different for multilevel index.\n new_column_names = pandas.MultiIndex.from_tuples(\n # Set level names on the 1st columns level and fill up empty level names with empty string.\n # Expand tuples in level names. This is how reset_index works when col_level col_fill are not specified.\n [\n tuple(\n list(level) + [\"\"] * (self.columns.nlevels - len(level))\n if isinstance(level, tuple)\n else [level] + [\"\"] * (self.columns.nlevels - 1)\n )\n for level in level_names\n ],\n names=self.columns.names,\n )\n else:\n new_column_names = pandas.Index(level_names, tupleize_cols=False)\n new_columns = new_column_names.append(self.columns)\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels.from_labels_executor_PandasDataframe.from_labels.from_labels_executor.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels.from_labels_executor_PandasDataframe.from_labels.from_labels_executor.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1179, "end_line": 1196, "span_ids": ["PandasDataframe.from_labels"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"rows\")\n def from_labels(self) -> \"PandasDataframe\":\n # ... other code\n\n def from_labels_executor(df, **kwargs):\n # Setting the names here ensures that external and internal metadata always match.\n df.index.names = new_column_names\n\n # Handling of a case when columns have the same name as one of index levels names.\n # In this case `df.reset_index` provides errors related to columns duplication.\n # This case is possible because columns metadata updating is deferred. To workaround\n # `df.reset_index` error we allow columns duplication in \"if\" branch via `concat`.\n if any(name_level in df.columns for name_level in df.index.names):\n columns_to_add = df.index.to_frame()\n columns_to_add.reset_index(drop=True, inplace=True)\n df = df.reset_index(drop=True)\n result = pandas.concat([columns_to_add, df], axis=1, copy=False)\n else:\n result = df.reset_index()\n # Put the index back to the original due to GH#4394\n result.index = df.index\n return result\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels.new_parts_PandasDataframe.from_labels.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_labels.new_parts_PandasDataframe.from_labels.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1198, "end_line": 1218, "span_ids": ["PandasDataframe.from_labels"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"rows\")\n def from_labels(self) -> \"PandasDataframe\":\n # ... other code\n\n new_parts = self._partition_mgr_cls.apply_func_to_select_indices(\n 0,\n self._partitions,\n from_labels_executor,\n [0],\n keep_remaining=True,\n )\n new_column_widths = [\n self.index.nlevels + self.column_widths[0]\n ] + self.column_widths[1:]\n result = self.__constructor__(\n new_parts,\n new_row_labels,\n new_columns,\n row_lengths=self._row_lengths_cache,\n column_widths=new_column_widths,\n dtypes=new_dtypes,\n )\n # Set flag for propagating deferred row labels across dataframe partitions\n result.synchronize_labels(axis=0)\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_labels_PandasDataframe.to_labels.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_labels_PandasDataframe.to_labels.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1220, "end_line": 1250, "span_ids": ["PandasDataframe.to_labels"], "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 PandasDataframe(ClassLogger):\n\n def to_labels(self, column_list: List[Hashable]) -> \"PandasDataframe\":\n \"\"\"\n Move one or more columns into the row labels. Previous labels are dropped.\n\n Parameters\n ----------\n column_list : list of hashable\n The list of column names to place as the new row labels.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe that has the updated labels.\n \"\"\"\n extracted_columns = self.take_2d_labels_or_positional(\n col_labels=column_list\n ).to_pandas()\n\n if len(column_list) == 1:\n new_labels = pandas.Index(\n extracted_columns.squeeze(axis=1), name=column_list[0]\n )\n else:\n new_labels = pandas.MultiIndex.from_frame(\n extracted_columns, names=column_list\n )\n result = self.take_2d_labels_or_positional(\n col_labels=[i for i in self.columns if i not in extracted_columns.columns]\n )\n result.index = new_labels\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._reorder_labels_PandasDataframe._reorder_labels.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._reorder_labels_PandasDataframe._reorder_labels.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1252, "end_line": 1332, "span_ids": ["PandasDataframe._reorder_labels"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def _reorder_labels(self, row_positions=None, col_positions=None):\n \"\"\"\n Reorder the column and or rows in this DataFrame.\n\n Parameters\n ----------\n row_positions : list of int, optional\n The ordered list of new row orders such that each position within the list\n indicates the new position.\n col_positions : list of int, optional\n The ordered list of new column orders such that each position within the\n list indicates the new position.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe with reordered columns and/or rows.\n \"\"\"\n new_dtypes = self.copy_dtypes_cache()\n if row_positions is not None:\n # We want to preserve the frame's partitioning so passing in ``keep_partitioning=True``\n # in order to use the cached `row_lengths` values for the new frame.\n # If the frame's is re-partitioned using the \"standard\" partitioning,\n # then knowing that, we can compute new row lengths.\n ordered_rows = self._partition_mgr_cls.map_axis_partitions(\n 0,\n self._partitions,\n lambda df: df.iloc[row_positions],\n keep_partitioning=True,\n )\n row_idx = self.index[row_positions]\n\n if len(row_idx) != len(self.index):\n # The frame was re-partitioned along the 0 axis during reordering using\n # the \"standard\" partitioning. Knowing the standard partitioning scheme\n # we are able to compute new row lengths.\n new_lengths = get_length_list(\n axis_len=len(row_idx), num_splits=ordered_rows.shape[0]\n )\n else:\n # If the frame's partitioning was preserved then\n # we can use previous row lengths cache\n new_lengths = self._row_lengths_cache\n else:\n ordered_rows = self._partitions\n row_idx = self.index\n new_lengths = self._row_lengths_cache\n if col_positions is not None:\n # We want to preserve the frame's partitioning so passing in ``keep_partitioning=True``\n # in order to use the cached `column_widths` values for the new frame.\n # If the frame's is re-partitioned using the \"standard\" partitioning,\n # then knowing that, we can compute new column widths.\n ordered_cols = self._partition_mgr_cls.map_axis_partitions(\n 1,\n ordered_rows,\n lambda df: df.iloc[:, col_positions],\n keep_partitioning=True,\n )\n col_idx = self.columns[col_positions]\n if self.has_materialized_dtypes:\n new_dtypes = self.dtypes.iloc[col_positions]\n\n if len(col_idx) != len(self.columns):\n # The frame was re-partitioned along the 1 axis during reordering using\n # the \"standard\" partitioning. Knowing the standard partitioning scheme\n # we are able to compute new column widths.\n new_widths = get_length_list(\n axis_len=len(col_idx), num_splits=ordered_cols.shape[1]\n )\n else:\n # If the frame's partitioning was preserved then\n # we can use previous column widths cache\n new_widths = self._column_widths_cache\n else:\n ordered_cols = ordered_rows\n col_idx = self.columns\n new_widths = self._column_widths_cache\n return self.__constructor__(\n ordered_cols, row_idx, col_idx, new_lengths, new_widths, new_dtypes\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.copy_PandasDataframe.astype.for_i_column_in_enumerat.if_.if_dtype_np_int32_and_.else_.new_dtypes_column_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.copy_PandasDataframe.astype.for_i_column_in_enumerat.if_.if_dtype_np_int32_and_.else_.new_dtypes_column_new_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1334, "end_line": 1407, "span_ids": ["PandasDataframe.astype", "PandasDataframe.copy"], "tokens": 577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=None)\n def copy(self):\n \"\"\"\n Copy this object.\n\n Returns\n -------\n PandasDataframe\n A copied version of this object.\n \"\"\"\n return self.__constructor__(\n self._partitions,\n self.copy_index_cache(),\n self.copy_columns_cache(),\n self._row_lengths_cache,\n self._column_widths_cache,\n self.copy_dtypes_cache(),\n )\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def astype(self, col_dtypes, errors: str = \"raise\"):\n \"\"\"\n Convert the columns dtypes to given dtypes.\n\n Parameters\n ----------\n col_dtypes : dictionary of {col: dtype,...}\n Where col is the column name and dtype is a NumPy dtype.\n errors : {'raise', 'ignore'}, default: 'raise'\n Control raising of exceptions on invalid data for provided dtype.\n\n Returns\n -------\n BaseDataFrame\n Dataframe with updated dtypes.\n \"\"\"\n columns = col_dtypes.keys()\n # Create Series for the updated dtypes\n new_dtypes = self.dtypes.copy()\n # When casting to \"category\" we have to make up the whole axis partition\n # to get the properly encoded table of categories. Every block partition\n # will store the encoded table. That can lead to higher memory footprint.\n # TODO: Revisit if this hurts users.\n use_full_axis_cast = False\n has_categorical_cast = False\n for i, column in enumerate(columns):\n dtype = col_dtypes[column]\n if (\n not isinstance(dtype, type(self.dtypes[column]))\n or dtype != self.dtypes[column]\n ):\n # Update the new dtype series to the proper pandas dtype\n try:\n new_dtype = np.dtype(dtype)\n except TypeError:\n new_dtype = dtype\n\n if dtype != np.int32 and new_dtype == np.int32:\n new_dtypes[column] = np.dtype(\"int64\")\n elif dtype != np.float32 and new_dtype == np.float32:\n new_dtypes[column] = np.dtype(\"float64\")\n # We cannot infer without computing the dtype if\n elif isinstance(new_dtype, str) and new_dtype == \"category\":\n new_dtypes[column] = LazyProxyCategoricalDtype._build_proxy(\n # Actual parent will substitute `None` at `.set_dtypes_cache`\n parent=None,\n column_name=column,\n materializer=lambda parent, column: parent._compute_dtypes(\n columns=[column]\n )[column],\n )\n use_full_axis_cast = has_categorical_cast = True\n else:\n new_dtypes[column] = new_dtype\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.astype.astype_builder_PandasDataframe.astype.astype_builder.return.df_for_astype_astype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.astype.astype_builder_PandasDataframe.astype.astype_builder.return.df_for_astype_astype_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1409, "end_line": 1420, "span_ids": ["PandasDataframe.astype"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def astype(self, col_dtypes, errors: str = \"raise\"):\n # ... other code\n\n def astype_builder(df):\n \"\"\"Compute new partition frame with dtypes updated.\"\"\"\n # TODO(https://github.com/modin-project/modin/issues/6266): Remove this\n # copy, which is a workaround for https://github.com/pandas-dev/pandas/issues/53658\n df_for_astype = (\n df.copy(deep=True)\n if Engine.get() == \"Ray\" and has_categorical_cast\n else df\n )\n return df_for_astype.astype(\n {k: v for k, v in col_dtypes.items() if k in df}, errors=errors\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.astype.if_use_full_axis_cast__PandasDataframe._Metadata_modification_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.astype.if_use_full_axis_cast__PandasDataframe._Metadata_modification_m", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1422, "end_line": 1439, "span_ids": ["PandasDataframe.astype"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def astype(self, col_dtypes, errors: str = \"raise\"):\n # ... other code\n\n if use_full_axis_cast:\n new_frame = self._partition_mgr_cls.map_axis_partitions(\n 0, self._partitions, astype_builder, keep_partitioning=True\n )\n else:\n new_frame = self._partition_mgr_cls.map_partitions(\n self._partitions, astype_builder\n )\n return self.__constructor__(\n new_frame,\n self.copy_index_cache(),\n self.copy_columns_cache(),\n self._row_lengths_cache,\n self._column_widths_cache,\n new_dtypes,\n )\n\n # Metadata modification methods", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.add_prefix_PandasDataframe.add_prefix.return.self_rename_new_col_label": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.add_prefix_PandasDataframe.add_prefix.return.self_rename_new_col_label", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1440, "end_line": 1462, "span_ids": ["PandasDataframe.add_prefix"], "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 PandasDataframe(ClassLogger):\n def add_prefix(self, prefix, axis):\n \"\"\"\n Add a prefix to the current row or column labels.\n\n Parameters\n ----------\n prefix : str\n The prefix to add.\n axis : int\n The axis to update.\n\n Returns\n -------\n PandasDataframe\n A new dataframe with the updated labels.\n \"\"\"\n\n def new_labels_mapper(x, prefix=str(prefix)):\n return prefix + str(x)\n\n if axis == 0:\n return self.rename(new_row_labels=new_labels_mapper)\n return self.rename(new_col_labels=new_labels_mapper)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.add_suffix_PandasDataframe.add_suffix.return.self_rename_new_col_label": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.add_suffix_PandasDataframe.add_suffix.return.self_rename_new_col_label", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1464, "end_line": 1486, "span_ids": ["PandasDataframe.add_suffix"], "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 PandasDataframe(ClassLogger):\n\n def add_suffix(self, suffix, axis):\n \"\"\"\n Add a suffix to the current row or column labels.\n\n Parameters\n ----------\n suffix : str\n The suffix to add.\n axis : int\n The axis to update.\n\n Returns\n -------\n PandasDataframe\n A new dataframe with the updated labels.\n \"\"\"\n\n def new_labels_mapper(x, suffix=str(suffix)):\n return str(x) + suffix\n\n if axis == 0:\n return self.rename(new_row_labels=new_labels_mapper)\n return self.rename(new_col_labels=new_labels_mapper)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._END_Metadata_modificati_PandasDataframe.numeric_columns.return.columns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._END_Metadata_modificati_PandasDataframe.numeric_columns.return.columns", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1488, "end_line": 1510, "span_ids": ["PandasDataframe.add_suffix", "PandasDataframe.numeric_columns"], "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 PandasDataframe(ClassLogger):\n\n # END Metadata modification methods\n\n def numeric_columns(self, include_bool=True):\n \"\"\"\n Return the names of numeric columns in the frame.\n\n Parameters\n ----------\n include_bool : bool, default: True\n Whether to consider boolean columns as numeric.\n\n Returns\n -------\n list\n List of column names.\n \"\"\"\n columns = []\n for col, dtype in zip(self.columns, self.dtypes):\n if is_numeric_dtype(dtype) and (\n include_bool or (not include_bool and dtype != np.bool_)\n ):\n columns.append(col)\n return columns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index_PandasDataframe._get_dict_of_block_index._Fasttrack_slices": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index_PandasDataframe._get_dict_of_block_index._Fasttrack_slices", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1512, "end_line": 1540, "span_ids": ["PandasDataframe._get_dict_of_block_index"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _get_dict_of_block_index(self, axis, indices, are_indices_sorted=False):\n \"\"\"\n Convert indices to an ordered dict mapping partition (or block) index to internal indices in said partition.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis along which to get the indices (0 - rows, 1 - columns).\n indices : list of int, slice\n A list of global indices to convert.\n are_indices_sorted : bool, default: False\n Flag indicating whether the `indices` sequence is sorted by ascending or not.\n Note: the internal algorithm requires for the `indices` to be sorted, this\n flag is used for optimization in order to not sort already sorted data.\n Be careful when passing ``True`` for this flag, if the data appears to be unsorted\n with the flag set to ``True`` this would lead to undefined behavior.\n\n Returns\n -------\n OrderedDict\n A mapping from partition index to list of internal indices which correspond to `indices` in each\n partition.\n \"\"\"\n # TODO: Support handling of slices with specified 'step'. For now, converting them into a range\n if isinstance(indices, slice) and (\n indices.step is not None and indices.step != 1\n ):\n indices = range(*indices.indices(len(self.axes[axis])))\n # Fasttrack slices\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index.None_1_PandasDataframe._get_dict_of_block_index.has_negative.np_any_negative_mask_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index.None_1_PandasDataframe._get_dict_of_block_index.has_negative.np_any_negative_mask_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1541, "end_line": 1612, "span_ids": ["PandasDataframe._get_dict_of_block_index"], "tokens": 740}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _get_dict_of_block_index(self, axis, indices, are_indices_sorted=False):\n # ... other code\n if isinstance(indices, slice) or (is_range_like(indices) and indices.step == 1):\n # Converting range-like indexer to slice\n indices = slice(indices.start, indices.stop, indices.step)\n if is_full_grab_slice(indices, sequence_len=len(self.axes[axis])):\n return OrderedDict(\n zip(\n range(self._partitions.shape[axis]),\n [slice(None)] * self._partitions.shape[axis],\n )\n )\n # Empty selection case\n if indices.start == indices.stop and indices.start is not None:\n return OrderedDict()\n if indices.start is None or indices.start == 0:\n last_part, last_idx = list(\n self._get_dict_of_block_index(axis, [indices.stop]).items()\n )[0]\n dict_of_slices = OrderedDict(\n zip(range(last_part), [slice(None)] * last_part)\n )\n dict_of_slices.update({last_part: slice(last_idx[0])})\n return dict_of_slices\n elif indices.stop is None or indices.stop >= len(self.axes[axis]):\n first_part, first_idx = list(\n self._get_dict_of_block_index(axis, [indices.start]).items()\n )[0]\n dict_of_slices = OrderedDict({first_part: slice(first_idx[0], None)})\n num_partitions = np.size(self._partitions, axis=axis)\n part_list = range(first_part + 1, num_partitions)\n dict_of_slices.update(\n OrderedDict(zip(part_list, [slice(None)] * len(part_list)))\n )\n return dict_of_slices\n else:\n first_part, first_idx = list(\n self._get_dict_of_block_index(axis, [indices.start]).items()\n )[0]\n last_part, last_idx = list(\n self._get_dict_of_block_index(axis, [indices.stop]).items()\n )[0]\n if first_part == last_part:\n return OrderedDict({first_part: slice(first_idx[0], last_idx[0])})\n else:\n if last_part - first_part == 1:\n return OrderedDict(\n # FIXME: this dictionary creation feels wrong - it might not maintain the order\n {\n first_part: slice(first_idx[0], None),\n last_part: slice(None, last_idx[0]),\n }\n )\n else:\n dict_of_slices = OrderedDict(\n {first_part: slice(first_idx[0], None)}\n )\n part_list = range(first_part + 1, last_part)\n dict_of_slices.update(\n OrderedDict(zip(part_list, [slice(None)] * len(part_list)))\n )\n dict_of_slices.update({last_part: slice(None, last_idx[0])})\n return dict_of_slices\n if isinstance(indices, list):\n # Converting python list to numpy for faster processing\n indices = np.array(indices, dtype=np.int64)\n # Fasttrack empty numpy array\n if isinstance(indices, np.ndarray) and indices.size == 0:\n # This will help preserve metadata stored in empty dataframes (indexes and dtypes)\n # Otherwise, we will get an empty `new_partitions` array, from which it will\n # no longer be possible to obtain metadata\n return OrderedDict([(0, np.array([], dtype=np.int64))])\n negative_mask = np.less(indices, 0)\n has_negative = np.any(negative_mask)\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index.if_has_negative__PandasDataframe._get_dict_of_block_index.return.OrderedDict_partition_ids": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._get_dict_of_block_index.if_has_negative__PandasDataframe._get_dict_of_block_index.return.OrderedDict_partition_ids", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1613, "end_line": 1672, "span_ids": ["PandasDataframe._get_dict_of_block_index"], "tokens": 552}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _get_dict_of_block_index(self, axis, indices, are_indices_sorted=False):\n # ... other code\n if has_negative:\n # We're going to modify 'indices' inplace in a numpy way, so doing a copy/converting indices to numpy.\n indices = (\n indices.copy()\n if isinstance(indices, np.ndarray)\n else np.array(indices, dtype=np.int64)\n )\n indices[negative_mask] = indices[negative_mask] % len(self.axes[axis])\n # If the `indices` array was modified because of the negative indices conversion\n # then the original order was broken and so we have to sort anyway:\n if has_negative or not are_indices_sorted:\n indices = np.sort(indices)\n if axis == 0:\n bins = np.array(self.row_lengths)\n else:\n bins = np.array(self.column_widths)\n # INT_MAX to make sure we don't try to compute on partitions that don't exist.\n cumulative = np.append(bins[:-1].cumsum(), np.iinfo(bins.dtype).max)\n\n def internal(block_idx: int, global_index):\n \"\"\"Transform global index to internal one for given block (identified by its index).\"\"\"\n return (\n global_index\n if not block_idx\n else np.subtract(\n global_index, cumulative[min(block_idx, len(cumulative) - 1) - 1]\n )\n )\n\n partition_ids = np.digitize(indices, cumulative)\n count_for_each_partition = np.array(\n [(partition_ids == i).sum() for i in range(len(cumulative))]\n ).cumsum()\n # Compute the internal indices and pair those with the partition index.\n # If the first partition has any values we need to return, compute those\n # first to make the list comprehension easier. Otherwise, just append the\n # rest of the values to an empty list.\n if count_for_each_partition[0] > 0:\n first_partition_indices = [\n (0, internal(0, indices[slice(count_for_each_partition[0])]))\n ]\n else:\n first_partition_indices = []\n partition_ids_with_indices = first_partition_indices + [\n (\n i,\n internal(\n i,\n indices[\n slice(\n count_for_each_partition[i - 1],\n count_for_each_partition[i],\n )\n ],\n ),\n )\n for i in range(1, len(count_for_each_partition))\n if count_for_each_partition[i] > count_for_each_partition[i - 1]\n ]\n return OrderedDict(partition_ids_with_indices)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._join_index_objects_PandasDataframe._join_index_objects.if_need_indexers_and_inde.indexers._index_get_indexer_for_jo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._join_index_objects_PandasDataframe._join_index_objects.if_need_indexers_and_inde.indexers._index_get_indexer_for_jo", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1674, "end_line": 1740, "span_ids": ["PandasDataframe._join_index_objects"], "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 PandasDataframe(ClassLogger):\n\n @staticmethod\n def _join_index_objects(axis, indexes, how, sort):\n \"\"\"\n Join the pair of index objects (columns or rows) by a given strategy.\n\n Unlike Index.join() in pandas, if `axis` is 1, `sort` is False,\n and `how` is \"outer\", the result will _not_ be sorted.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis index object to join (0 - rows, 1 - columns).\n indexes : list(Index)\n The indexes to join on.\n how : {'left', 'right', 'inner', 'outer', None}\n The type of join to join to make. If `None` then joined index\n considered to be the first index in the `indexes` list.\n sort : boolean\n Whether or not to sort the joined index.\n\n Returns\n -------\n (Index, func)\n Joined index with make_reindexer func.\n \"\"\"\n assert isinstance(indexes, list)\n\n # define helper functions\n def merge(left_index, right_index):\n \"\"\"Combine a pair of indices depending on `axis`, `how` and `sort` from outside.\"\"\"\n if axis == 1 and how == \"outer\" and not sort:\n return left_index.union(right_index, sort=False)\n else:\n return left_index.join(right_index, how=how, sort=sort)\n\n # define condition for joining indexes\n all_indices_equal = all(indexes[0].equals(index) for index in indexes[1:])\n do_join_index = how is not None and not all_indices_equal\n\n # define condition for joining indexes with getting indexers\n need_indexers = (\n axis == 0\n and not all_indices_equal\n and any(not index.is_unique for index in indexes)\n )\n indexers = None\n\n # perform joining indexes\n if do_join_index:\n if len(indexes) == 2 and need_indexers:\n # in case of count of indexes > 2 we should perform joining all indexes\n # after that get indexers\n # in the fast path we can obtain joined_index and indexers in one call\n indexers = [None, None]\n joined_index, indexers[0], indexers[1] = indexes[0].join(\n indexes[1], how=how, sort=sort, return_indexers=True\n )\n else:\n joined_index = indexes[0]\n # TODO: revisit for performance\n for index in indexes[1:]:\n joined_index = merge(joined_index, index)\n else:\n joined_index = indexes[0].copy()\n\n if need_indexers and indexers is None:\n indexers = [index.get_indexer_for(joined_index) for index in indexes]\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._join_index_objects.make_reindexer_PandasDataframe._join_index_objects.return.joined_index_make_reinde": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._join_index_objects.make_reindexer_PandasDataframe._join_index_objects.return.joined_index_make_reinde", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1742, "end_line": 1758, "span_ids": ["PandasDataframe._join_index_objects"], "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 PandasDataframe(ClassLogger):\n\n @staticmethod\n def _join_index_objects(axis, indexes, how, sort):\n # ... other code\n\n def make_reindexer(do_reindex: bool, frame_idx: int):\n \"\"\"Create callback that reindexes the dataframe using newly computed index.\"\"\"\n # the order of the frames must match the order of the indexes\n if not do_reindex:\n return lambda df: df\n\n if need_indexers:\n assert indexers is not None\n\n return lambda df: df._reindex_with_indexers(\n {0: [joined_index, indexers[frame_idx]]},\n copy=True,\n allow_dups=True,\n )\n return lambda df: df.reindex(joined_index, axis=axis)\n\n return joined_index, make_reindexer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._Internal_methods_PandasDataframe._build_treereduce_func._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._Internal_methods_PandasDataframe._build_treereduce_func._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1760, "end_line": 1784, "span_ids": ["PandasDataframe._build_treereduce_func", "PandasDataframe._join_index_objects"], "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 PandasDataframe(ClassLogger):\n\n # Internal methods\n # These methods are for building the correct answer in a modular way.\n # Please be careful when changing these!\n\n def _build_treereduce_func(self, axis, func):\n \"\"\"\n Properly formats a TreeReduce result so that the partitioning is correct.\n\n Parameters\n ----------\n axis : int\n The axis along which to apply the function.\n func : callable\n The function to apply.\n\n Returns\n -------\n callable\n A function to be shipped to the partitions to be executed.\n\n Notes\n -----\n This should be used for any TreeReduce style operation that results in a\n reduced data dimensionality (dataframe -> series).\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._build_treereduce_func._tree_reduce_func_PandasDataframe._build_treereduce_func.return._tree_reduce_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._build_treereduce_func._tree_reduce_func_PandasDataframe._build_treereduce_func.return._tree_reduce_func", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1786, "end_line": 1806, "span_ids": ["PandasDataframe._build_treereduce_func"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _build_treereduce_func(self, axis, func):\n\n def _tree_reduce_func(df, *args, **kwargs):\n \"\"\"Tree-reducer function itself executing `func`, presenting the resulting pandas.Series as pandas.DataFrame.\"\"\"\n series_result = func(df, *args, **kwargs)\n if axis == 0 and isinstance(series_result, pandas.Series):\n # In the case of axis=0, we need to keep the shape of the data\n # consistent with what we have done. In the case of a reduce, the\n # data for axis=0 should be a single value for each column. By\n # transposing the data after we convert to a DataFrame, we ensure that\n # the columns of the result line up with the columns from the data.\n # axis=1 does not have this requirement because the index already will\n # line up with the index of the data based on how pandas creates a\n # DataFrame from a Series.\n result = pandas.DataFrame(series_result).T\n result.index = [MODIN_UNNAMED_SERIES_LABEL]\n else:\n result = pandas.DataFrame(series_result)\n if isinstance(series_result, pandas.Series):\n result.columns = [MODIN_UNNAMED_SERIES_LABEL]\n return result\n\n return _tree_reduce_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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_tree_reduce_metadata_PandasDataframe._compute_tree_reduce_metadata.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._compute_tree_reduce_metadata_PandasDataframe._compute_tree_reduce_metadata.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1808, "end_line": 1849, "span_ids": ["PandasDataframe._compute_tree_reduce_metadata"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _compute_tree_reduce_metadata(self, axis, new_parts, dtypes=None):\n \"\"\"\n Compute the metadata for the result of reduce function.\n\n Parameters\n ----------\n axis : int\n The axis on which reduce function was applied.\n new_parts : NumPy 2D array\n Partitions with the result of applied function.\n dtypes : str, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n\n Returns\n -------\n PandasDataframe\n Modin series (1xN frame) containing the reduced data.\n \"\"\"\n new_axes, new_axes_lengths = [0, 0], [0, 0]\n\n new_axes[axis] = [MODIN_UNNAMED_SERIES_LABEL]\n new_axes[axis ^ 1] = self.axes[axis ^ 1]\n\n new_axes_lengths[axis] = [1]\n new_axes_lengths[axis ^ 1] = self._axes_lengths[axis ^ 1]\n\n if dtypes == \"copy\":\n dtypes = self.copy_dtypes_cache()\n elif dtypes is not None:\n dtypes = pandas.Series(\n [np.dtype(dtypes)] * len(new_axes[1]), index=new_axes[1]\n )\n\n result = self.__constructor__(\n new_parts,\n *new_axes,\n *new_axes_lengths,\n dtypes,\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.reduce_PandasDataframe.reduce.return.self__compute_tree_reduce": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.reduce_PandasDataframe.reduce.return.self__compute_tree_reduce", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1851, "end_line": 1886, "span_ids": ["PandasDataframe.reduce"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def reduce(\n self,\n axis: Union[int, Axis],\n function: Callable,\n dtypes: Optional[str] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Perform a user-defined aggregation on the specified axis, where the axis reduces down to a singleton. Requires knowledge of the full axis for the reduction.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the reduce over.\n function : callable(row|col) -> single value\n The reduce function to apply to each column.\n dtypes : str, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n\n Returns\n -------\n PandasDataframe\n Modin series (1xN frame) containing the reduced data.\n\n Notes\n -----\n The user-defined function must reduce to a single value.\n \"\"\"\n axis = Axis(axis)\n function = self._build_treereduce_func(axis.value, function)\n new_parts = self._partition_mgr_cls.map_axis_partitions(\n axis.value, self._partitions, function\n )\n return self._compute_tree_reduce_metadata(axis.value, new_parts, dtypes=dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.tree_reduce_PandasDataframe.tree_reduce.return.self__compute_tree_reduce": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.tree_reduce_PandasDataframe.tree_reduce.return.self__compute_tree_reduce", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1888, "end_line": 1929, "span_ids": ["PandasDataframe.tree_reduce"], "tokens": 361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"opposite\", axis_arg=0)\n def tree_reduce(\n self,\n axis: Union[int, Axis],\n map_func: Callable,\n reduce_func: Optional[Callable] = None,\n dtypes: Optional[str] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Apply function that will reduce the data to a pandas Series.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the tree reduce over.\n map_func : callable(row|col) -> row|col\n Callable function to map the dataframe.\n reduce_func : callable(row|col) -> single value, optional\n Callable function to reduce the dataframe.\n If none, then apply map_func twice.\n dtypes : str, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n \"\"\"\n axis = Axis(axis)\n map_func = self._build_treereduce_func(axis.value, map_func)\n if reduce_func is None:\n reduce_func = map_func\n else:\n reduce_func = self._build_treereduce_func(axis.value, reduce_func)\n\n map_parts = self._partition_mgr_cls.map_partitions(self._partitions, map_func)\n reduce_parts = self._partition_mgr_cls.map_axis_partitions(\n axis.value, map_parts, reduce_func\n )\n return self._compute_tree_reduce_metadata(axis.value, reduce_parts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.map_PandasDataframe.map.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.map_PandasDataframe.map.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1931, "end_line": 1981, "span_ids": ["PandasDataframe.map"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=None)\n def map(\n self,\n func: Callable,\n dtypes: Optional[str] = None,\n new_columns: Optional[pandas.Index] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Perform a function that maps across the entire dataset.\n\n Parameters\n ----------\n func : callable(row|col|cell) -> row|col|cell\n The function to apply.\n dtypes : dtypes of the result, optional\n The data types for the result. This is an optimization\n because there are functions that always result in a particular data\n type, and this allows us to avoid (re)computing it.\n new_columns : pandas.Index, optional\n New column labels of the result, its length has to be identical\n to the older columns. If not specified, old column labels are preserved.\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n \"\"\"\n new_partitions = self._partition_mgr_cls.map_partitions(self._partitions, func)\n if new_columns is not None and self.has_materialized_columns:\n assert len(new_columns) == len(\n self.columns\n ), \"New column's length must be identical to the previous columns\"\n elif new_columns is None:\n new_columns = self.copy_columns_cache()\n if isinstance(dtypes, str) and dtypes == \"copy\":\n dtypes = self.copy_dtypes_cache()\n elif dtypes is not None and not isinstance(dtypes, pandas.Series):\n if isinstance(new_columns, ModinIndex):\n # Materializing lazy columns in order to build dtype's index\n new_columns = new_columns.get(return_lengths=False)\n dtypes = pandas.Series(\n [np.dtype(dtypes)] * len(new_columns), index=new_columns\n )\n return self.__constructor__(\n new_partitions,\n self.copy_index_cache(),\n new_columns,\n self._row_lengths_cache,\n self._column_widths_cache,\n dtypes=dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.window_PandasDataframe.window.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.window_PandasDataframe.window.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1983, "end_line": 2016, "span_ids": ["PandasDataframe.window"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def window(\n self,\n axis: Union[int, Axis],\n reduce_fn: Callable,\n window_size: int,\n result_schema: Optional[Dict[Hashable, type]] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Apply a sliding window operator that acts as a GROUPBY on each window, and reduces down to a single row (column) per window.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to slide over.\n reduce_fn : callable(rowgroup|colgroup) -> row|col\n The reduce function to apply over the data.\n window_size : int\n The number of row/columns to pass to the function.\n (The size of the sliding window).\n result_schema : dict, optional\n Mapping from column labels to data types that represents the types of the output dataframe.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe with the reduce function applied over windows of the specified\n axis.\n\n Notes\n -----\n The user-defined reduce function must reduce each window\u2019s column\n (row if axis=1) down to a single value.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.fold_PandasDataframe.fold.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.fold_PandasDataframe.fold.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2018, "end_line": 2060, "span_ids": ["PandasDataframe.fold"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def fold(self, axis, func, new_columns=None):\n \"\"\"\n Perform a function across an entire axis.\n\n Parameters\n ----------\n axis : int\n The axis to apply over.\n func : callable\n The function to apply.\n new_columns : list-like, optional\n The columns of the result.\n Must be the same length as the columns' length of `self`.\n The column labels of `self` may change during an operation so\n we may want to pass the new column labels in (e.g., see `cat.codes`).\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n\n Notes\n -----\n The data shape is not changed (length and width of the table).\n \"\"\"\n if new_columns is not None:\n if self.has_materialized_columns:\n assert len(self.columns) == len(\n new_columns\n ), \"The length of `new_columns` doesn't match the columns' length of `self`\"\n self.set_columns_cache(new_columns)\n\n new_partitions = self._partition_mgr_cls.map_axis_partitions(\n axis, self._partitions, func, keep_partitioning=True\n )\n return self.__constructor__(\n new_partitions,\n self.copy_index_cache(),\n self.copy_columns_cache(),\n self._row_lengths_cache,\n self._column_widths_cache,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.infer_objects_PandasDataframe.infer_objects.return.self_infer_types_obj_cols": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.infer_objects_PandasDataframe.infer_objects.return.self_infer_types_obj_cols", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2062, "end_line": 2078, "span_ids": ["PandasDataframe.infer_objects"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def infer_objects(self) -> \"PandasDataframe\":\n \"\"\"\n Attempt to infer better dtypes for object columns.\n\n Attempts soft conversion of object-dtyped columns, leaving non-object and unconvertible\n columns unchanged. The inference rules are the same as during normal Series/DataFrame\n construction.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe with the inferred schema.\n \"\"\"\n obj_cols = [\n col for col, dtype in enumerate(self.dtypes) if is_object_dtype(dtype)\n ]\n return self.infer_types(obj_cols)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.infer_types_PandasDataframe.infer_types.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.infer_types_PandasDataframe.infer_types.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2080, "end_line": 2106, "span_ids": ["PandasDataframe.infer_types"], "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 PandasDataframe(ClassLogger):\n\n def infer_types(self, col_labels: List[str]) -> \"PandasDataframe\":\n \"\"\"\n Determine the compatible type shared by all values in the specified columns, and coerce them to that type.\n\n Parameters\n ----------\n col_labels : list\n List of column labels to infer and induce types over.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe with the inferred schema.\n \"\"\"\n # Compute dtypes on the specified columns, and then set those dtypes on a new frame\n new_cols = self.take_2d_labels_or_positional(col_labels=col_labels)\n new_cols_dtypes = new_cols.tree_reduce(0, pandas.DataFrame.infer_objects).dtypes\n new_dtypes = self.dtypes.copy()\n new_dtypes[col_labels] = new_cols_dtypes\n return self.__constructor__(\n self._partitions,\n self.copy_index_cache(),\n self.copy_columns_cache(),\n self._row_lengths_cache,\n self._column_widths_cache,\n new_dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.join_PandasDataframe.join.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.join_PandasDataframe.join.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2108, "end_line": 2144, "span_ids": ["PandasDataframe.join"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def join(\n self,\n axis: Union[int, Axis],\n condition: Callable,\n other: ModinDataframe,\n join_type: Union[str, JoinType],\n ) -> \"PandasDataframe\":\n \"\"\"\n Join this dataframe with the other.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the join on.\n condition : callable\n Function that determines which rows should be joined. The condition can be a\n simple equality, e.g. \"left.col1 == right.col1\" or can be arbitrarily complex.\n other : ModinDataframe\n The other data to join with, i.e. the right dataframe.\n join_type : string {\"inner\", \"left\", \"right\", \"outer\"} or modin.core.dataframe.base.utils.JoinType\n The type of join to perform.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe that is the result of applying the specified join over the two\n dataframes.\n\n Notes\n -----\n During the join, this dataframe is considered the left, while the other is\n treated as the right.\n\n Only inner joins, left outer, right outer, and full outer joins are currently supported.\n Support for other join types (e.g. natural join) may be implemented in the future.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.rename_PandasDataframe.rename.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.rename_PandasDataframe.rename.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2146, "end_line": 2214, "span_ids": ["PandasDataframe.rename"], "tokens": 537}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def rename(\n self,\n new_row_labels: Optional[Union[Dict[Hashable, Hashable], Callable]] = None,\n new_col_labels: Optional[Union[Dict[Hashable, Hashable], Callable]] = None,\n level: Optional[Union[int, List[int]]] = None,\n ) -> \"PandasDataframe\":\n \"\"\"\n Replace the row and column labels with the specified new labels.\n\n Parameters\n ----------\n new_row_labels : dictionary or callable, optional\n Mapping or callable that relates old row labels to new labels.\n new_col_labels : dictionary or callable, optional\n Mapping or callable that relates old col labels to new labels.\n level : int, optional\n Level whose row labels to replace.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe with the new row and column labels.\n\n Notes\n -----\n If level is not specified, the default behavior is to replace row labels in all levels.\n \"\"\"\n new_index = self.index.copy()\n\n def make_label_swapper(label_dict):\n if isinstance(label_dict, dict):\n return lambda label: label_dict.get(label, label)\n return label_dict\n\n def swap_labels_levels(index_tuple):\n if isinstance(new_row_labels, dict):\n return tuple(new_row_labels.get(label, label) for label in index_tuple)\n return tuple(new_row_labels(label) for label in index_tuple)\n\n if new_row_labels:\n swap_row_labels = make_label_swapper(new_row_labels)\n if isinstance(self.index, pandas.MultiIndex):\n if level is not None:\n new_index.set_levels(\n new_index.levels[level].map(swap_row_labels), level\n )\n else:\n new_index = new_index.map(swap_labels_levels)\n else:\n new_index = new_index.map(swap_row_labels)\n new_cols = self.columns.copy()\n if new_col_labels:\n new_cols = new_cols.map(make_label_swapper(new_col_labels))\n\n def map_fn(df):\n return df.rename(index=new_row_labels, columns=new_col_labels, level=level)\n\n new_parts = self._partition_mgr_cls.map_partitions(self._partitions, map_fn)\n new_dtypes = None\n if self.has_materialized_dtypes:\n new_dtypes = self.dtypes.set_axis(new_cols)\n return self.__constructor__(\n new_parts,\n new_index,\n new_cols,\n self._row_lengths_cache,\n self._column_widths_cache,\n new_dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.combine_and_apply_PandasDataframe.combine_and_apply.return.modin_frame_apply_full_ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.combine_and_apply_PandasDataframe.combine_and_apply.return.modin_frame_apply_full_ax", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2216, "end_line": 2259, "span_ids": ["PandasDataframe.combine_and_apply"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def combine_and_apply(\n self, func, new_index=None, new_columns=None, new_dtypes=None\n ):\n \"\"\"\n Combine all partitions into a single big one and apply the passed function to it.\n\n Use this method with care as it collects all the data on the same worker,\n it's only recommended to use this method on small or reduced datasets.\n\n Parameters\n ----------\n func : callable(pandas.DataFrame) -> pandas.DataFrame\n A function to apply to the combined partition.\n new_index : sequence, optional\n Index of the result.\n new_columns : sequence, optional\n Columns of the result.\n new_dtypes : dict-like, optional\n Dtypes of the result.\n\n Returns\n -------\n PandasDataframe\n \"\"\"\n if self._partitions.shape[1] > 1:\n new_partitions = self._partition_mgr_cls.row_partitions(self._partitions)\n new_partitions = np.array([[partition] for partition in new_partitions])\n modin_frame = self.__constructor__(\n new_partitions,\n self.copy_index_cache(),\n self.copy_columns_cache(),\n self._row_lengths_cache,\n [len(self.columns)] if self.has_materialized_columns else None,\n self.copy_dtypes_cache(),\n )\n else:\n modin_frame = self\n return modin_frame.apply_full_axis(\n axis=0,\n func=func,\n new_index=new_index,\n new_columns=new_columns,\n dtypes=new_dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._apply_func_to_range_partitioning_PandasDataframe._apply_func_to_range_partitioning.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._apply_func_to_range_partitioning_PandasDataframe._apply_func_to_range_partitioning.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2261, "end_line": 2362, "span_ids": ["PandasDataframe._apply_func_to_range_partitioning"], "tokens": 848}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _apply_func_to_range_partitioning(\n self, key_column, func, ascending=True, **kwargs\n ):\n \"\"\"\n Reshuffle data so it would be range partitioned and then apply the passed function row-wise.\n\n Parameters\n ----------\n key_column : hashable\n Column name to build the range partitioning for.\n func : callable(pandas.DataFrame) -> pandas.DataFrame\n Function to apply against partitions.\n ascending : bool, default: True\n Whether the range should be built in ascending or descending order.\n **kwargs : dict\n Additional arguments to forward to the range builder function.\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n \"\"\"\n # If there's only one row partition can simply apply the function row-wise without the need to reshuffle\n if self._partitions.shape[0] == 1:\n return self.apply_full_axis(axis=1, func=func)\n\n ideal_num_new_partitions = len(self._partitions)\n m = len(self.index) / ideal_num_new_partitions\n sampling_probability = (1 / m) * np.log(\n ideal_num_new_partitions * len(self.index)\n )\n # If this df is overpartitioned, we try to sample each partition with probability\n # greater than 1, which leads to an error. In this case, we can do one of the following\n # two things. If there is only enough rows for one partition, and we have only 1 column\n # partition, we can just combine the overpartitioned df into one partition, and sort that\n # partition. If there is enough data for more than one partition, we can tell the sorting\n # algorithm how many partitions we want to end up with, so it samples and finds pivots\n # according to that.\n if sampling_probability >= 1:\n from modin.config import MinPartitionSize\n\n ideal_num_new_partitions = round(len(self.index) / MinPartitionSize.get())\n if len(self.index) < MinPartitionSize.get() or ideal_num_new_partitions < 2:\n # If the data is too small, we shouldn't try reshuffling/repartitioning but rather\n # simply combine all partitions and apply the sorting to the whole dataframe\n return self.combine_and_apply(func=func)\n\n if self.dtypes[key_column] == object:\n # This means we are not sorting numbers, so we need our quantiles to not try\n # arithmetic on the values.\n method = \"inverted_cdf\"\n else:\n method = \"linear\"\n\n shuffling_functions = build_sort_functions(\n self,\n key_column,\n method,\n ascending[0] if is_list_like(ascending) else ascending,\n ideal_num_new_partitions,\n **kwargs,\n )\n if ideal_num_new_partitions < len(self._partitions):\n if len(self._partitions) % ideal_num_new_partitions == 0:\n joining_partitions = np.split(\n self._partitions, ideal_num_new_partitions\n )\n else:\n joining_partitions = np.split(\n self._partitions,\n range(\n 0,\n len(self._partitions),\n round(len(self._partitions) / ideal_num_new_partitions),\n )[1:],\n )\n\n new_partitions = np.array(\n [\n self._partition_mgr_cls.column_partitions(ptn_grp, full_axis=False)\n for ptn_grp in joining_partitions\n ]\n )\n else:\n new_partitions = self._partitions\n\n major_col_partition_index = self.columns.get_loc(key_column)\n cols_seen = 0\n index = -1\n for i, length in enumerate(self.column_widths):\n cols_seen += length\n if major_col_partition_index < cols_seen:\n index = i\n break\n new_partitions = self._partition_mgr_cls.shuffle_partitions(\n new_partitions,\n index,\n shuffling_functions,\n func,\n )\n\n return self.__constructor__(new_partitions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by_PandasDataframe.sort_by.if_not_isinstance_columns.columns._columns_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by_PandasDataframe.sort_by.if_not_isinstance_columns.columns._columns_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2364, "end_line": 2392, "span_ids": ["PandasDataframe.sort_by"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def sort_by(\n self,\n axis: Union[int, Axis],\n columns: Union[str, List[str]],\n ascending: bool = True,\n **kwargs,\n ) -> \"PandasDataframe\":\n \"\"\"\n Logically reorder rows (columns if axis=1) lexicographically by the data in a column or set of columns.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to perform the sort over.\n columns : string or list\n Column label(s) to use to determine lexicographical ordering.\n ascending : boolean, default: True\n Whether to sort in ascending or descending order.\n **kwargs : dict\n Keyword arguments to pass when sorting partitions.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe sorted into lexicographical order by the specified column(s).\n \"\"\"\n if not isinstance(columns, list):\n columns = [columns]\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by.sort_function_PandasDataframe.sort_by.sort_function.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by.sort_function_PandasDataframe.sort_by.sort_function.return.df", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2394, "end_line": 2406, "span_ids": ["PandasDataframe.sort_by"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def sort_by(\n self,\n axis: Union[int, Axis],\n columns: Union[str, List[str]],\n ascending: bool = True,\n **kwargs,\n ) -> \"PandasDataframe\":\n # ... other code\n\n def sort_function(df): # pragma: no cover\n # When we do a sort on the result of Series.value_counts, we don't rename the index until\n # after everything is done, which causes an error when sorting the partitions, since the\n # index and the column share the same name, when in actuality, the index's name should be\n # None. This fixes the indexes name beforehand in that case, so that the sort works.\n index_renaming = None\n if any(name in df.columns for name in df.index.names):\n index_renaming = df.index.names\n df.index = df.index.set_names([None] * len(df.index.names))\n df = df.sort_values(by=columns, ascending=ascending, **kwargs)\n if index_renaming is not None:\n df.index = df.index.set_names(index_renaming)\n return df\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by._If_this_df_is_empty_we_PandasDataframe.sort_by.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.sort_by._If_this_df_is_empty_we_PandasDataframe.sort_by.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2408, "end_line": 2438, "span_ids": ["PandasDataframe.sort_by"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def sort_by(\n self,\n axis: Union[int, Axis],\n columns: Union[str, List[str]],\n ascending: bool = True,\n **kwargs,\n ) -> \"PandasDataframe\":\n\n # If this df is empty, we don't want to try and shuffle or sort.\n if len(self.axes[0]) == 0 or len(self.axes[1]) == 0:\n return self.copy()\n\n axis = Axis(axis)\n if axis != Axis.ROW_WISE:\n raise NotImplementedError(\n f\"Algebra sort only implemented row-wise. {axis.name} sort not implemented yet!\"\n )\n\n result = self._apply_func_to_range_partitioning(\n key_column=columns[0], func=sort_function, ascending=ascending, **kwargs\n )\n\n result.set_axis_cache(self.copy_axis_cache(axis.value ^ 1), axis=axis.value ^ 1)\n result.set_dtypes_cache(self.copy_dtypes_cache())\n # We perform the final steps of the sort on full axis partitions, so we know that the\n # length of each partition is the full length of the dataframe.\n if self.has_materialized_columns:\n self._set_axis_lengths_cache([len(self.columns)], axis=axis.value ^ 1)\n\n if kwargs.get(\"ignore_index\", False):\n result.index = RangeIndex(len(self.get_axis(axis.value)))\n\n # Since the strategy to pick our pivots involves random sampling\n # we could end up picking poor pivots, leading to skew in our partitions.\n # We should add a fix to check if there is skew in the partitions and rebalance\n # them if necessary. Calling `rebalance_partitions` won't do this, since it only\n # resolves the case where there isn't the right amount of partitions - not where\n # there is skew across the lengths of partitions.\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.filter_PandasDataframe.filter.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.filter_PandasDataframe.filter.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2440, "end_line": 2483, "span_ids": ["PandasDataframe.filter"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def filter(self, axis: Union[Axis, int], condition: Callable) -> \"PandasDataframe\":\n \"\"\"\n Filter data based on the function provided along an entire axis.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to filter over.\n condition : callable(row|col) -> bool\n The function to use for the filter. This function should filter the\n data itself.\n\n Returns\n -------\n PandasDataframe\n A new filtered dataframe.\n \"\"\"\n axis = Axis(axis)\n assert axis in (\n Axis.ROW_WISE,\n Axis.COL_WISE,\n ), \"Axis argument to filter operator must be 0 (rows) or 1 (columns)\"\n\n new_partitions = self._partition_mgr_cls.map_axis_partitions(\n axis.value, self._partitions, condition, keep_partitioning=True\n )\n\n new_axes, new_lengths = [0, 0], [0, 0]\n\n new_axes[axis.value] = (\n self.copy_index_cache() if axis.value == 0 else self.copy_columns_cache()\n )\n new_lengths[axis.value] = (\n self._row_lengths_cache if axis.value == 0 else self._column_widths_cache\n )\n new_axes[axis.value ^ 1], new_lengths[axis.value ^ 1] = None, None\n\n return self.__constructor__(\n new_partitions,\n *new_axes,\n *new_lengths,\n self.copy_dtypes_cache() if axis == Axis.COL_WISE else None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.filter_by_types_PandasDataframe.filter_by_types.return.self_take_2d_labels_or_po": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.filter_by_types_PandasDataframe.filter_by_types.return.self_take_2d_labels_or_po", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2485, "end_line": 2501, "span_ids": ["PandasDataframe.filter_by_types"], "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 PandasDataframe(ClassLogger):\n\n def filter_by_types(self, types: List[Hashable]) -> \"PandasDataframe\":\n \"\"\"\n Allow the user to specify a type or set of types by which to filter the columns.\n\n Parameters\n ----------\n types : list\n The types to filter columns by.\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe from the filter provided.\n \"\"\"\n return self.take_2d_labels_or_positional(\n col_positions=[i for i, dtype in enumerate(self.dtypes) if dtype in types]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.explode_PandasDataframe.explode.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.explode_PandasDataframe.explode.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2503, "end_line": 2537, "span_ids": ["PandasDataframe.explode"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def explode(self, axis: Union[int, Axis], func: Callable) -> \"PandasDataframe\":\n \"\"\"\n Explode list-like entries along an entire axis.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis specifying how to explode. If axis=1, explode according\n to columns.\n func : callable\n The function to use to explode a single element.\n\n Returns\n -------\n PandasFrame\n A new filtered dataframe.\n \"\"\"\n axis = Axis(axis)\n partitions = self._partition_mgr_cls.map_axis_partitions(\n axis.value, self._partitions, func, keep_partitioning=True\n )\n if axis == Axis.COL_WISE:\n new_index, row_lengths = self._compute_axis_labels_and_lengths(\n 0, partitions\n )\n new_columns, column_widths = self.columns, self._column_widths_cache\n else:\n new_index, row_lengths = self.index, self._row_lengths_cache\n new_columns, column_widths = self._compute_axis_labels_and_lengths(\n 1, partitions\n )\n return self.__constructor__(\n partitions, new_index, new_columns, row_lengths, column_widths\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_full_axis_PandasDataframe.apply_full_axis.return.self_broadcast_apply_full": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_full_axis_PandasDataframe.apply_full_axis.return.self_broadcast_apply_full", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2539, "end_line": 2616, "span_ids": ["PandasDataframe.apply_full_axis"], "tokens": 677}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def apply_full_axis(\n self,\n axis,\n func,\n new_index=None,\n new_columns=None,\n apply_indices=None,\n enumerate_partitions: bool = False,\n dtypes=None,\n keep_partitioning=True,\n num_splits=None,\n sync_labels=True,\n pass_axis_lengths_to_partitions=False,\n ):\n \"\"\"\n Perform a function across an entire axis.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to apply over (0 - rows, 1 - columns).\n func : callable\n The function to apply.\n new_index : list-like, optional\n The index of the result. We may know this in advance,\n and if not provided it must be computed.\n new_columns : list-like, optional\n The columns of the result. We may know this in\n advance, and if not provided it must be computed.\n apply_indices : list-like, default: None\n Indices of `axis ^ 1` to apply function over.\n enumerate_partitions : bool, default: False\n Whether pass partition index into applied `func` or not.\n Note that `func` must be able to obtain `partition_idx` kwarg.\n dtypes : list-like, optional\n The data types of the result. This is an optimization\n because there are functions that always result in a particular data\n type, and allows us to avoid (re)computing it.\n keep_partitioning : boolean, default: True\n The flag to keep partition boundaries for Modin Frame if possible.\n Setting it to True disables shuffling data from one partition to another in case the resulting\n number of splits is equal to the initial number of splits.\n num_splits : int, optional\n The number of partitions to split the result into across the `axis`. If None, then the number\n of splits will be infered automatically. If `num_splits` is None and `keep_partitioning=True`\n then the number of splits is preserved.\n sync_labels : boolean, default: True\n Synchronize external indexes (`new_index`, `new_columns`) with internal indexes.\n This could be used when you're certain that the indices in partitions are equal to\n the provided hints in order to save time on syncing them.\n pass_axis_lengths_to_partitions : bool, default: False\n Whether pass partition lengths along `axis ^ 1` to the kernel `func`.\n Note that `func` must be able to obtain `df, *axis_lengths`.\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n\n Notes\n -----\n The data shape may change as a result of the function.\n \"\"\"\n return self.broadcast_apply_full_axis(\n axis=axis,\n func=func,\n new_index=new_index,\n new_columns=new_columns,\n apply_indices=apply_indices,\n enumerate_partitions=enumerate_partitions,\n dtypes=dtypes,\n other=None,\n keep_partitioning=keep_partitioning,\n num_splits=num_splits,\n sync_labels=sync_labels,\n pass_axis_lengths_to_partitions=pass_axis_lengths_to_partitions,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_full_axis_select_indices_PandasDataframe.apply_full_axis_select_indices.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_full_axis_select_indices_PandasDataframe.apply_full_axis_select_indices.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2618, "end_line": 2678, "span_ids": ["PandasDataframe.apply_full_axis_select_indices"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def apply_full_axis_select_indices(\n self,\n axis,\n func,\n apply_indices=None,\n numeric_indices=None,\n new_index=None,\n new_columns=None,\n keep_remaining=False,\n ):\n \"\"\"\n Apply a function across an entire axis for a subset of the data.\n\n Parameters\n ----------\n axis : int\n The axis to apply over.\n func : callable\n The function to apply.\n apply_indices : list-like, default: None\n The labels to apply over.\n numeric_indices : list-like, default: None\n The indices to apply over.\n new_index : list-like, optional\n The index of the result. We may know this in advance,\n and if not provided it must be computed.\n new_columns : list-like, optional\n The columns of the result. We may know this in\n advance, and if not provided it must be computed.\n keep_remaining : boolean, default: False\n Whether or not to drop the data that is not computed over.\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n \"\"\"\n assert apply_indices is not None or numeric_indices is not None\n # Convert indices to numeric indices\n old_index = self.index if axis else self.columns\n if apply_indices is not None:\n numeric_indices = old_index.get_indexer_for(apply_indices)\n # Get the indices for the axis being applied to (it is the opposite of axis\n # being applied over)\n dict_indices = self._get_dict_of_block_index(axis ^ 1, numeric_indices)\n new_partitions = (\n self._partition_mgr_cls.apply_func_to_select_indices_along_full_axis(\n axis,\n self._partitions,\n func,\n dict_indices,\n keep_remaining=keep_remaining,\n )\n )\n # TODO Infer columns and index from `keep_remaining` and `apply_indices`\n if new_index is None:\n new_index = self.index if axis == 1 else None\n if new_columns is None:\n new_columns = self.columns if axis == 0 else None\n return self.__constructor__(new_partitions, new_index, new_columns, 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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_select_indices_PandasDataframe.apply_select_indices.if_new_columns_is_None_.new_columns.self_columns_if_axis_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_select_indices_PandasDataframe.apply_select_indices.if_new_columns_is_None_.new_columns.self_columns_if_axis_0", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2680, "end_line": 2730, "span_ids": ["PandasDataframe.apply_select_indices"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def apply_select_indices(\n self,\n axis,\n func,\n apply_indices=None,\n row_labels=None,\n col_labels=None,\n new_index=None,\n new_columns=None,\n keep_remaining=False,\n item_to_distribute=no_default,\n ):\n \"\"\"\n Apply a function for a subset of the data.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to apply over.\n func : callable\n The function to apply.\n apply_indices : list-like, default: None\n The labels to apply over. Must be given if axis is provided.\n row_labels : list-like, default: None\n The row labels to apply over. Must be provided with\n `col_labels` to apply over both axes.\n col_labels : list-like, default: None\n The column labels to apply over. Must be provided\n with `row_labels` to apply over both axes.\n new_index : list-like, optional\n The index of the result. We may know this in advance,\n and if not provided it must be computed.\n new_columns : list-like, optional\n The columns of the result. We may know this in\n advance, and if not provided it must be computed.\n keep_remaining : boolean, default: False\n Whether or not to drop the data that is not computed over.\n item_to_distribute : np.ndarray or scalar, default: no_default\n The item to split up so it can be applied over both axes.\n\n Returns\n -------\n PandasDataframe\n A new dataframe.\n \"\"\"\n # TODO Infer columns and index from `keep_remaining` and `apply_indices`\n if new_index is None:\n new_index = self.index if axis == 1 else None\n if new_columns is None:\n new_columns = self.columns if axis == 0 else None\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_select_indices.if_axis_is_not_None__PandasDataframe.apply_select_indices.if_axis_is_not_None_.else_.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.apply_select_indices.if_axis_is_not_None__PandasDataframe.apply_select_indices.if_axis_is_not_None_.else_.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2731, "end_line": 2785, "span_ids": ["PandasDataframe.apply_select_indices"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def apply_select_indices(\n self,\n axis,\n func,\n apply_indices=None,\n row_labels=None,\n col_labels=None,\n new_index=None,\n new_columns=None,\n keep_remaining=False,\n item_to_distribute=no_default,\n ):\n # ... other code\n if axis is not None:\n assert apply_indices is not None\n # Convert indices to numeric indices\n old_index = self.index if axis else self.columns\n numeric_indices = old_index.get_indexer_for(apply_indices)\n # Get indices being applied to (opposite of indices being applied over)\n dict_indices = self._get_dict_of_block_index(axis ^ 1, numeric_indices)\n new_partitions = self._partition_mgr_cls.apply_func_to_select_indices(\n axis,\n self._partitions,\n func,\n dict_indices,\n keep_remaining=keep_remaining,\n )\n # Length objects for new object creation. This is shorter than if..else\n # This object determines the lengths and widths based on the given\n # parameters and builds a dictionary used in the constructor below. 0 gives\n # the row lengths and 1 gives the column widths. Since the dimension of\n # `axis` given may have changed, we currently just recompute it.\n # TODO Determine lengths from current lengths if `keep_remaining=False`\n lengths_objs = {\n axis: [len(apply_indices)]\n if not keep_remaining\n else [self.row_lengths, self.column_widths][axis],\n axis ^ 1: [self.row_lengths, self.column_widths][axis ^ 1],\n }\n return self.__constructor__(\n new_partitions, new_index, new_columns, lengths_objs[0], lengths_objs[1]\n )\n else:\n # We are applying over both axes here, so make sure we have all the right\n # variables set.\n assert row_labels is not None and col_labels is not None\n assert keep_remaining\n assert item_to_distribute is not no_default\n row_partitions_list = self._get_dict_of_block_index(0, row_labels).items()\n col_partitions_list = self._get_dict_of_block_index(1, col_labels).items()\n new_partitions = self._partition_mgr_cls.apply_func_to_indices_both_axis(\n self._partitions,\n func,\n row_partitions_list,\n col_partitions_list,\n item_to_distribute,\n # Passing caches instead of values in order to not trigger shapes recomputation\n # if they are not used inside this function.\n self._row_lengths_cache,\n self._column_widths_cache,\n )\n return self.__constructor__(\n new_partitions,\n new_index,\n new_columns,\n self._row_lengths_cache,\n self._column_widths_cache,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_PandasDataframe.broadcast_apply.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_PandasDataframe.broadcast_apply.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2787, "end_line": 2859, "span_ids": ["PandasDataframe.broadcast_apply"], "tokens": 594}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def broadcast_apply(\n self, axis, func, other, join_type=\"left\", labels=\"keep\", dtypes=None\n ):\n \"\"\"\n Broadcast axis partitions of `other` to partitions of `self` and apply a function.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to broadcast over.\n func : callable\n Function to apply.\n other : PandasDataframe\n Modin DataFrame to broadcast.\n join_type : str, default: \"left\"\n Type of join to apply.\n labels : {\"keep\", \"replace\", \"drop\"}, default: \"keep\"\n Whether keep labels from `self` Modin DataFrame, replace them with labels\n from joined DataFrame or drop altogether to make them be computed lazily later.\n dtypes : \"copy\", pandas.Series or None, default: None\n Dtypes of the result. \"copy\" to keep old dtypes and None to compute them on demand.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n # Only sort the indices if they do not match\n (\n left_parts,\n right_parts,\n joined_index,\n partition_sizes_along_axis,\n ) = self._copartition(\n axis, other, join_type, sort=not self.axes[axis].equals(other.axes[axis])\n )\n # unwrap list returned by `copartition`.\n right_parts = right_parts[0]\n new_frame = self._partition_mgr_cls.broadcast_apply(\n axis, func, left_parts, right_parts\n )\n if isinstance(dtypes, str) and dtypes == \"copy\":\n dtypes = self.copy_dtypes_cache()\n\n def _pick_axis(get_axis, sizes_cache):\n if labels == \"keep\":\n return get_axis(), sizes_cache\n if labels == \"replace\":\n return joined_index, partition_sizes_along_axis\n assert labels == \"drop\", f\"Unexpected `labels`: {labels}\"\n return None, None\n\n if axis == 0:\n # Pass shape caches instead of values in order to not trigger shape computation.\n new_index, new_row_lengths = _pick_axis(\n self._get_index, self._row_lengths_cache\n )\n new_columns, new_column_widths = self.columns, self._column_widths_cache\n else:\n new_index, new_row_lengths = self.index, self._row_lengths_cache\n new_columns, new_column_widths = _pick_axis(\n self._get_columns, self._column_widths_cache\n )\n\n return self.__constructor__(\n new_frame,\n new_index,\n new_columns,\n new_row_lengths,\n new_column_widths,\n dtypes=dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._prepare_frame_to_broadcast_PandasDataframe._prepare_frame_to_broadcast.return.result_dict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._prepare_frame_to_broadcast_PandasDataframe._prepare_frame_to_broadcast.return.result_dict", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2861, "end_line": 2897, "span_ids": ["PandasDataframe._prepare_frame_to_broadcast"], "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 PandasDataframe(ClassLogger):\n\n def _prepare_frame_to_broadcast(self, axis, indices, broadcast_all):\n \"\"\"\n Compute the indices to broadcast `self` considering `indices`.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to broadcast along.\n indices : dict\n Dict of indices and internal indices of partitions where `self` must\n be broadcasted.\n broadcast_all : bool\n Whether broadcast the whole axis of `self` frame or just a subset of it.\n\n Returns\n -------\n dict\n Dictionary with indices of partitions to broadcast.\n\n Notes\n -----\n New dictionary of indices of `self` partitions represents that\n you want to broadcast `self` at specified another partition named `other`. For example,\n Dictionary {key: {key1: [0, 1], key2: [5]}} means, that in `other`[key] you want to\n broadcast [self[key1], self[key2]] partitions and internal indices for `self` must be [[0, 1], [5]]\n \"\"\"\n if broadcast_all:\n sizes = self.row_lengths if axis else self.column_widths\n return {key: dict(enumerate(sizes)) for key in indices.keys()}\n passed_len = 0\n result_dict = {}\n for part_num, internal in indices.items():\n result_dict[part_num] = self._get_dict_of_block_index(\n axis ^ 1, np.arange(passed_len, passed_len + len(internal))\n )\n passed_len += len(internal)\n return result_dict", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.__make_init_labels_args_PandasDataframe.__make_init_labels_args.return.kw": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.__make_init_labels_args_PandasDataframe.__make_init_labels_args.return.kw", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2899, "end_line": 2911, "span_ids": ["PandasDataframe.__make_init_labels_args"], "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 PandasDataframe(ClassLogger):\n\n def __make_init_labels_args(self, partitions, index, columns) -> dict:\n kw = {}\n kw[\"index\"], kw[\"row_lengths\"] = (\n self._compute_axis_labels_and_lengths(0, partitions)\n if index is None\n else (index, None)\n )\n kw[\"columns\"], kw[\"column_widths\"] = (\n self._compute_axis_labels_and_lengths(1, partitions)\n if columns is None\n else (columns, None)\n )\n return kw", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_select_indices_PandasDataframe.broadcast_apply_select_indices.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_select_indices_PandasDataframe.broadcast_apply_select_indices.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2913, "end_line": 2993, "span_ids": ["PandasDataframe.broadcast_apply_select_indices"], "tokens": 580}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def broadcast_apply_select_indices(\n self,\n axis,\n func,\n other,\n apply_indices=None,\n numeric_indices=None,\n keep_remaining=False,\n broadcast_all=True,\n new_index=None,\n new_columns=None,\n ):\n \"\"\"\n Apply a function to select indices at specified axis and broadcast partitions of `other` Modin DataFrame.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to apply function along.\n func : callable\n Function to apply.\n other : PandasDataframe\n Partitions of which should be broadcasted.\n apply_indices : list, default: None\n List of labels to apply (if `numeric_indices` are not specified).\n numeric_indices : list, default: None\n Numeric indices to apply (if `apply_indices` are not specified).\n keep_remaining : bool, default: False\n Whether drop the data that is not computed over or not.\n broadcast_all : bool, default: True\n Whether broadcast the whole axis of right frame to every\n partition or just a subset of it.\n new_index : pandas.Index, optional\n Index of the result. We may know this in advance,\n and if not provided it must be computed.\n new_columns : pandas.Index, optional\n Columns of the result. We may know this in advance,\n and if not provided it must be computed.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n assert (\n apply_indices is not None or numeric_indices is not None\n ), \"Indices to apply must be specified!\"\n\n if other is None:\n if apply_indices is None:\n apply_indices = self.axes[axis][numeric_indices]\n return self.apply_select_indices(\n axis=axis,\n func=func,\n apply_indices=apply_indices,\n keep_remaining=keep_remaining,\n new_index=new_index,\n new_columns=new_columns,\n )\n\n if numeric_indices is None:\n old_index = self.index if axis else self.columns\n numeric_indices = old_index.get_indexer_for(apply_indices)\n\n dict_indices = self._get_dict_of_block_index(axis ^ 1, numeric_indices)\n broadcasted_dict = other._prepare_frame_to_broadcast(\n axis, dict_indices, broadcast_all=broadcast_all\n )\n new_partitions = self._partition_mgr_cls.broadcast_apply_select_indices(\n axis,\n func,\n self._partitions,\n other._partitions,\n dict_indices,\n broadcasted_dict,\n keep_remaining,\n )\n\n kw = self.__make_init_labels_args(new_partitions, new_index, new_columns)\n return self.__constructor__(new_partitions, **kw)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_full_axis_PandasDataframe.broadcast_apply_full_axis.apply_func_args.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_full_axis_PandasDataframe.broadcast_apply_full_axis.apply_func_args.None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2995, "end_line": 3069, "span_ids": ["PandasDataframe.broadcast_apply_full_axis"], "tokens": 699}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def broadcast_apply_full_axis(\n self,\n axis,\n func,\n other,\n new_index=None,\n new_columns=None,\n apply_indices=None,\n enumerate_partitions=False,\n dtypes=None,\n keep_partitioning=True,\n num_splits=None,\n sync_labels=True,\n pass_axis_lengths_to_partitions=False,\n ):\n \"\"\"\n Broadcast partitions of `other` Modin DataFrame and apply a function along full axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to apply over (0 - rows, 1 - columns).\n func : callable\n Function to apply.\n other : PandasDataframe or list\n Modin DataFrame(s) to broadcast.\n new_index : list-like, optional\n Index of the result. We may know this in advance,\n and if not provided it must be computed.\n new_columns : list-like, optional\n Columns of the result. We may know this in\n advance, and if not provided it must be computed.\n apply_indices : list-like, default: None\n Indices of `axis ^ 1` to apply function over.\n enumerate_partitions : bool, default: False\n Whether pass partition index into applied `func` or not.\n Note that `func` must be able to obtain `partition_idx` kwarg.\n dtypes : list-like, default: None\n Data types of the result. This is an optimization\n because there are functions that always result in a particular data\n type, and allows us to avoid (re)computing it.\n keep_partitioning : boolean, default: True\n The flag to keep partition boundaries for Modin Frame if possible.\n Setting it to True disables shuffling data from one partition to another in case the resulting\n number of splits is equal to the initial number of splits.\n num_splits : int, optional\n The number of partitions to split the result into across the `axis`. If None, then the number\n of splits will be infered automatically. If `num_splits` is None and `keep_partitioning=True`\n then the number of splits is preserved.\n sync_labels : boolean, default: True\n Synchronize external indexes (`new_index`, `new_columns`) with internal indexes.\n This could be used when you're certain that the indices in partitions are equal to\n the provided hints in order to save time on syncing them.\n pass_axis_lengths_to_partitions : bool, default: False\n Whether pass partition lengths along `axis ^ 1` to the kernel `func`.\n Note that `func` must be able to obtain `df, *axis_lengths`.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n if other is not None:\n if not isinstance(other, list):\n other = [other]\n other = [o._partitions for o in other] if len(other) else None\n\n if apply_indices is not None:\n numeric_indices = self.axes[axis ^ 1].get_indexer_for(apply_indices)\n apply_indices = self._get_dict_of_block_index(\n axis ^ 1, numeric_indices\n ).keys()\n\n apply_func_args = None\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_full_axis.if_pass_axis_lengths_to_p_PandasDataframe.broadcast_apply_full_axis.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.broadcast_apply_full_axis.if_pass_axis_lengths_to_p_PandasDataframe.broadcast_apply_full_axis.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3070, "end_line": 3151, "span_ids": ["PandasDataframe.broadcast_apply_full_axis"], "tokens": 801}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def broadcast_apply_full_axis(\n self,\n axis,\n func,\n other,\n new_index=None,\n new_columns=None,\n apply_indices=None,\n enumerate_partitions=False,\n dtypes=None,\n keep_partitioning=True,\n num_splits=None,\n sync_labels=True,\n pass_axis_lengths_to_partitions=False,\n ):\n # ... other code\n if pass_axis_lengths_to_partitions:\n if axis == 0:\n apply_func_args = (\n self._column_widths_cache\n if self._column_widths_cache is not None\n else [part.width(materialize=False) for part in self._partitions[0]]\n )\n else:\n apply_func_args = (\n self._row_lengths_cache\n if self._row_lengths_cache is not None\n else [\n part.length(materialize=False) for part in self._partitions.T[0]\n ]\n )\n\n new_partitions = self._partition_mgr_cls.broadcast_axis_partitions(\n axis=axis,\n left=self._partitions,\n right=other,\n apply_func=self._build_treereduce_func(axis, func),\n apply_indices=apply_indices,\n enumerate_partitions=enumerate_partitions,\n keep_partitioning=keep_partitioning,\n num_splits=num_splits,\n apply_func_args=apply_func_args,\n )\n kw = {\"row_lengths\": None, \"column_widths\": None}\n if isinstance(dtypes, str) and dtypes == \"copy\":\n kw[\"dtypes\"] = self.copy_dtypes_cache()\n elif dtypes is not None:\n if isinstance(dtypes, (pandas.Series, ModinDtypes)):\n kw[\"dtypes\"] = dtypes.copy()\n else:\n if new_columns is None:\n (\n new_columns,\n kw[\"column_widths\"],\n ) = self._compute_axis_labels_and_lengths(1, new_partitions)\n kw[\"dtypes\"] = (\n pandas.Series(dtypes, index=new_columns)\n if is_list_like(dtypes)\n else pandas.Series(\n [np.dtype(dtypes)] * len(new_columns), index=new_columns\n )\n )\n\n if not keep_partitioning:\n if kw[\"row_lengths\"] is None and new_index is not None:\n if axis == 0:\n kw[\"row_lengths\"] = get_length_list(\n axis_len=len(new_index), num_splits=new_partitions.shape[0]\n )\n elif axis == 1:\n if self._row_lengths_cache is not None and len(new_index) == sum(\n self._row_lengths_cache\n ):\n kw[\"row_lengths\"] = self._row_lengths_cache\n elif len(new_index) == 1 and new_partitions.shape[0] == 1:\n kw[\"row_lengths\"] = [1]\n if kw[\"column_widths\"] is None and new_columns is not None:\n if axis == 1:\n kw[\"column_widths\"] = get_length_list(\n axis_len=len(new_columns),\n num_splits=new_partitions.shape[1],\n )\n elif axis == 0:\n if self._column_widths_cache is not None and len(\n new_columns\n ) == sum(self._column_widths_cache):\n kw[\"column_widths\"] = self._column_widths_cache\n elif len(new_columns) == 1 and new_partitions.shape[1] == 1:\n kw[\"column_widths\"] = [1]\n\n result = self.__constructor__(\n new_partitions, index=new_index, columns=new_columns, **kw\n )\n if sync_labels and new_index is not None:\n result.synchronize_labels(axis=0)\n if sync_labels and new_columns is not None:\n result.synchronize_labels(axis=1)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._copartition_PandasDataframe._copartition.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._copartition_PandasDataframe._copartition.None_7", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3153, "end_line": 3241, "span_ids": ["PandasDataframe._copartition"], "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 PandasDataframe(ClassLogger):\n\n def _copartition(self, axis, other, how, sort, force_repartition=False):\n \"\"\"\n Copartition two Modin DataFrames.\n\n Perform aligning of partitions, index and partition blocks.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to copartition along (0 - rows, 1 - columns).\n other : PandasDataframe\n Other Modin DataFrame(s) to copartition against.\n how : str\n How to manage joining the index object (\"left\", \"right\", etc.).\n sort : bool\n Whether sort the joined index or not.\n force_repartition : bool, default: False\n Whether force the repartitioning or not. By default,\n this method will skip repartitioning if it is possible. This is because\n reindexing is extremely inefficient. Because this method is used to\n `join` or `append`, it is vital that the internal indices match.\n\n Returns\n -------\n tuple\n Tuple containing:\n 1) 2-d NumPy array of aligned left partitions\n 2) list of 2-d NumPy arrays of aligned right partitions\n 3) joined index along ``axis``\n 4) List with sizes of partitions along axis that partitioning\n was done on. This list will be empty if and only if all\n the frames are empty.\n \"\"\"\n if isinstance(other, type(self)):\n other = [other]\n\n self_index = self.axes[axis]\n others_index = [o.axes[axis] for o in other]\n joined_index, make_reindexer = self._join_index_objects(\n axis, [self_index] + others_index, how, sort\n )\n\n frames = [self] + other\n non_empty_frames_idx = [\n i for i, o in enumerate(frames) if o._partitions.size != 0\n ]\n\n # If all frames are empty\n if len(non_empty_frames_idx) == 0:\n return (\n self._partitions,\n [o._partitions for o in other],\n joined_index,\n # There are no partition sizes because the resulting dataframe\n # has no partitions.\n [],\n )\n\n base_frame_idx = non_empty_frames_idx[0]\n other_frames = frames[base_frame_idx + 1 :]\n\n # Picking first non-empty frame\n base_frame = frames[non_empty_frames_idx[0]]\n base_index = base_frame.axes[axis]\n\n # define conditions for reindexing and repartitioning `self` frame\n do_reindex_base = not base_index.equals(joined_index)\n do_repartition_base = force_repartition or do_reindex_base\n\n # Perform repartitioning and reindexing for `base_frame` if needed.\n # Also define length of base and frames. We will need to know the\n # lengths for alignment.\n if do_repartition_base:\n reindexed_base = base_frame._partition_mgr_cls.map_axis_partitions(\n axis,\n base_frame._partitions,\n make_reindexer(do_reindex_base, base_frame_idx),\n )\n if axis:\n base_lengths = [obj.width() for obj in reindexed_base[0]]\n else:\n base_lengths = [obj.length() for obj in reindexed_base.T[0]]\n else:\n reindexed_base = base_frame._partitions\n base_lengths = base_frame.column_widths if axis else base_frame.row_lengths\n\n others_lengths = [o._axes_lengths[axis] for o in other_frames]\n\n # define conditions for reindexing and repartitioning `other` frames\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._copartition.do_reindex_others_PandasDataframe._copartition.return._reindexed_frames_0_rei": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._copartition.do_reindex_others_PandasDataframe._copartition.return._reindexed_frames_0_rei", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3242, "end_line": 3274, "span_ids": ["PandasDataframe._copartition"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def _copartition(self, axis, other, how, sort, force_repartition=False):\n # ... other code\n do_reindex_others = [\n not o.axes[axis].equals(joined_index) for o in other_frames\n ]\n\n do_repartition_others = [None] * len(other_frames)\n for i in range(len(other_frames)):\n do_repartition_others[i] = (\n force_repartition\n or do_reindex_others[i]\n or others_lengths[i] != base_lengths\n )\n\n # perform repartitioning and reindexing for `other_frames` if needed\n reindexed_other_list = [None] * len(other_frames)\n for i in range(len(other_frames)):\n if do_repartition_others[i]:\n # indices of others frame start from `base_frame_idx` + 1\n reindexed_other_list[i] = other_frames[\n i\n ]._partition_mgr_cls.map_axis_partitions(\n axis,\n other_frames[i]._partitions,\n make_reindexer(do_repartition_others[i], base_frame_idx + 1 + i),\n lengths=base_lengths,\n )\n else:\n reindexed_other_list[i] = other_frames[i]._partitions\n reindexed_frames = (\n [frames[i]._partitions for i in range(base_frame_idx)]\n + [reindexed_base]\n + reindexed_other_list\n )\n return (reindexed_frames[0], reindexed_frames[1:], joined_index, base_lengths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.n_ary_op_PandasDataframe.n_ary_op.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.n_ary_op_PandasDataframe.n_ary_op.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3276, "end_line": 3357, "span_ids": ["PandasDataframe.n_ary_op"], "tokens": 536}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def n_ary_op(\n self,\n op,\n right_frames: list,\n join_type=\"outer\",\n copartition_along_columns=True,\n dtypes=None,\n ):\n \"\"\"\n Perform an n-opary operation by joining with other Modin DataFrame(s).\n\n Parameters\n ----------\n op : callable\n Function to apply after the join.\n right_frames : list of PandasDataframe\n Modin DataFrames to join with.\n join_type : str, default: \"outer\"\n Type of join to apply.\n copartition_along_columns : bool, default: True\n Whether to perform copartitioning along columns or not.\n For some ops this isn't needed (e.g., `fillna`).\n dtypes : series, default: None\n Dtypes of the resultant dataframe, this argument will be\n received if the resultant dtypes of n-opary operation is precomputed.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n left_parts, list_of_right_parts, joined_index, row_lengths = self._copartition(\n 0, right_frames, join_type, sort=True\n )\n if copartition_along_columns:\n new_left_frame = self.__constructor__(\n left_parts, joined_index, self.columns, row_lengths, self.column_widths\n )\n new_right_frames = [\n self.__constructor__(\n right_parts,\n joined_index,\n right_frame.columns,\n row_lengths,\n right_frame.column_widths,\n )\n for right_parts, right_frame in zip(list_of_right_parts, right_frames)\n ]\n\n (\n left_parts,\n list_of_right_parts,\n joined_columns,\n column_widths,\n ) = new_left_frame._copartition(\n 1,\n new_right_frames,\n join_type,\n sort=True,\n )\n else:\n joined_columns = self.copy_columns_cache()\n column_widths = self._column_widths_cache\n\n new_frame = (\n np.array([])\n if len(left_parts) == 0\n or any(len(right_parts) == 0 for right_parts in list_of_right_parts)\n else self._partition_mgr_cls.n_ary_operation(\n left_parts, op, list_of_right_parts\n )\n )\n\n return self.__constructor__(\n new_frame,\n joined_index,\n joined_columns,\n row_lengths,\n column_widths,\n dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.concat_PandasDataframe.concat.new_dtypes.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.concat_PandasDataframe.concat.new_dtypes.None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3359, "end_line": 3440, "span_ids": ["PandasDataframe.concat"], "tokens": 634}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def concat(\n self,\n axis: Union[int, Axis],\n others: Union[\"PandasDataframe\", List[\"PandasDataframe\"]],\n how,\n sort,\n ) -> \"PandasDataframe\":\n \"\"\"\n Concatenate `self` with one or more other Modin DataFrames.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n Axis to concatenate over.\n others : list\n List of Modin DataFrames to concatenate with.\n how : str\n Type of join to use for the axis.\n sort : bool\n Whether sort the result or not.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n axis = Axis(axis)\n new_widths = None\n new_lengths = None\n\n def _compute_new_widths():\n widths = None\n if self._column_widths_cache is not None and all(\n o._column_widths_cache is not None for o in others\n ):\n widths = self._column_widths_cache + [\n width for o in others for width in o._column_widths_cache\n ]\n return widths\n\n # Fast path for equivalent columns and partitioning\n if (\n axis == Axis.ROW_WISE\n and all(o.columns.equals(self.columns) for o in others)\n and all(o.column_widths == self.column_widths for o in others)\n ):\n joined_index = self.columns\n left_parts = self._partitions\n right_parts = [o._partitions for o in others]\n new_widths = self._column_widths_cache\n elif (\n axis == Axis.COL_WISE\n and all(o.index.equals(self.index) for o in others)\n and all(o.row_lengths == self.row_lengths for o in others)\n ):\n joined_index = self.index\n left_parts = self._partitions\n right_parts = [o._partitions for o in others]\n new_lengths = self._row_lengths_cache\n # we can only do this for COL_WISE because `concat` might rebalance partitions for ROW_WISE\n new_widths = _compute_new_widths()\n else:\n (\n left_parts,\n right_parts,\n joined_index,\n partition_sizes_along_axis,\n ) = self._copartition(\n axis.value ^ 1, others, how, sort, force_repartition=False\n )\n if axis == Axis.COL_WISE:\n new_lengths = partition_sizes_along_axis\n new_widths = _compute_new_widths()\n else:\n new_widths = partition_sizes_along_axis\n new_partitions, new_lengths2 = self._partition_mgr_cls.concat(\n axis.value, left_parts, right_parts\n )\n if new_lengths is None:\n new_lengths = new_lengths2\n new_dtypes = None\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.concat.if_axis_Axis_ROW_WISE__PandasDataframe.concat.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.concat.if_axis_Axis_ROW_WISE__PandasDataframe.concat.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3441, "end_line": 3491, "span_ids": ["PandasDataframe.concat"], "tokens": 621}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def concat(\n self,\n axis: Union[int, Axis],\n others: Union[\"PandasDataframe\", List[\"PandasDataframe\"]],\n how,\n sort,\n ) -> \"PandasDataframe\":\n # ... other code\n if axis == Axis.ROW_WISE:\n new_index = self.index.append([other.index for other in others])\n new_columns = joined_index\n frames = [self] + others\n if all(frame.has_materialized_dtypes for frame in frames):\n all_dtypes = [frame.dtypes for frame in frames]\n new_dtypes = pandas.concat(all_dtypes, axis=1)\n # 'nan' value will be placed in a row if a column doesn't exist in all frames;\n # this value is np.float64 type so we need an explicit conversion\n new_dtypes.fillna(np.dtype(\"float64\"), inplace=True)\n new_dtypes = new_dtypes.apply(\n lambda row: find_common_type(row.values), axis=1\n )\n # If we have already cached the length of each row in at least one\n # of the row's partitions, we can build new_lengths for the new\n # frame. Typically, if we know the length for any partition in a\n # row, we know the length for the first partition in the row. So\n # just check the lengths of the first column of partitions.\n if not new_lengths:\n new_lengths = []\n if new_partitions.size > 0:\n for part in new_partitions.T[0]:\n if part._length_cache is not None:\n new_lengths.append(part.length())\n else:\n new_lengths = None\n break\n else:\n new_columns = self.columns.append([other.columns for other in others])\n new_index = joined_index\n if self.has_materialized_dtypes and all(\n o.has_materialized_dtypes for o in others\n ):\n new_dtypes = pandas.concat([self.dtypes] + [o.dtypes for o in others])\n # If we have already cached the width of each column in at least one\n # of the column's partitions, we can build new_widths for the new\n # frame. Typically, if we know the width for any partition in a\n # column, we know the width for the first partition in the column.\n # So just check the widths of the first row of partitions.\n if not new_widths:\n new_widths = []\n if new_partitions.size > 0:\n for part in new_partitions[0]:\n if part._width_cache is not None:\n new_widths.append(part.width())\n else:\n new_widths = None\n break\n return self.__constructor__(\n new_partitions, new_index, new_columns, new_lengths, new_widths, new_dtypes\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.groupby_PandasDataframe.groupby.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.groupby_PandasDataframe.groupby.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3493, "end_line": 3565, "span_ids": ["PandasDataframe.groupby"], "tokens": 595}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def groupby(\n self,\n axis: Union[int, Axis],\n by: Union[str, List[str]],\n operator: Callable,\n result_schema: Optional[Dict[Hashable, type]] = None,\n **kwargs: dict,\n ) -> \"PandasDataframe\":\n \"\"\"\n Generate groups based on values in the input column(s) and perform the specified operation on each.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to apply the grouping over.\n by : string or list of strings\n One or more column labels to use for grouping.\n operator : callable(pandas.core.groupby.DataFrameGroupBy) -> pandas.DataFrame\n The operation to carry out on each of the groups. The operator is another\n algebraic operator with its own user-defined function parameter, depending\n on the output desired by the user.\n result_schema : dict, optional\n Mapping from column labels to data types that represents the types of the output dataframe.\n **kwargs : dict\n Additional arguments to pass to the ``df.groupby`` method (besides the 'by' argument).\n\n Returns\n -------\n PandasDataframe\n A new PandasDataframe containing the groupings specified, with the operator\n applied to each group.\n\n Notes\n -----\n No communication between groups is allowed in this algebra implementation.\n\n The number of rows (columns if axis=1) returned by the user-defined function\n passed to the groupby may be at most the number of rows in the group, and\n may be as small as a single row.\n\n Unlike the pandas API, an intermediate \"GROUP BY\" object is not present in this\n algebra implementation.\n \"\"\"\n axis = Axis(axis)\n if axis != Axis.ROW_WISE:\n raise NotImplementedError(\n f\"Algebra groupby only implemented row-wise. {axis.name} axis groupby not implemented yet!\"\n )\n\n if not isinstance(by, list):\n by = [by]\n\n def apply_func(df): # pragma: no cover\n if any(dtype == \"category\" for dtype in df.dtypes[by].values):\n raise NotImplementedError(\n \"Reshuffling groupby is not yet supported when grouping on a categorical column. \"\n + \"https://github.com/modin-project/modin/issues/5925\"\n )\n return operator(df.groupby(by, **kwargs))\n\n result = self._apply_func_to_range_partitioning(\n key_column=by[0],\n func=apply_func,\n )\n\n if result_schema is not None:\n new_dtypes = pandas.Series(result_schema)\n\n result.set_dtypes_cache(new_dtypes)\n result.set_columns_cache(new_dtypes.index)\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.groupby_reduce_PandasDataframe.groupby_reduce.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.groupby_reduce_PandasDataframe.groupby_reduce.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3567, "end_line": 3619, "span_ids": ["PandasDataframe.groupby_reduce"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"opposite\", axis_arg=0)\n def groupby_reduce(\n self,\n axis,\n by,\n map_func,\n reduce_func,\n new_index=None,\n new_columns=None,\n apply_indices=None,\n ):\n \"\"\"\n Groupby another Modin DataFrame dataframe and aggregate the result.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to groupby and aggregate over.\n by : PandasDataframe or None\n A Modin DataFrame to group by.\n map_func : callable\n Map component of the aggregation.\n reduce_func : callable\n Reduce component of the aggregation.\n new_index : pandas.Index, optional\n Index of the result. We may know this in advance,\n and if not provided it must be computed.\n new_columns : pandas.Index, optional\n Columns of the result. We may know this in advance,\n and if not provided it must be computed.\n apply_indices : list-like, default: None\n Indices of `axis ^ 1` to apply groupby over.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n by_parts = by if by is None else by._partitions\n if by is None:\n self._propagate_index_objs(axis=0)\n\n if apply_indices is not None:\n numeric_indices = self.axes[axis ^ 1].get_indexer_for(apply_indices)\n apply_indices = list(\n self._get_dict_of_block_index(axis ^ 1, numeric_indices).keys()\n )\n\n new_partitions = self._partition_mgr_cls.groupby_reduce(\n axis, self._partitions, by_parts, map_func, reduce_func, apply_indices\n )\n kw = self.__make_init_labels_args(new_partitions, new_index, new_columns)\n return self.__constructor__(new_partitions, **kw)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_pandas_PandasDataframe.from_pandas.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_pandas_PandasDataframe.from_pandas.return.cls_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3621, "end_line": 3649, "span_ids": ["PandasDataframe.from_pandas"], "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 PandasDataframe(ClassLogger):\n\n @classmethod\n def from_pandas(cls, df):\n \"\"\"\n Create a Modin DataFrame from a pandas DataFrame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A pandas DataFrame.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n new_index = df.index\n new_columns = df.columns\n new_dtypes = df.dtypes\n new_frame, new_lengths, new_widths = cls._partition_mgr_cls.from_pandas(\n df, True\n )\n return cls(\n new_frame,\n new_index,\n new_columns,\n new_lengths,\n new_widths,\n dtypes=new_dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_arrow_PandasDataframe.from_arrow.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_arrow_PandasDataframe.from_arrow.return.cls_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3651, "end_line": 3682, "span_ids": ["PandasDataframe.from_arrow"], "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 PandasDataframe(ClassLogger):\n\n @classmethod\n def from_arrow(cls, at):\n \"\"\"\n Create a Modin DataFrame from an Arrow Table.\n\n Parameters\n ----------\n at : pyarrow.table\n Arrow Table.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n new_frame, new_lengths, new_widths = cls._partition_mgr_cls.from_arrow(\n at, return_dims=True\n )\n new_columns = Index.__new__(Index, data=at.column_names, dtype=\"O\")\n new_index = Index.__new__(RangeIndex, data=range(at.num_rows))\n new_dtypes = pandas.Series(\n [cls._arrow_type_to_dtype(col.type) for col in at.columns],\n index=at.column_names,\n )\n return cls(\n partitions=new_frame,\n index=new_index,\n columns=new_columns,\n row_lengths=new_lengths,\n column_widths=new_widths,\n dtypes=new_dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._arrow_type_to_dtype_PandasDataframe._arrow_type_to_dtype.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe._arrow_type_to_dtype_PandasDataframe._arrow_type_to_dtype.return.res", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3684, "end_line": 3713, "span_ids": ["PandasDataframe._arrow_type_to_dtype"], "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 PandasDataframe(ClassLogger):\n\n @classmethod\n def _arrow_type_to_dtype(cls, arrow_type):\n \"\"\"\n Convert an arrow data type to a pandas data type.\n\n Parameters\n ----------\n arrow_type : arrow dtype\n Arrow data type to be converted to a pandas data type.\n\n Returns\n -------\n object\n Any dtype compatible with pandas.\n \"\"\"\n import pyarrow\n\n try:\n res = arrow_type.to_pandas_dtype()\n # Conversion to pandas is not implemented for some arrow types,\n # perform manual conversion for them:\n except NotImplementedError:\n if pyarrow.types.is_time(arrow_type):\n res = np.dtype(datetime.time)\n else:\n raise\n\n if not isinstance(res, (np.dtype, str)):\n return np.dtype(res)\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_pandas_PandasDataframe.to_pandas.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_pandas_PandasDataframe.to_pandas.return.df", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3715, "end_line": 3744, "span_ids": ["PandasDataframe.to_pandas"], "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 PandasDataframe(ClassLogger):\n\n @lazy_metadata_decorator(apply_axis=\"both\")\n def to_pandas(self):\n \"\"\"\n Convert this Modin DataFrame to a pandas DataFrame.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n df = self._partition_mgr_cls.to_pandas(self._partitions)\n if df.empty:\n df = pandas.DataFrame(columns=self.columns, index=self.index)\n else:\n for axis, has_external_index in enumerate(\n [\"has_materialized_index\", \"has_materialized_columns\"]\n ):\n # no need to check external and internal axes since in that case\n # external axes will be computed from internal partitions\n if getattr(self, has_external_index):\n external_index = self.columns if axis else self.index\n ErrorMessage.catch_bugs_and_request_email(\n not df.axes[axis].equals(external_index),\n f\"Internal and external indices on axis {axis} do not match.\",\n )\n # have to do this in order to assign some potentially missing metadata,\n # the ones that were set to the external index but were never propagated\n # into the internal ones\n df = df.set_axis(axis=axis, labels=external_index, copy=False)\n\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_numpy_PandasDataframe.finalize.self__partition_mgr_cls_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.to_numpy_PandasDataframe.finalize.self__partition_mgr_cls_f", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3746, "end_line": 3800, "span_ids": ["PandasDataframe.to_numpy", "PandasDataframe.transpose", "PandasDataframe.finalize"], "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 PandasDataframe(ClassLogger):\n\n def to_numpy(self, **kwargs):\n \"\"\"\n Convert this Modin DataFrame to a NumPy array.\n\n Parameters\n ----------\n **kwargs : dict\n Additional keyword arguments to be passed in `to_numpy`.\n\n Returns\n -------\n np.ndarray\n \"\"\"\n return self._partition_mgr_cls.to_numpy(self._partitions, **kwargs)\n\n @lazy_metadata_decorator(apply_axis=None, transpose=True)\n def transpose(self):\n \"\"\"\n Transpose the index and columns of this Modin DataFrame.\n\n Reflect this Modin DataFrame over its main diagonal\n by writing rows as columns and vice-versa.\n\n Returns\n -------\n PandasDataframe\n New Modin DataFrame.\n \"\"\"\n new_partitions = self._partition_mgr_cls.lazy_map_partitions(\n self._partitions, lambda df: df.T\n ).T\n if self.has_materialized_dtypes:\n new_dtypes = pandas.Series(\n np.full(len(self.index), find_common_type(self.dtypes.values)),\n index=self.index,\n )\n else:\n new_dtypes = None\n return self.__constructor__(\n new_partitions,\n self.copy_columns_cache(),\n self.copy_index_cache(),\n self._column_widths_cache,\n self._row_lengths_cache,\n dtypes=new_dtypes,\n )\n\n def finalize(self):\n \"\"\"\n Perform all deferred calls on partitions.\n\n This makes `self` Modin Dataframe independent of a history of queries\n that were used to build it.\n \"\"\"\n self._partition_mgr_cls.finalize(self._partitions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.__dataframe___PandasDataframe.__dataframe__.return.PandasProtocolDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.__dataframe___PandasDataframe.__dataframe__.return.PandasProtocolDataframe_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3802, "end_line": 3833, "span_ids": ["PandasDataframe.__dataframe__"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframe(ClassLogger):\n\n def __dataframe__(self, nan_as_null: bool = False, allow_copy: bool = True):\n \"\"\"\n Get a Modin DataFrame that implements the dataframe exchange protocol.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n nan_as_null : bool, default: False\n A keyword intended for the consumer to tell the producer\n to overwrite null values in the data with ``NaN`` (or ``NaT``).\n This currently has no effect; once support for nullable extension\n dtypes is added, this value should be propagated to columns.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n\n Returns\n -------\n ProtocolDataframe\n A dataframe object following the dataframe protocol specification.\n \"\"\"\n from modin.core.dataframe.pandas.interchange.dataframe_protocol.dataframe import (\n PandasProtocolDataframe,\n )\n\n return PandasProtocolDataframe(\n self, nan_as_null=nan_as_null, allow_copy=allow_copy\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/dataframe.py_PandasDataframe.from_dataframe_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3835, "end_line": 3867, "span_ids": ["PandasDataframe.from_dataframe"], "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 PandasDataframe(ClassLogger):\n\n @classmethod\n def from_dataframe(cls, df: \"ProtocolDataframe\") -> \"PandasDataframe\":\n \"\"\"\n Convert a DataFrame implementing the dataframe exchange protocol to a Core Modin Dataframe.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n df : ProtocolDataframe\n The DataFrame object supporting the dataframe exchange protocol.\n\n Returns\n -------\n PandasDataframe\n A new Core Modin Dataframe object.\n \"\"\"\n if type(df) == cls:\n return df\n\n if not hasattr(df, \"__dataframe__\"):\n raise ValueError(\n \"`df` does not support DataFrame exchange protocol, i.e. `__dataframe__` method\"\n )\n\n from modin.core.dataframe.pandas.interchange.dataframe_protocol.from_dataframe import (\n from_dataframe_to_pandas,\n )\n\n ErrorMessage.default_to_pandas(message=\"`from_dataframe`\")\n pandas_df = from_dataframe_to_pandas(df)\n return cls.from_pandas(pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_np_build_sort_functions.return.ShuffleFunctions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_np_build_sort_functions.return.ShuffleFunctions_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 83, "span_ids": ["build_sort_functions", "docstring"], "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": "import numpy as np\nimport pandas\nfrom typing import Callable, Union, Optional, TYPE_CHECKING\nfrom collections import namedtuple\n\nif TYPE_CHECKING:\n from modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\n\n\nShuffleFunctions = namedtuple(\n \"ShuffleFunctions\", [\"sample_function\", \"pivot_function\", \"split_function\"]\n)\n\n\ndef build_sort_functions(\n modin_frame: \"PandasDataframe\",\n column: str,\n method: str,\n ascending: Union[list, bool],\n ideal_num_new_partitions: int,\n **kwargs: dict,\n) -> ShuffleFunctions:\n \"\"\"\n Return a named tuple containing the functions necessary to perform a sort.\n\n Parameters\n ----------\n modin_frame : PandasDataframe\n The frame calling these sort functions.\n column : str\n The major column name to sort by.\n method : str\n The method to use for picking quantiles.\n ascending : bool\n The ascending flag.\n ideal_num_new_partitions : int\n The ideal number of new partitions.\n **kwargs : dict\n Additional keyword arguments.\n\n Returns\n -------\n ShuffleFunctions :\n A named tuple containing the functions to pick quantiles, choose pivot points, and split\n partitions for sorting.\n \"\"\"\n frame_len = len(modin_frame.index)\n is_column_numeric = pandas.api.types.is_numeric_dtype(modin_frame.dtypes[column])\n\n def sample_fn(partition):\n return pick_samples_for_quantiles(\n partition[column], ideal_num_new_partitions, frame_len\n )\n\n def pivot_fn(samples):\n key = kwargs.get(\"key\", None)\n return pick_pivots_from_samples_for_sort(\n samples, ideal_num_new_partitions, method, key\n )\n\n def split_fn(partition, pivots):\n return split_partitions_using_pivots_for_sort(\n partition, column, is_column_numeric, pivots, ascending, **kwargs\n )\n\n return ShuffleFunctions(\n sample_function=sample_fn, pivot_function=pivot_fn, split_function=split_fn\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py__find_quantiles__find_quantiles.if_method_linear_.else_.try_.except_Exception_.return.np_quantile_df_quantiles": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py__find_quantiles__find_quantiles.if_method_linear_.else_.try_.except_Exception_.return.np_quantile_df_quantiles", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 124, "span_ids": ["_find_quantiles"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _find_quantiles(\n df: Union[pandas.DataFrame, pandas.Series], quantiles: list, method: str\n) -> np.ndarray:\n \"\"\"\n Find quantiles of a given dataframe using the specified method.\n\n We use this method to provide backwards compatibility with NumPy versions < 1.23 (e.g. when\n the user is using Modin in compat mode). This is basically a wrapper around `np.quantile` that\n ensures we provide the correct `method` argument - i.e. if we are dealing with objects (which\n may or may not support algebra), we do not want to use a method to find quantiles that will\n involve algebra operations (e.g. mean) between the objects, since that may fail.\n\n Parameters\n ----------\n df : pandas.DataFrame or pandas.Series\n The data to pick quantiles from.\n quantiles : list[float]\n The quantiles to compute.\n method : str\n The method to use. `linear` if dealing with numeric types, otherwise `inverted_cdf`.\n\n Returns\n -------\n np.ndarray\n A NumPy array with the quantiles of the data.\n \"\"\"\n if method == \"linear\":\n # This is the default method for finding quantiles, so it does not need to be specified,\n # which keeps backwards compatibility with older versions of NumPy that do not have a\n # `method` keyword argument in np.quantile.\n return np.quantile(df, quantiles)\n else:\n try:\n return np.quantile(df, quantiles, method=method)\n except Exception:\n # In this case, we're dealing with an array of objects, but the current version of\n # NumPy does not have a `method` kwarg. We need to use the older kwarg, `interpolation`\n # instead.\n return np.quantile(df, quantiles, interpolation=\"lower\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_pick_samples_for_quantiles_pick_samples_for_quantiles.return.df_sample_frac_probabilit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_pick_samples_for_quantiles_pick_samples_for_quantiles.return.df_sample_frac_probabilit", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 160, "span_ids": ["pick_samples_for_quantiles"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pick_samples_for_quantiles(\n df: pandas.DataFrame,\n num_partitions: int,\n length: int,\n) -> np.ndarray:\n \"\"\"\n Pick samples over the given partition.\n\n This function picks samples from the given partition using the TeraSort algorithm - each\n value is sampled with probability 1 / m * ln(n * t) where m = total_length / num_partitions,\n t = num_partitions, and n = total_length.\n\n Parameters\n ----------\n df : pandas.Dataframe\n The masked dataframe to pick samples from.\n num_partitions : int\n The number of partitions.\n length : int\n The total length.\n\n Returns\n -------\n np.ndarray:\n The samples for the partition.\n\n Notes\n -----\n This sampling algorithm is inspired by TeraSort. You can find more information about TeraSort\n and the sampling algorithm at https://www.cse.cuhk.edu.hk/~taoyf/paper/sigmod13-mr.pdf.\n \"\"\"\n m = length / num_partitions\n probability = (1 / m) * np.log(num_partitions * length)\n return df.sample(frac=probability).to_numpy()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_pick_pivots_from_samples_for_sort_pick_pivots_from_samples_for_sort.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_pick_pivots_from_samples_for_sort_pick_pivots_from_samples_for_sort.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 208, "span_ids": ["pick_pivots_from_samples_for_sort"], "tokens": 472}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pick_pivots_from_samples_for_sort(\n samples: \"list[np.ndarray]\",\n ideal_num_new_partitions: int,\n method: str = \"linear\",\n key: Optional[Callable] = None,\n) -> np.ndarray:\n \"\"\"\n Determine quantiles from the given samples.\n\n This function takes as input the quantiles calculated over all partitions from\n `sample_func` defined above, and determines a final NPartitions.get() quantiles\n to use to roughly sort the entire dataframe. It does so by collating all the samples\n and computing NPartitions.get() quantiles for the overall set.\n\n Parameters\n ----------\n samples : list[np.ndarray]\n The samples computed by ``get_partition_quantiles_for_sort``.\n ideal_num_new_partitions : int\n The ideal number of new partitions.\n method : str, default: linear\n The method to use when picking quantiles.\n key : Callable, default: None\n The key to use on the samples when picking pivots.\n\n Returns\n -------\n np.ndarray\n A list of overall quantiles.\n \"\"\"\n # We don't call `np.unique` on the samples, since if a quantile shows up in multiple\n # partition's samples, this is probably an indicator of skew in the dataset, and we\n # want our final partitions to take this into account.\n # We need to use numpy to concatenate the samples since the sample from each partition is\n # a NumPy array, and we want one flattened array of samples.\n all_pivots = np.concatenate(samples).flatten()\n if key is not None:\n all_pivots = key(all_pivots)\n # We don't want to pick very many quantiles if we have a very small dataframe.\n num_quantiles = ideal_num_new_partitions\n quantiles = [i / num_quantiles for i in range(1, num_quantiles)]\n # If we only desire 1 partition, we need to ensure that we're not trying to find quantiles\n # from an empty list of pivots.\n if len(quantiles) > 0:\n return _find_quantiles(all_pivots, quantiles, method)\n return np.array([])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_split_partitions_using_pivots_for_sort_split_partitions_using_pivots_for_sort.if_is_numeric_column_.else_.if_not_ascending_.groupby_col.len_pivots_groupby_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_split_partitions_using_pivots_for_sort_split_partitions_using_pivots_for_sort.if_is_numeric_column_.else_.if_not_ascending_.groupby_col.len_pivots_groupby_col", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 277, "span_ids": ["split_partitions_using_pivots_for_sort"], "tokens": 706}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_partitions_using_pivots_for_sort(\n df: pandas.DataFrame,\n column: str,\n is_numeric_column: bool,\n pivots: np.ndarray,\n ascending: bool,\n **kwargs: dict,\n) -> \"tuple[pandas.DataFrame, ...]\":\n \"\"\"\n Split the given dataframe into the partitions specified by `pivots`.\n\n This function takes as input a row-axis partition, as well as the quantiles determined\n by the `pivot_func` defined above. It then splits the input dataframe into NPartitions.get()\n dataframes, with the elements in the i-th split belonging to the i-th partition, as determined\n by the quantiles we're using.\n\n Parameters\n ----------\n df : pandas.Dataframe\n The partition to split.\n column : str\n The major column to sort by.\n is_numeric_column : bool\n Whether the passed `column` has numeric type (int, float).\n pivots : np.ndarray\n The quantiles to use to split the data.\n ascending : bool\n The ascending flag.\n **kwargs : dict\n Additional keyword arguments.\n\n Returns\n -------\n tuple[pandas.DataFrame]\n A tuple of the splits from this partition.\n \"\"\"\n if len(pivots) == 0:\n # We can return the dataframe with zero changes if there were no pivots passed\n return (df,)\n # If `ascending=False` and we are dealing with a numeric dtype, we can pass in a reversed list\n # of pivots, and `np.digitize` will work correctly. For object dtypes, we use `np.searchsorted`\n # which breaks when we reverse the pivots.\n if not ascending and is_numeric_column:\n # `key` is already applied to `pivots` in the `pick_pivots_from_samples_for_sort` function.\n pivots = pivots[::-1]\n key = kwargs.pop(\"key\", None)\n na_index = df[column].isna()\n na_rows = df[na_index]\n non_na_rows = df[~na_index]\n cols_to_digitize = non_na_rows[column]\n if key is not None:\n cols_to_digitize = key(cols_to_digitize)\n\n if is_numeric_column:\n groupby_col = np.digitize(cols_to_digitize.squeeze(), pivots)\n # `np.digitize` returns results based off of the sort order of the pivots it is passed.\n # When we only have one unique value in our pivots, `np.digitize` assumes that the pivots\n # are sorted in ascending order, and gives us results based off of that assumption - so if\n # we actually want to sort in descending order, we need to swap the new indices.\n if not ascending and len(np.unique(pivots)) == 1:\n groupby_col = len(pivots) - groupby_col\n else:\n groupby_col = np.searchsorted(pivots, cols_to_digitize.squeeze(), side=\"right\")\n # Since np.searchsorted requires the pivots to be in ascending order, if we want to sort\n # in descending order, we need to swap the new indices.\n if not ascending:\n groupby_col = len(pivots) - groupby_col\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_split_partitions_using_pivots_for_sort.if_len_non_na_rows_1__split_partitions_using_pivots_for_sort.return.tuple_groups_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_split_partitions_using_pivots_for_sort.if_len_non_na_rows_1__split_partitions_using_pivots_for_sort.return.tuple_groups_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 300, "span_ids": ["split_partitions_using_pivots_for_sort"], "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 split_partitions_using_pivots_for_sort(\n df: pandas.DataFrame,\n column: str,\n is_numeric_column: bool,\n pivots: np.ndarray,\n ascending: bool,\n **kwargs: dict,\n) -> \"tuple[pandas.DataFrame, ...]\":\n # ... other code\n if len(non_na_rows) == 1:\n groups = [\n # taking an empty slice for an index's metadata\n pandas.DataFrame(index=df.index[:0], columns=df.columns).astype(df.dtypes)\n if i != groupby_col\n else non_na_rows\n for i in range(len(pivots) + 1)\n ]\n else:\n grouped = non_na_rows.groupby(groupby_col)\n groups = [\n grouped.get_group(i) if i in grouped.keys\n # taking an empty slice for an index's metadata\n else pandas.DataFrame(index=df.index[:0], columns=df.columns).astype(\n df.dtypes\n )\n for i in range(len(pivots) + 1)\n ]\n index_to_insert_na_vals = -1 if kwargs.get(\"na_position\", \"last\") == \"last\" else 0\n groups[index_to_insert_na_vals] = pandas.concat(\n [groups[index_to_insert_na_vals], na_rows]\n ).astype(df.dtypes)\n return tuple(groups)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_lazy_metadata_decorator_lazy_metadata_decorator._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_lazy_metadata_decorator_lazy_metadata_decorator._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 330, "span_ids": ["lazy_metadata_decorator"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lazy_metadata_decorator(apply_axis=None, axis_arg=-1, transpose=False):\n \"\"\"\n Lazily propagate metadata for the ``PandasDataframe``.\n\n This decorator first adds the minimum required reindexing operations\n to each partition's queue of functions to be lazily applied for\n each PandasDataframe in the arguments by applying the function\n run_f_on_minimally_updated_metadata. The decorator also sets the\n flags for deferred metadata synchronization on the function result\n if necessary.\n\n Parameters\n ----------\n apply_axis : str, default: None\n The axes on which to apply the reindexing operations to the `self._partitions` lazily.\n Case None: No lazy metadata propagation.\n Case \"both\": Add reindexing operations on both axes to partition queue.\n Case \"opposite\": Add reindexing operations complementary to given axis.\n Case \"rows\": Add reindexing operations on row axis to partition queue.\n axis_arg : int, default: -1\n The index or column axis.\n transpose : bool, default: False\n Boolean for if a transpose operation is being used.\n\n Returns\n -------\n Wrapped Function.\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_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_lazy_metadata_decorator.decorator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/dataframe/utils.py_lazy_metadata_decorator.decorator_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 395, "span_ids": ["lazy_metadata_decorator"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lazy_metadata_decorator(apply_axis=None, axis_arg=-1, transpose=False):\n\n def decorator(f):\n from functools import wraps\n\n @wraps(f)\n def run_f_on_minimally_updated_metadata(self, *args, **kwargs):\n from .dataframe import PandasDataframe\n\n for obj in (\n [self]\n + [o for o in args if isinstance(o, PandasDataframe)]\n + [v for v in kwargs.values() if isinstance(v, PandasDataframe)]\n + [\n d\n for o in args\n if isinstance(o, list)\n for d in o\n if isinstance(d, PandasDataframe)\n ]\n + [\n d\n for _, o in kwargs.items()\n if isinstance(o, list)\n for d in o\n if isinstance(d, PandasDataframe)\n ]\n ):\n if apply_axis == \"both\":\n if obj._deferred_index and obj._deferred_column:\n obj._propagate_index_objs(axis=None)\n elif obj._deferred_index:\n obj._propagate_index_objs(axis=0)\n elif obj._deferred_column:\n obj._propagate_index_objs(axis=1)\n elif apply_axis == \"opposite\":\n if \"axis\" not in kwargs:\n axis = args[axis_arg]\n else:\n axis = kwargs[\"axis\"]\n if axis == 0 and obj._deferred_column:\n obj._propagate_index_objs(axis=1)\n elif axis == 1 and obj._deferred_index:\n obj._propagate_index_objs(axis=0)\n elif apply_axis == \"rows\":\n obj._propagate_index_objs(axis=0)\n result = f(self, *args, **kwargs)\n if apply_axis is None and not transpose:\n result._deferred_index = self._deferred_index\n result._deferred_column = self._deferred_column\n elif apply_axis is None and transpose:\n result._deferred_index = self._deferred_column\n result._deferred_column = self._deferred_index\n elif apply_axis == \"opposite\":\n if axis == 0:\n result._deferred_index = self._deferred_index\n else:\n result._deferred_column = self._deferred_column\n elif apply_axis == \"rows\":\n result._deferred_column = self._deferred_column\n return result\n\n return run_f_on_minimally_updated_metadata\n\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 19, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/buffer.py_enum_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/buffer.py_enum_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/buffer.py", "file_name": "buffer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 117, "span_ids": ["PandasProtocolBuffer", "PandasProtocolBuffer.__init__", "PandasProtocolBuffer.ptr", "PandasProtocolBuffer.bufsize", "PandasProtocolBuffer.__repr__", "PandasProtocolBuffer.__dlpack_device__", "docstring", "PandasProtocolBuffer.__dlpack__"], "tokens": 658}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import enum\nimport numpy as np\nfrom typing import Tuple\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolBuffer,\n)\nfrom modin.utils import _inherit_docstrings\n\n\n@_inherit_docstrings(ProtocolBuffer)\nclass PandasProtocolBuffer(ProtocolBuffer):\n \"\"\"\n Data in the buffer is guaranteed to be contiguous in memory.\n\n Note that there is no dtype attribute present, a buffer can be thought of\n as simply a block of memory. However, if the column that the buffer is\n attached to has a dtype that's supported by DLPack and ``__dlpack__`` is\n implemented, then that dtype information will be contained in the return\n value from ``__dlpack__``.\n\n This distinction is useful to support both (a) data exchange via DLPack on a\n buffer and (b) dtypes like variable-length strings which do not have a\n fixed number of bytes per element.\n\n Parameters\n ----------\n x : np.ndarray\n Data to be held by ``Buffer``.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n \"\"\"\n\n def __init__(self, x: np.ndarray, allow_copy: bool = True) -> None:\n if not x.strides == (x.dtype.itemsize,):\n # The protocol does not support strided buffers, so a copy is\n # necessary. If that's not allowed, we need to raise an exception.\n if allow_copy:\n x = x.copy()\n else:\n raise RuntimeError(\n \"Exports cannot be zero-copy in the case \"\n + \"of a non-contiguous buffer\"\n )\n\n # Store the numpy array in which the data resides as a private\n # attribute, so we can use it to retrieve the public attributes\n self._x = x\n\n @property\n def bufsize(self) -> int:\n return self._x.size * self._x.dtype.itemsize\n\n @property\n def ptr(self) -> int:\n return self._x.__array_interface__[\"data\"][0]\n\n def __dlpack__(self):\n raise NotImplementedError(\"__dlpack__\")\n\n def __dlpack_device__(self) -> Tuple[enum.IntEnum, int]:\n class Device(enum.IntEnum):\n CPU = 1\n\n return (Device.CPU, None)\n\n def __repr__(self) -> str:\n \"\"\"\n Return a string representation for a particular ``PandasProtocolBuffer``.\n\n Returns\n -------\n str\n \"\"\"\n return (\n \"Buffer(\"\n + str(\n {\n \"bufsize\": self.bufsize,\n \"ptr\": self.ptr,\n \"device\": self.__dlpack_device__()[0].name,\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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_from_typing_import_Any_O__NO_VALIDITY_BUFFER._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_from_typing_import_Any_O__NO_VALIDITY_BUFFER._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 51, "span_ids": ["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": "from typing import Any, Optional, Tuple, Dict, Iterable\nimport numpy as np\nimport pandas\n\nfrom modin.utils import _inherit_docstrings\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n CategoricalDescription,\n ProtocolColumn,\n)\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.utils import (\n DTypeKind,\n pandas_dtype_to_arrow_c,\n ColumnNullType,\n)\nfrom modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\nfrom .buffer import PandasProtocolBuffer\nfrom .exception import NoValidityBuffer, NoOffsetsBuffer\n\n\n_NO_VALIDITY_BUFFER = {\n ColumnNullType.NON_NULLABLE: \"This column is non-nullable so does not have a mask\",\n ColumnNullType.USE_NAN: \"This column uses NaN as null so does not have a separate mask\",\n ColumnNullType.USE_SENTINEL: \"This column uses a sentinel value so does not have a mask\",\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn_PandasProtocolColumn._cached_property": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn_PandasProtocolColumn._cached_property", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 123, "span_ids": ["PandasProtocolColumn.offset", "PandasProtocolColumn.size", "PandasProtocolColumn", "PandasProtocolColumn.__init__", "PandasProtocolColumn:3"], "tokens": 713}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n \"\"\"\n A column object, with only the methods and properties required by the interchange protocol defined.\n\n A column can contain one or more chunks. Each chunk can contain up to three\n buffers - a data buffer, a mask buffer (depending on null representation),\n and an offsets buffer (if variable-size binary; e.g., variable-length strings).\n\n TBD: Arrow has a separate \"null\" dtype, and has no separate mask concept.\n Instead, it seems to use \"children\" for both columns with a bit mask,\n and for nested dtypes. Unclear whether this is elegant or confusing.\n This design requires checking the null representation explicitly.\n The Arrow design requires checking:\n 1. the ARROW_FLAG_NULLABLE (for sentinel values)\n 2. if a column has two children, combined with one of those children\n having a null dtype.\n Making the mask concept explicit seems useful. One null dtype would\n not be enough to cover both bit and byte masks, so that would mean\n even more checking if we did it the Arrow way.\n TBD: there's also the \"chunk\" concept here, which is implicit in Arrow as\n multiple buffers per array (= column here). Semantically it may make\n sense to have both: chunks were meant for example for lazy evaluation\n of data which doesn't fit in memory, while multiple buffers per column\n could also come from doing a selection operation on a single\n contiguous buffer.\n Given these concepts, one would expect chunks to be all of the same\n size (say a 10,000 row dataframe could have 10 chunks of 1,000 rows),\n while multiple buffers could have data-dependent lengths. Not an issue\n in pandas if one column is backed by a single NumPy array, but in\n Arrow it seems possible.\n Are multiple chunks *and* multiple buffers per column necessary for\n the purposes of this interchange protocol, or must producers either\n reuse the chunk concept for this or copy the data?\n\n Parameters\n ----------\n column : PandasDataframe\n A ``PandasDataframe`` object.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n\n Notes\n -----\n This Column object can only be produced by ``__dataframe__``,\n so doesn't need its own version or ``__column__`` protocol.\n \"\"\"\n\n def __init__(self, column: PandasDataframe, allow_copy: bool = True) -> None:\n if not isinstance(column, PandasDataframe):\n raise NotImplementedError(f\"Columns of type {type(column)} not handled yet\")\n\n self._col = column\n self._allow_copy = allow_copy\n\n def size(self) -> int:\n return len(self._col.index)\n\n @property\n def offset(self) -> int:\n return 0\n\n _dtype_cache = None\n\n # TODO: since python 3.9:\n # @cached_property", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.dtype_PandasProtocolColumn.dtype.return.self__dtype_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.dtype_PandasProtocolColumn.dtype.return.self__dtype_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 152, "span_ids": ["PandasProtocolColumn.dtype"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n @property\n def dtype(self) -> Tuple[DTypeKind, int, str, str]:\n if self._dtype_cache is not None:\n return self._dtype_cache\n\n dtype = self._col.dtypes[0]\n\n if pandas.api.types.is_categorical_dtype(dtype):\n pandas_series = self._col.to_pandas().squeeze(axis=1)\n codes = pandas_series.values.codes\n (\n _,\n bitwidth,\n c_arrow_dtype_f_str,\n _,\n ) = self._dtype_from_primitive_pandas_dtype(codes.dtype)\n dtype_cache = (\n DTypeKind.CATEGORICAL,\n bitwidth,\n c_arrow_dtype_f_str,\n \"=\",\n )\n elif pandas.api.types.is_string_dtype(dtype):\n dtype_cache = (DTypeKind.STRING, 8, pandas_dtype_to_arrow_c(dtype), \"=\")\n else:\n dtype_cache = self._dtype_from_primitive_pandas_dtype(dtype)\n\n self._dtype_cache = dtype_cache\n return self._dtype_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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._dtype_from_primitive_pandas_dtype_PandasProtocolColumn._dtype_from_primitive_pandas_dtype.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._dtype_from_primitive_pandas_dtype_PandasProtocolColumn._dtype_from_primitive_pandas_dtype.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 187, "span_ids": ["PandasProtocolColumn._dtype_from_primitive_pandas_dtype"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n def _dtype_from_primitive_pandas_dtype(\n self, dtype\n ) -> Tuple[DTypeKind, int, str, str]:\n \"\"\"\n Deduce dtype specific for the protocol from pandas dtype.\n\n See `self.dtype` for details.\n\n Parameters\n ----------\n dtype : any\n A pandas dtype.\n\n Returns\n -------\n tuple\n \"\"\"\n _np_kinds = {\n \"i\": DTypeKind.INT,\n \"u\": DTypeKind.UINT,\n \"f\": DTypeKind.FLOAT,\n \"b\": DTypeKind.BOOL,\n }\n kind = _np_kinds.get(dtype.kind, None)\n if kind is None:\n raise NotImplementedError(\n f\"Data type {dtype} not supported by the dataframe exchange protocol\"\n )\n return (\n kind,\n dtype.itemsize * 8,\n pandas_dtype_to_arrow_c(dtype),\n dtype.byteorder,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.describe_categorical_PandasProtocolColumn.describe_categorical.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.describe_categorical_PandasProtocolColumn.describe_categorical.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 205, "span_ids": ["PandasProtocolColumn.describe_categorical"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n @property\n def describe_categorical(self) -> CategoricalDescription:\n if self.dtype[0] != DTypeKind.CATEGORICAL:\n raise TypeError(\n \"`describe_categorical only works on a column with \"\n + \"categorical dtype!\"\n )\n\n pandas_series = self._col.to_pandas().squeeze(axis=1)\n cat_frame = type(self._col).from_pandas(\n pandas.DataFrame({\"cat\": pandas_series.cat.categories})\n )\n return {\n \"is_ordered\": pandas_series.cat.ordered,\n \"is_dictionary\": True,\n \"categories\": PandasProtocolColumn(cat_frame, self._allow_copy),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.describe_null_PandasProtocolColumn.describe_null.return.null_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.describe_null_PandasProtocolColumn.describe_null.return.null_value", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 228, "span_ids": ["PandasProtocolColumn.describe_null"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n @property\n def describe_null(self) -> Tuple[int, Any]:\n nulls = {\n DTypeKind.FLOAT: (ColumnNullType.USE_NAN, None),\n DTypeKind.DATETIME: (ColumnNullType.USE_NAN, None),\n DTypeKind.INT: (ColumnNullType.NON_NULLABLE, None),\n DTypeKind.UINT: (ColumnNullType.NON_NULLABLE, None),\n DTypeKind.BOOL: (ColumnNullType.NON_NULLABLE, None),\n # Null values for categoricals are stored as `-1` sentinel values\n # in the category date (e.g., `col.values.codes` is int8 np.ndarray)\n DTypeKind.CATEGORICAL: (ColumnNullType.USE_SENTINEL, -1),\n # follow Arrow in using 1 as valid value and 0 for missing/null value\n DTypeKind.STRING: (ColumnNullType.USE_BYTEMASK, 0),\n }\n\n kind = self.dtype[0]\n try:\n null, value = nulls[kind]\n except KeyError:\n raise NotImplementedError(f\"Data type {kind} not yet supported\")\n\n return null, value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._null_count_cache_PandasProtocolColumn.num_chunks.return.self__col__partitions_sha": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._null_count_cache_PandasProtocolColumn.num_chunks.return.self__col__partitions_sha", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 262, "span_ids": ["PandasProtocolColumn.null_count", "PandasProtocolColumn.num_chunks", "PandasProtocolColumn.metadata", "PandasProtocolColumn:5"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n _null_count_cache = None\n\n # TODO: since python 3.9:\n # @cached_property\n @property\n def null_count(self) -> int:\n if self._null_count_cache is not None:\n return self._null_count_cache\n\n def map_func(df):\n return df.isna()\n\n def reduce_func(df):\n return pandas.DataFrame(df.sum())\n\n intermediate_df = self._col.tree_reduce(0, map_func, reduce_func)\n # Set ``pandas.RangeIndex(1)`` to index and column labels because\n # 1) We internally use `MODIN_UNNAMED_SERIES_LABEL` for labels of a reduced axis\n # 2) The return value of `reduce_func` is a pandas DataFrame with\n # index and column labels set to ``pandas.RangeIndex(1)``\n # 3) We further use `to_pandas().squeeze()` to get an integer value of the null count.\n # Otherwise, we get mismatching internal and external indices for both axes\n intermediate_df.index = pandas.RangeIndex(1)\n intermediate_df.columns = pandas.RangeIndex(1)\n self._null_count_cache = intermediate_df.to_pandas().squeeze()\n return self._null_count_cache\n\n @property\n def metadata(self) -> Dict[str, Any]:\n return {\"modin.index\": self._col.index}\n\n def num_chunks(self) -> int:\n return self._col._partitions.shape[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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.get_chunks_PandasProtocolColumn.get_chunks.for_i_in_range_len_cum_ro.yield_PandasProtocolColum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.get_chunks_PandasProtocolColumn.get_chunks.for_i_in_range_len_cum_ro.yield_PandasProtocolColum", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 317, "span_ids": ["PandasProtocolColumn.get_chunks"], "tokens": 451}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n def get_chunks(\n self, n_chunks: Optional[int] = None\n ) -> Iterable[\"PandasProtocolColumn\"]:\n cur_n_chunks = self.num_chunks()\n n_rows = self.size()\n if n_chunks is None or n_chunks == cur_n_chunks:\n cum_row_lengths = np.cumsum([0] + self._col.row_lengths)\n for i in range(len(cum_row_lengths) - 1):\n yield PandasProtocolColumn(\n self._col.take_2d_labels_or_positional(\n row_positions=range(cum_row_lengths[i], cum_row_lengths[i + 1]),\n col_positions=None,\n ),\n allow_copy=self._col._allow_copy,\n )\n return\n\n if n_chunks % cur_n_chunks != 0:\n raise RuntimeError(\n \"The passed `n_chunks` must be a multiple of `self.num_chunks()`.\"\n )\n\n if n_chunks > n_rows:\n raise RuntimeError(\n \"The passed `n_chunks` value is bigger than `self.num_rows()`.\"\n )\n\n chunksize = n_rows // n_chunks\n new_lengths = [chunksize] * n_chunks\n new_lengths[-1] = n_rows % n_chunks + new_lengths[-1]\n\n new_partitions = self._col._partition_mgr_cls.map_axis_partitions(\n 0,\n self._col._partitions,\n lambda df: df,\n keep_partitioning=False,\n lengths=new_lengths,\n )\n new_df = self._col.__constructor__(\n new_partitions,\n self._col.index,\n self._col.columns,\n new_lengths,\n self._col.column_widths,\n )\n cum_row_lengths = np.cumsum([0] + new_df.row_lengths)\n for i in range(len(cum_row_lengths) - 1):\n yield PandasProtocolColumn(\n new_df.take_2d_labels_or_positional(\n row_positions=range(cum_row_lengths[i], cum_row_lengths[i + 1]),\n col_positions=None,\n ),\n allow_copy=self._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.get_buffers_PandasProtocolColumn._get_data_buffer.return.self__data_buffer_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn.get_buffers_PandasProtocolColumn._get_data_buffer.return.self__data_buffer_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 319, "end_line": 384, "span_ids": ["PandasProtocolColumn._get_data_buffer", "PandasProtocolColumn:7", "PandasProtocolColumn.get_buffers"], "tokens": 554}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n def get_buffers(self) -> Dict[str, Any]:\n buffers = {}\n buffers[\"data\"] = self._get_data_buffer()\n try:\n buffers[\"validity\"] = self._get_validity_buffer()\n except NoValidityBuffer:\n buffers[\"validity\"] = None\n\n try:\n buffers[\"offsets\"] = self._get_offsets_buffer()\n except NoOffsetsBuffer:\n buffers[\"offsets\"] = None\n\n return buffers\n\n _data_buffer_cache = None\n\n def _get_data_buffer(\n self,\n ) -> Tuple[PandasProtocolBuffer, Any]: # Any is for self.dtype tuple\n \"\"\"\n Return the buffer containing the data and the buffer's associated dtype.\n\n Returns\n -------\n tuple\n The data buffer.\n \"\"\"\n if self._data_buffer_cache is not None:\n return self._data_buffer_cache\n\n dtype = self.dtype\n if dtype[0] in (DTypeKind.INT, DTypeKind.UINT, DTypeKind.FLOAT, DTypeKind.BOOL):\n buffer = PandasProtocolBuffer(\n self._col.to_numpy().flatten(), allow_copy=self._allow_copy\n )\n elif dtype[0] == DTypeKind.CATEGORICAL:\n pandas_series = self._col.to_pandas().squeeze(axis=1)\n codes = pandas_series.values.codes\n buffer = PandasProtocolBuffer(codes, allow_copy=self._allow_copy)\n dtype = self._dtype_from_primitive_pandas_dtype(codes.dtype)\n elif dtype[0] == DTypeKind.STRING:\n # Marshal the strings from a NumPy object array into a byte array\n buf = self._col.to_numpy().flatten()\n b = bytearray()\n\n # TODO: this for-loop is slow; can be implemented in Cython/C/C++ later\n for i in range(buf.size):\n if type(buf[i]) == str:\n b.extend(buf[i].encode(encoding=\"utf-8\"))\n\n # Convert the byte array to a pandas \"buffer\" using a NumPy array as the backing store\n buffer = PandasProtocolBuffer(np.frombuffer(b, dtype=\"uint8\"))\n\n # Define the dtype for the returned buffer\n dtype = (\n DTypeKind.STRING,\n 8,\n \"u\",\n \"=\",\n ) # note: currently only support native endianness\n else:\n raise NotImplementedError(f\"Data type {self._col.dtype[0]} not handled yet\")\n\n self._data_buffer_cache = (buffer, dtype)\n return self._data_buffer_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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._validity_buffer_cache_PandasProtocolColumn._offsets_buffer_cache.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._validity_buffer_cache_PandasProtocolColumn._offsets_buffer_cache.None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 386, "end_line": 434, "span_ids": ["PandasProtocolColumn._get_validity_buffer", "PandasProtocolColumn:9", "PandasProtocolColumn:11"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n _validity_buffer_cache = None\n\n def _get_validity_buffer(self) -> Tuple[PandasProtocolBuffer, Any]:\n \"\"\"\n Get the validity buffer.\n\n The buffer contains the mask values indicating\n missing data and the buffer's associated dtype.\n\n Returns\n -------\n tuple\n The validity buffer.\n\n Raises\n ------\n ``NoValidityBuffer`` if null representation is not a bit or byte mask.\n \"\"\"\n if self._validity_buffer_cache is not None:\n return self._validity_buffer_cache\n\n null, invalid = self.describe_null\n\n if self.dtype[0] == DTypeKind.STRING:\n # For now, have the mask array be comprised of bytes, rather than a bit array\n buf = self._col.to_numpy().flatten()\n\n # Determine the encoding for valid values\n valid = 1 if invalid == 0 else 0\n\n mask = [valid if type(buf[i]) == str else invalid for i in range(buf.size)]\n\n # Convert the mask array to a Pandas \"buffer\" using a NumPy array as the backing store\n buffer = PandasProtocolBuffer(np.asarray(mask, dtype=\"uint8\"))\n\n # Define the dtype of the returned buffer\n dtype = (DTypeKind.UINT, 8, \"C\", \"=\")\n\n self._validity_buffer_cache = (buffer, dtype)\n return self._validity_buffer_cache\n\n try:\n msg = _NO_VALIDITY_BUFFER[null]\n except KeyError:\n raise NotImplementedError(\"See self.describe_null\")\n\n raise NoValidityBuffer(msg)\n\n _offsets_buffer_cache = 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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._get_offsets_buffer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py_PandasProtocolColumn._get_offsets_buffer_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 436, "end_line": 488, "span_ids": ["PandasProtocolColumn._get_offsets_buffer"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass PandasProtocolColumn(ProtocolColumn):\n\n def _get_offsets_buffer(self) -> Tuple[PandasProtocolBuffer, Any]:\n \"\"\"\n Get the offsets buffer.\n\n The buffer contains the offset values for variable-size binary data\n (e.g., variable-length strings) and the buffer's associated dtype.\n\n Returns\n -------\n tuple\n The offsets buffer.\n\n Raises\n ------\n ``NoOffsetsBuffer`` if the data buffer does not have an associated offsets buffer.\n \"\"\"\n if self._offsets_buffer_cache is not None:\n return self._offsets_buffer_cache\n\n if self.dtype[0] == DTypeKind.STRING:\n # For each string, we need to manually determine the next offset\n values = self._col.to_numpy().flatten()\n ptr = 0\n offsets = [ptr] + [None] * len(values)\n for i, v in enumerate(values):\n # For missing values (in this case, `np.nan` values), we don't increment the pointer)\n if type(v) == str:\n b = v.encode(encoding=\"utf-8\")\n ptr += len(b)\n\n offsets[i + 1] = ptr\n\n # Convert the list of offsets to a NumPy array of signed 64-bit integers (note: Arrow allows the offsets array to be either `int32` or `int64`; here, we default to the latter)\n buf = np.asarray(offsets, dtype=\"int64\")\n\n # Convert the offsets to a Pandas \"buffer\" using the NumPy array as the backing store\n buffer = PandasProtocolBuffer(buf)\n\n # Assemble the buffer dtype info\n dtype = (\n DTypeKind.INT,\n 64,\n \"l\",\n \"=\",\n ) # note: currently only support native endianness\n else:\n raise NoOffsetsBuffer(\n \"This column has a fixed-length dtype so does not have an offsets buffer\"\n )\n\n self._offsets_buffer_cache = (buffer, dtype)\n return self._offsets_buffer_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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_collections_PandasProtocolDataframe.get_columns.for_name_in_self__df_colu.yield_PandasProtocolColum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_collections_PandasProtocolDataframe.get_columns.for_name_in_self__df_colu.yield_PandasProtocolColum", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 127, "span_ids": ["PandasProtocolDataframe.num_rows", "PandasProtocolDataframe.__init__", "PandasProtocolDataframe.get_column_by_name", "PandasProtocolDataframe.__dataframe__", "PandasProtocolDataframe.num_columns", "PandasProtocolDataframe.metadata", "PandasProtocolDataframe.num_chunks", "PandasProtocolDataframe.column_names", "PandasProtocolDataframe.get_column", "docstring", "PandasProtocolDataframe.get_columns", "PandasProtocolDataframe"], "tokens": 836}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import collections\nfrom typing import Any, Dict, Optional, Iterable, Sequence\nimport numpy as np\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolDataframe,\n)\nfrom modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\nfrom modin.utils import _inherit_docstrings\nfrom .column import PandasProtocolColumn\n\n\n@_inherit_docstrings(ProtocolDataframe)\nclass PandasProtocolDataframe(ProtocolDataframe):\n \"\"\"\n A data frame class, with only the methods required by the interchange protocol defined.\n\n Instances of this (private) class are returned from ``modin.pandas.DataFrame.__dataframe__``\n as objects with the methods and attributes defined on this class.\n\n A \"data frame\" represents an ordered collection of named columns.\n A column's \"name\" must be a unique string. Columns may be accessed by name or by position.\n This could be a public data frame class, or an object with the methods and\n attributes defined on this DataFrame class could be returned from the\n ``__dataframe__`` method of a public data frame class in a library adhering\n to the dataframe interchange protocol specification.\n\n Parameters\n ----------\n df : PandasDataframe\n A ``PandasDataframe`` object.\n nan_as_null : bool, default:False\n A keyword intended for the consumer to tell the producer\n to overwrite null values in the data with ``NaN`` (or ``NaT``).\n This currently has no effect; once support for nullable extension\n dtypes is added, this value should be propagated to columns.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n \"\"\"\n\n def __init__(\n self,\n df: PandasDataframe,\n nan_as_null: bool = False,\n allow_copy: bool = True,\n ) -> None:\n self._df = df\n self._nan_as_null = nan_as_null\n self._allow_copy = allow_copy\n\n def __dataframe__(self, nan_as_null: bool = False, allow_copy: bool = True):\n return PandasProtocolDataframe(\n self._df, nan_as_null=nan_as_null, allow_copy=allow_copy\n )\n\n @property\n def metadata(self) -> Dict[str, Any]:\n return {\"modin.index\": self._df.index}\n\n def num_columns(self) -> int:\n return len(self._df.columns)\n\n def num_rows(self) -> int:\n return len(self._df.index)\n\n def num_chunks(self) -> int:\n return self._df._partitions.shape[0]\n\n def column_names(self) -> Iterable[str]:\n for col in self._df.columns:\n yield col\n\n def get_column(self, i: int) -> PandasProtocolColumn:\n return PandasProtocolColumn(\n self._df.take_2d_labels_or_positional(\n row_positions=None, col_positions=[i]\n ),\n allow_copy=self._allow_copy,\n )\n\n def get_column_by_name(self, name: str) -> PandasProtocolColumn:\n return PandasProtocolColumn(\n self._df.take_2d_labels_or_positional(\n row_positions=None, col_labels=[name]\n ),\n allow_copy=self._allow_copy,\n )\n\n def get_columns(self) -> Iterable[PandasProtocolColumn]:\n for name in self._df.columns:\n yield PandasProtocolColumn(\n self._df.take_2d_labels_or_positional(\n row_positions=None, col_labels=[name]\n ),\n allow_copy=self._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_PandasProtocolDataframe.select_columns_PandasProtocolDataframe.select_columns_by_name.return.PandasProtocolDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_PandasProtocolDataframe.select_columns_PandasProtocolDataframe.select_columns_by_name.return.PandasProtocolDataframe_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 129, "end_line": 147, "span_ids": ["PandasProtocolDataframe.select_columns_by_name", "PandasProtocolDataframe.select_columns"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass PandasProtocolDataframe(ProtocolDataframe):\n\n def select_columns(self, indices: Sequence[int]) -> \"PandasProtocolDataframe\":\n if not isinstance(indices, collections.abc.Sequence):\n raise ValueError(\"`indices` is not a sequence\")\n\n return PandasProtocolDataframe(\n self._df.take_2d_labels_or_positional(\n row_positions=None, col_positions=indices\n ),\n allow_copy=self._allow_copy,\n )\n\n def select_columns_by_name(self, names: Sequence[str]) -> \"PandasProtocolDataframe\":\n if not isinstance(names, collections.abc.Sequence):\n raise ValueError(\"`names` is not a sequence\")\n\n return PandasProtocolDataframe(\n self._df.take_2d_labels_or_positional(row_positions=None, col_labels=names),\n allow_copy=self._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_PandasProtocolDataframe.get_chunks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py_PandasProtocolDataframe.get_chunks_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 202, "span_ids": ["PandasProtocolDataframe.get_chunks"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass PandasProtocolDataframe(ProtocolDataframe):\n\n def get_chunks(\n self, n_chunks: Optional[int] = None\n ) -> Iterable[\"PandasProtocolDataframe\"]:\n cur_n_chunks = self.num_chunks()\n n_rows = self.num_rows()\n if n_chunks is None or n_chunks == cur_n_chunks:\n cum_row_lengths = np.cumsum([0] + self._df.row_lengths)\n for i in range(len(cum_row_lengths) - 1):\n yield PandasProtocolDataframe(\n self._df.take_2d_labels_or_positional(\n row_positions=range(cum_row_lengths[i], cum_row_lengths[i + 1]),\n col_positions=None,\n ),\n allow_copy=self._allow_copy,\n )\n return\n if n_chunks % cur_n_chunks != 0:\n raise RuntimeError(\n \"The passed `n_chunks` must be a multiple of `self.num_chunks()`.\"\n )\n\n if n_chunks > n_rows:\n raise RuntimeError(\n \"The passed `n_chunks` value is bigger than `self.num_rows()`.\"\n )\n\n chunksize = n_rows // n_chunks\n new_lengths = [chunksize] * n_chunks\n new_lengths[-1] = n_rows % n_chunks + new_lengths[-1]\n\n new_partitions = self._df._partition_mgr_cls.map_axis_partitions(\n 0,\n self._df._partitions,\n lambda df: df,\n keep_partitioning=False,\n lengths=new_lengths,\n )\n new_df = self._df.__constructor__(\n new_partitions,\n self._df.index,\n self._df.columns,\n new_lengths,\n self._df.column_widths,\n )\n cum_row_lengths = np.cumsum([0] + new_df.row_lengths)\n for i in range(len(cum_row_lengths) - 1):\n yield PandasProtocolDataframe(\n new_df.take_2d_labels_or_positional(\n row_positions=range(cum_row_lengths[i], cum_row_lengths[i + 1]),\n col_positions=None,\n ),\n allow_copy=self._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/exception.py_NoValidityBuffer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/exception.py_NoValidityBuffer_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/exception.py", "file_name": "exception.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 27, "span_ids": ["NoValidityBuffer", "NoOffsetsBuffer"], "tokens": 57}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NoValidityBuffer(Exception):\n \"\"\"Exception to be raised if there is no validity buffer for ``PandasProtocolColumn``.\"\"\"\n\n pass\n\n\nclass NoOffsetsBuffer(Exception):\n \"\"\"Exception to be raised if there is no offsets buffer for ``PandasProtocolColumn``.\"\"\"\n\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_pandas_np_types_map._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_pandas_np_types_map._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 41, "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": "import pandas\nimport numpy as np\nimport ctypes\nimport re\nfrom typing import Optional, Tuple, Any, Union\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.utils import (\n DTypeKind,\n ColumnNullType,\n ArrowCTypes,\n Endianness,\n)\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolDataframe,\n ProtocolColumn,\n ProtocolBuffer,\n)\n\n\nnp_types_map = {\n DTypeKind.INT: {8: np.int8, 16: np.int16, 32: np.int32, 64: np.int64},\n DTypeKind.UINT: {8: np.uint8, 16: np.uint16, 32: np.uint32, 64: np.uint64},\n DTypeKind.FLOAT: {32: np.float32, 64: np.float64},\n # Consider bitmask to be a uint8 dtype to parse the bits later\n DTypeKind.BOOL: {1: np.uint8, 8: bool},\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_from_dataframe_to_pandas_from_dataframe_to_pandas.return.pandas_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_from_dataframe_to_pandas_from_dataframe_to_pandas.return.pandas_df", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 77, "span_ids": ["from_dataframe_to_pandas"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def from_dataframe_to_pandas(df: ProtocolDataframe, n_chunks: Optional[int] = None):\n \"\"\"\n Build a ``pandas.DataFrame`` from an object supporting the DataFrame exchange protocol, i.e. `__dataframe__` method.\n\n Parameters\n ----------\n df : ProtocolDataframe\n Object supporting the exchange protocol, i.e. `__dataframe__` method.\n n_chunks : int, optional\n Number of chunks to split `df`.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n if not hasattr(df, \"__dataframe__\"):\n raise ValueError(\"`df` does not support __dataframe__\")\n\n df = df.__dataframe__()\n if isinstance(df, dict):\n df = df[\"dataframe\"]\n\n pandas_dfs = []\n for chunk in df.get_chunks(n_chunks):\n pandas_df = protocol_df_chunk_to_pandas(chunk)\n pandas_dfs.append(pandas_df)\n\n pandas_df = pandas.concat(pandas_dfs, axis=0, ignore_index=True)\n\n index_obj = df.metadata.get(\"modin.index\", df.metadata.get(\"pandas.index\", None))\n if index_obj is not None:\n pandas_df.index = index_obj\n\n return pandas_df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_protocol_df_chunk_to_pandas_protocol_df_chunk_to_pandas.return.pandas_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_protocol_df_chunk_to_pandas_protocol_df_chunk_to_pandas.return.pandas_df", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 107, "span_ids": ["protocol_df_chunk_to_pandas"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def protocol_df_chunk_to_pandas(df):\n \"\"\"\n Convert exchange protocol chunk to ``pandas.DataFrame``.\n\n Parameters\n ----------\n df : ProtocolDataframe\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n # We need a dict of columns here, with each column being a NumPy array (at\n # least for now, deal with non-NumPy dtypes later).\n columns = dict()\n buffers = [] # hold on to buffers, keeps memory alive\n for name in df.column_names():\n if not isinstance(name, str):\n raise ValueError(f\"Column {name} is not a string\")\n if name in columns:\n raise ValueError(f\"Column {name} is not unique\")\n col = df.get_column_by_name(name)\n columns[name], buf = unpack_protocol_column(col)\n buffers.append(buf)\n\n pandas_df = pandas.DataFrame(columns)\n pandas_df._buffers = buffers\n return pandas_df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_unpack_protocol_column_unpack_protocol_column.if_dtype_in_.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_unpack_protocol_column_unpack_protocol_column.if_dtype_in_.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 142, "span_ids": ["unpack_protocol_column"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def unpack_protocol_column(\n col: ProtocolColumn,\n) -> Tuple[Union[np.ndarray, pandas.Series], Any]:\n \"\"\"\n Unpack an interchange protocol column to a pandas-ready column.\n\n Parameters\n ----------\n col : ProtocolColumn\n Column to unpack.\n\n Returns\n -------\n tuple\n Tuple of resulting column (either an ndarray or a series) and the object\n which keeps memory referenced by the column alive.\n \"\"\"\n dtype = col.dtype[0]\n if dtype in (\n DTypeKind.INT,\n DTypeKind.UINT,\n DTypeKind.FLOAT,\n DTypeKind.BOOL,\n ):\n return primitive_column_to_ndarray(col)\n elif dtype == DTypeKind.CATEGORICAL:\n return categorical_column_to_series(col)\n elif dtype == DTypeKind.STRING:\n return string_column_to_ndarray(col)\n elif dtype == DTypeKind.DATETIME:\n return datetime_column_to_ndarray(col)\n else:\n raise NotImplementedError(f\"Data type {dtype} not handled yet\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_primitive_column_to_ndarray_primitive_column_to_ndarray.return.data_buffers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_primitive_column_to_ndarray_primitive_column_to_ndarray.return.data_buffers", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 164, "span_ids": ["primitive_column_to_ndarray"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def primitive_column_to_ndarray(col: ProtocolColumn) -> Tuple[np.ndarray, Any]:\n \"\"\"\n Convert a column holding one of the primitive dtypes (int, uint, float or bool) to a NumPy array.\n\n Parameters\n ----------\n col : ProtocolColumn\n\n Returns\n -------\n tuple\n Tuple of np.ndarray holding the data and the memory owner object that keeps the memory alive.\n \"\"\"\n buffers = col.get_buffers()\n\n data_buff, data_dtype = buffers[\"data\"]\n data = buffer_to_ndarray(data_buff, data_dtype, col.offset, col.size())\n\n data = set_nulls(data, col, buffers[\"validity\"])\n return data, buffers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_categorical_column_to_series_categorical_column_to_series.return.data_buffers_categorie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_categorical_column_to_series_categorical_column_to_series.return.data_buffers_categorie", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 203, "span_ids": ["categorical_column_to_series"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def categorical_column_to_series(col: ProtocolColumn) -> Tuple[pandas.Series, Any]:\n \"\"\"\n Convert a column holding categorical data to a pandas Series.\n\n Parameters\n ----------\n col : ProtocolColumn\n\n Returns\n -------\n tuple\n Tuple of pandas.Series holding the data and the memory owner object that keeps the memory alive.\n \"\"\"\n cat_descr = col.describe_categorical\n ordered, is_dict, categories = (\n cat_descr[\"is_ordered\"],\n cat_descr[\"is_dictionary\"],\n cat_descr[\"categories\"],\n )\n\n if not is_dict or categories is None:\n raise NotImplementedError(\"Non-dictionary categoricals not supported yet\")\n\n buffers = col.get_buffers()\n\n codes_buff, codes_dtype = buffers[\"data\"]\n codes = buffer_to_ndarray(codes_buff, codes_dtype, col.offset, col.size())\n\n # Doing module in order to not get ``IndexError`` for out-of-bounds sentinel values in `codes`\n cat_values, categories_buf = unpack_protocol_column(categories)\n values = cat_values[codes % len(cat_values)]\n\n cat = pandas.Categorical(values, categories=cat_values, ordered=ordered)\n data = pandas.Series(cat)\n\n data = set_nulls(data, col, buffers[\"validity\"])\n return data, [buffers, categories_buf]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py__inverse_null_buf__inverse_null_buf.return.buf_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py__inverse_null_buf__inverse_null_buf.return.buf_0", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 229, "span_ids": ["_inverse_null_buf"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _inverse_null_buf(buf: np.ndarray, null_kind: ColumnNullType) -> np.ndarray:\n \"\"\"\n Inverse the boolean value of buffer storing either bit- or bytemask.\n\n Parameters\n ----------\n buf : np.ndarray\n Buffer to inverse the boolean value for.\n null_kind : {ColumnNullType.USE_BYTEMASK, ColumnNullType.USE_BITMASK}\n How to treat the buffer.\n\n Returns\n -------\n np.ndarray\n Logically inversed buffer.\n \"\"\"\n if null_kind == ColumnNullType.USE_BITMASK:\n return ~buf\n assert (\n null_kind == ColumnNullType.USE_BYTEMASK\n ), f\"Unexpected null kind: {null_kind}\"\n # bytemasks use 0 for `False` and anything else for `True`, so convert to bool\n # by direct comparison instead of bitwise reversal like we do for bitmasks\n return buf == 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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_string_column_to_ndarray_string_column_to_ndarray.return.np_asarray_str_list_dtyp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_string_column_to_ndarray_string_column_to_ndarray.return.np_asarray_str_list_dtyp", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 232, "end_line": 311, "span_ids": ["string_column_to_ndarray"], "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": "def string_column_to_ndarray(col: ProtocolColumn) -> Tuple[np.ndarray, Any]:\n \"\"\"\n Convert a column holding string data to a NumPy array.\n\n Parameters\n ----------\n col : ProtocolColumn\n\n Returns\n -------\n tuple\n Tuple of np.ndarray holding the data and the memory owner object that keeps the memory alive.\n \"\"\"\n null_kind, sentinel_val = col.describe_null\n\n if null_kind not in (\n ColumnNullType.NON_NULLABLE,\n ColumnNullType.USE_BITMASK,\n ColumnNullType.USE_BYTEMASK,\n ):\n raise NotImplementedError(\n f\"{null_kind} null kind is not yet supported for string columns.\"\n )\n\n buffers = col.get_buffers()\n\n # Retrieve the data buffer containing the UTF-8 code units\n data_buff, protocol_data_dtype = buffers[\"data\"]\n # We're going to reinterpret the buffer as uint8, so making sure we can do it safely\n assert protocol_data_dtype[1] == 8 # bitwidth == 8\n assert protocol_data_dtype[2] == ArrowCTypes.STRING # format_str == utf-8\n # Convert the buffers to NumPy arrays, in order to go from STRING to an equivalent ndarray,\n # we claim that the buffer is uint8 (i.e., a byte array)\n data_dtype = (\n DTypeKind.UINT,\n 8,\n ArrowCTypes.UINT8,\n Endianness.NATIVE,\n )\n # Specify zero offset as we don't want to chunk the string data\n data = buffer_to_ndarray(data_buff, data_dtype, offset=0, length=col.size())\n\n # Retrieve the offsets buffer containing the index offsets demarcating the beginning and end of each string\n offset_buff, offset_dtype = buffers[\"offsets\"]\n # Offsets buffer contains start-stop positions of strings in the data buffer,\n # meaning that it has more elements than in the data buffer, do `col.size() + 1` here\n # to pass a proper offsets buffer size\n offsets = buffer_to_ndarray(\n offset_buff, offset_dtype, col.offset, length=col.size() + 1\n )\n\n null_pos = None\n if null_kind in (ColumnNullType.USE_BITMASK, ColumnNullType.USE_BYTEMASK):\n valid_buff, valid_dtype = buffers[\"validity\"]\n null_pos = buffer_to_ndarray(valid_buff, valid_dtype, col.offset, col.size())\n if sentinel_val == 0:\n null_pos = _inverse_null_buf(null_pos, null_kind)\n\n # Assemble the strings from the code units\n str_list = [None] * col.size()\n for i in range(col.size()):\n # Check for missing values\n if null_pos is not None and null_pos[i]:\n str_list[i] = np.nan\n continue\n\n # Extract a range of code units\n units = data[offsets[i] : offsets[i + 1]]\n\n # Convert the list of code units to bytes\n str_bytes = bytes(units)\n\n # Create the string\n string = str_bytes.decode(encoding=\"utf-8\")\n\n # Add to our list of strings\n str_list[i] = string\n\n # Convert the string list to a NumPy array\n return np.asarray(str_list, dtype=\"object\"), buffers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_datetime_column_to_ndarray_datetime_column_to_ndarray.data.buffer_to_ndarray_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_datetime_column_to_ndarray_datetime_column_to_ndarray.data.buffer_to_ndarray_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 342, "span_ids": ["datetime_column_to_ndarray"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def datetime_column_to_ndarray(col: ProtocolColumn) -> Tuple[np.ndarray, Any]:\n \"\"\"\n Convert a column holding DateTime data to a NumPy array.\n\n Parameters\n ----------\n col : ProtocolColumn\n\n Returns\n -------\n tuple\n Tuple of np.ndarray holding the data and the memory owner object that keeps the memory alive.\n \"\"\"\n buffers = col.get_buffers()\n\n _, _, format_str, _ = col.dtype\n dbuf, dtype = buffers[\"data\"]\n # Consider dtype being `uint` to get number of units passed since the 01.01.1970\n data = buffer_to_ndarray(\n dbuf,\n (\n DTypeKind.UINT,\n dtype[1],\n getattr(ArrowCTypes, f\"UINT{dtype[1]}\"),\n Endianness.NATIVE,\n ),\n col.offset,\n col.size(),\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_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_datetime_column_to_ndarray.parse_format_str_datetime_column_to_ndarray.return.data_buffers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_datetime_column_to_ndarray.parse_format_str_datetime_column_to_ndarray.return.data_buffers", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 344, "end_line": 377, "span_ids": ["datetime_column_to_ndarray"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def datetime_column_to_ndarray(col: ProtocolColumn) -> Tuple[np.ndarray, Any]:\n # ... other code\n\n def parse_format_str(format_str, data):\n \"\"\"Parse datetime `format_str` to interpret the `data`.\"\"\"\n # timestamp 'ts{unit}:tz'\n timestamp_meta = re.match(r\"ts([smun]):(.*)\", format_str)\n if timestamp_meta:\n unit, tz = timestamp_meta.group(1), timestamp_meta.group(2)\n if tz != \"\":\n raise NotImplementedError(\"Timezones are not supported yet\")\n if unit != \"s\":\n # the format string describes only a first letter of the unit, add one extra\n # letter to make the unit in numpy-style: 'm' -> 'ms', 'u' -> 'us', 'n' -> 'ns'\n unit += \"s\"\n data = data.astype(f\"datetime64[{unit}]\")\n return data\n\n # date 'td{Days/Ms}'\n date_meta = re.match(r\"td([Dm])\", format_str)\n if date_meta:\n unit = date_meta.group(1)\n if unit == \"D\":\n # NumPy doesn't support DAY unit, so converting days to seconds\n # (converting to uint64 to avoid overflow)\n data = (data.astype(np.uint64) * (24 * 60 * 60)).astype(\"datetime64[s]\")\n elif unit == \"m\":\n data = data.astype(\"datetime64[ms]\")\n else:\n raise NotImplementedError(f\"Date unit is not supported: {unit}\")\n return data\n\n raise NotImplementedError(f\"DateTime kind is not supported: {format_str}\")\n\n data = parse_format_str(format_str, data)\n data = set_nulls(data, col, buffers[\"validity\"])\n return data, buffers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_buffer_to_ndarray_buffer_to_ndarray.if_bit_width_1_.else_.return.np_ctypeslib_as_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_buffer_to_ndarray_buffer_to_ndarray.if_bit_width_1_.else_.return.np_ctypeslib_as_array_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 431, "span_ids": ["buffer_to_ndarray"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def buffer_to_ndarray(\n buffer: ProtocolBuffer,\n dtype: Tuple[DTypeKind, int, str, str],\n offset: int = 0,\n length: Optional[int] = None,\n) -> np.ndarray:\n \"\"\"\n Build a NumPy array from the passed buffer.\n\n Parameters\n ----------\n buffer : ProtocolBuffer\n Buffer to build a NumPy array from.\n dtype : tuple\n Data type of the buffer conforming protocol dtypes format.\n offset : int, default: 0\n Number of elements to offset from the start of the buffer.\n length : int, optional\n If the buffer is a bit-mask, specifies a number of bits to read\n from the buffer. Has no effect otherwise.\n\n Returns\n -------\n np.ndarray\n\n Notes\n -----\n The returned array doesn't own the memory. A user of the function must keep the memory\n owner object alive as long as the returned NumPy array is being used.\n \"\"\"\n kind, bit_width, _, _ = dtype\n\n column_dtype = np_types_map.get(kind, {}).get(bit_width, None)\n if column_dtype is None:\n raise NotImplementedError(f\"Convertion for {dtype} is not yet supported.\")\n\n # TODO: No DLPack yet, so need to construct a new ndarray from the data pointer\n # and size in the buffer plus the dtype on the column. Use DLPack as NumPy supports\n # it since https://github.com/numpy/numpy/pull/19083\n ctypes_type = np.ctypeslib.as_ctypes_type(column_dtype)\n data_pointer = ctypes.cast(\n buffer.ptr + (offset * bit_width // 8), ctypes.POINTER(ctypes_type)\n )\n\n if bit_width == 1:\n assert length is not None, \"`length` must be specified for a bit-mask buffer.\"\n arr = np.ctypeslib.as_array(data_pointer, shape=(buffer.bufsize,))\n return bitmask_to_bool_ndarray(arr, length, first_byte_offset=offset % 8)\n else:\n return np.ctypeslib.as_array(\n data_pointer, shape=(buffer.bufsize // (bit_width // 8),)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_bitmask_to_bool_ndarray_bitmask_to_bool_ndarray.return.bool_mask": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_bitmask_to_bool_ndarray_bitmask_to_bool_ndarray.return.bool_mask", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 434, "end_line": 485, "span_ids": ["bitmask_to_bool_ndarray"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bitmask_to_bool_ndarray(\n bitmask: np.ndarray, mask_length: int, first_byte_offset: int = 0\n) -> np.ndarray:\n \"\"\"\n Convert bit-mask to a boolean NumPy array.\n\n Parameters\n ----------\n bitmask : np.ndarray[uint8]\n NumPy array of uint8 dtype representing the bitmask.\n mask_length : int\n Number of elements in the mask to interpret.\n first_byte_offset : int, default: 0\n Number of elements to offset from the start of the first byte.\n\n Returns\n -------\n np.ndarray[bool]\n \"\"\"\n bytes_to_skip = first_byte_offset // 8\n bitmask = bitmask[bytes_to_skip:]\n first_byte_offset %= 8\n\n bool_mask = np.zeros(mask_length, dtype=bool)\n\n # Proccessing the first byte separately as it has its own offset\n val = bitmask[0]\n mask_idx = 0\n bits_in_first_byte = min(8 - first_byte_offset, mask_length)\n for j in range(bits_in_first_byte):\n if val & (1 << (j + first_byte_offset)):\n bool_mask[mask_idx] = True\n mask_idx += 1\n\n # `mask_length // 8` describes how many full bytes to process\n for i in range((mask_length - bits_in_first_byte) // 8):\n # doing `+ 1` as we already processed the first byte\n val = bitmask[i + 1]\n for j in range(8):\n if val & (1 << j):\n bool_mask[mask_idx] = True\n mask_idx += 1\n\n if len(bitmask) > 1:\n # Processing reminder of last byte\n val = bitmask[-1]\n for j in range(len(bool_mask) - mask_idx):\n if val & (1 << j):\n bool_mask[mask_idx] = True\n mask_idx += 1\n\n return bool_mask", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_set_nulls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py_set_nulls_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/interchange/dataframe_protocol/from_dataframe.py", "file_name": "from_dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 488, "end_line": 542, "span_ids": ["set_nulls"], "tokens": 484}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_nulls(\n data: Union[np.ndarray, pandas.Series],\n col: ProtocolColumn,\n validity: Tuple[ProtocolBuffer, Tuple[DTypeKind, int, str, str]],\n allow_modify_inplace: bool = True,\n):\n \"\"\"\n Set null values for the data according to the column null kind.\n\n Parameters\n ----------\n data : np.ndarray or pandas.Series\n Data to set nulls in.\n col : ProtocolColumn\n Column object that describes the `data`.\n validity : tuple(ProtocolBuffer, dtype) or None\n The return value of ``col.buffers()``. We do not access the ``col.buffers()``\n here to not take the ownership of the memory of buffer objects.\n allow_modify_inplace : bool, default: True\n Whether to modify the `data` inplace when zero-copy is possible (True) or always\n modify a copy of the `data` (False).\n\n Returns\n -------\n np.ndarray or pandas.Series\n Data with the nulls being set.\n \"\"\"\n null_kind, sentinel_val = col.describe_null\n null_pos = None\n\n if null_kind == ColumnNullType.USE_SENTINEL:\n null_pos = data == sentinel_val\n elif null_kind in (ColumnNullType.USE_BITMASK, ColumnNullType.USE_BYTEMASK):\n valid_buff, valid_dtype = validity\n null_pos = buffer_to_ndarray(valid_buff, valid_dtype, col.offset, col.size())\n if sentinel_val == 0:\n null_pos = _inverse_null_buf(null_pos, null_kind)\n elif null_kind in (ColumnNullType.NON_NULLABLE, ColumnNullType.USE_NAN):\n pass\n else:\n raise NotImplementedError(f\"Null kind {null_kind} is not yet supported.\")\n\n if null_pos is not None and np.any(null_pos):\n if not allow_modify_inplace:\n data = data.copy()\n try:\n data[null_pos] = None\n except TypeError:\n # TypeError happens if the `data` dtype appears to be non-nullable in numpy notation\n # (bool, int, uint), if such happens, cast the `data` to nullable float dtype.\n data = data.astype(float)\n data[null_pos] = None\n\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/__init__.py_ModinIndex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/__init__.py_ModinIndex_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 20, "span_ids": ["docstring"], "tokens": 48}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .index import ModinIndex\nfrom .dtypes import ModinDtypes, LazyProxyCategoricalDtype\n\n__all__ = [\"ModinDtypes\", \"ModinIndex\", \"LazyProxyCategoricalDtype\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_pandas_ModinDtypes.__reduce__.return._self___class___self__v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_pandas_ModinDtypes.__reduce__.return._self___class___self__v", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 93, "span_ids": ["ModinDtypes", "ModinDtypes.__reduce__", "ModinDtypes.get", "ModinDtypes.is_materialized", "ModinDtypes.__init__", "docstring", "ModinDtypes.__len__"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\n\nfrom modin.error_message import ErrorMessage\n\n\nclass ModinDtypes:\n \"\"\"\n A class that hides the various implementations of the dtypes needed for optimization.\n\n Parameters\n ----------\n value : pandas.Series or callable\n \"\"\"\n\n def __init__(self, value):\n if value is None:\n raise ValueError(f\"ModinDtypes doesn't work with '{value}'\")\n self._value = value\n\n @property\n def is_materialized(self) -> bool:\n \"\"\"\n Check if the internal representation is materialized.\n\n Returns\n -------\n bool\n \"\"\"\n return isinstance(self._value, pandas.Series)\n\n def get(self) -> pandas.Series:\n \"\"\"\n Get the materialized internal representation.\n\n Returns\n -------\n pandas.Series\n \"\"\"\n if not self.is_materialized:\n if callable(self._value):\n self._value = self._value()\n if self._value is None:\n self._value = pandas.Series([])\n else:\n raise NotImplementedError(type(self._value))\n return self._value\n\n def __len__(self):\n \"\"\"\n Redirect the 'len' request to the internal representation.\n\n Returns\n -------\n int\n\n Notes\n -----\n Executing this function materializes the data.\n \"\"\"\n if not self.is_materialized:\n self.get()\n return len(self._value)\n\n def __reduce__(self):\n \"\"\"\n Serialize an object of this class.\n\n Returns\n -------\n tuple\n\n Notes\n -----\n The default implementation generates a recursion error. In a short:\n during the construction of the object, `__getattr__` function is called, which\n is not intended to be used in situations where the object is not initialized.\n \"\"\"\n return (self.__class__, (self._value,))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_ModinDtypes.__getattr___ModinDtypes.__getattr__.return.self__value___getattribut": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_ModinDtypes.__getattr___ModinDtypes.__getattr__.return.self__value___getattribut", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 119, "span_ids": ["ModinDtypes.__getattr__"], "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 ModinDtypes:\n\n def __getattr__(self, name):\n \"\"\"\n Redirect access to non-existent attributes to the internal representation.\n\n This is necessary so that objects of this class in most cases mimic the behavior\n of the ``pandas.Series``. The main limitations of the current approach are type\n checking and the use of this object where pandas dtypes are supposed to be used.\n\n Parameters\n ----------\n name : str\n Attribute name.\n\n Returns\n -------\n object\n Attribute.\n\n Notes\n -----\n Executing this function materializes the data.\n \"\"\"\n if not self.is_materialized:\n self.get()\n return self._value.__getattribute__(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_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_ModinDtypes.copy_ModinDtypes.__contains__.return.key_in_self__value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_ModinDtypes.copy_ModinDtypes.__contains__.return.key_in_self__value", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 152, "span_ids": ["ModinDtypes.copy", "ModinDtypes.__iter__", "ModinDtypes.__setitem__", "ModinDtypes.__getitem__", "ModinDtypes.__contains__"], "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 ModinDtypes:\n\n def copy(self) -> \"ModinDtypes\":\n \"\"\"\n Copy an object without materializing the internal representation.\n\n Returns\n -------\n ModinDtypes\n \"\"\"\n idx_cache = self._value\n if not callable(idx_cache):\n idx_cache = idx_cache.copy()\n return ModinDtypes(idx_cache)\n\n def __getitem__(self, key): # noqa: GL08\n if not self.is_materialized:\n self.get()\n return self._value.__getitem__(key)\n\n def __setitem__(self, key, item): # noqa: GL08\n if not self.is_materialized:\n self.get()\n self._value.__setitem__(key, item)\n\n def __iter__(self): # noqa: GL08\n if not self.is_materialized:\n self.get()\n return iter(self._value)\n\n def __contains__(self, key): # noqa: GL08\n if not self.is_materialized:\n self.get()\n return key in self._value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype_LazyProxyCategoricalDtype.__init__.super___init___categori": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype_LazyProxyCategoricalDtype.__init__.super___init___categori", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 179, "span_ids": ["LazyProxyCategoricalDtype", "LazyProxyCategoricalDtype.__init__"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LazyProxyCategoricalDtype(pandas.CategoricalDtype):\n \"\"\"\n A lazy proxy representing ``pandas.CategoricalDtype``.\n\n Parameters\n ----------\n categories : list-like, optional\n ordered : bool, default: False\n\n Notes\n -----\n Important note! One shouldn't use the class' constructor to instantiate a proxy instance,\n it's intended only for compatibility purposes! In order to create a new proxy instance\n use the appropriate class method `._build_proxy(...)`.\n \"\"\"\n\n def __init__(self, categories=None, ordered=False):\n # These will be initialized later inside of the `._build_proxy()` method\n self._parent, self._column_name, self._categories_val, self._materializer = (\n None,\n None,\n None,\n None,\n )\n super().__init__(categories, ordered)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype._update_proxy_LazyProxyCategoricalDtype._update_proxy.if_self__is_materialized_.else_.return.self__build_proxy_parent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype._update_proxy_LazyProxyCategoricalDtype._update_proxy.if_self__is_materialized_.else_.return.self__build_proxy_parent_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 202, "span_ids": ["LazyProxyCategoricalDtype._update_proxy"], "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 LazyProxyCategoricalDtype(pandas.CategoricalDtype):\n\n def _update_proxy(self, parent, column_name):\n \"\"\"\n Create a new proxy, if either parent or column name are different.\n\n Parameters\n ----------\n parent : object\n Source object to extract categories on demand.\n column_name : str\n Column name of the categorical column in the source object.\n\n Returns\n -------\n pandas.CategoricalDtype or LazyProxyCategoricalDtype\n \"\"\"\n if self._is_materialized:\n # The parent has been materialized, we don't need a proxy anymore.\n return pandas.CategoricalDtype(self.categories, ordered=self._ordered)\n elif parent is self._parent and column_name == self._column_name:\n return self\n else:\n return self._build_proxy(parent, column_name, self._materializer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype._build_proxy_LazyProxyCategoricalDtype._build_proxy.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype._build_proxy_LazyProxyCategoricalDtype._build_proxy.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 226, "span_ids": ["LazyProxyCategoricalDtype._build_proxy"], "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 LazyProxyCategoricalDtype(pandas.CategoricalDtype):\n\n @classmethod\n def _build_proxy(cls, parent, column_name, materializer):\n \"\"\"\n Construct a lazy proxy.\n\n Parameters\n ----------\n parent : object\n Source object to extract categories on demand.\n column_name : str\n Column name of the categorical column in the source object.\n materializer : callable(parent, column_name) -> pandas.CategoricalDtype\n A function to call in order to extract categorical values.\n\n Returns\n -------\n LazyProxyCategoricalDtype\n \"\"\"\n result = cls()\n result._parent = parent\n result._column_name = column_name\n result._materializer = materializer\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_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype.__reduce___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/dtypes.py_LazyProxyCategoricalDtype.__reduce___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/dtypes.py", "file_name": "dtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 289, "span_ids": ["LazyProxyCategoricalDtype._categories", "LazyProxyCategoricalDtype._is_materialized", "LazyProxyCategoricalDtype._materialize_categories", "LazyProxyCategoricalDtype.__reduce__", "LazyProxyCategoricalDtype._categories_4"], "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 LazyProxyCategoricalDtype(pandas.CategoricalDtype):\n\n def __reduce__(self):\n \"\"\"\n Serialize an object of this class.\n\n Returns\n -------\n tuple\n\n Notes\n -----\n This object is serialized into a ``pandas.CategoricalDtype`` as an actual proxy can't be\n properly serialized because of the references it stores for its potentially distributed parent.\n \"\"\"\n return (pandas.CategoricalDtype, (self.categories, self.ordered))\n\n @property\n def _categories(self):\n \"\"\"\n Get materialized categorical values.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n if not self._is_materialized:\n self._materialize_categories()\n return self._categories_val\n\n @_categories.setter\n def _categories(self, categories):\n \"\"\"\n Set new categorical values.\n\n Parameters\n ----------\n categories : list-like\n \"\"\"\n self._categories_val = categories\n self._parent = None # The parent is not required any more\n self._materializer = None\n\n @property\n def _is_materialized(self) -> bool:\n \"\"\"\n Check whether categorical values were already materialized.\n\n Returns\n -------\n bool\n \"\"\"\n return self._categories_val is not None\n\n def _materialize_categories(self):\n \"\"\"Materialize actual categorical values.\"\"\"\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=self._parent is None,\n extra_log=\"attempted to materialize categories with parent being 'None'\",\n )\n categoricals = self._materializer(self._parent, self._column_name)\n self._categories = categoricals.categories\n self._ordered = categoricals.ordered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_pandas_ModinIndex.is_materialized.return.isinstance_self__value_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_pandas_ModinIndex.is_materialized.return.isinstance_self__value_p", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 45, "span_ids": ["ModinIndex", "ModinIndex.__init__", "ModinIndex.is_materialized", "docstring"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nfrom pandas.core.indexes.api import ensure_index\n\n\nclass ModinIndex:\n \"\"\"\n A class that hides the various implementations of the index needed for optimization.\n\n Parameters\n ----------\n value : sequence or callable\n \"\"\"\n\n def __init__(self, value):\n if callable(value):\n self._value = value\n else:\n self._value = ensure_index(value)\n self._lengths_cache = None\n\n @property\n def is_materialized(self) -> bool:\n \"\"\"\n Check if the internal representation is materialized.\n\n Returns\n -------\n bool\n \"\"\"\n return isinstance(self._value, pandas.Index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.get_ModinIndex.get.if_return_lengths_.else_.return.self__value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.get_ModinIndex.get.if_return_lengths_.else_.return.self__value", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 71, "span_ids": ["ModinIndex.get"], "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 ModinIndex:\n\n def get(self, return_lengths=False) -> pandas.Index:\n \"\"\"\n Get the materialized internal representation.\n\n Parameters\n ----------\n return_lengths : bool, default: False\n In some cases, during the index calculation, it's possible to get\n the lengths of the partitions. This flag allows this data to be used\n for optimization.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n if not self.is_materialized:\n if callable(self._value):\n index, self._lengths_cache = self._value()\n self._value = ensure_index(index)\n else:\n raise NotImplementedError(type(self._value))\n if return_lengths:\n return self._value, self._lengths_cache\n else:\n return self._value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.__len___ModinIndex.__reduce__.return._self___class___self__v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.__len___ModinIndex.__reduce__.return._self___class___self__v", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 105, "span_ids": ["ModinIndex.__reduce__", "ModinIndex.__len__"], "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 ModinIndex:\n\n def __len__(self):\n \"\"\"\n Redirect the 'len' request to the internal representation.\n\n Returns\n -------\n int\n\n Notes\n -----\n Executing this function materializes the data.\n \"\"\"\n if not self.is_materialized:\n self.get()\n return len(self._value)\n\n def __reduce__(self):\n \"\"\"\n Serialize an object of this class.\n\n Returns\n -------\n tuple\n\n Notes\n -----\n The default implementation generates a recursion error. In a short:\n during the construction of the object, `__getattr__` function is called, which\n is not intended to be used in situations where the object is not initialized.\n \"\"\"\n if self._lengths_cache is not None:\n return (self.__class__, (lambda: (self._value, self._lengths_vache),))\n return (self.__class__, (self._value,))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.__getattr___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/metadata/index.py_ModinIndex.__getattr___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/metadata/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 145, "span_ids": ["ModinIndex.__getattr__", "ModinIndex.copy"], "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 ModinIndex:\n\n def __getattr__(self, name):\n \"\"\"\n Redirect access to non-existent attributes to the internal representation.\n\n This is necessary so that objects of this class in most cases mimic the behavior\n of the ``pandas.Index``. The main limitations of the current approach are type\n checking and the use of this object where pandas indexes are supposed to be used.\n\n Parameters\n ----------\n name : str\n Attribute name.\n\n Returns\n -------\n object\n Attribute.\n\n Notes\n -----\n Executing this function materializes the data.\n \"\"\"\n if not self.is_materialized:\n self.get()\n return self._value.__getattribute__(name)\n\n def copy(self) -> \"ModinIndex\":\n \"\"\"\n Copy an object without materializing the internal representation.\n\n Returns\n -------\n ModinIndex\n \"\"\"\n idx_cache = self._value\n if not callable(idx_cache):\n idx_cache = idx_cache.copy()\n return ModinIndex(idx_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_pandas_PandasDataframeAxisPartition.__init__.self._list_of_block_partitions.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_pandas_PandasDataframeAxisPartition.__init__.self._list_of_block_partitions.None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 80, "span_ids": ["PandasDataframeAxisPartition", "PandasDataframeAxisPartition.__init__", "docstring"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport numpy as np\nfrom modin.core.storage_formats.pandas.utils import split_result_of_axis_func_pandas\nfrom modin.core.dataframe.base.partitioning.axis_partition import (\n BaseDataframeAxisPartition,\n)\nfrom .partition import PandasDataframePartition\n\n\nclass PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n \"\"\"\n An abstract class is created to simplify and consolidate the code for axis partition that run pandas.\n\n Because much of the code is similar, this allows us to reuse this code.\n\n Parameters\n ----------\n list_of_partitions : Union[list, PandasDataframePartition]\n List of ``PandasDataframePartition`` and\n ``PandasDataframeAxisPartition`` objects, or a single\n ``PandasDataframePartition``.\n get_ip : bool, default: False\n Whether to get node IP addresses to conforming partitions or not.\n full_axis : bool, default: True\n Whether or not the axis partition encompasses the whole axis.\n call_queue : list, optional\n A list of tuples (callable, args, kwargs) that contains deferred calls.\n length : the future's type or int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : the future's type or int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n \"\"\"\n\n def __init__(\n self,\n list_of_partitions,\n get_ip=False,\n full_axis=True,\n call_queue=None,\n length=None,\n width=None,\n ):\n if isinstance(list_of_partitions, PandasDataframePartition):\n list_of_partitions = [list_of_partitions]\n self.full_axis = full_axis\n self.call_queue = call_queue or []\n self._length_cache = length\n self._width_cache = width\n # Check that all axis partition axes are the same in `list_of_partitions`\n # We should never have mismatching axis in the current implementation. We add this\n # defensive assertion to ensure that undefined behavior does not happen.\n assert (\n len(\n set(\n obj.axis\n for obj in list_of_partitions\n if isinstance(obj, PandasDataframeAxisPartition)\n )\n )\n <= 1\n )\n self._list_of_constituent_partitions = list_of_partitions\n # Defer computing _list_of_block_partitions because we might need to\n # drain call queues for that.\n self._list_of_block_partitions = 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_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.list_of_blocks_PandasDataframeAxisPartition.list_of_blocks.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.list_of_blocks_PandasDataframeAxisPartition.list_of_blocks.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 96, "span_ids": ["PandasDataframeAxisPartition.list_of_blocks"], "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 PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @property\n def list_of_blocks(self):\n \"\"\"\n Get the list of physical partition objects that compose this partition.\n\n Returns\n -------\n list\n A list of physical partition objects (``ray.ObjectRef``, ``distributed.Future`` e.g.).\n \"\"\"\n # Defer draining call queue (which is hidden in `partition.list_of_blocks` call) until we get the partitions.\n # TODO Look into draining call queue at the same time as the task\n return [\n partition.list_of_blocks[0] for partition in self.list_of_block_partitions\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.list_of_block_partitions_PandasDataframeAxisPartition.list_of_block_partitions.return.self__list_of_block_parti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.list_of_block_partitions_PandasDataframeAxisPartition.list_of_block_partitions.return.self__list_of_block_parti", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 138, "span_ids": ["PandasDataframeAxisPartition.list_of_block_partitions"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @property\n def list_of_block_partitions(self) -> list:\n \"\"\"\n Get the list of block partitions that compose this partition.\n\n Returns\n -------\n List\n A list of ``PandasDataframePartition``.\n \"\"\"\n if self._list_of_block_partitions is not None:\n return self._list_of_block_partitions\n self._list_of_block_partitions = []\n # Extract block partitions from the block and axis partitions that\n # constitute this partition.\n for partition in self._list_of_constituent_partitions:\n if isinstance(partition, PandasDataframeAxisPartition):\n if partition.axis == self.axis:\n # We are building an axis partition out of another\n # axis partition `partition` that contains its own list\n # of block partitions, partition.list_of_block_partitions.\n # `partition` may have its own call queue, which has to be\n # applied to the entire `partition` before we execute any\n # further operations on its block parittions.\n partition.drain_call_queue()\n self._list_of_block_partitions.extend(\n partition.list_of_block_partitions\n )\n else:\n # If this axis partition is made of axis partitions\n # for the other axes, squeeze such partitions into a single\n # block so that this partition only holds a one-dimensional\n # list of blocks. We could change this implementation to\n # hold a 2-d list of blocks, but that would complicate the\n # code quite a bit.\n self._list_of_block_partitions.append(\n partition.force_materialization().list_of_block_partitions[0]\n )\n else:\n self._list_of_block_partitions.append(partition)\n return self._list_of_block_partitions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition._get_drain_func_PandasDataframeAxisPartition.drain_call_queue.self._list_of_block_partitions.drained": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition._get_drain_func_PandasDataframeAxisPartition.drain_call_queue.self._list_of_block_partitions.drained", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 171, "span_ids": ["PandasDataframeAxisPartition._get_drain_func", "PandasDataframeAxisPartition.drain_call_queue"], "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 PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @classmethod\n def _get_drain_func(cls): # noqa: GL08\n return PandasDataframeAxisPartition.drain\n\n def drain_call_queue(self, num_splits=None):\n \"\"\"\n Execute all operations stored in this partition's call queue.\n\n Parameters\n ----------\n num_splits : int, default: None\n The number of times to split the result object.\n \"\"\"\n if len(self.call_queue) == 0:\n # this implicitly calls `drain_call_queue` for block partitions,\n # which might have deferred call queues\n _ = self.list_of_blocks\n return\n call_queue = self.call_queue\n try:\n # Clearing the queue before calling `.apply()` so it won't try to drain it repeatedly\n self.call_queue = []\n drained = self.apply(\n self._get_drain_func(), num_splits=num_splits, call_queue=call_queue\n )\n except Exception:\n # Restoring the call queue in case of an exception as it most likely wasn't drained\n self.call_queue = call_queue\n raise\n if not isinstance(drained, list):\n drained = [drained]\n self._list_of_block_partitions = drained", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.force_materialization_PandasDataframeAxisPartition.force_materialization.return.materialized": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.force_materialization_PandasDataframeAxisPartition.force_materialization.return.materialized", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 173, "end_line": 189, "span_ids": ["PandasDataframeAxisPartition.force_materialization"], "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 PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n def force_materialization(self, get_ip=False):\n \"\"\"\n Materialize partitions into a single partition.\n\n Parameters\n ----------\n get_ip : bool, default: False\n Whether to get node ip address to a single partition or not.\n\n Returns\n -------\n PandasDataframeAxisPartition\n An axis partition containing only a single materialized partition.\n \"\"\"\n materialized = super().force_materialization(get_ip=get_ip)\n self._list_of_block_partitions = materialized.list_of_block_partitions\n return materialized", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.apply_PandasDataframeAxisPartition.apply.if_self_full_axis_.else_.return.result_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.apply_PandasDataframeAxisPartition.apply.if_self_full_axis_.else_.return.result_0_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 291, "span_ids": ["PandasDataframeAxisPartition.apply"], "tokens": 694}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n def apply(\n self,\n func,\n *args,\n num_splits=None,\n other_axis_partition=None,\n maintain_partitioning=True,\n lengths=None,\n manual_partition=False,\n **kwargs,\n ):\n \"\"\"\n Apply a function to this axis partition along full axis.\n\n Parameters\n ----------\n func : callable\n The function to apply.\n *args : iterable\n Positional arguments to pass to `func`.\n num_splits : int, default: None\n The number of times to split the result object.\n other_axis_partition : PandasDataframeAxisPartition, default: None\n Another `PandasDataframeAxisPartition` object to be applied\n to func. This is for operations that are between two data sets.\n maintain_partitioning : bool, default: True\n Whether to keep the partitioning in the same\n orientation as it was previously or not. This is important because we may be\n operating on an individual AxisPartition and not touching the rest.\n In this case, we have to return the partitioning to its previous\n orientation (the lengths will remain the same). This is ignored between\n two axis partitions.\n lengths : iterable, default: None\n The list of lengths to shuffle the object.\n manual_partition : bool, default: False\n If True, partition the result with `lengths`.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n list\n A list of `PandasDataframePartition` objects.\n \"\"\"\n if not self.full_axis:\n # If this is not a full axis partition, it already contains a subset of\n # the full axis, so we shouldn't split the result further.\n num_splits = 1\n if len(self.call_queue) > 0:\n self.drain_call_queue()\n\n if num_splits is None:\n num_splits = len(self.list_of_blocks)\n\n if other_axis_partition is not None:\n if not isinstance(other_axis_partition, list):\n other_axis_partition = [other_axis_partition]\n\n # (other_shape[i-1], other_shape[i]) will indicate slice\n # to restore i-1 axis partition\n other_shape = np.cumsum(\n [0] + [len(o.list_of_blocks) for o in other_axis_partition]\n )\n\n return self._wrap_partitions(\n self.deploy_func_between_two_axis_partitions(\n self.axis,\n func,\n args,\n kwargs,\n num_splits,\n len(self.list_of_blocks),\n other_shape,\n *tuple(\n self.list_of_blocks\n + [\n part\n for axis_partition in other_axis_partition\n for part in axis_partition.list_of_blocks\n ]\n ),\n )\n )\n result = self._wrap_partitions(\n self.deploy_axis_func(\n self.axis,\n func,\n args,\n kwargs,\n num_splits,\n maintain_partitioning,\n *self.list_of_blocks,\n manual_partition=manual_partition,\n lengths=lengths,\n )\n )\n if self.full_axis:\n return result\n else:\n # If this is not a full axis partition, just take out the single split in the result.\n return 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_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.split_PandasDataframeAxisPartition.split.return.self__wrap_partitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.split_PandasDataframeAxisPartition.split.return.self__wrap_partitions_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 293, "end_line": 333, "span_ids": ["PandasDataframeAxisPartition.split"], "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 PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n def split(\n self, split_func, num_splits, f_args=None, f_kwargs=None, extract_metadata=False\n ):\n \"\"\"\n Split axis partition into multiple partitions using the `split_func`.\n\n Parameters\n ----------\n split_func : callable(pandas.DataFrame) -> list[pandas.DataFrame]\n A function that takes partition's content and split it into multiple chunks.\n num_splits : int\n The number of splits the `split_func` return.\n f_args : iterable, optional\n Positional arguments to pass to the `split_func`.\n f_kwargs : dict, optional\n Keyword arguments to pass to the `split_func`.\n extract_metadata : bool, default: False\n Whether to return metadata (length, width, ip) of the result. Passing `False` may relax\n the load on object storage as the remote function would return X times fewer futures\n (where X is the number of metadata values). Passing `False` makes sense for temporary\n results where you know for sure that the metadata will never be requested.\n\n Returns\n -------\n list\n List of wrapped remote partition objects.\n \"\"\"\n f_args = tuple() if f_args is None else f_args\n f_kwargs = {} if f_kwargs is None else f_kwargs\n return self._wrap_partitions(\n self.deploy_splitting_func(\n self.axis,\n split_func,\n f_args,\n f_kwargs,\n num_splits,\n *self.list_of_blocks,\n extract_metadata=extract_metadata,\n ),\n extract_metadata=extract_metadata,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_splitting_func_PandasDataframeAxisPartition.deploy_splitting_func.return.split_func_dataframe_f_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_splitting_func_PandasDataframeAxisPartition.deploy_splitting_func.return.split_func_dataframe_f_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 373, "span_ids": ["PandasDataframeAxisPartition.deploy_splitting_func"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @classmethod\n def deploy_splitting_func(\n cls,\n axis,\n split_func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n extract_metadata=False,\n ):\n \"\"\"\n Deploy a splitting function along a full axis.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n split_func : callable(pandas.DataFrame) -> list[pandas.DataFrame]\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to `split_func`.\n f_kwargs : dict\n Keyword arguments to pass to `split_func`.\n num_splits : int\n The number of splits the `split_func` return.\n *partitions : iterable\n All partitions that make up the full axis (row or column).\n extract_metadata : bool, default: False\n Whether to return metadata (length, width, ip) of the result. Note that `True` value\n is not supported in `PandasDataframeAxisPartition` class.\n\n Returns\n -------\n list\n A list of pandas DataFrames.\n \"\"\"\n dataframe = pandas.concat(list(partitions), axis=axis, copy=False)\n return split_func(dataframe, *f_args, **f_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_axis_func_PandasDataframeAxisPartition.deploy_axis_func.return.split_result_of_axis_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_axis_func_PandasDataframeAxisPartition.deploy_axis_func.return.split_result_of_axis_func", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 375, "end_line": 442, "span_ids": ["PandasDataframeAxisPartition.deploy_axis_func"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @classmethod\n def deploy_axis_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n lengths=None,\n manual_partition=False,\n ):\n \"\"\"\n Deploy a function along a full axis.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see `split_result_of_axis_func_pandas`).\n maintain_partitioning : bool\n If True, keep the old partitioning if possible.\n If False, create a new partition layout.\n *partitions : iterable\n All partitions that make up the full axis (row or column).\n lengths : list, optional\n The list of lengths to shuffle the object.\n manual_partition : bool, default: False\n If True, partition the result with `lengths`.\n\n Returns\n -------\n list\n A list of pandas DataFrames.\n \"\"\"\n dataframe = pandas.concat(list(partitions), axis=axis, copy=False)\n result = func(dataframe, *f_args, **f_kwargs)\n\n if num_splits == 1:\n # If we're not going to split the result, we don't need to specify\n # split lengths.\n lengths = None\n elif manual_partition:\n # The split function is expecting a list\n lengths = list(lengths)\n # We set lengths to None so we don't use the old lengths for the resulting partition\n # layout. This is done if the number of splits is changing or we are told not to\n # keep the old partitioning.\n elif num_splits != len(partitions) or not maintain_partitioning:\n lengths = None\n else:\n if axis == 0:\n lengths = [len(part) for part in partitions]\n if sum(lengths) != len(result):\n lengths = None\n else:\n lengths = [len(part.columns) for part in partitions]\n if sum(lengths) != len(result.columns):\n lengths = None\n return split_result_of_axis_func_pandas(axis, num_splits, result, lengths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions_PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions.return.split_result_of_axis_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions_PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions.return.split_result_of_axis_func", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 444, "end_line": 499, "span_ids": ["PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @classmethod\n def deploy_func_between_two_axis_partitions(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n ):\n \"\"\"\n Deploy a function along a full axis between two data sets.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see `split_result_of_axis_func_pandas`).\n len_of_left : int\n The number of values in `partitions` that belong to the left data set.\n other_shape : np.ndarray\n The shape of right frame in terms of partitions, i.e.\n (other_shape[i-1], other_shape[i]) will indicate slice to restore i-1 axis partition.\n *partitions : iterable\n All partitions that make up the full axis (row or column) for both data sets.\n\n Returns\n -------\n list\n A list of pandas DataFrames.\n \"\"\"\n lt_frame = pandas.concat(partitions[:len_of_left], axis=axis, copy=False)\n\n rt_parts = partitions[len_of_left:]\n\n # reshaping flattened `rt_parts` array into a frame with shape `other_shape`\n combined_axis = [\n pandas.concat(\n rt_parts[other_shape[i - 1] : other_shape[i]],\n axis=axis,\n copy=False,\n )\n for i in range(1, len(other_shape))\n ]\n rt_frame = pandas.concat(combined_axis, axis=axis ^ 1, copy=False)\n result = func(lt_frame, rt_frame, *f_args, **f_kwargs)\n return split_result_of_axis_func_pandas(axis, num_splits, 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_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.drain_PandasDataframeAxisPartition.mask.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.drain_PandasDataframeAxisPartition.mask.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 501, "end_line": 540, "span_ids": ["PandasDataframeAxisPartition.mask", "PandasDataframeAxisPartition.drain"], "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 PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n @classmethod\n def drain(cls, df: pandas.DataFrame, call_queue: list):\n \"\"\"\n Execute all operations stored in the call queue on the pandas object (helper function).\n\n Parameters\n ----------\n df : pandas.DataFrame\n call_queue : list\n Call queue that needs to be executed on pandas DataFrame.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n for func, args, kwargs in call_queue:\n df = func(df, *args, **kwargs)\n return df\n\n def mask(self, row_indices, col_indices):\n \"\"\"\n Create (synchronously) a mask that extracts the indices provided.\n\n Parameters\n ----------\n row_indices : list-like, slice or label\n The row labels for the rows to extract.\n col_indices : list-like, slice or label\n The column labels for the columns to extract.\n\n Returns\n -------\n PandasDataframeAxisPartition\n A new ``PandasDataframeAxisPartition`` object, materialized.\n \"\"\"\n return (\n self.force_materialization()\n .list_of_block_partitions[0]\n .mask(row_indices, col_indices)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.to_pandas_PandasDataframeAxisPartition.wait.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.to_pandas_PandasDataframeAxisPartition.wait.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 604, "span_ids": ["PandasDataframeAxisPartition:5", "PandasDataframeAxisPartition.to_pandas", "PandasDataframeAxisPartition:3", "PandasDataframeAxisPartition.width", "PandasDataframeAxisPartition.length", "PandasDataframeAxisPartition.wait", "PandasDataframeAxisPartition.to_numpy"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n def to_pandas(self):\n \"\"\"\n Convert the data in this partition to a ``pandas.DataFrame``.\n\n Returns\n -------\n pandas DataFrame.\n \"\"\"\n return self.force_materialization().list_of_block_partitions[0].to_pandas()\n\n def to_numpy(self):\n \"\"\"\n Convert the data in this partition to a ``numpy.array``.\n\n Returns\n -------\n NumPy array.\n \"\"\"\n return self.force_materialization().list_of_block_partitions[0].to_numpy()\n\n _length_cache = None\n\n def length(self):\n \"\"\"\n Get the length of this partition.\n\n Returns\n -------\n int\n The length of the partition.\n \"\"\"\n if self._length_cache is None:\n if self.axis == 0:\n self._length_cache = sum(\n obj.length() for obj in self.list_of_block_partitions\n )\n else:\n self._length_cache = self.list_of_block_partitions[0].length()\n return self._length_cache\n\n _width_cache = None\n\n def width(self):\n \"\"\"\n Get the width of this partition.\n\n Returns\n -------\n int\n The width of the partition.\n \"\"\"\n if self._width_cache is None:\n if self.axis == 1:\n self._width_cache = sum(\n obj.width() for obj in self.list_of_block_partitions\n )\n else:\n self._width_cache = self.list_of_block_partitions[0].width()\n return self._width_cache\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.add_to_apply_calls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/axis_partition.py_PandasDataframeAxisPartition.add_to_apply_calls_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 606, "end_line": 635, "span_ids": ["PandasDataframeAxisPartition.add_to_apply_calls"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframeAxisPartition(BaseDataframeAxisPartition):\n\n def add_to_apply_calls(self, func, *args, length=None, width=None, **kwargs):\n \"\"\"\n Add a function to the call queue.\n\n Parameters\n ----------\n func : callable or a future type\n Function to be added to the call queue.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n length : A future type or int, optional\n Length, or reference to it, of wrapped ``pandas.DataFrame``.\n width : A future type or int, optional\n Width, or reference to it, of wrapped ``pandas.DataFrame``.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasDataframeAxisPartition\n A new ``PandasDataframeAxisPartition`` object.\n \"\"\"\n return type(self)(\n self.list_of_block_partitions,\n full_axis=self.full_axis,\n call_queue=self.call_queue + [[func, args, kwargs]],\n length=length,\n width=width,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_from_abc_import_ABC_PandasDataframePartition.__constructor__.return.type_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_from_abc_import_ABC_PandasDataframePartition.__constructor__.return.type_self_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 52, "span_ids": ["PandasDataframePartition", "PandasDataframePartition.__constructor__", "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": "from abc import ABC\nfrom copy import copy\nimport logging\nimport uuid\n\nimport pandas\nfrom pandas.api.types import is_scalar\nfrom pandas.util import cache_readonly\n\nfrom modin.pandas.indexing import compute_sliced_len\nfrom modin.core.storage_formats.pandas.utils import length_fn_pandas, width_fn_pandas\nfrom modin.logging import get_logger\n\n\nclass PandasDataframePartition(ABC): # pragma: no cover\n \"\"\"\n An abstract class that is base for any partition class of ``pandas`` storage format.\n\n The class providing an API that has to be overridden by child classes.\n \"\"\"\n\n _length_cache = None\n _width_cache = None\n _identity_cache = None\n _data = None\n\n @cache_readonly\n def __constructor__(self):\n \"\"\"\n Create a new instance of this object.\n\n Returns\n -------\n PandasDataframePartition\n New instance of pandas partition.\n \"\"\"\n return type(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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.get_PandasDataframePartition.get.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.get_PandasDataframePartition.get.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 74, "span_ids": ["PandasDataframePartition.get"], "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 PandasDataframePartition(ABC):\n\n def get(self):\n \"\"\"\n Get the object wrapped by this partition.\n\n Returns\n -------\n object\n The object that was wrapped by this partition.\n\n Notes\n -----\n This is the opposite of the classmethod `put`.\n E.g. if you assign `x = PandasDataframePartition.put(1)`, `x.get()` should\n always return 1.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.get::{self._identity}\")\n self.drain_call_queue()\n result = self.execution_wrapper.materialize(self._data)\n self._is_debug(log) and log.debug(f\"EXIT::Partition.get::{self._identity}\")\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.list_of_blocks_PandasDataframePartition.apply.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.list_of_blocks_PandasDataframePartition.apply.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 115, "span_ids": ["PandasDataframePartition.apply", "PandasDataframePartition.list_of_blocks"], "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 PandasDataframePartition(ABC):\n\n @property\n def list_of_blocks(self):\n \"\"\"\n Get the list of physical partition objects that compose this partition.\n\n Returns\n -------\n list\n A list of physical partition objects (``ray.ObjectRef``, ``distributed.Future`` e.g.).\n \"\"\"\n # Defer draining call queue until we get the partitions.\n # TODO Look into draining call queue at the same time as the task\n self.drain_call_queue()\n return [self._data]\n\n def apply(self, func, *args, **kwargs):\n \"\"\"\n Apply a function to the object wrapped by this partition.\n\n Parameters\n ----------\n func : callable\n Function to apply.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasDataframePartition\n New `PandasDataframePartition` object.\n\n Notes\n -----\n It is up to the implementation how `kwargs` are handled. They are\n an important part of many implementations. As of right now, they\n are not serialized.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.add_to_apply_calls_PandasDataframePartition.add_to_apply_calls.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.add_to_apply_calls_PandasDataframePartition.add_to_apply_calls.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 149, "span_ids": ["PandasDataframePartition.add_to_apply_calls"], "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 PandasDataframePartition(ABC):\n\n def add_to_apply_calls(self, func, *args, length=None, width=None, **kwargs):\n \"\"\"\n Add a function to the call queue.\n\n Parameters\n ----------\n func : callable\n Function to be added to the call queue.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n length : reference or int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : reference or int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasDataframePartition\n New `PandasDataframePartition` object with the function added to the call queue.\n\n Notes\n -----\n This function will be executed when `apply` is called. It will be executed\n in the order inserted; apply's func operates the last and return.\n \"\"\"\n return self.__constructor__(\n self._data,\n call_queue=self.call_queue + [[func, args, kwargs]],\n length=length,\n width=width,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.drain_call_queue_PandasDataframePartition.to_pandas.return.dataframe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.drain_call_queue_PandasDataframePartition.to_pandas.return.dataframe", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 174, "span_ids": ["PandasDataframePartition.wait", "PandasDataframePartition.to_pandas", "PandasDataframePartition.drain_call_queue"], "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 PandasDataframePartition(ABC):\n\n def drain_call_queue(self):\n \"\"\"Execute all operations stored in the call queue on the object wrapped by this partition.\"\"\"\n pass\n\n def wait(self):\n \"\"\"Wait for completion of computations on the object wrapped by the partition.\"\"\"\n pass\n\n def to_pandas(self):\n \"\"\"\n Convert the object wrapped by this partition to a ``pandas.DataFrame``.\n\n Returns\n -------\n pandas.DataFrame\n\n Notes\n -----\n If the underlying object is a pandas DataFrame, this will likely\n only need to call `get`.\n \"\"\"\n dataframe = self.get()\n assert isinstance(dataframe, (pandas.DataFrame, pandas.Series))\n return dataframe", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.to_numpy_PandasDataframePartition._iloc.return.df_iloc_row_labels_col_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.to_numpy_PandasDataframePartition._iloc.return.df_iloc_row_labels_col_l", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 199, "span_ids": ["PandasDataframePartition._iloc", "PandasDataframePartition.to_numpy"], "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 PandasDataframePartition(ABC):\n\n def to_numpy(self, **kwargs):\n \"\"\"\n Convert the object wrapped by this partition to a NumPy array.\n\n Parameters\n ----------\n **kwargs : dict\n Additional keyword arguments to be passed in ``to_numpy``.\n\n Returns\n -------\n np.ndarray\n\n Notes\n -----\n If the underlying object is a pandas DataFrame, this will return\n a 2D NumPy array.\n \"\"\"\n return self.apply(lambda df, **kwargs: df.to_numpy(**kwargs)).get()\n\n @staticmethod\n def _iloc(df, row_labels, col_labels): # noqa: RT01, PR01\n \"\"\"Perform `iloc` on dataframes wrapped in partitions (helper function).\"\"\"\n return df.iloc[row_labels, col_labels]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.mask_PandasDataframePartition.mask.return.new_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.mask_PandasDataframePartition.mask.return.new_obj", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 201, "end_line": 251, "span_ids": ["PandasDataframePartition.mask"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartition(ABC):\n\n def mask(self, row_labels, col_labels):\n \"\"\"\n Lazily create a mask that extracts the indices provided.\n\n Parameters\n ----------\n row_labels : list-like, slice or label\n The row labels for the rows to extract.\n col_labels : list-like, slice or label\n The column labels for the columns to extract.\n\n Returns\n -------\n PandasDataframePartition\n New `PandasDataframePartition` object.\n \"\"\"\n\n def is_full_axis_mask(index, axis_length):\n \"\"\"Check whether `index` mask grabs `axis_length` amount of elements.\"\"\"\n if isinstance(index, slice):\n return index == slice(None) or (\n isinstance(axis_length, int)\n and compute_sliced_len(index, axis_length) == axis_length\n )\n return (\n hasattr(index, \"__len__\")\n and isinstance(axis_length, int)\n and len(index) == axis_length\n )\n\n row_labels = [row_labels] if is_scalar(row_labels) else row_labels\n col_labels = [col_labels] if is_scalar(col_labels) else col_labels\n\n if is_full_axis_mask(row_labels, self._length_cache) and is_full_axis_mask(\n col_labels, self._width_cache\n ):\n return copy(self)\n\n new_obj = self.add_to_apply_calls(self._iloc, row_labels, col_labels)\n\n def try_recompute_cache(indices, previous_cache):\n \"\"\"Compute new axis-length cache for the masked frame based on its previous cache.\"\"\"\n if not isinstance(indices, slice):\n return len(indices)\n if not isinstance(previous_cache, int):\n return None\n return compute_sliced_len(indices, previous_cache)\n\n new_obj._length_cache = try_recompute_cache(row_labels, self._length_cache)\n new_obj._width_cache = try_recompute_cache(col_labels, self._width_cache)\n return new_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.put_PandasDataframePartition.preprocess_func.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.put_PandasDataframePartition.preprocess_func.pass", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 292, "span_ids": ["PandasDataframePartition.put", "PandasDataframePartition.preprocess_func"], "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 PandasDataframePartition(ABC):\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Put an object into a store and wrap it with partition object.\n\n Parameters\n ----------\n obj : object\n An object to be put.\n\n Returns\n -------\n PandasDataframePartition\n New `PandasDataframePartition` object.\n \"\"\"\n pass\n\n @classmethod\n def preprocess_func(cls, func):\n \"\"\"\n Preprocess a function before an `apply` call.\n\n Parameters\n ----------\n func : callable\n Function to preprocess.\n\n Returns\n -------\n callable\n An object that can be accepted by `apply`.\n\n Notes\n -----\n This is a classmethod because the definition of how to preprocess\n should be class-wide. Also, we may want to use this before we\n deploy a preprocessed function to multiple `PandasDataframePartition`\n objects.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition._length_extraction_fn_PandasDataframePartition._width_extraction_fn.return.width_fn_pandas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition._length_extraction_fn_PandasDataframePartition._width_extraction_fn.return.width_fn_pandas", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 294, "end_line": 316, "span_ids": ["PandasDataframePartition._width_extraction_fn", "PandasDataframePartition._length_extraction_fn"], "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 PandasDataframePartition(ABC):\n\n @classmethod\n def _length_extraction_fn(cls):\n \"\"\"\n Return the function that computes the length of the object wrapped by this partition.\n\n Returns\n -------\n callable\n The function that computes the length of the object wrapped by this partition.\n \"\"\"\n return length_fn_pandas\n\n @classmethod\n def _width_extraction_fn(cls):\n \"\"\"\n Return the function that computes the width of the object wrapped by this partition.\n\n Returns\n -------\n callable\n The function that computes the width of the object wrapped by this partition.\n \"\"\"\n return width_fn_pandas", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.length_PandasDataframePartition.length.return.self__length_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.length_PandasDataframePartition.length.return.self__length_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 318, "end_line": 336, "span_ids": ["PandasDataframePartition.length"], "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 PandasDataframePartition(ABC):\n\n def length(self, materialize=True):\n \"\"\"\n Get the length of the object wrapped by this partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or its Future\n The length of the object.\n \"\"\"\n if self._length_cache is None:\n self._length_cache = self.apply(self._length_extraction_fn()).get()\n return self._length_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.width_PandasDataframePartition._identity.return.self__identity_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.width_PandasDataframePartition._identity.return.self__identity_cache", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 338, "end_line": 369, "span_ids": ["PandasDataframePartition.width", "PandasDataframePartition._identity"], "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 PandasDataframePartition(ABC):\n\n def width(self, materialize=True):\n \"\"\"\n Get the width of the object wrapped by the partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or its Future\n The width of the object.\n \"\"\"\n if self._width_cache is None:\n self._width_cache = self.apply(self._width_extraction_fn()).get()\n return self._width_cache\n\n @property\n def _identity(self):\n \"\"\"\n Calculate identifier on request for debug logging mode.\n\n Returns\n -------\n str\n \"\"\"\n if self._identity_cache is None:\n self._identity_cache = uuid.uuid4().hex\n return self._identity_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.split_PandasDataframePartition.split.return._self___constructor___out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.split_PandasDataframePartition.split.return._self___constructor___out", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 371, "end_line": 398, "span_ids": ["PandasDataframePartition.split"], "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 PandasDataframePartition(ABC):\n\n def split(self, split_func, num_splits, *args):\n \"\"\"\n Split the object wrapped by the partition into multiple partitions.\n\n Parameters\n ----------\n split_func : Callable[pandas.DataFrame, List[Any]] -> List[pandas.DataFrame]\n The function that will split this partition into multiple partitions. The list contains\n pivots to split by, and will have the same dtype as the major column we are shuffling on.\n num_splits : int\n The number of resulting partitions (may be empty).\n *args : List[Any]\n Arguments to pass to ``split_func``.\n\n Returns\n -------\n list\n A list of partitions.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.split::{self._identity}\")\n\n self._is_debug(log) and log.debug(f\"SUBMIT::_split_df::{self._identity}\")\n outputs = self.execution_wrapper.deploy(\n split_func, [self._data] + list(args), num_returns=num_splits\n )\n self._is_debug(log) and log.debug(f\"EXIT::Partition.split::{self._identity}\")\n return [self.__constructor__(output) for output in outputs]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.empty_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition.py_PandasDataframePartition.empty_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 431, "span_ids": ["PandasDataframePartition.empty", "PandasDataframePartition._is_debug"], "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 PandasDataframePartition(ABC):\n\n @classmethod\n def empty(cls):\n \"\"\"\n Create a new partition that wraps an empty pandas DataFrame.\n\n Returns\n -------\n PandasDataframePartition\n New `PandasDataframePartition` object.\n \"\"\"\n return cls.put(pandas.DataFrame(), 0, 0)\n\n def _is_debug(self, logger=None):\n \"\"\"\n Check that the logger is set to debug mode.\n\n Parameters\n ----------\n logger : logging.logger, optional\n Logger obtained from Modin's `get_logger` utility.\n Explicit transmission of this parameter can be used in the case\n when within the context of `_is_debug` call there was already\n `get_logger` call. This is an optimization.\n\n Returns\n -------\n bool\n \"\"\"\n if logger is None:\n logger = get_logger()\n return logger.isEnabledFor(logging.DEBUG)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_from_abc_import_ABC_wait_computations_if_benchmark_mode.return.wait": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_from_abc_import_ABC_wait_computations_if_benchmark_mode.return.wait", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 76, "span_ids": ["wait_computations_if_benchmark_mode", "docstring"], "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": "from abc import ABC\nfrom functools import wraps\nimport numpy as np\nimport pandas\nfrom pandas._libs.lib import no_default\nimport warnings\n\nfrom modin.error_message import ErrorMessage\nfrom modin.core.storage_formats.pandas.utils import compute_chunksize\nfrom modin.core.dataframe.pandas.utils import concatenate\nfrom modin.config import NPartitions, ProgressBar, BenchmarkMode\nfrom modin.logging import ClassLogger\n\nimport os\n\n\ndef wait_computations_if_benchmark_mode(func):\n \"\"\"\n Make sure a `func` finished its computations in benchmark mode.\n\n Parameters\n ----------\n func : callable\n A function that should be performed in syncronous mode.\n\n Returns\n -------\n callable\n Wrapped function that executes eagerly (if benchmark mode) or original `func`.\n\n Notes\n -----\n `func` should return NumPy array with partitions.\n \"\"\"\n\n @wraps(func)\n def wait(cls, *args, **kwargs):\n \"\"\"Wait for computation results.\"\"\"\n result = func(cls, *args, **kwargs)\n if BenchmarkMode.get():\n if isinstance(result, tuple):\n partitions = result[0]\n else:\n partitions = result\n # When partitions have a deferred call queue, calling\n # partition.wait() on each partition serially will serially kick\n # off each deferred computation and wait for each partition to\n # finish before kicking off the next one. Instead, we want to\n # serially kick off all the deferred computations so that they can\n # all run asynchronously, then wait on all the results.\n cls.finalize(partitions)\n # The partition manager invokes the relevant .wait() method under\n # the hood, which should wait in parallel for all computations to finish\n cls.wait_partitions(partitions.flatten())\n return result\n\n return wait", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager_PandasDataframePartitionManager.preprocess_func.return.cls__partition_class_prep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager_PandasDataframePartitionManager.preprocess_func.return.cls__partition_class_prep", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 120, "span_ids": ["PandasDataframePartitionManager.preprocess_func", "PandasDataframePartitionManager"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n \"\"\"\n Base class for managing the dataframe data layout and operators across the distribution of partitions.\n\n Partition class is the class to use for storing each partition.\n Each partition must extend the `PandasDataframePartition` class.\n \"\"\"\n\n _partition_class = None\n # Column partitions class is the class to use to create the column partitions.\n _column_partitions_class = None\n # Row partitions class is the class to use to create the row partitions.\n _row_partition_class = None\n\n @classmethod\n def preprocess_func(cls, map_func):\n \"\"\"\n Preprocess a function to be applied to `PandasDataframePartition` objects.\n\n Parameters\n ----------\n map_func : callable\n The function to be preprocessed.\n\n Returns\n -------\n callable\n The preprocessed version of the `map_func` provided.\n\n Notes\n -----\n Preprocessing does not require any specific format, only that the\n `PandasDataframePartition.apply` method will recognize it (for the subclass\n being used).\n\n If your `PandasDataframePartition` objects assume that a function provided\n is serialized or wrapped or in some other format, this is the place\n to add that logic. It is possible that this can also just return\n `map_func` if the `apply` method of the `PandasDataframePartition` object\n you are using does not require any modification to a given function.\n \"\"\"\n return cls._partition_class.preprocess_func(map_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._END_Abstract_Methods_PandasDataframePartitionManager.column_partitions.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._END_Abstract_Methods_PandasDataframePartitionManager.column_partitions.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 152, "span_ids": ["PandasDataframePartitionManager.preprocess_func", "PandasDataframePartitionManager.column_partitions"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n # END Abstract Methods\n\n @classmethod\n def column_partitions(cls, partitions, full_axis=True):\n \"\"\"\n Get the list of `BaseDataframeAxisPartition` objects representing column-wise partitions.\n\n Parameters\n ----------\n partitions : list-like\n List of (smaller) partitions to be combined to column-wise partitions.\n full_axis : bool, default: True\n Whether or not this partition contains the entire column axis.\n\n Returns\n -------\n list\n A list of `BaseDataframeAxisPartition` objects.\n\n Notes\n -----\n Each value in this list will be an `BaseDataframeAxisPartition` object.\n `BaseDataframeAxisPartition` is located in `axis_partition.py`.\n \"\"\"\n if not isinstance(partitions, list):\n partitions = [partitions]\n return [\n cls._column_partitions_class(col, full_axis=full_axis)\n for frame in partitions\n for col in frame.T\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.row_partitions_PandasDataframePartitionManager.row_partitions.return._cls__row_partition_class": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.row_partitions_PandasDataframePartitionManager.row_partitions.return._cls__row_partition_class", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 176, "span_ids": ["PandasDataframePartitionManager.row_partitions"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def row_partitions(cls, partitions):\n \"\"\"\n List of `BaseDataframeAxisPartition` objects representing row-wise partitions.\n\n Parameters\n ----------\n partitions : list-like\n List of (smaller) partitions to be combined to row-wise partitions.\n\n Returns\n -------\n list\n A list of `BaseDataframeAxisPartition` objects.\n\n Notes\n -----\n Each value in this list will an `BaseDataframeAxisPartition` object.\n `BaseDataframeAxisPartition` is located in `axis_partition.py`.\n \"\"\"\n if not isinstance(partitions, list):\n partitions = [partitions]\n return [cls._row_partition_class(row) for frame in partitions for row in frame]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.axis_partition_PandasDataframePartitionManager.axis_partition.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.axis_partition_PandasDataframePartitionManager.axis_partition.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 209, "span_ids": ["PandasDataframePartitionManager.axis_partition"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def axis_partition(cls, partitions, axis, full_axis: bool = True):\n \"\"\"\n Logically partition along given axis (columns or rows).\n\n Parameters\n ----------\n partitions : list-like\n List of partitions to be combined.\n axis : {0, 1}\n 0 for column partitions, 1 for row partitions.\n full_axis : bool, default: True\n Whether or not this partition contains the entire column axis.\n\n Returns\n -------\n list\n A list of `BaseDataframeAxisPartition` objects.\n \"\"\"\n make_column_partitions = axis == 0\n if not full_axis and not make_column_partitions:\n raise NotImplementedError(\n (\n \"Row partitions must contain the entire axis. We don't \"\n + \"support virtual partitioning for row partitions yet.\"\n )\n )\n return (\n cls.column_partitions(partitions)\n if make_column_partitions\n else cls.row_partitions(partitions)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.groupby_reduce_PandasDataframePartitionManager.groupby_reduce.return.cls_map_axis_partitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.groupby_reduce_PandasDataframePartitionManager.groupby_reduce.return.cls_map_axis_partitions_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 251, "span_ids": ["PandasDataframePartitionManager.groupby_reduce"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def groupby_reduce(\n cls, axis, partitions, by, map_func, reduce_func, apply_indices=None\n ):\n \"\"\"\n Groupby data using the `map_func` provided along the `axis` over the `partitions` then reduce using `reduce_func`.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to groupby over.\n partitions : NumPy 2D array\n Partitions of the ModinFrame to groupby.\n by : NumPy 2D array\n Partitions of 'by' to broadcast.\n map_func : callable\n Map function.\n reduce_func : callable,\n Reduce function.\n apply_indices : list of ints, default: None\n Indices of `axis ^ 1` to apply function over.\n\n Returns\n -------\n NumPy array\n Partitions with applied groupby.\n \"\"\"\n if apply_indices is not None:\n partitions = (\n partitions[apply_indices] if axis else partitions[:, apply_indices]\n )\n\n if by is not None:\n mapped_partitions = cls.broadcast_apply(\n axis, map_func, left=partitions, right=by\n )\n else:\n mapped_partitions = cls.map_partitions(partitions, map_func)\n return cls.map_axis_partitions(\n axis, mapped_partitions, reduce_func, enumerate_partitions=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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_apply_select_indices_PandasDataframePartitionManager.broadcast_apply_select_indices.return.new_partitions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_apply_select_indices_PandasDataframePartitionManager.broadcast_apply_select_indices.return.new_partitions", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 331, "span_ids": ["PandasDataframePartitionManager.broadcast_apply_select_indices"], "tokens": 568}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def broadcast_apply_select_indices(\n cls,\n axis,\n apply_func,\n left,\n right,\n left_indices,\n right_indices,\n keep_remaining=False,\n ):\n \"\"\"\n Broadcast the `right` partitions to `left` and apply `apply_func` to selected indices.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to apply and broadcast over.\n apply_func : callable\n Function to apply.\n left : NumPy 2D array\n Left partitions.\n right : NumPy 2D array\n Right partitions.\n left_indices : list-like\n Indices to apply function to.\n right_indices : dictionary of indices of right partitions\n Indices that you want to bring at specified left partition, for example\n dict {key: {key1: [0, 1], key2: [5]}} means that in left[key] you want to\n broadcast [right[key1], right[key2]] partitions and internal indices\n for `right` must be [[0, 1], [5]].\n keep_remaining : bool, default: False\n Whether or not to keep the other partitions.\n Some operations may want to drop the remaining partitions and\n keep only the results.\n\n Returns\n -------\n NumPy array\n An array of partition objects.\n\n Notes\n -----\n Your internal function must take these kwargs:\n [`internal_indices`, `other`, `internal_other_indices`] to work correctly!\n \"\"\"\n if not axis:\n partitions_for_apply = left.T\n right = right.T\n else:\n partitions_for_apply = left\n\n [obj.drain_call_queue() for row in right for obj in row]\n\n def get_partitions(index):\n \"\"\"Grab required partitions and indices from `right` and `right_indices`.\"\"\"\n must_grab = right_indices[index]\n partitions_list = np.array([right[i] for i in must_grab.keys()])\n indices_list = list(must_grab.values())\n return {\"other\": partitions_list, \"internal_other_indices\": indices_list}\n\n new_partitions = np.array(\n [\n partitions_for_apply[i]\n if i not in left_indices\n else cls._apply_func_to_list_of_partitions_broadcast(\n apply_func,\n partitions_for_apply[i],\n internal_indices=left_indices[i],\n **get_partitions(i),\n )\n for i in range(len(partitions_for_apply))\n if i in left_indices or keep_remaining\n ]\n )\n if not axis:\n new_partitions = new_partitions.T\n return new_partitions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_apply_PandasDataframePartitionManager.broadcast_apply.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_apply_PandasDataframePartitionManager.broadcast_apply.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 384, "span_ids": ["PandasDataframePartitionManager.broadcast_apply"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def broadcast_apply(cls, axis, apply_func, left, right):\n \"\"\"\n Broadcast the `right` partitions to `left` and apply `apply_func` function.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to apply and broadcast over.\n apply_func : callable\n Function to apply.\n left : np.ndarray\n NumPy array of left partitions.\n right : np.ndarray\n NumPy array of right partitions.\n\n Returns\n -------\n np.ndarray\n NumPy array of result partition objects.\n\n Notes\n -----\n This will often be overridden by implementations. It materializes the\n entire partitions of the right and applies them to the left through `apply`.\n \"\"\"\n\n def map_func(df, *others):\n other = (\n pandas.concat(others, axis=axis ^ 1) if len(others) > 1 else others[0]\n )\n return apply_func(df, other)\n\n map_func = cls.preprocess_func(map_func)\n rt_axis_parts = cls.axis_partition(right, axis ^ 1)\n return np.array(\n [\n [\n part.apply(\n map_func,\n *(\n rt_axis_parts[col_idx].list_of_blocks\n if axis\n else rt_axis_parts[row_idx].list_of_blocks\n ),\n )\n for col_idx, part in enumerate(left[row_idx])\n ]\n for row_idx in range(len(left))\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_axis_partitions_PandasDataframePartitionManager.broadcast_axis_partitions._For_mapping_across_the_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_axis_partitions_PandasDataframePartitionManager.broadcast_axis_partitions._For_mapping_across_the_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 386, "end_line": 465, "span_ids": ["PandasDataframePartitionManager.broadcast_axis_partitions"], "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": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def broadcast_axis_partitions(\n cls,\n axis,\n apply_func,\n left,\n right,\n keep_partitioning=False,\n num_splits=None,\n apply_indices=None,\n enumerate_partitions=False,\n lengths=None,\n apply_func_args=None,\n **kwargs,\n ):\n \"\"\"\n Broadcast the `right` partitions to `left` and apply `apply_func` along full `axis`.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to apply and broadcast over.\n apply_func : callable\n Function to apply.\n left : NumPy 2D array\n Left partitions.\n right : NumPy 2D array\n Right partitions.\n keep_partitioning : boolean, default: False\n The flag to keep partition boundaries for Modin Frame if possible.\n Setting it to True disables shuffling data from one partition to another in case the resulting\n number of splits is equal to the initial number of splits.\n num_splits : int, optional\n The number of partitions to split the result into across the `axis`. If None, then the number\n of splits will be infered automatically. If `num_splits` is None and `keep_partitioning=True`\n then the number of splits is preserved.\n apply_indices : list of ints, default: None\n Indices of `axis ^ 1` to apply function over.\n enumerate_partitions : bool, default: False\n Whether or not to pass partition index into `apply_func`.\n Note that `apply_func` must be able to accept `partition_idx` kwarg.\n lengths : list of ints, default: None\n The list of lengths to shuffle the object. Note:\n 1. Passing `lengths` omits the `num_splits` parameter as the number of splits\n will now be inferred from the number of integers present in `lengths`.\n 2. When passing lengths you must explicitly specify `keep_partitioning=False`.\n apply_func_args : list-like, optional\n Positional arguments to pass to the `func`.\n **kwargs : dict\n Additional options that could be used by different engines.\n\n Returns\n -------\n NumPy array\n An array of partition objects.\n \"\"\"\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=keep_partitioning and lengths is not None,\n extra_log=f\"`keep_partitioning` must be set to `False` when passing `lengths`. Got: {keep_partitioning=} | {lengths=}\",\n )\n\n # Since we are already splitting the DataFrame back up after an\n # operation, we will just use this time to compute the number of\n # partitions as best we can right now.\n if keep_partitioning and num_splits is None:\n num_splits = len(left) if axis == 0 else len(left.T)\n elif lengths:\n num_splits = len(lengths)\n elif num_splits is None:\n num_splits = NPartitions.get()\n else:\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=not isinstance(num_splits, int),\n extra_log=f\"Expected `num_splits` to be an integer, got: {type(num_splits)} | {num_splits=}\",\n )\n preprocessed_map_func = cls.preprocess_func(apply_func)\n left_partitions = cls.axis_partition(left, axis)\n right_partitions = None if right is None else cls.axis_partition(right, axis)\n # For mapping across the entire axis, we don't maintain partitioning because we\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_axis_partitions._may_want_to_line_to_par_PandasDataframePartitionManager.broadcast_axis_partitions.return.result_blocks_T_if_not_ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.broadcast_axis_partitions._may_want_to_line_to_par_PandasDataframePartitionManager.broadcast_axis_partitions.return.result_blocks_T_if_not_ax", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 496, "span_ids": ["PandasDataframePartitionManager.broadcast_axis_partitions"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def broadcast_axis_partitions(\n cls,\n axis,\n apply_func,\n left,\n right,\n keep_partitioning=False,\n num_splits=None,\n apply_indices=None,\n enumerate_partitions=False,\n lengths=None,\n apply_func_args=None,\n **kwargs,\n ):\n # may want to line to partitioning up with another BlockPartitions object. Since\n # we don't need to maintain the partitioning, this gives us the opportunity to\n # load-balance the data as well.\n kw = {\n \"num_splits\": num_splits,\n \"other_axis_partition\": right_partitions,\n \"maintain_partitioning\": keep_partitioning,\n }\n if lengths:\n kw[\"lengths\"] = lengths\n kw[\"manual_partition\"] = True\n\n if apply_indices is None:\n apply_indices = np.arange(len(left_partitions))\n\n result_blocks = np.array(\n [\n left_partitions[i].apply(\n preprocessed_map_func,\n *(apply_func_args if apply_func_args else []),\n **kw,\n **({\"partition_idx\": idx} if enumerate_partitions else {}),\n **kwargs,\n )\n for idx, i in enumerate(apply_indices)\n ]\n )\n # If we are mapping over columns, they are returned to use the same as\n # rows, so we need to transpose the returned 2D NumPy array to return\n # the structure to the correct order.\n return result_blocks.T if not axis else result_blocks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.map_partitions_PandasDataframePartitionManager.map_partitions.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.map_partitions_PandasDataframePartitionManager.map_partitions.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 498, "end_line": 522, "span_ids": ["PandasDataframePartitionManager.map_partitions"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def map_partitions(cls, partitions, map_func):\n \"\"\"\n Apply `map_func` to every partition in `partitions`.\n\n Parameters\n ----------\n partitions : NumPy 2D array\n Partitions housing the data of Modin Frame.\n map_func : callable\n Function to apply.\n\n Returns\n -------\n NumPy array\n An array of partitions\n \"\"\"\n preprocessed_map_func = cls.preprocess_func(map_func)\n return np.array(\n [\n [part.apply(preprocessed_map_func) for part in row_of_parts]\n for row_of_parts in partitions\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.lazy_map_partitions_PandasDataframePartitionManager.lazy_map_partitions.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.lazy_map_partitions_PandasDataframePartitionManager.lazy_map_partitions.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 524, "end_line": 548, "span_ids": ["PandasDataframePartitionManager.lazy_map_partitions"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def lazy_map_partitions(cls, partitions, map_func):\n \"\"\"\n Apply `map_func` to every partition in `partitions` *lazily*.\n\n Parameters\n ----------\n partitions : NumPy 2D array\n Partitions of Modin Frame.\n map_func : callable\n Function to apply.\n\n Returns\n -------\n NumPy array\n An array of partitions\n \"\"\"\n preprocessed_map_func = cls.preprocess_func(map_func)\n return np.array(\n [\n [part.add_to_apply_calls(preprocessed_map_func) for part in row]\n for row in partitions\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.map_axis_partitions_PandasDataframePartitionManager.map_axis_partitions.return.cls_broadcast_axis_partit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.map_axis_partitions_PandasDataframePartitionManager.map_axis_partitions.return.cls_broadcast_axis_partit", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 612, "span_ids": ["PandasDataframePartitionManager.map_axis_partitions"], "tokens": 514}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def map_axis_partitions(\n cls,\n axis,\n partitions,\n map_func,\n keep_partitioning=False,\n num_splits=None,\n lengths=None,\n enumerate_partitions=False,\n **kwargs,\n ):\n \"\"\"\n Apply `map_func` to every partition in `partitions` along given `axis`.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to perform the map across (0 - index, 1 - columns).\n partitions : NumPy 2D array\n Partitions of Modin Frame.\n map_func : callable\n Function to apply.\n keep_partitioning : boolean, default: False\n The flag to keep partition boundaries for Modin Frame if possible.\n Setting it to True disables shuffling data from one partition to another in case the resulting\n number of splits is equal to the initial number of splits.\n num_splits : int, optional\n The number of partitions to split the result into across the `axis`. If None, then the number\n of splits will be infered automatically. If `num_splits` is None and `keep_partitioning=True`\n then the number of splits is preserved.\n lengths : list of ints, default: None\n The list of lengths to shuffle the object. Note:\n 1. Passing `lengths` omits the `num_splits` parameter as the number of splits\n will now be inferred from the number of integers present in `lengths`.\n 2. When passing lengths you must explicitly specify `keep_partitioning=False`.\n enumerate_partitions : bool, default: False\n Whether or not to pass partition index into `map_func`.\n Note that `map_func` must be able to accept `partition_idx` kwarg.\n **kwargs : dict\n Additional options that could be used by different engines.\n\n Returns\n -------\n NumPy array\n An array of new partitions for Modin Frame.\n\n Notes\n -----\n This method should be used in the case when `map_func` relies on\n some global information about the axis.\n \"\"\"\n return cls.broadcast_axis_partitions(\n axis=axis,\n left=partitions,\n apply_func=map_func,\n keep_partitioning=keep_partitioning,\n num_splits=num_splits,\n right=None,\n lengths=lengths,\n enumerate_partitions=enumerate_partitions,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.concat_PandasDataframePartitionManager.concat.if_axis_0_.else_.return.result_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.concat_PandasDataframePartitionManager.concat.if_axis_0_.else_.return.result_None", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 614, "end_line": 658, "span_ids": ["PandasDataframePartitionManager.concat"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def concat(cls, axis, left_parts, right_parts):\n \"\"\"\n Concatenate the blocks of partitions with another set of blocks.\n\n Parameters\n ----------\n axis : int\n The axis to concatenate to.\n left_parts : np.ndarray\n NumPy array of partitions to concatenate with.\n right_parts : np.ndarray or list\n NumPy array of partitions to be concatenated.\n\n Returns\n -------\n np.ndarray\n A new NumPy array with concatenated partitions.\n list[int] or None\n Row lengths if possible to compute it.\n\n Notes\n -----\n Assumes that the blocks are already the same shape on the\n dimension being concatenated. A ValueError will be thrown if this\n condition is not met.\n \"\"\"\n # TODO: Possible change is `isinstance(right_parts, list)`\n if type(right_parts) is list:\n # `np.array` with partitions of empty ModinFrame has a shape (0,)\n # but `np.concatenate` can concatenate arrays only if its shapes at\n # specified axis are equals, so filtering empty frames to avoid concat error\n right_parts = [o for o in right_parts if o.size != 0]\n to_concat = (\n [left_parts] + right_parts if left_parts.size != 0 else right_parts\n )\n result = (\n np.concatenate(to_concat, axis=axis) if len(to_concat) else left_parts\n )\n else:\n result = np.append(left_parts, right_parts, axis=axis)\n if axis == 0:\n return cls.rebalance_partitions(result)\n else:\n return result, 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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.to_pandas_PandasDataframePartitionManager.to_pandas.if_len_df_rows_0_.else_.return.concatenate_df_rows_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.to_pandas_PandasDataframePartitionManager.to_pandas.if_len_df_rows_0_.else_.return.concatenate_df_rows_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 660, "end_line": 719, "span_ids": ["PandasDataframePartitionManager.to_pandas"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def to_pandas(cls, partitions):\n \"\"\"\n Convert NumPy array of PandasDataframePartition to pandas DataFrame.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array of PandasDataframePartition.\n\n Returns\n -------\n pandas.DataFrame\n A pandas DataFrame\n \"\"\"\n retrieved_objects = cls.get_objects_from_partitions(partitions.flatten())\n if all(\n isinstance(obj, (pandas.DataFrame, pandas.Series))\n for obj in retrieved_objects\n ):\n height, width, *_ = tuple(partitions.shape) + (0,)\n # restore 2d array\n objs = iter(retrieved_objects)\n retrieved_objects = [\n [next(objs) for _ in range(width)] for __ in range(height)\n ]\n else:\n # Partitions do not always contain pandas objects, for example, hdk uses pyarrow tables.\n # This implementation comes from the fact that calling `partition.get`\n # function is not always equivalent to `partition.to_pandas`.\n retrieved_objects = [\n [obj.to_pandas() for obj in part] for part in partitions\n ]\n if all(\n isinstance(part, pandas.Series) for row in retrieved_objects for part in row\n ):\n axis = 0\n elif all(\n isinstance(part, pandas.DataFrame)\n for row in retrieved_objects\n for part in row\n ):\n axis = 1\n else:\n ErrorMessage.catch_bugs_and_request_email(True)\n\n def is_part_empty(part):\n return part.empty and (\n not isinstance(part, pandas.DataFrame) or (len(part.columns) == 0)\n )\n\n df_rows = [\n pandas.concat([part for part in row], axis=axis)\n for row in retrieved_objects\n if not all(is_part_empty(part) for part in row)\n ]\n if len(df_rows) == 0:\n return pandas.DataFrame()\n else:\n return concatenate(df_rows)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.to_numpy_PandasDataframePartitionManager.to_numpy.return.np_block_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.to_numpy_PandasDataframePartitionManager.to_numpy.return.np_block_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 721, "end_line": 740, "span_ids": ["PandasDataframePartitionManager.to_numpy"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def to_numpy(cls, partitions, **kwargs):\n \"\"\"\n Convert NumPy array of PandasDataframePartition to NumPy array of data stored within `partitions`.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array of PandasDataframePartition.\n **kwargs : dict\n Keyword arguments for PandasDataframePartition.to_numpy function.\n\n Returns\n -------\n np.ndarray\n A NumPy array.\n \"\"\"\n return np.block(\n [[block.to_numpy(**kwargs) for block in row] for row in partitions]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.from_pandas_PandasDataframePartitionManager.from_pandas.if_not_return_dims_.else_.return.np_array_parts_row_leng": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.from_pandas_PandasDataframePartitionManager.from_pandas.if_not_return_dims_.else_.return.np_array_parts_row_leng", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 742, "end_line": 822, "span_ids": ["PandasDataframePartitionManager.from_pandas"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def from_pandas(cls, df, return_dims=False):\n \"\"\"\n Return the partitions from pandas.DataFrame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A pandas.DataFrame.\n return_dims : bool, default: False\n If it's True, return as (np.ndarray, row_lengths, col_widths),\n else np.ndarray.\n\n Returns\n -------\n np.ndarray or (np.ndarray, row_lengths, col_widths)\n A NumPy array with partitions (with dimensions or not).\n \"\"\"\n\n def update_bar(pbar, f):\n if ProgressBar.get():\n pbar.update(1)\n return f\n\n num_splits = NPartitions.get()\n put_func = cls._partition_class.put\n row_chunksize = compute_chunksize(df.shape[0], num_splits)\n col_chunksize = compute_chunksize(df.shape[1], num_splits)\n\n bar_format = (\n \"{l_bar}{bar}{r_bar}\"\n if os.environ.get(\"DEBUG_PROGRESS_BAR\", \"False\") == \"True\"\n else \"{desc}: {percentage:3.0f}%{bar} Elapsed time: {elapsed}, estimated remaining time: {remaining}\"\n )\n if ProgressBar.get():\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n try:\n from tqdm.autonotebook import tqdm as tqdm_notebook\n except ImportError:\n raise ImportError(\"Please pip install tqdm to use the progress bar\")\n\n rows = max(1, round(len(df) / row_chunksize))\n cols = max(1, round(len(df.columns) / col_chunksize))\n update_count = rows * cols\n pbar = tqdm_notebook(\n total=round(update_count),\n desc=\"Distributing Dataframe\",\n bar_format=bar_format,\n )\n else:\n pbar = None\n parts = [\n [\n update_bar(\n pbar,\n put_func(df.iloc[i : i + row_chunksize, j : j + col_chunksize]),\n )\n for j in range(0, len(df.columns), col_chunksize)\n ]\n for i in range(0, len(df), row_chunksize)\n ]\n if ProgressBar.get():\n pbar.close()\n if not return_dims:\n return np.array(parts)\n else:\n row_lengths = [\n row_chunksize\n if i + row_chunksize < len(df)\n else len(df) % row_chunksize or row_chunksize\n for i in range(0, len(df), row_chunksize)\n ]\n col_widths = [\n col_chunksize\n if i + col_chunksize < len(df.columns)\n else len(df.columns) % col_chunksize or col_chunksize\n for i in range(0, len(df.columns), col_chunksize)\n ]\n return np.array(parts), row_lengths, col_widths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.from_arrow_PandasDataframePartitionManager.from_arrow.return.cls_from_pandas_at_to_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.from_arrow_PandasDataframePartitionManager.from_arrow.return.cls_from_pandas_at_to_pan", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 824, "end_line": 842, "span_ids": ["PandasDataframePartitionManager.from_arrow"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def from_arrow(cls, at, return_dims=False):\n \"\"\"\n Return the partitions from Apache Arrow (PyArrow).\n\n Parameters\n ----------\n at : pyarrow.table\n Arrow Table.\n return_dims : bool, default: False\n If it's True, return as (np.ndarray, row_lengths, col_widths),\n else np.ndarray.\n\n Returns\n -------\n np.ndarray or (np.ndarray, row_lengths, col_widths)\n A NumPy array with partitions (with dimensions or not).\n \"\"\"\n return cls.from_pandas(at.to_pandas(), return_dims=return_dims)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.get_objects_from_partitions_PandasDataframePartitionManager.get_objects_from_partitions.return._partition_get_for_part": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.get_objects_from_partitions_PandasDataframePartitionManager.get_objects_from_partitions.return._partition_get_for_part", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 844, "end_line": 870, "span_ids": ["PandasDataframePartitionManager.get_objects_from_partitions"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def get_objects_from_partitions(cls, partitions):\n \"\"\"\n Get the objects wrapped by `partitions` (in parallel if supported).\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``PandasDataframePartition``-s.\n\n Returns\n -------\n list\n The objects wrapped by `partitions`.\n \"\"\"\n if hasattr(cls, \"_execution_wrapper\"):\n # more efficient parallel implementation\n for idx, part in enumerate(partitions):\n if hasattr(part, \"force_materialization\"):\n partitions[idx] = part.force_materialization()\n assert all(\n [len(partition.list_of_blocks) == 1 for partition in partitions]\n ), \"Implementation assumes that each partition contains a single block.\"\n return cls._execution_wrapper.materialize(\n [partition.list_of_blocks[0] for partition in partitions]\n )\n return [partition.get() for partition in partitions]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.wait_partitions_PandasDataframePartitionManager.wait_partitions.for_partition_in_partitio.partition_wait_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.wait_partitions_PandasDataframePartitionManager.wait_partitions.for_partition_in_partitio.partition_wait_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 872, "end_line": 890, "span_ids": ["PandasDataframePartitionManager.wait_partitions"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def wait_partitions(cls, partitions):\n \"\"\"\n Wait on the objects wrapped by `partitions`, without materializing them.\n\n This method will block until all computations in the list have completed.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``PandasDataframePartition``-s.\n\n Notes\n -----\n This method should be implemented in a more efficient way for engines that supports\n waiting on objects in parallel.\n \"\"\"\n for partition in partitions:\n partition.wait()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.get_indices_PandasDataframePartitionManager.get_indices.return.total_idx_new_idx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.get_indices_PandasDataframePartitionManager.get_indices.return.total_idx_new_idx", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 892, "end_line": 940, "span_ids": ["PandasDataframePartitionManager.get_indices"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def get_indices(cls, axis, partitions, index_func=None):\n \"\"\"\n Get the internal indices stored in the partitions.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to extract the labels over.\n partitions : np.ndarray\n NumPy array with PandasDataframePartition's.\n index_func : callable, default: None\n The function to be used to extract the indices.\n\n Returns\n -------\n pandas.Index\n A pandas Index object.\n list of pandas.Index\n The list of internal indices for each partition.\n\n Notes\n -----\n These are the global indices of the object. This is mostly useful\n when you have deleted rows/columns internally, but do not know\n which ones were deleted.\n \"\"\"\n if index_func is None:\n index_func = lambda df: df.axes[axis] # noqa: E731\n ErrorMessage.catch_bugs_and_request_email(not callable(index_func))\n func = cls.preprocess_func(index_func)\n target = partitions.T if axis == 0 else partitions\n if len(target):\n new_idx = [idx.apply(func) for idx in target[0]]\n new_idx = cls.get_objects_from_partitions(new_idx)\n else:\n new_idx = [pandas.Index([])]\n\n # filter empty indexes in case there are multiple partitions\n total_idx = list(filter(len, new_idx))\n if len(total_idx) > 0:\n # TODO FIX INFORMATION LEAK!!!!1!!1!!\n total_idx = total_idx[0].append(total_idx[1:])\n else:\n # Meaning that all partitions returned a zero-length index,\n # in this case, we return an index of any partition to preserve\n # the index's metadata\n total_idx = new_idx[0]\n return total_idx, new_idx", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast_PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast_PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast.return._", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 942, "end_line": 972, "span_ids": ["PandasDataframePartitionManager._apply_func_to_list_of_partitions_broadcast"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def _apply_func_to_list_of_partitions_broadcast(\n cls, func, partitions, other, **kwargs\n ):\n \"\"\"\n Apply a function to a list of remote partitions.\n\n `other` partitions will be broadcasted to `partitions`\n and `func` will be applied.\n\n Parameters\n ----------\n func : callable\n The func to apply.\n partitions : np.ndarray\n The partitions to which the `func` will apply.\n other : np.ndarray\n The partitions to be broadcasted to `partitions`.\n **kwargs : dict\n Keyword arguments for PandasDataframePartition.apply function.\n\n Returns\n -------\n list\n A list of PandasDataframePartition objects.\n \"\"\"\n preprocessed_func = cls.preprocess_func(func)\n return [\n obj.apply(preprocessed_func, other=[o.get() for o in broadcasted], **kwargs)\n for obj, broadcasted in zip(partitions, other.T)\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._apply_func_to_list_of_partitions_PandasDataframePartitionManager._apply_func_to_list_of_partitions.return._obj_apply_preprocessed_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager._apply_func_to_list_of_partitions_PandasDataframePartitionManager._apply_func_to_list_of_partitions.return._obj_apply_preprocessed_f", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 974, "end_line": 998, "span_ids": ["PandasDataframePartitionManager._apply_func_to_list_of_partitions"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def _apply_func_to_list_of_partitions(cls, func, partitions, **kwargs):\n \"\"\"\n Apply a function to a list of remote partitions.\n\n Parameters\n ----------\n func : callable\n The func to apply.\n partitions : np.ndarray\n The partitions to which the `func` will apply.\n **kwargs : dict\n Keyword arguments for PandasDataframePartition.apply function.\n\n Returns\n -------\n list\n A list of PandasDataframePartition objects.\n\n Notes\n -----\n This preprocesses the `func` first before applying it to the partitions.\n \"\"\"\n preprocessed_func = cls.preprocess_func(func)\n return [obj.apply(preprocessed_func, **kwargs) for obj in partitions]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_PandasDataframePartitionManager.apply_func_to_select_indices._accept_a_keyword_argume": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_PandasDataframePartitionManager.apply_func_to_select_indices._accept_a_keyword_argume", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1000, "end_line": 1051, "span_ids": ["PandasDataframePartitionManager.apply_func_to_select_indices"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_select_indices(\n cls, axis, partitions, func, indices, keep_remaining=False\n ):\n \"\"\"\n Apply a function to select indices.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to apply the `func` over.\n partitions : np.ndarray\n The partitions to which the `func` will apply.\n func : callable\n The function to apply to these indices of partitions.\n indices : dict\n The indices to apply the function to.\n keep_remaining : bool, default: False\n Whether or not to keep the other partitions. Some operations\n may want to drop the remaining partitions and keep\n only the results.\n\n Returns\n -------\n np.ndarray\n A NumPy array with partitions.\n\n Notes\n -----\n Your internal function must take a kwarg `internal_indices` for\n this to work correctly. This prevents information leakage of the\n internal index to the external representation.\n \"\"\"\n if partitions.size == 0:\n return np.array([[]])\n # Handling dictionaries has to be done differently, but we still want\n # to figure out the partitions that need to be applied to, so we will\n # store the dictionary in a separate variable and assign `indices` to\n # the keys to handle it the same as we normally would.\n if isinstance(func, dict):\n dict_func = func\n else:\n dict_func = None\n if not axis:\n partitions_for_apply = partitions.T\n else:\n partitions_for_apply = partitions\n # We may have a command to perform different functions on different\n # columns at the same time. We attempt to handle this as efficiently as\n # possible here. Functions that use this in the dictionary format must\n # accept a keyword argument `func_dict`.\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices.if_dict_func_is_not_None__PandasDataframePartitionManager.apply_func_to_select_indices.return.result_T_if_not_axis_else": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices.if_dict_func_is_not_None__PandasDataframePartitionManager.apply_func_to_select_indices.return.result_T_if_not_axis_else", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1052, "end_line": 1112, "span_ids": ["PandasDataframePartitionManager.apply_func_to_select_indices"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_select_indices(\n cls, axis, partitions, func, indices, keep_remaining=False\n ):\n # ... other code\n if dict_func is not None:\n if not keep_remaining:\n result = np.array(\n [\n cls._apply_func_to_list_of_partitions(\n func,\n partitions_for_apply[o_idx],\n func_dict={\n i_idx: dict_func[i_idx]\n for i_idx in list_to_apply\n if i_idx >= 0\n },\n )\n for o_idx, list_to_apply in indices.items()\n ]\n )\n else:\n result = np.array(\n [\n partitions_for_apply[i]\n if i not in indices\n else cls._apply_func_to_list_of_partitions(\n func,\n partitions_for_apply[i],\n func_dict={\n idx: dict_func[idx] for idx in indices[i] if idx >= 0\n },\n )\n for i in range(len(partitions_for_apply))\n ]\n )\n else:\n if not keep_remaining:\n # We are passing internal indices in here. In order for func to\n # actually be able to use this information, it must be able to take in\n # the internal indices. This might mean an iloc in the case of Pandas\n # or some other way to index into the internal representation.\n result = np.array(\n [\n cls._apply_func_to_list_of_partitions(\n func,\n partitions_for_apply[idx],\n internal_indices=list_to_apply,\n )\n for idx, list_to_apply in indices.items()\n ]\n )\n else:\n # The difference here is that we modify a subset and return the\n # remaining (non-updated) blocks in their original position.\n result = np.array(\n [\n partitions_for_apply[i]\n if i not in indices\n else cls._apply_func_to_list_of_partitions(\n func, partitions_for_apply[i], internal_indices=indices[i]\n )\n for i in range(len(partitions_for_apply))\n ]\n )\n return result.T if not axis else 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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis._accept_a_keyword_argume": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis._accept_a_keyword_argume", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1114, "end_line": 1181, "span_ids": ["PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_select_indices_along_full_axis(\n cls, axis, partitions, func, indices, keep_remaining=False\n ):\n \"\"\"\n Apply a function to a select subset of full columns/rows.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to apply the function over.\n partitions : np.ndarray\n The partitions to which the `func` will apply.\n func : callable\n The function to apply.\n indices : list-like\n The global indices to apply the func to.\n keep_remaining : bool, default: False\n Whether or not to keep the other partitions.\n Some operations may want to drop the remaining partitions and\n keep only the results.\n\n Returns\n -------\n np.ndarray\n A NumPy array with partitions.\n\n Notes\n -----\n This should be used when you need to apply a function that relies\n on some global information for the entire column/row, but only need\n to apply a function to a subset.\n For your func to operate directly on the indices provided,\n it must use `internal_indices` as a keyword argument.\n \"\"\"\n if partitions.size == 0:\n return np.array([[]])\n # Handling dictionaries has to be done differently, but we still want\n # to figure out the partitions that need to be applied to, so we will\n # store the dictionary in a separate variable and assign `indices` to\n # the keys to handle it the same as we normally would.\n if isinstance(func, dict):\n dict_func = func\n else:\n dict_func = None\n preprocessed_func = cls.preprocess_func(func)\n # Since we might be keeping the remaining blocks that are not modified,\n # we have to also keep the block_partitions object in the correct\n # direction (transpose for columns).\n if not keep_remaining:\n selected_partitions = partitions.T if not axis else partitions\n selected_partitions = np.array([selected_partitions[i] for i in indices])\n selected_partitions = (\n selected_partitions.T if not axis else selected_partitions\n )\n else:\n selected_partitions = partitions\n if not axis:\n partitions_for_apply = cls.column_partitions(selected_partitions)\n partitions_for_remaining = partitions.T\n else:\n partitions_for_apply = cls.row_partitions(selected_partitions)\n partitions_for_remaining = partitions\n # We may have a command to perform different functions on different\n # columns at the same time. We attempt to handle this as efficiently as\n # possible here. Functions that use this in the dictionary format must\n # accept a keyword argument `func_dict`.\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis.if_dict_func_is_not_None__PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis.return.result_T_if_not_axis_else": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis.if_dict_func_is_not_None__PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis.return.result_T_if_not_axis_else", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1182, "end_line": 1227, "span_ids": ["PandasDataframePartitionManager.apply_func_to_select_indices_along_full_axis"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_select_indices_along_full_axis(\n cls, axis, partitions, func, indices, keep_remaining=False\n ):\n # ... other code\n if dict_func is not None:\n if not keep_remaining:\n result = np.array(\n [\n part.apply(\n preprocessed_func,\n func_dict={idx: dict_func[idx] for idx in indices[i]},\n )\n for i, part in zip(indices, partitions_for_apply)\n ]\n )\n else:\n result = np.array(\n [\n partitions_for_remaining[i]\n if i not in indices\n else cls._apply_func_to_list_of_partitions(\n preprocessed_func,\n partitions_for_apply[i],\n func_dict={idx: dict_func[idx] for idx in indices[i]},\n )\n for i in range(len(partitions_for_apply))\n ]\n )\n else:\n if not keep_remaining:\n # See notes in `apply_func_to_select_indices`\n result = np.array(\n [\n part.apply(preprocessed_func, internal_indices=indices[i])\n for i, part in zip(indices, partitions_for_apply)\n ]\n )\n else:\n # See notes in `apply_func_to_select_indices`\n result = np.array(\n [\n partitions_for_remaining[i]\n if i not in indices\n else partitions_for_apply[i].apply(\n preprocessed_func, internal_indices=indices[i]\n )\n for i in range(len(partitions_for_remaining))\n ]\n )\n return result.T if not axis else 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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis_PandasDataframePartitionManager.apply_func_to_indices_both_axis.if_col_widths_is_None_.col_widths._None_len_col_partitio": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis_PandasDataframePartitionManager.apply_func_to_indices_both_axis.if_col_widths_is_None_.col_widths._None_len_col_partitio", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1229, "end_line": 1284, "span_ids": ["PandasDataframePartitionManager.apply_func_to_indices_both_axis"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_indices_both_axis(\n cls,\n partitions,\n func,\n row_partitions_list,\n col_partitions_list,\n item_to_distribute=no_default,\n row_lengths=None,\n col_widths=None,\n ):\n \"\"\"\n Apply a function along both axes.\n\n Parameters\n ----------\n partitions : np.ndarray\n The partitions to which the `func` will apply.\n func : callable\n The function to apply.\n row_partitions_list : iterable of tuples\n Iterable of tuples, containing 2 values:\n 1. Integer row partition index.\n 2. Internal row indexer of this partition.\n col_partitions_list : iterable of tuples\n Iterable of tuples, containing 2 values:\n 1. Integer column partition index.\n 2. Internal column indexer of this partition.\n item_to_distribute : np.ndarray or scalar, default: no_default\n The item to split up so it can be applied over both axes.\n row_lengths : list of ints, optional\n Lengths of partitions for every row. If not specified this information\n is extracted from partitions itself.\n col_widths : list of ints, optional\n Widths of partitions for every column. If not specified this information\n is extracted from partitions itself.\n\n Returns\n -------\n np.ndarray\n A NumPy array with partitions.\n\n Notes\n -----\n For your func to operate directly on the indices provided,\n it must use `row_internal_indices`, `col_internal_indices` as keyword\n arguments.\n \"\"\"\n partition_copy = partitions.copy()\n row_position_counter = 0\n\n if row_lengths is None:\n row_lengths = [None] * len(row_partitions_list)\n if col_widths is None:\n col_widths = [None] * len(col_partitions_list)\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis.compute_part_size_PandasDataframePartitionManager.apply_func_to_indices_both_axis.compute_part_size.return.len_indexer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis.compute_part_size_PandasDataframePartitionManager.apply_func_to_indices_both_axis.compute_part_size.return.len_indexer_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1286, "end_line": 1297, "span_ids": ["PandasDataframePartitionManager.apply_func_to_indices_both_axis"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_indices_both_axis(\n cls,\n partitions,\n func,\n row_partitions_list,\n col_partitions_list,\n item_to_distribute=no_default,\n row_lengths=None,\n col_widths=None,\n ):\n # ... other code\n\n def compute_part_size(indexer, remote_part, part_idx, axis):\n \"\"\"Compute indexer length along the specified axis for the passed partition.\"\"\"\n if isinstance(indexer, slice):\n shapes_container = row_lengths if axis == 0 else col_widths\n part_size = shapes_container[part_idx]\n if part_size is None:\n part_size = (\n remote_part.length() if axis == 0 else remote_part.width()\n )\n shapes_container[part_idx] = part_size\n indexer = range(*indexer.indices(part_size))\n return len(indexer)\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis.for_row_idx_row_values_i_PandasDataframePartitionManager.apply_func_to_indices_both_axis.return.partition_copy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.apply_func_to_indices_both_axis.for_row_idx_row_values_i_PandasDataframePartitionManager.apply_func_to_indices_both_axis.return.partition_copy", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1299, "end_line": 1334, "span_ids": ["PandasDataframePartitionManager.apply_func_to_indices_both_axis"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def apply_func_to_indices_both_axis(\n cls,\n partitions,\n func,\n row_partitions_list,\n col_partitions_list,\n item_to_distribute=no_default,\n row_lengths=None,\n col_widths=None,\n ):\n # ... other code\n\n for row_idx, row_values in enumerate(row_partitions_list):\n row_blk_idx, row_internal_idx = row_values\n col_position_counter = 0\n row_offset = 0\n for col_idx, col_values in enumerate(col_partitions_list):\n col_blk_idx, col_internal_idx = col_values\n remote_part = partition_copy[row_blk_idx, col_blk_idx]\n\n row_offset = compute_part_size(\n row_internal_idx, remote_part, row_idx, axis=0\n )\n col_offset = compute_part_size(\n col_internal_idx, remote_part, col_idx, axis=1\n )\n\n if item_to_distribute is not no_default:\n if isinstance(item_to_distribute, np.ndarray):\n item = item_to_distribute[\n row_position_counter : row_position_counter + row_offset,\n col_position_counter : col_position_counter + col_offset,\n ]\n else:\n item = item_to_distribute\n item = {\"item\": item}\n else:\n item = {}\n block_result = remote_part.add_to_apply_calls(\n func,\n row_internal_indices=row_internal_idx,\n col_internal_indices=col_internal_idx,\n **item,\n )\n partition_copy[row_blk_idx, col_blk_idx] = block_result\n col_position_counter += col_offset\n row_position_counter += row_offset\n return partition_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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.n_ary_operation_PandasDataframePartitionManager.n_ary_operation.func.cls_preprocess_func_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.n_ary_operation_PandasDataframePartitionManager.n_ary_operation.func.cls_preprocess_func_func_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1336, "end_line": 1361, "span_ids": ["PandasDataframePartitionManager.n_ary_operation"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def n_ary_operation(cls, left, func, right: list):\n r\"\"\"\n Apply an n-ary operation to multiple ``PandasDataframe`` objects.\n\n This method assumes that all the partitions of the dataframes in left\n and right have the same dimensions. For each position i, j in each\n dataframe's partitions, the result has a partition at (i, j) whose data\n is func(left_partitions[i,j], \\*each_right_partitions[i,j]).\n\n Parameters\n ----------\n left : np.ndarray\n The partitions of left ``PandasDataframe``.\n func : callable\n The function to apply.\n right : list of np.ndarray\n The list of partitions of other ``PandasDataframe``.\n\n Returns\n -------\n np.ndarray\n A NumPy array with new partitions.\n \"\"\"\n func = cls.preprocess_func(func)\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.n_ary_operation.get_right_block_PandasDataframePartitionManager.finalize._part_drain_call_queue_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.n_ary_operation.get_right_block_PandasDataframePartitionManager.finalize._part_drain_call_queue_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1363, "end_line": 1413, "span_ids": ["PandasDataframePartitionManager.n_ary_operation", "PandasDataframePartitionManager.finalize"], "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 PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n @wait_computations_if_benchmark_mode\n def n_ary_operation(cls, left, func, right: list):\n # ... other code\n\n def get_right_block(right_partitions, row_idx, col_idx):\n partition = right_partitions[row_idx][col_idx]\n blocks = partition.list_of_blocks\n \"\"\"\n NOTE:\n Currently we do one remote call per right virtual partition to\n materialize the partitions' blocks, then another remote call to do\n the n_ary operation. we could get better performance if we\n assembled the other partition within the remote `apply` call, by\n passing the partition in as `other_axis_partition`. However,\n passing `other_axis_partition` requires some extra care that would\n complicate the code quite a bit:\n - block partitions don't know how to deal with `other_axis_partition`\n - the right axis partition's axis could be different from the axis\n of the corresponding left partition\n - there can be multiple other_axis_partition because this is an n-ary\n operation and n can be > 2.\n So for now just do the materialization in a separate remote step.\n \"\"\"\n if len(blocks) > 1:\n partition.force_materialization()\n assert len(partition.list_of_blocks) == 1\n return partition.list_of_blocks[0]\n\n return np.array(\n [\n [\n part.apply(\n func,\n *(\n get_right_block(right_partitions, row_idx, col_idx)\n for right_partitions in right\n ),\n )\n for col_idx, part in enumerate(left[row_idx])\n ]\n for row_idx in range(len(left))\n ]\n )\n\n @classmethod\n def finalize(cls, partitions):\n \"\"\"\n Perform all deferred calls on partitions.\n\n Parameters\n ----------\n partitions : np.ndarray\n Partitions of Modin Dataframe on which all deferred calls should be performed.\n \"\"\"\n [part.drain_call_queue() for row in partitions for part in row]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.rebalance_partitions_PandasDataframePartitionManager.rebalance_partitions.ideal_partition_size.compute_chunksize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.rebalance_partitions_PandasDataframePartitionManager.rebalance_partitions.ideal_partition_size.compute_chunksize_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1415, "end_line": 1488, "span_ids": ["PandasDataframePartitionManager.rebalance_partitions"], "tokens": 623}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def rebalance_partitions(cls, partitions):\n \"\"\"\n Rebalance a 2-d array of partitions if we are using ``PandasOnRay`` or ``PandasOnDask`` executions.\n\n For all other executions, the partitions are returned unchanged.\n\n Rebalance the partitions by building a new array\n of partitions out of the original ones so that:\n\n - If all partitions have a length, each new partition has roughly the same number of rows.\n - Otherwise, each new partition spans roughly the same number of old partitions.\n\n Parameters\n ----------\n partitions : np.ndarray\n The 2-d array of partitions to rebalance.\n\n Returns\n -------\n np.ndarray\n A NumPy array with the same; or new, rebalanced, partitions, depending on the execution\n engine and storage format.\n list[int] or None\n Row lengths if possible to compute it.\n \"\"\"\n # We rebalance when the ratio of the number of existing partitions to\n # the ideal number of partitions is larger than this threshold. The\n # threshold is a heuristic that may need to be tuned for performance.\n max_excess_of_num_partitions = 1.5\n num_existing_partitions = partitions.shape[0]\n ideal_num_new_partitions = NPartitions.get()\n if (\n num_existing_partitions\n <= ideal_num_new_partitions * max_excess_of_num_partitions\n ):\n return partitions, None\n # If any partition has an unknown length, give each axis partition\n # roughly the same number of row partitions. We use `_length_cache` here\n # to avoid materializing any unmaterialized lengths.\n if any(\n partition._length_cache is None for row in partitions for partition in row\n ):\n # We need each partition to go into an axis partition, but the\n # number of axis partitions may not evenly divide the number of\n # partitions.\n chunk_size = compute_chunksize(\n num_existing_partitions, ideal_num_new_partitions, min_block_size=1\n )\n new_partitions = np.array(\n [\n cls.column_partitions(\n partitions[i : i + chunk_size],\n full_axis=False,\n )\n for i in range(\n 0,\n num_existing_partitions,\n chunk_size,\n )\n ]\n )\n return new_partitions, None\n\n # If we know the number of rows in every partition, then we should try\n # instead to give each new partition roughly the same number of rows.\n new_partitions = []\n # `start` is the index of the first existing partition that we want to\n # put into the current new partition.\n start = 0\n total_rows = sum(part.length() for part in partitions[:, 0])\n ideal_partition_size = compute_chunksize(\n total_rows, ideal_num_new_partitions, min_block_size=1\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_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.rebalance_partitions.for___in_range_ideal_num__PandasDataframePartitionManager.rebalance_partitions.return.new_partitions_lengths": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.rebalance_partitions.for___in_range_ideal_num__PandasDataframePartitionManager.rebalance_partitions.return.new_partitions_lengths", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1489, "end_line": 1546, "span_ids": ["PandasDataframePartitionManager.rebalance_partitions"], "tokens": 615}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def rebalance_partitions(cls, partitions):\n # ... other code\n for _ in range(ideal_num_new_partitions):\n # We might pick up old partitions too quickly and exhaust all of them.\n if start >= len(partitions):\n break\n # `stop` is the index of the last existing partition so far that we\n # want to put into the current new partition.\n stop = start\n partition_size = partitions[start][0].length()\n # Add existing partitions into the current new partition until the\n # number of rows in the new partition hits `ideal_partition_size`.\n while stop < len(partitions) and partition_size < ideal_partition_size:\n stop += 1\n if stop < len(partitions):\n partition_size += partitions[stop][0].length()\n # If the new partition is larger than we want, split the last\n # current partition that it contains into two partitions, where\n # the first partition has just enough rows to make the current\n # new partition have length `ideal_partition_size`, and the second\n # partition has the remainder.\n if partition_size > ideal_partition_size * max_excess_of_num_partitions:\n prev_length = sum(row[0].length() for row in partitions[start:stop])\n new_last_partition_size = ideal_partition_size - prev_length\n partitions = np.insert(\n partitions,\n stop + 1,\n [\n obj.mask(slice(new_last_partition_size, None), slice(None))\n for obj in partitions[stop]\n ],\n 0,\n )\n # TODO: explicit `_length_cache` computing may be avoided after #4903 is merged\n for obj in partitions[stop + 1]:\n obj._length_cache = partition_size - (\n prev_length + new_last_partition_size\n )\n\n partitions[stop, :] = [\n obj.mask(slice(None, new_last_partition_size), slice(None))\n for obj in partitions[stop]\n ]\n # TODO: explicit `_length_cache` computing may be avoided after #4903 is merged\n for obj in partitions[stop]:\n obj._length_cache = new_last_partition_size\n\n # The new virtual partitions are not `full_axis`, even if they\n # happen to span all rows in the dataframe, because they are\n # meant to be the final partitions of the dataframe. They've\n # already been split up correctly along axis 0, but using the\n # default full_axis=True would cause partition.apply() to split\n # its result along axis 0.\n new_partitions.append(\n cls.column_partitions(partitions[start : stop + 1], full_axis=False)\n )\n start = stop + 1\n new_partitions = np.array(new_partitions)\n lengths = [part.length() for part in new_partitions[:, 0]]\n return new_partitions, lengths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.shuffle_partitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/partitioning/partition_manager.py_PandasDataframePartitionManager.shuffle_partitions_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1548, "end_line": 1613, "span_ids": ["PandasDataframePartitionManager.shuffle_partitions"], "tokens": 536}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasDataframePartitionManager(ClassLogger, ABC):\n\n @classmethod\n def shuffle_partitions(\n cls, partitions, index, shuffle_functions, final_shuffle_func\n ):\n \"\"\"\n Return shuffled partitions.\n\n Parameters\n ----------\n partitions : np.ndarray\n The 2-d array of partitions to shuffle.\n index : int\n The index of partitions corresponding to the partitions that contain the column to sample.\n shuffle_functions : NamedTuple\n A named tuple containing the functions that we will be using to perform this shuffle.\n final_shuffle_func : Callable(pandas.DataFrame) -> pandas.DataFrame\n Function that shuffles the data within each new partition.\n\n Returns\n -------\n np.ndarray\n A list of row-partitions that have been shuffled.\n \"\"\"\n # Mask the partition that contains the column that will be sampled.\n masked_partitions = partitions[:, index]\n # Sample each partition\n sample_func = cls.preprocess_func(shuffle_functions.sample_function)\n samples = [partition.apply(sample_func) for partition in masked_partitions]\n # Get each sample to pass in to the pivot function\n samples = cls.get_objects_from_partitions(samples)\n pivots = np.unique(shuffle_functions.pivot_function(samples))\n # Convert our list of block partitions to row partitions. We need to create full-axis\n # row partitions since we need to send the whole partition to the split step as otherwise\n # we wouldn't know how to split the block partitions that don't contain the shuffling key.\n row_partitions = cls.row_partitions(partitions)\n if len(pivots):\n # Gather together all of the sub-partitions\n split_row_partitions = np.array(\n [\n partition.split(\n shuffle_functions.split_function,\n num_splits=len(pivots) + 1,\n f_args=(pivots,),\n # The partition's metadata will never be accessed for the split partitions,\n # thus no need to compute it.\n extract_metadata=False,\n )\n for partition in row_partitions\n ]\n ).T\n # We need to convert every partition that came from the splits into a full-axis column partition.\n new_partitions = [\n [\n cls._column_partitions_class(row_partition, full_axis=False).apply(\n final_shuffle_func\n )\n ]\n for row_partition in split_row_partitions\n ]\n return np.array(new_partitions)\n else:\n # If there are not pivots we can simply apply the function row-wise\n return np.array(\n [row_part.apply(final_shuffle_func) for row_part in row_partitions]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/utils.py_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/pandas/utils.py_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 47, "span_ids": ["concatenate", "docstring"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nfrom pandas.api.types import union_categoricals\n\n\ndef concatenate(dfs):\n \"\"\"\n Concatenate pandas DataFrames with saving 'category' dtype.\n\n All dataframes' columns must be equal to each other.\n\n Parameters\n ----------\n dfs : list\n List of pandas DataFrames to concatenate.\n\n Returns\n -------\n pandas.DataFrame\n A pandas DataFrame.\n \"\"\"\n for df in dfs:\n assert df.columns.equals(dfs[0].columns)\n for i in dfs[0].columns.get_indexer_for(dfs[0].select_dtypes(\"category\").columns):\n columns = [df.iloc[:, i] for df in dfs]\n union = union_categoricals(columns)\n for df in dfs:\n df.isetitem(\n i, pandas.Categorical(df.iloc[:, i], categories=union.categories)\n )\n return pandas.concat(dfs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/dask/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/dask/common/__init__.py_DaskWrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/__init__.py_DaskWrapper_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/common/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 23, "span_ids": ["docstring"], "tokens": 35}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .engine_wrapper import DaskWrapper\nfrom .utils import initialize_dask\n\n__all__ = [\n \"initialize_dask\",\n \"DaskWrapper\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_from_collections_import_U__deploy_dask_func.return.func_args_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_from_collections_import_U__deploy_dask_func.return.func_args_kwargs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 40, "span_ids": ["_deploy_dask_func", "docstring"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import UserDict\n\nfrom distributed.client import default_client\nfrom dask.distributed import wait\n\n\ndef _deploy_dask_func(func, *args, **kwargs): # pragma: no cover\n \"\"\"\n Wrap `func` to ease calling it remotely.\n\n Parameters\n ----------\n func : callable\n A local function that we want to call remotely.\n *args : iterable\n Positional arguments to pass to `func` when calling remotely.\n **kwargs : dict\n Keyword arguments to pass to `func` when calling remotely.\n\n Returns\n -------\n distributed.Future or list\n Dask identifier of the result being put into distributed memory.\n \"\"\"\n return func(*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_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper_DaskWrapper.deploy.return.remote_task_future": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper_DaskWrapper.deploy.return.remote_task_future", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 91, "span_ids": ["DaskWrapper", "DaskWrapper.deploy"], "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 DaskWrapper:\n \"\"\"The class responsible for execution of remote operations.\"\"\"\n\n @classmethod\n def deploy(\n cls,\n func,\n f_args=None,\n f_kwargs=None,\n num_returns=1,\n pure=True,\n ):\n \"\"\"\n Deploy a function in a worker process.\n\n Parameters\n ----------\n func : callable or distributed.Future\n Function to be deployed in a worker process.\n f_args : list or tuple, optional\n Positional arguments to pass to ``func``.\n f_kwargs : dict, optional\n Keyword arguments to pass to ``func``.\n num_returns : int, default: 1\n The number of returned objects.\n pure : bool, default: True\n Whether or not `func` is pure. See `Client.submit` for details.\n\n Returns\n -------\n list\n The result of ``func`` split into parts in accordance with ``num_returns``.\n \"\"\"\n client = default_client()\n args = [] if f_args is None else f_args\n kwargs = {} if f_kwargs is None else f_kwargs\n if callable(func):\n remote_task_future = client.submit(func, *args, pure=pure, **kwargs)\n else:\n # for the case where type(func) is distributed.Future\n remote_task_future = client.submit(\n _deploy_dask_func, func, *args, pure=pure, **kwargs\n )\n if num_returns != 1:\n return [\n client.submit(lambda tup, i: tup[i], remote_task_future, i)\n for i in range(num_returns)\n ]\n return remote_task_future", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper.materialize_DaskWrapper.put.return.client_scatter_data_kw": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper.materialize_DaskWrapper.put.return.client_scatter_data_kw", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 136, "span_ids": ["DaskWrapper.put", "DaskWrapper.materialize"], "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 DaskWrapper:\n\n @classmethod\n def materialize(cls, future):\n \"\"\"\n Materialize data matching `future` object.\n\n Parameters\n ----------\n future : distributed.Future or list\n Future object of list of future objects whereby data needs to be materialized.\n\n Returns\n -------\n Any\n An object(s) from the distributed memory.\n \"\"\"\n client = default_client()\n return client.gather(future)\n\n @classmethod\n def put(cls, data, **kwargs):\n \"\"\"\n Put data into distributed memory.\n\n Parameters\n ----------\n data : list, dict, or object\n Data to scatter out to workers. Output type matches input type.\n **kwargs : dict\n Additional keyword arguments to be passed in `Client.scatter`.\n\n Returns\n -------\n List, dict, iterator, or queue of futures matching the type of input.\n \"\"\"\n if isinstance(data, dict):\n # there is a bug that looks similar to https://github.com/dask/distributed/issues/3965;\n # to avoid this we could change behaviour for serialization:\n # \n # vs\n # {'sep': , \\\n # 'delimiter': ...\n data = UserDict(data)\n client = default_client()\n return client.scatter(data, **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_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper.wait_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/engine_wrapper.py_DaskWrapper.wait_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 163, "span_ids": ["DaskWrapper.wait"], "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 DaskWrapper:\n\n @classmethod\n def wait(cls, obj_ids, num_returns=None):\n \"\"\"\n Wait on the objects without materializing them (blocking operation).\n\n Parameters\n ----------\n obj_ids : list, scalar\n num_returns : int, optional\n \"\"\"\n if not isinstance(obj_ids, list):\n obj_ids = [obj_ids]\n if num_returns is None:\n num_returns = len(obj_ids)\n if num_returns == len(obj_ids):\n wait(obj_ids, return_when=\"ALL_COMPLETED\")\n else:\n # Dask doesn't natively support `num_returns` as int.\n # `wait` function doesn't always return only one finished future,\n # so a simple loop is not enough here\n done, not_done = wait(obj_ids, return_when=\"FIRST_COMPLETED\")\n while len(done) < num_returns and (i := 0 < num_returns):\n extra_done, not_done = wait(not_done, return_when=\"FIRST_COMPLETED\")\n done.update(extra_done)\n i += 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_modin-project__modin/modin/core/execution/dask/common/utils.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/common/utils.py_os_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 68, "span_ids": ["initialize_dask", "docstring"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom modin.config import (\n CpuCount,\n Memory,\n NPartitions,\n GithubCI,\n CIAWSAccessKeyID,\n CIAWSSecretAccessKey,\n)\nfrom modin.error_message import ErrorMessage\n\n\ndef initialize_dask():\n \"\"\"Initialize Dask environment.\"\"\"\n from distributed.client import default_client\n\n try:\n client = default_client()\n except ValueError:\n from distributed import Client\n\n # The indentation here is intentional, we want the code to be indented.\n ErrorMessage.not_initialized(\n \"Dask\",\n \"\"\"\n from distributed import Client\n\n client = Client()\n\"\"\",\n )\n num_cpus = CpuCount.get()\n memory_limit = Memory.get()\n worker_memory_limit = memory_limit // num_cpus if memory_limit else \"auto\"\n client = Client(n_workers=num_cpus, memory_limit=worker_memory_limit)\n if GithubCI.get():\n # set these keys to run tests that write to the mock s3 service. this seems\n # to be the way to pass environment variables to the workers:\n # https://jacobtomlinson.dev/posts/2021/bio-for-2021/\n access_key = CIAWSAccessKeyID.get()\n aws_secret = CIAWSSecretAccessKey.get()\n client.run(\n lambda: os.environ.update(\n {\n \"AWS_ACCESS_KEY_ID\": access_key,\n \"AWS_SECRET_ACCESS_KEY\": aws_secret,\n }\n )\n )\n\n num_cpus = len(client.ncores())\n NPartitions._put(num_cpus)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/dataframe/__init__.py_PandasOnDaskDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/dataframe/__init__.py_PandasOnDaskDataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 26}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .dataframe import PandasOnDaskDataframe\n\n__all__ = [\"PandasOnDaskDataframe\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/dataframe/dataframe.py_from_modin_core_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/dataframe/dataframe.py_from_modin_core_dataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 43, "span_ids": ["PandasOnDaskDataframe", "docstring"], "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": "from modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\nfrom ..partitioning.partition_manager import PandasOnDaskDataframePartitionManager\n\n\nclass PandasOnDaskDataframe(PandasDataframe):\n \"\"\"\n The class implements the interface in ``PandasDataframe``.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence\n The index for the dataframe. Converted to a pandas.Index.\n columns : sequence\n The columns object for the dataframe. Converted to a pandas.Index.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = PandasOnDaskDataframePartitionManager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/__init__.py_PandasOnDaskIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/__init__.py_PandasOnDaskIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["docstring"], "tokens": 26}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import PandasOnDaskIO\n\n__all__ = [\n \"PandasOnDaskIO\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py_from_modin_core_io_import_None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py_from_modin_core_io_import_None_6", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 42, "span_ids": ["docstring"], "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": "from modin.core.io import BaseIO\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.dask.implementations.pandas_on_dask.dataframe import (\n PandasOnDaskDataframe,\n)\nfrom modin.core.execution.dask.implementations.pandas_on_dask.partitioning import (\n PandasOnDaskDataframePartition,\n)\nfrom modin.core.io import (\n CSVDispatcher,\n FWFDispatcher,\n JSONDispatcher,\n ParquetDispatcher,\n FeatherDispatcher,\n SQLDispatcher,\n ExcelDispatcher,\n)\nfrom modin.core.storage_formats.pandas.parsers import (\n PandasCSVParser,\n PandasFWFParser,\n PandasJSONParser,\n PandasParquetParser,\n PandasFeatherParser,\n PandasSQLParser,\n PandasExcelParser,\n)\nfrom modin.core.execution.dask.common import DaskWrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py_PandasOnDaskIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py_PandasOnDaskIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 79, "span_ids": ["PandasOnDaskIO.__make_read", "PandasOnDaskIO:9", "PandasOnDaskIO", "PandasOnDaskIO.__make_write"], "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 PandasOnDaskIO(BaseIO):\n \"\"\"The class implements interface in ``BaseIO`` using Dask as an execution engine.\"\"\"\n\n frame_cls = PandasOnDaskDataframe\n query_compiler_cls = PandasQueryCompiler\n build_args = dict(\n frame_cls=PandasOnDaskDataframe,\n frame_partition_cls=PandasOnDaskDataframePartition,\n query_compiler_cls=PandasQueryCompiler,\n base_io=BaseIO,\n )\n\n def __make_read(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (DaskWrapper, *classes), build_args).read\n\n def __make_write(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (DaskWrapper, *classes), build_args).write\n\n read_csv = __make_read(PandasCSVParser, CSVDispatcher)\n read_fwf = __make_read(PandasFWFParser, FWFDispatcher)\n read_json = __make_read(PandasJSONParser, JSONDispatcher)\n read_parquet = __make_read(PandasParquetParser, ParquetDispatcher)\n to_parquet = __make_write(ParquetDispatcher)\n # Blocked on pandas-dev/pandas#12236. It is faster to default to pandas.\n # read_hdf = __make_read(PandasHDFParser, HDFReader)\n read_feather = __make_read(PandasFeatherParser, FeatherDispatcher)\n read_sql = __make_read(PandasSQLParser, SQLDispatcher)\n to_sql = __make_write(SQLDispatcher)\n read_excel = __make_read(PandasExcelParser, ExcelDispatcher)\n\n del __make_read # to not pollute class namespace\n del __make_write # to not pollute class namespace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/__init__.py_PandasOnDaskDataframePartition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/__init__.py_PandasOnDaskDataframePartition_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 31, "span_ids": ["docstring"], "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": "from .partition import PandasOnDaskDataframePartition\nfrom .partition_manager import PandasOnDaskDataframePartitionManager\nfrom .virtual_partition import (\n PandasOnDaskDataframeVirtualPartition,\n PandasOnDaskDataframeColumnPartition,\n PandasOnDaskDataframeRowPartition,\n)\n\n__all__ = [\n \"PandasOnDaskDataframePartition\",\n \"PandasOnDaskDataframePartitionManager\",\n \"PandasOnDaskDataframeVirtualPartition\",\n \"PandasOnDaskDataframeColumnPartition\",\n \"PandasOnDaskDataframeRowPartition\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_from_distributed_import_F_PandasOnDaskDataframePartition.__init__.self__is_debug_log_and_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_from_distributed_import_F_PandasOnDaskDataframePartition.__init__.self__is_debug_log_and_l", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 63, "span_ids": ["PandasOnDaskDataframePartition", "PandasOnDaskDataframePartition.__init__", "docstring"], "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": "from distributed import Future\nfrom distributed.utils import get_ip\n\nfrom modin.core.dataframe.pandas.partitioning.partition import PandasDataframePartition\nfrom modin.pandas.indexing import compute_sliced_len\nfrom modin.logging import get_logger\nfrom modin.core.execution.dask.common import DaskWrapper\n\n\nclass PandasOnDaskDataframePartition(PandasDataframePartition):\n \"\"\"\n The class implements the interface in ``PandasDataframePartition``.\n\n Parameters\n ----------\n data : distributed.Future\n A reference to pandas DataFrame that need to be wrapped with this class.\n length : distributed.Future or int, optional\n Length or reference to it of wrapped pandas DataFrame.\n width : distributed.Future or int, optional\n Width or reference to it of wrapped pandas DataFrame.\n ip : distributed.Future or str, optional\n Node IP address or reference to it that holds wrapped pandas DataFrame.\n call_queue : list, optional\n Call queue that needs to be executed on wrapped pandas DataFrame.\n \"\"\"\n\n execution_wrapper = DaskWrapper\n\n def __init__(self, data, length=None, width=None, ip=None, call_queue=None):\n assert isinstance(data, Future)\n self._data = data\n if call_queue is None:\n call_queue = []\n self.call_queue = call_queue\n self._length_cache = length\n self._width_cache = width\n self._ip_cache = ip\n\n log = get_logger()\n self._is_debug(log) and log.debug(\n \"Partition ID: {}, Height: {}, Width: {}, Node IP: {}\".format(\n self._identity,\n str(self._length_cache),\n str(self._width_cache),\n str(self._ip_cache),\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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.apply_PandasOnDaskDataframePartition.apply.return.self___constructor___futu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.apply_PandasOnDaskDataframePartition.apply.return.self___constructor___futu", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 113, "span_ids": ["PandasOnDaskDataframePartition.apply"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnDaskDataframePartition(PandasDataframePartition):\n\n def apply(self, func, *args, **kwargs):\n \"\"\"\n Apply a function to the object wrapped by this partition.\n\n Parameters\n ----------\n func : callable or distributed.Future\n A function to apply.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasOnDaskDataframePartition\n A new ``PandasOnDaskDataframePartition`` object.\n\n Notes\n -----\n The keyword arguments are sent as a dictionary.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.apply::{self._identity}\")\n call_queue = self.call_queue + [[func, args, kwargs]]\n if len(call_queue) > 1:\n self._is_debug(log) and log.debug(\n f\"SUBMIT::_apply_list_of_funcs::{self._identity}\"\n )\n futures = DaskWrapper.deploy(\n func=apply_list_of_funcs,\n f_args=(call_queue, self._data),\n num_returns=2,\n pure=False,\n )\n else:\n # We handle `len(call_queue) == 1` in a different way because\n # this improves performance a bit.\n func, f_args, f_kwargs = call_queue[0]\n futures = DaskWrapper.deploy(\n func=apply_func,\n f_args=(self._data, func, *f_args),\n f_kwargs=f_kwargs,\n num_returns=2,\n pure=False,\n )\n self._is_debug(log) and log.debug(f\"SUBMIT::_apply_func::{self._identity}\")\n self._is_debug(log) and log.debug(f\"EXIT::Partition.apply::{self._identity}\")\n return self.__constructor__(futures[0], ip=futures[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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.drain_call_queue_PandasOnDaskDataframePartition.wait.DaskWrapper_wait_self__da": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.drain_call_queue_PandasOnDaskDataframePartition.wait.DaskWrapper_wait_self__da", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 156, "span_ids": ["PandasOnDaskDataframePartition.drain_call_queue", "PandasOnDaskDataframePartition.wait"], "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 PandasOnDaskDataframePartition(PandasDataframePartition):\n\n def drain_call_queue(self):\n \"\"\"Execute all operations stored in the call queue on the object wrapped by this partition.\"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(\n f\"ENTER::Partition.drain_call_queue::{self._identity}\"\n )\n if len(self.call_queue) == 0:\n return\n call_queue = self.call_queue\n if len(call_queue) > 1:\n self._is_debug(log) and log.debug(\n f\"SUBMIT::_apply_list_of_funcs::{self._identity}\"\n )\n futures = DaskWrapper.deploy(\n func=apply_list_of_funcs,\n f_args=(call_queue, self._data),\n num_returns=2,\n pure=False,\n )\n else:\n # We handle `len(call_queue) == 1` in a different way because\n # this improves performance a bit.\n func, f_args, f_kwargs = call_queue[0]\n self._is_debug(log) and log.debug(f\"SUBMIT::_apply_func::{self._identity}\")\n futures = DaskWrapper.deploy(\n func=apply_func,\n f_args=(self._data, func, *f_args),\n f_kwargs=f_kwargs,\n num_returns=2,\n pure=False,\n )\n self._data = futures[0]\n self._ip_cache = futures[1]\n self._is_debug(log) and log.debug(\n f\"EXIT::Partition.drain_call_queue::{self._identity}\"\n )\n self.call_queue = []\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\n self.drain_call_queue()\n DaskWrapper.wait(self._data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.mask_PandasOnDaskDataframePartition.mask.return.new_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.mask_PandasOnDaskDataframePartition.mask.return.new_obj", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 194, "span_ids": ["PandasOnDaskDataframePartition.mask"], "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 PandasOnDaskDataframePartition(PandasDataframePartition):\n\n def mask(self, row_labels, col_labels):\n \"\"\"\n Lazily create a mask that extracts the indices provided.\n\n Parameters\n ----------\n row_labels : list-like, slice or label\n The row labels for the rows to extract.\n col_labels : list-like, slice or label\n The column labels for the columns to extract.\n\n Returns\n -------\n PandasOnDaskDataframePartition\n A new ``PandasOnDaskDataframePartition`` object.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.mask::{self._identity}\")\n new_obj = super().mask(row_labels, col_labels)\n if isinstance(row_labels, slice) and isinstance(self._length_cache, Future):\n if row_labels == slice(None):\n # fast path - full axis take\n new_obj._length_cache = self._length_cache\n else:\n new_obj._length_cache = DaskWrapper.deploy(\n func=compute_sliced_len, f_args=(row_labels, self._length_cache)\n )\n if isinstance(col_labels, slice) and isinstance(self._width_cache, Future):\n if col_labels == slice(None):\n # fast path - full axis take\n new_obj._width_cache = self._width_cache\n else:\n new_obj._width_cache = DaskWrapper.deploy(\n func=compute_sliced_len, f_args=(col_labels, self._width_cache)\n )\n self._is_debug(log) and log.debug(f\"EXIT::Partition.mask::{self._identity}\")\n return new_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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.__copy___PandasOnDaskDataframePartition.preprocess_func.return.DaskWrapper_put_func_has": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.__copy___PandasOnDaskDataframePartition.preprocess_func.return.DaskWrapper_put_func_has", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 245, "span_ids": ["PandasOnDaskDataframePartition.__copy__", "PandasOnDaskDataframePartition.put", "PandasOnDaskDataframePartition.preprocess_func"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnDaskDataframePartition(PandasDataframePartition):\n\n def __copy__(self):\n \"\"\"\n Create a copy of this partition.\n\n Returns\n -------\n PandasOnDaskDataframePartition\n A copy of this partition.\n \"\"\"\n return self.__constructor__(\n self._data,\n length=self._length_cache,\n width=self._width_cache,\n ip=self._ip_cache,\n call_queue=self.call_queue,\n )\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Put an object into distributed memory and wrap it with partition object.\n\n Parameters\n ----------\n obj : any\n An object to be put.\n\n Returns\n -------\n PandasOnDaskDataframePartition\n A new ``PandasOnDaskDataframePartition`` object.\n \"\"\"\n return cls(DaskWrapper.put(obj, hash=False), len(obj.index), len(obj.columns))\n\n @classmethod\n def preprocess_func(cls, func):\n \"\"\"\n Preprocess a function before an ``apply`` call.\n\n Parameters\n ----------\n func : callable\n The function to preprocess.\n\n Returns\n -------\n callable\n An object that can be accepted by ``apply``.\n \"\"\"\n return DaskWrapper.put(func, hash=False, broadcast=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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.length_PandasOnDaskDataframePartition.length.return.self__length_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.length_PandasOnDaskDataframePartition.length.return.self__length_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 247, "end_line": 267, "span_ids": ["PandasOnDaskDataframePartition.length"], "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 PandasOnDaskDataframePartition(PandasDataframePartition):\n\n def length(self, materialize=True):\n \"\"\"\n Get the length of the object wrapped by this partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or distributed.Future\n The length of the object.\n \"\"\"\n if self._length_cache is None:\n self._length_cache = self.apply(len)._data\n if isinstance(self._length_cache, Future) and materialize:\n self._length_cache = DaskWrapper.materialize(self._length_cache)\n return self._length_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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.width_PandasOnDaskDataframePartition.ip.return.self__ip_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_PandasOnDaskDataframePartition.width_PandasOnDaskDataframePartition.ip.return.self__ip_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 269, "end_line": 304, "span_ids": ["PandasOnDaskDataframePartition.width", "PandasOnDaskDataframePartition.ip"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnDaskDataframePartition(PandasDataframePartition):\n\n def width(self, materialize=True):\n \"\"\"\n Get the width of the object wrapped by the partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or distributed.Future\n The width of the object.\n \"\"\"\n if self._width_cache is None:\n self._width_cache = self.apply(lambda df: len(df.columns))._data\n if isinstance(self._width_cache, Future) and materialize:\n self._width_cache = DaskWrapper.materialize(self._width_cache)\n return self._width_cache\n\n def ip(self):\n \"\"\"\n Get the node IP address of the object wrapped by this partition.\n\n Returns\n -------\n str\n IP address of the node that holds the data.\n \"\"\"\n if self._ip_cache is None:\n self._ip_cache = self.apply(lambda df: df)._ip_cache\n if isinstance(self._ip_cache, Future):\n self._ip_cache = DaskWrapper.materialize(self._ip_cache)\n return self._ip_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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_apply_func_apply_func.return.result_get_ip_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_apply_func_apply_func.return.result_get_ip_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 335, "span_ids": ["apply_func"], "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 apply_func(partition, func, *args, **kwargs):\n \"\"\"\n Execute a function on the partition in a worker process.\n\n Parameters\n ----------\n partition : pandas.DataFrame\n A pandas DataFrame the function needs to be executed on.\n func : callable\n The function to perform.\n *args : list\n Positional arguments to pass to ``func``.\n **kwargs : dict\n Keyword arguments to pass to ``func``.\n\n Returns\n -------\n pandas.DataFrame\n The resulting pandas DataFrame.\n str\n The node IP address of the worker process.\n\n Notes\n -----\n Directly passing a call queue entry (i.e. a list of [func, args, kwargs]) instead of\n destructuring it causes a performance penalty.\n \"\"\"\n result = func(partition, *args, **kwargs)\n return result, get_ip()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_apply_list_of_funcs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py_apply_list_of_funcs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 338, "end_line": 359, "span_ids": ["apply_list_of_funcs"], "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 apply_list_of_funcs(call_queue, partition):\n \"\"\"\n Execute all operations stored in the call queue on the partition in a worker process.\n\n Parameters\n ----------\n call_queue : list\n A call queue of ``[func, args, kwargs]`` triples that needs to be executed on the partition.\n partition : pandas.DataFrame\n A pandas DataFrame the call queue needs to be executed on.\n\n Returns\n -------\n pandas.DataFrame\n The resulting pandas DataFrame.\n str\n The node IP address of the worker process.\n \"\"\"\n for func, f_args, f_kwargs in call_queue:\n partition = func(partition, *f_args, **f_kwargs)\n return partition, get_ip()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition_manager.py_from_modin_core_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition_manager.py_from_modin_core_dataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 51, "span_ids": ["PandasOnDaskDataframePartitionManager.wait_partitions", "PandasOnDaskDataframePartitionManager", "docstring"], "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": "from modin.core.dataframe.pandas.partitioning.partition_manager import (\n PandasDataframePartitionManager,\n)\nfrom modin.core.execution.dask.common import DaskWrapper\nfrom .virtual_partition import (\n PandasOnDaskDataframeColumnPartition,\n PandasOnDaskDataframeRowPartition,\n)\nfrom .partition import PandasOnDaskDataframePartition\n\n\nclass PandasOnDaskDataframePartitionManager(PandasDataframePartitionManager):\n \"\"\"The class implements the interface in `PandasDataframePartitionManager`.\"\"\"\n\n # This object uses PandasOnDaskDataframePartition objects as the underlying store.\n _partition_class = PandasOnDaskDataframePartition\n _column_partitions_class = PandasOnDaskDataframeColumnPartition\n _row_partition_class = PandasOnDaskDataframeRowPartition\n _execution_wrapper = DaskWrapper\n\n @classmethod\n def wait_partitions(cls, partitions):\n \"\"\"\n Wait on the objects wrapped by `partitions` in parallel, without materializing them.\n\n This method will block until all computations in the list have completed.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``PandasDataframePartition``-s.\n \"\"\"\n DaskWrapper.wait(\n [block for partition in partitions for block in partition.list_of_blocks]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_from_distributed_import_F_PandasOnDaskDataframeVirtualPartition.list_of_ips.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_from_distributed_import_F_PandasOnDaskDataframeVirtualPartition.list_of_ips.return.result", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 71, "span_ids": ["PandasOnDaskDataframeVirtualPartition", "PandasOnDaskDataframeVirtualPartition.list_of_ips", "docstring"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from distributed import Future\nfrom distributed.utils import get_ip\n\nimport pandas\n\nfrom modin.core.dataframe.pandas.partitioning.axis_partition import (\n PandasDataframeAxisPartition,\n)\nfrom .partition import PandasOnDaskDataframePartition\nfrom modin.core.execution.dask.common import DaskWrapper\nfrom modin.utils import _inherit_docstrings\n\n\nclass PandasOnDaskDataframeVirtualPartition(PandasDataframeAxisPartition):\n \"\"\"\n The class implements the interface in ``PandasDataframeAxisPartition``.\n\n Parameters\n ----------\n list_of_partitions : Union[list, PandasOnDaskDataframePartition]\n List of ``PandasOnDaskDataframePartition`` and\n ``PandasOnDaskDataframeVirtualPartition`` objects, or a single\n ``PandasOnDaskDataframePartition``.\n get_ip : bool, default: False\n Whether to get node IP addresses of conforming partitions or not.\n full_axis : bool, default: True\n Whether or not the virtual partition encompasses the whole axis.\n call_queue : list, optional\n A list of tuples (callable, args, kwargs) that contains deferred calls.\n length : distributed.Future or int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : distributed.Future or int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n \"\"\"\n\n axis = None\n _PARTITIONS_METADATA_LEN = 3 # (length, width, ip)\n partition_type = PandasOnDaskDataframePartition\n instance_type = Future\n\n @property\n def list_of_ips(self):\n \"\"\"\n Get the IPs holding the physical objects composing this partition.\n\n Returns\n -------\n List\n A list of IPs as ``distributed.Future`` or str.\n \"\"\"\n # Defer draining call queue until we get the ip address\n result = [None] * len(self.list_of_block_partitions)\n for idx, partition in enumerate(self.list_of_block_partitions):\n partition.drain_call_queue()\n result[idx] = partition._ip_cache\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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_splitting_func_PandasOnDaskDataframeVirtualPartition.deploy_splitting_func.return.DaskWrapper_deploy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_splitting_func_PandasOnDaskDataframeVirtualPartition.deploy_splitting_func.return.DaskWrapper_deploy_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 101, "span_ids": ["PandasOnDaskDataframeVirtualPartition.deploy_splitting_func"], "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 PandasOnDaskDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n @_inherit_docstrings(PandasDataframeAxisPartition.deploy_splitting_func)\n def deploy_splitting_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n extract_metadata=False,\n ):\n return DaskWrapper.deploy(\n func=_deploy_dask_func,\n f_args=(\n PandasDataframeAxisPartition.deploy_splitting_func,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n ),\n f_kwargs={\"extract_metadata\": extract_metadata},\n num_returns=num_splits * (1 + cls._PARTITIONS_METADATA_LEN)\n if extract_metadata\n else num_splits,\n pure=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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_axis_func_PandasOnDaskDataframeVirtualPartition.deploy_axis_func.return.DaskWrapper_deploy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_axis_func_PandasOnDaskDataframeVirtualPartition.deploy_axis_func.return.DaskWrapper_deploy_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 165, "span_ids": ["PandasOnDaskDataframeVirtualPartition.deploy_axis_func"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnDaskDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n def deploy_axis_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n lengths=None,\n manual_partition=False,\n ):\n \"\"\"\n Deploy a function along a full axis.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see `split_result_of_axis_func_pandas`).\n maintain_partitioning : bool\n If True, keep the old partitioning if possible.\n If False, create a new partition layout.\n *partitions : iterable\n All partitions that make up the full axis (row or column).\n lengths : iterable, default: None\n The list of lengths to shuffle the partition into.\n manual_partition : bool, default: False\n If True, partition the result with `lengths`.\n\n Returns\n -------\n list\n A list of distributed.Future.\n \"\"\"\n result_num_splits = len(lengths) if lengths else num_splits\n return DaskWrapper.deploy(\n func=_deploy_dask_func,\n f_args=(\n PandasDataframeAxisPartition.deploy_axis_func,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n ),\n f_kwargs={\n \"lengths\": lengths,\n \"manual_partition\": manual_partition,\n },\n num_returns=result_num_splits * (1 + cls._PARTITIONS_METADATA_LEN),\n pure=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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnDaskDataframeRowPartition.axis.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py_PandasOnDaskDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnDaskDataframeRowPartition.axis.1", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 237, "span_ids": ["PandasOnDaskDataframeColumnPartition", "PandasOnDaskDataframeRowPartition", "PandasOnDaskDataframeVirtualPartition.deploy_func_between_two_axis_partitions", "PandasOnDaskDataframeVirtualPartition.wait"], "tokens": 497}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnDaskDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n def deploy_func_between_two_axis_partitions(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n ):\n \"\"\"\n Deploy a function along a full axis between two data sets.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see `split_result_of_axis_func_pandas`).\n len_of_left : int\n The number of values in `partitions` that belong to the left data set.\n other_shape : np.ndarray\n The shape of right frame in terms of partitions, i.e.\n (other_shape[i-1], other_shape[i]) will indicate slice to restore i-1 axis partition.\n *partitions : iterable\n All partitions that make up the full axis (row or column) for both data sets.\n\n Returns\n -------\n list\n A list of distributed.Future.\n \"\"\"\n return DaskWrapper.deploy(\n func=_deploy_dask_func,\n f_args=(\n PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n ),\n num_returns=num_splits * (1 + cls._PARTITIONS_METADATA_LEN),\n pure=False,\n )\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\n self.drain_call_queue()\n DaskWrapper.wait(self.list_of_blocks)\n\n\n@_inherit_docstrings(PandasOnDaskDataframeVirtualPartition.__init__)\nclass PandasOnDaskDataframeColumnPartition(PandasOnDaskDataframeVirtualPartition):\n axis = 0\n\n\n@_inherit_docstrings(PandasOnDaskDataframeVirtualPartition.__init__)\nclass PandasOnDaskDataframeRowPartition(PandasOnDaskDataframeVirtualPartition):\n axis = 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_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py__deploy_dask_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py__deploy_dask_func_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dask/implementations/pandas_on_dask/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 240, "end_line": 294, "span_ids": ["_deploy_dask_func"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _deploy_dask_func(\n deployer,\n axis,\n f_to_deploy,\n f_args,\n f_kwargs,\n *args,\n extract_metadata=True,\n **kwargs,\n):\n \"\"\"\n Execute a function on an axis partition in a worker process.\n\n This is ALWAYS called on either ``PandasDataframeAxisPartition.deploy_axis_func``\n or ``PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions``, which both\n serve to deploy another dataframe function on a Dask worker process.\n\n Parameters\n ----------\n deployer : callable\n A `PandasDataFrameAxisPartition.deploy_*` method that will call `deploy_f`.\n axis : {0, 1}\n The axis to perform the function along.\n f_to_deploy : callable or RayObjectID\n The function to deploy.\n f_args : list or tuple\n Positional arguments to pass to ``f_to_deploy``.\n f_kwargs : dict\n Keyword arguments to pass to ``f_to_deploy``.\n *args : list\n Positional arguments to pass to ``func``.\n extract_metadata : bool, default: True\n Whether to return metadata (length, width, ip) of the result. Passing `False` may relax\n the load on object storage as the remote function would return 4 times fewer futures.\n Passing `False` makes sense for temporary results where you know for sure that the\n metadata will never be requested.\n **kwargs : dict\n Keyword arguments to pass to ``func``.\n\n Returns\n -------\n list\n The result of the function ``func`` and metadata for it.\n \"\"\"\n result = deployer(axis, f_to_deploy, f_args, f_kwargs, *args, **kwargs)\n if not extract_metadata:\n return result\n ip = get_ip()\n if isinstance(result, pandas.DataFrame):\n return result, len(result), len(result.columns), ip\n elif all(isinstance(r, pandas.DataFrame) for r in result):\n return [i for r in result for i in [r, len(r), len(r.columns), ip]]\n else:\n return [i for r in result for i in [r, None, None, ip]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/dispatching/factories/__init__.py_factories_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/__init__.py_factories_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 33, "span_ids": ["impl", "_get_remote_engines", "docstring"], "tokens": 96}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from . import factories\n\n\ndef _get_remote_engines():\n \"\"\"Yield engines of all of the experimental remote factories.\"\"\"\n for name in dir(factories):\n obj = getattr(factories, name)\n if isinstance(obj, type) and issubclass(\n obj, factories.ExperimentalRemoteFactory\n ):\n try:\n yield obj.get_info().engine\n except factories.NotRealFactory:\n pass\n\n\nREMOTE_ENGINES = set(_get_remote_engines())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_from_modin_config_import__StubIoEngine.__getattr__.return.stub": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_from_modin_config_import__StubIoEngine.__getattr__.return.stub", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/dispatcher.py", "file_name": "dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 71, "span_ids": ["StubIoEngine.__init__", "FactoryNotFoundError", "StubIoEngine.__getattr__", "docstring", "StubIoEngine"], "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": "from modin.config import Engine, StorageFormat, IsExperimental\nfrom modin.core.execution.dispatching.factories import factories\nfrom modin.utils import get_current_execution, _inherit_docstrings\n\n\nclass FactoryNotFoundError(AttributeError):\n \"\"\"\n ``FactoryNotFound`` exception class.\n\n Raise when no matching factory could be found.\n \"\"\"\n\n pass\n\n\nclass StubIoEngine(object):\n \"\"\"\n IO-Engine that does nothing more than raise NotImplementedError when any method is called.\n\n Parameters\n ----------\n factory_name : str\n Factory name, which will be reflected in error messages.\n\n Notes\n -----\n Used for testing purposes.\n \"\"\"\n\n def __init__(self, factory_name=\"\"):\n self.factory_name = factory_name or \"Unknown\"\n\n def __getattr__(self, name):\n \"\"\"\n Return a function that raises `NotImplementedError` for the `name` method.\n\n Parameters\n ----------\n name : str\n Method name to indicate in `NotImplementedError`.\n\n Returns\n -------\n callable\n \"\"\"\n\n def stub(*args, **kw):\n raise NotImplementedError(\n f\"Method {self.factory_name}.{name} is not implemented\"\n )\n\n return stub", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_StubFactory_StubFactory.set_failing_name.return.cls": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_StubFactory_StubFactory.set_failing_name.return.cls", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/dispatcher.py", "file_name": "dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 96, "span_ids": ["StubFactory", "StubFactory.set_failing_name"], "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 StubFactory(factories.BaseFactory):\n \"\"\"\n Factory that does nothing more than raise NotImplementedError when any method is called.\n\n Notes\n -----\n Used for testing purposes.\n \"\"\"\n\n io_cls = StubIoEngine()\n\n @classmethod\n def set_failing_name(cls, factory_name):\n \"\"\"\n Fill in `.io_cls` class attribute with ``StubIoEngine`` engine.\n\n Parameters\n ----------\n factory_name : str\n Name to pass to the ``StubIoEngine`` constructor.\n \"\"\"\n cls.io_cls = StubIoEngine(factory_name)\n return cls", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher_FactoryDispatcher.get_factory.return.cls___factory": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher_FactoryDispatcher.get_factory.return.cls___factory", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/dispatcher.py", "file_name": "dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 118, "span_ids": ["FactoryDispatcher", "FactoryDispatcher.get_factory"], "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 FactoryDispatcher(object):\n \"\"\"\n Class that routes IO-work to the factories.\n\n This class is responsible for keeping selected factory up-to-date and dispatching\n calls of IO-functions to its actual execution-specific implementations.\n \"\"\"\n\n __factory: factories.BaseFactory = None\n\n @classmethod\n def get_factory(cls) -> factories.BaseFactory:\n \"\"\"Get current factory.\"\"\"\n if cls.__factory is None:\n from modin.pandas import _update_engine\n\n Engine.subscribe(_update_engine)\n Engine.subscribe(cls._update_factory)\n StorageFormat.subscribe(cls._update_factory)\n return cls.__factory", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher._update_factory_FactoryDispatcher._update_factory.try_.else_.cls___factory_prepare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher._update_factory_FactoryDispatcher._update_factory.try_.else_.cls___factory_prepare_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/dispatcher.py", "file_name": "dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 158, "span_ids": ["FactoryDispatcher._update_factory"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FactoryDispatcher(object):\n\n @classmethod\n # FIXME: replace `_` parameter with `*args`\n def _update_factory(cls, _):\n \"\"\"\n Update and prepare factory with a new one specified via Modin config.\n\n Parameters\n ----------\n _ : object\n This parameters serves the compatibility purpose.\n Does not affect the result.\n \"\"\"\n factory_name = get_current_execution() + \"Factory\"\n try:\n cls.__factory = getattr(factories, factory_name)\n except AttributeError:\n if factory_name == \"ExperimentalOmnisciOnRayFactory\":\n msg = (\n \"OmniSci storage format no longer needs Ray engine; \"\n + \"please specify MODIN_ENGINE='native'\"\n )\n raise FactoryNotFoundError(msg)\n if not IsExperimental.get():\n # allow missing factories in experimenal mode only\n if hasattr(factories, \"Experimental\" + factory_name):\n msg = (\n \"{0} is only accessible through the experimental API.\\nRun \"\n + \"`import modin.experimental.pandas as pd` to use {0}.\"\n )\n else:\n msg = (\n \"Cannot find factory {}. \"\n + \"Potential reason might be incorrect environment variable value for \"\n + f\"{StorageFormat.varname} or {Engine.varname}\"\n )\n raise FactoryNotFoundError(msg.format(factory_name))\n cls.__factory = StubFactory.set_failing_name(factory_name)\n else:\n cls.__factory.prepare()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher.from_pandas_FactoryDispatcher.read_sql.return.cls_get_factory__read_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher.from_pandas_FactoryDispatcher.read_sql.return.cls_get_factory__read_s", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/dispatcher.py", "file_name": "dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 255, "span_ids": ["FactoryDispatcher.from_pandas", "FactoryDispatcher.read_csv_glob", "FactoryDispatcher.read_pickle", "FactoryDispatcher.from_dataframe", "FactoryDispatcher.read_html", "FactoryDispatcher.read_json", "FactoryDispatcher.read_sql", "FactoryDispatcher.from_non_pandas", "FactoryDispatcher.read_pickle_distributed", "FactoryDispatcher.read_sas", "FactoryDispatcher.read_feather", "FactoryDispatcher.read_excel", "FactoryDispatcher.read_hdf", "FactoryDispatcher.read_gbq", "FactoryDispatcher.from_arrow", "FactoryDispatcher.read_parquet", "FactoryDispatcher.read_csv", "FactoryDispatcher.read_clipboard", "FactoryDispatcher.read_stata"], "tokens": 773}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FactoryDispatcher(object):\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._from_pandas)\n def from_pandas(cls, df):\n return cls.get_factory()._from_pandas(df)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._from_arrow)\n def from_arrow(cls, at):\n return cls.get_factory()._from_arrow(at)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._from_non_pandas)\n def from_non_pandas(cls, *args, **kwargs):\n return cls.get_factory()._from_non_pandas(*args, **kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._from_dataframe)\n def from_dataframe(cls, *args, **kwargs):\n return cls.get_factory()._from_dataframe(*args, **kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_parquet)\n def read_parquet(cls, **kwargs):\n return cls.get_factory()._read_parquet(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_csv)\n def read_csv(cls, **kwargs):\n return cls.get_factory()._read_csv(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.ExperimentalPandasOnRayFactory._read_csv_glob)\n def read_csv_glob(cls, **kwargs):\n return cls.get_factory()._read_csv_glob(**kwargs)\n\n @classmethod\n @_inherit_docstrings(\n factories.ExperimentalPandasOnRayFactory._read_pickle_distributed\n )\n def read_pickle_distributed(cls, **kwargs):\n return cls.get_factory()._read_pickle_distributed(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_json)\n def read_json(cls, **kwargs):\n return cls.get_factory()._read_json(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_gbq)\n def read_gbq(cls, **kwargs):\n return cls.get_factory()._read_gbq(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_html)\n def read_html(cls, **kwargs):\n return cls.get_factory()._read_html(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_clipboard)\n def read_clipboard(cls, **kwargs):\n return cls.get_factory()._read_clipboard(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_excel)\n def read_excel(cls, **kwargs):\n return cls.get_factory()._read_excel(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_hdf)\n def read_hdf(cls, **kwargs):\n return cls.get_factory()._read_hdf(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_feather)\n def read_feather(cls, **kwargs):\n return cls.get_factory()._read_feather(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_stata)\n def read_stata(cls, **kwargs):\n return cls.get_factory()._read_stata(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_sas)\n def read_sas(cls, **kwargs): # pragma: no cover\n return cls.get_factory()._read_sas(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_pickle)\n def read_pickle(cls, **kwargs):\n return cls.get_factory()._read_pickle(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_sql)\n def read_sql(cls, **kwargs):\n return cls.get_factory()._read_sql(**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_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher.read_fwf_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/dispatcher.py_FactoryDispatcher.read_fwf_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/dispatcher.py", "file_name": "dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 308, "span_ids": ["FactoryDispatcher.read_fwf", "FactoryDispatcher.to_sql", "FactoryDispatcher.read_spss", "FactoryDispatcher.read_custom_text", "FactoryDispatcher.to_parquet", "FactoryDispatcher.read_sql_query", "FactoryDispatcher.to_pickle_distributed", "FactoryDispatcher.to_pickle", "FactoryDispatcher.to_csv", "FactoryDispatcher.read_sql_table"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FactoryDispatcher(object):\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_fwf)\n def read_fwf(cls, **kwargs):\n return cls.get_factory()._read_fwf(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_sql_table)\n def read_sql_table(cls, **kwargs):\n return cls.get_factory()._read_sql_table(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_sql_query)\n def read_sql_query(cls, **kwargs):\n return cls.get_factory()._read_sql_query(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._read_spss)\n def read_spss(cls, **kwargs):\n return cls.get_factory()._read_spss(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._to_sql)\n def to_sql(cls, *args, **kwargs):\n return cls.get_factory()._to_sql(*args, **kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._to_pickle)\n def to_pickle(cls, *args, **kwargs):\n return cls.get_factory()._to_pickle(*args, **kwargs)\n\n @classmethod\n @_inherit_docstrings(\n factories.ExperimentalPandasOnRayFactory._to_pickle_distributed\n )\n def to_pickle_distributed(cls, *args, **kwargs):\n return cls.get_factory()._to_pickle_distributed(*args, **kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.ExperimentalPandasOnRayFactory._read_custom_text)\n def read_custom_text(cls, **kwargs):\n return cls.get_factory()._read_custom_text(**kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._to_csv)\n def to_csv(cls, *args, **kwargs):\n return cls.get_factory()._to_csv(*args, **kwargs)\n\n @classmethod\n @_inherit_docstrings(factories.BaseFactory._to_parquet)\n def to_parquet(cls, *args, **kwargs):\n return cls.get_factory()._to_parquet(*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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_warnings_NotRealFactory.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_warnings_NotRealFactory.pass", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 130, "span_ids": ["FactoryInfo", "impl:13", "NotRealFactory", "docstring"], "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": "import warnings\nimport typing\nimport re\n\nfrom modin.config import Engine\nfrom modin.utils import _inherit_docstrings, get_current_execution\nfrom modin.core.io import BaseIO\nfrom pandas.util._decorators import doc\n\nimport pandas\n\n\n_doc_abstract_factory_class = \"\"\"\nAbstract {role} factory which allows to override the IO module easily.\n\nThis class is responsible for dispatching calls of IO-functions to its\nactual execution-specific implementations.\n\nAttributes\n----------\nio_cls : BaseIO\n IO module class of the underlying execution. The place to dispatch calls to.\n\"\"\"\n\n_doc_factory_class = \"\"\"\nFactory of {execution_name} execution.\n\nThis class is responsible for dispatching calls of IO-functions to its\nactual execution-specific implementations.\n\nAttributes\n----------\nio_cls : {execution_name}IO\n IO module class of the underlying execution. The place to dispatch calls to.\n\"\"\"\n\n_doc_factory_prepare_method = \"\"\"\nInitialize Factory.\n\nFills in `.io_cls` class attribute with {io_module_name} lazily.\n\"\"\"\n\n_doc_io_method_raw_template = \"\"\"\nBuild query compiler from {source}.\n\nParameters\n----------\n{params}\n\nReturns\n-------\nQueryCompiler\n Query compiler of the selected storage format.\n\"\"\"\n\n_doc_io_method_template = (\n _doc_io_method_raw_template\n + \"\"\"\nSee Also\n--------\nmodin.pandas.{method}\n\"\"\"\n)\n\n_doc_io_method_all_params = \"\"\"*args : args\n Arguments to pass to the QueryCompiler builder method.\n**kwargs : kwargs\n Arguments to pass to the QueryCompiler builder method.\"\"\"\n\n_doc_io_method_kwargs_params = \"\"\"**kwargs : kwargs\n Arguments to pass to the QueryCompiler builder method.\"\"\"\n\n\ntypes_dictionary = {\"pandas\": {\"category\": pandas.CategoricalDtype}}\n\nsupported_execution = (\n \"ExperimentalPandasOnRay\",\n \"ExperimentalPandasOnUnidist\",\n \"ExperimentalPandasOnDask\",\n)\n\n\nclass FactoryInfo(typing.NamedTuple):\n \"\"\"\n Structure that stores information about factory.\n\n Parameters\n ----------\n engine : str\n Name of underlying execution engine.\n partition : str\n Name of the partition format.\n experimental : bool\n Whether underlying engine is experimental-only.\n \"\"\"\n\n engine: str\n partition: str\n experimental: bool\n\n\nclass NotRealFactory(Exception):\n \"\"\"\n ``NotRealFactory`` exception class.\n\n Raise when no matching factory could be found.\n \"\"\"\n\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory_BaseFactory.get_info.return.FactoryInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory_BaseFactory.get_info.return.FactoryInfo_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 133, "end_line": 155, "span_ids": ["BaseFactory", "BaseFactory.get_info"], "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": "@doc(_doc_abstract_factory_class, role=\"\")\nclass BaseFactory(object):\n io_cls: typing.Type[BaseIO] = None # The module where the I/O functionality exists.\n\n @classmethod\n def get_info(cls) -> FactoryInfo:\n \"\"\"\n Get information about current factory.\n\n Notes\n -----\n It parses factory name, so it must be conformant with how ``FactoryDispatcher``\n class constructs factory names.\n \"\"\"\n try:\n experimental, partition, engine = re.match(\n r\"^(Experimental)?(.*)On(.*)Factory$\", cls.__name__\n ).groups()\n except AttributeError:\n raise NotRealFactory()\n return FactoryInfo(\n engine=engine, partition=partition, experimental=bool(experimental)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory.prepare_BaseFactory._read_excel.return.cls_io_cls_read_excel_k": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory.prepare_BaseFactory._read_excel.return.cls_io_cls_read_excel_k", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 273, "span_ids": ["BaseFactory._from_pandas", "BaseFactory._read_parquet", "BaseFactory._read_clipboard", "BaseFactory._from_arrow", "BaseFactory._read_html", "BaseFactory._read_excel", "BaseFactory._from_dataframe", "BaseFactory._from_non_pandas", "BaseFactory.prepare", "BaseFactory._read_csv", "BaseFactory._read_gbq", "BaseFactory._read_json"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_abstract_factory_class, role=\"\")\nclass BaseFactory(object):\n\n @classmethod\n @doc(\n _doc_factory_prepare_method,\n io_module_name=\"an underlying execution's IO-module\",\n )\n def prepare(cls):\n raise NotImplementedError(\"Subclasses of BaseFactory must implement prepare\")\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"pandas DataFrame\",\n params=\"df : pandas.DataFrame\",\n method=\"utils.from_pandas\",\n )\n def _from_pandas(cls, df):\n return cls.io_cls.from_pandas(df)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"Arrow Table\",\n params=\"at : pyarrow.Table\",\n method=\"utils.from_arrow\",\n )\n def _from_arrow(cls, at):\n return cls.io_cls.from_arrow(at)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a non-pandas object (dict, list, np.array etc...)\",\n params=_doc_io_method_all_params,\n method=\"utils.from_non_pandas\",\n )\n def _from_non_pandas(cls, *args, **kwargs):\n return cls.io_cls.from_non_pandas(*args, **kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a DataFrame object supporting exchange protocol `__dataframe__()`\",\n params=_doc_io_method_all_params,\n method=\"utils.from_dataframe\",\n )\n def _from_dataframe(cls, *args, **kwargs):\n return cls.io_cls.from_dataframe(*args, **kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a Parquet file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_parquet\",\n )\n def _read_parquet(cls, **kwargs):\n return cls.io_cls.read_parquet(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a CSV file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_csv\",\n )\n def _read_csv(cls, **kwargs):\n return cls.io_cls.read_csv(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a JSON file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_json\",\n )\n def _read_json(cls, **kwargs):\n return cls.io_cls.read_json(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a Google BigQuery\",\n params=_doc_io_method_kwargs_params,\n method=\"read_gbq\",\n )\n def _read_gbq(cls, **kwargs):\n return cls.io_cls.read_gbq(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"an HTML document\",\n params=_doc_io_method_kwargs_params,\n method=\"read_html\",\n )\n def _read_html(cls, **kwargs):\n return cls.io_cls.read_html(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"clipboard\",\n params=_doc_io_method_kwargs_params,\n method=\"read_clipboard\",\n )\n def _read_clipboard(cls, **kwargs): # pragma: no cover\n return cls.io_cls.read_clipboard(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"an Excel file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_excel\",\n )\n def _read_excel(cls, **kwargs):\n return cls.io_cls.read_excel(**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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory._read_hdf_BaseFactory._to_sql.return.cls_io_cls_to_sql_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory._read_hdf_BaseFactory._to_sql.return.cls_io_cls_to_sql_args_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 275, "end_line": 387, "span_ids": ["BaseFactory._read_feather", "BaseFactory._read_sas", "BaseFactory._read_fwf", "BaseFactory._read_sql", "BaseFactory._read_pickle", "BaseFactory._read_sql_query", "BaseFactory._to_sql", "BaseFactory._read_hdf", "BaseFactory._read_stata", "BaseFactory._read_sql_table", "BaseFactory._read_spss"], "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": "@doc(_doc_abstract_factory_class, role=\"\")\nclass BaseFactory(object):\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"an HDFStore\",\n params=_doc_io_method_kwargs_params,\n method=\"read_hdf\",\n )\n def _read_hdf(cls, **kwargs):\n return cls.io_cls.read_hdf(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a feather-format object\",\n params=_doc_io_method_kwargs_params,\n method=\"read_feather\",\n )\n def _read_feather(cls, **kwargs):\n return cls.io_cls.read_feather(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a Stata file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_stata\",\n )\n def _read_stata(cls, **kwargs):\n return cls.io_cls.read_stata(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a SAS file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_sas\",\n )\n def _read_sas(cls, **kwargs): # pragma: no cover\n return cls.io_cls.read_sas(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a pickled Modin or pandas DataFrame\",\n params=_doc_io_method_kwargs_params,\n method=\"read_pickle\",\n )\n def _read_pickle(cls, **kwargs):\n return cls.io_cls.read_pickle(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a SQL query or database table\",\n params=_doc_io_method_kwargs_params,\n method=\"read_sql\",\n )\n def _read_sql(cls, **kwargs):\n return cls.io_cls.read_sql(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a table of fixed-width formatted lines\",\n params=_doc_io_method_kwargs_params,\n method=\"read_fwf\",\n )\n def _read_fwf(cls, **kwargs):\n return cls.io_cls.read_fwf(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a SQL database table\",\n params=_doc_io_method_kwargs_params,\n method=\"read_sql_table\",\n )\n def _read_sql_table(cls, **kwargs):\n return cls.io_cls.read_sql_table(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"a SQL query\",\n params=_doc_io_method_kwargs_params,\n method=\"read_sql_query\",\n )\n def _read_sql_query(cls, **kwargs):\n return cls.io_cls.read_sql_query(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_template,\n source=\"an SPSS file\",\n params=_doc_io_method_kwargs_params,\n method=\"read_spss\",\n )\n def _read_spss(cls, **kwargs):\n return cls.io_cls.read_spss(**kwargs)\n\n @classmethod\n def _to_sql(cls, *args, **kwargs):\n \"\"\"\n Write query compiler content to a SQL database.\n\n Parameters\n ----------\n *args : args\n Arguments to the writer method.\n **kwargs : kwargs\n Arguments to the writer method.\n \"\"\"\n return cls.io_cls.to_sql(*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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory._to_pickle_BaseFactory._to_parquet.return.cls_io_cls_to_parquet_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_BaseFactory._to_pickle_BaseFactory._to_parquet.return.cls_io_cls_to_parquet_ar", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 429, "span_ids": ["BaseFactory._to_parquet", "BaseFactory._to_pickle", "BaseFactory._to_csv"], "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": "@doc(_doc_abstract_factory_class, role=\"\")\nclass BaseFactory(object):\n\n @classmethod\n def _to_pickle(cls, *args, **kwargs):\n \"\"\"\n Pickle query compiler object.\n\n Parameters\n ----------\n *args : args\n Arguments to the writer method.\n **kwargs : kwargs\n Arguments to the writer method.\n \"\"\"\n return cls.io_cls.to_pickle(*args, **kwargs)\n\n @classmethod\n def _to_csv(cls, *args, **kwargs):\n \"\"\"\n Write query compiler content to a CSV file.\n\n Parameters\n ----------\n *args : args\n Arguments to pass to the writer method.\n **kwargs : kwargs\n Arguments to pass to the writer method.\n \"\"\"\n return cls.io_cls.to_csv(*args, **kwargs)\n\n @classmethod\n def _to_parquet(cls, *args, **kwargs):\n \"\"\"\n Write query compiler content to a parquet file.\n\n Parameters\n ----------\n *args : args\n Arguments to pass to the writer method.\n **kwargs : kwargs\n Arguments to pass to the writer method.\n \"\"\"\n return cls.io_cls.to_parquet(*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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_CudfOnRayFactory_PandasOnDaskFactory.prepare.cls.io_cls.PandasOnDaskIO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_CudfOnRayFactory_PandasOnDaskFactory.prepare.cls.io_cls.PandasOnDaskIO", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 432, "end_line": 475, "span_ids": ["PandasOnRayFactory.prepare", "PandasOnPythonFactory.prepare", "PandasOnDaskFactory.prepare", "CudfOnRayFactory", "PandasOnPythonFactory", "PandasOnDaskFactory", "CudfOnRayFactory.prepare", "PandasOnRayFactory"], "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": "@doc(_doc_factory_class, execution_name=\"cuDFOnRay\")\nclass CudfOnRayFactory(BaseFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``cuDFOnRayIO``\")\n def prepare(cls):\n from modin.core.execution.ray.implementations.cudf_on_ray.io import cuDFOnRayIO\n\n cls.io_cls = cuDFOnRayIO\n\n\n@doc(_doc_factory_class, execution_name=\"PandasOnRay\")\nclass PandasOnRayFactory(BaseFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``PandasOnRayIO``\")\n def prepare(cls):\n from modin.core.execution.ray.implementations.pandas_on_ray.io import (\n PandasOnRayIO,\n )\n\n cls.io_cls = PandasOnRayIO\n\n\n@doc(_doc_factory_class, execution_name=\"PandasOnPython\")\nclass PandasOnPythonFactory(BaseFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``PandasOnPythonIO``\")\n def prepare(cls):\n from modin.core.execution.python.implementations.pandas_on_python.io import (\n PandasOnPythonIO,\n )\n\n cls.io_cls = PandasOnPythonIO\n\n\n@doc(_doc_factory_class, execution_name=\"PandasOnDask\")\nclass PandasOnDaskFactory(BaseFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``PandasOnDaskIO``\")\n def prepare(cls):\n from modin.core.execution.dask.implementations.pandas_on_dask.io import (\n PandasOnDaskIO,\n )\n\n cls.io_cls = PandasOnDaskIO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory_ExperimentalBaseFactory._read_sql.return.cls_io_cls_read_sql_kwa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory_ExperimentalBaseFactory._read_sql.return.cls_io_cls_read_sql_kwa", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 478, "end_line": 509, "span_ids": ["ExperimentalBaseFactory", "ExperimentalBaseFactory._read_sql"], "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": "@doc(_doc_abstract_factory_class, role=\"experimental\")\nclass ExperimentalBaseFactory(BaseFactory):\n @classmethod\n @_inherit_docstrings(BaseFactory._read_sql)\n def _read_sql(cls, **kwargs):\n supported_engines = (\"Ray\", \"Unidist\", \"Dask\")\n if Engine.get() not in supported_engines:\n if \"partition_column\" in kwargs:\n if kwargs[\"partition_column\"] is not None:\n warnings.warn(\n f\"Distributed read_sql() was only implemented for {', '.join(supported_engines)} engines.\"\n )\n del kwargs[\"partition_column\"]\n if \"lower_bound\" in kwargs:\n if kwargs[\"lower_bound\"] is not None:\n warnings.warn(\n f\"Distributed read_sql() was only implemented for {', '.join(supported_engines)} engines.\"\n )\n del kwargs[\"lower_bound\"]\n if \"upper_bound\" in kwargs:\n if kwargs[\"upper_bound\"] is not None:\n warnings.warn(\n f\"Distributed read_sql() was only implemented for {', '.join(supported_engines)} engines.\"\n )\n del kwargs[\"upper_bound\"]\n if \"max_sessions\" in kwargs:\n if kwargs[\"max_sessions\"] is not None:\n warnings.warn(\n f\"Distributed read_sql() was only implemented for {', '.join(supported_engines)} engines.\"\n )\n del kwargs[\"max_sessions\"]\n return cls.io_cls.read_sql(**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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory._read_csv_glob_ExperimentalBaseFactory._read_custom_text.return.cls_io_cls_read_custom_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory._read_csv_glob_ExperimentalBaseFactory._read_custom_text.return.cls_io_cls_read_custom_te", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 511, "end_line": 551, "span_ids": ["ExperimentalBaseFactory._read_csv_glob", "ExperimentalBaseFactory._read_pickle_distributed", "ExperimentalBaseFactory._read_custom_text"], "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": "@doc(_doc_abstract_factory_class, role=\"experimental\")\nclass ExperimentalBaseFactory(BaseFactory):\n\n @classmethod\n @doc(\n _doc_io_method_raw_template,\n source=\"CSV files\",\n params=_doc_io_method_kwargs_params,\n )\n def _read_csv_glob(cls, **kwargs):\n current_execution = get_current_execution()\n if current_execution not in supported_execution:\n raise NotImplementedError(\n f\"`_read_csv_glob()` is not implemented for {current_execution} execution.\"\n )\n return cls.io_cls.read_csv_glob(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_raw_template,\n source=\"Pickle files\",\n params=_doc_io_method_kwargs_params,\n )\n def _read_pickle_distributed(cls, **kwargs):\n current_execution = get_current_execution()\n if current_execution not in supported_execution:\n raise NotImplementedError(\n f\"`_read_pickle_distributed()` is not implemented for {current_execution} execution.\"\n )\n return cls.io_cls.read_pickle_distributed(**kwargs)\n\n @classmethod\n @doc(\n _doc_io_method_raw_template,\n source=\"Custom text files\",\n params=_doc_io_method_kwargs_params,\n )\n def _read_custom_text(cls, **kwargs):\n current_execution = get_current_execution()\n if current_execution not in supported_execution:\n raise NotImplementedError(\n f\"`_read_custom_text()` is not implemented for {current_execution} execution.\"\n )\n return cls.io_cls.read_custom_text(**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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory._to_pickle_distributed_ExperimentalBaseFactory._to_pickle_distributed.return.cls_io_cls_to_pickle_dist": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalBaseFactory._to_pickle_distributed_ExperimentalBaseFactory._to_pickle_distributed.return.cls_io_cls_to_pickle_dist", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 553, "end_line": 570, "span_ids": ["ExperimentalBaseFactory._to_pickle_distributed"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_abstract_factory_class, role=\"experimental\")\nclass ExperimentalBaseFactory(BaseFactory):\n\n @classmethod\n def _to_pickle_distributed(cls, *args, **kwargs):\n \"\"\"\n Distributed pickle query compiler object.\n\n Parameters\n ----------\n *args : args\n Arguments to the writer method.\n **kwargs : kwargs\n Arguments to the writer method.\n \"\"\"\n current_execution = get_current_execution()\n if current_execution not in supported_execution:\n raise NotImplementedError(\n f\"`_to_pickle_distributed()` is not implemented for {current_execution} execution.\"\n )\n return cls.io_cls.to_pickle_distributed(*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_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnRayFactory_ExperimentalPandasOnRayFactory.prepare.cls.io_cls.ExperimentalPandasOnRayIO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnRayFactory_ExperimentalPandasOnRayFactory.prepare.cls.io_cls.ExperimentalPandasOnRayIO", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 573, "end_line": 582, "span_ids": ["ExperimentalPandasOnRayFactory", "ExperimentalPandasOnRayFactory.prepare"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_factory_class, execution_name=\"experimental PandasOnRay\")\nclass ExperimentalPandasOnRayFactory(ExperimentalBaseFactory, PandasOnRayFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``ExperimentalPandasOnRayIO``\")\n def prepare(cls):\n from modin.experimental.core.execution.ray.implementations.pandas_on_ray.io import (\n ExperimentalPandasOnRayIO,\n )\n\n cls.io_cls = ExperimentalPandasOnRayIO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnDaskFactory_ExperimentalPandasOnDaskFactory.prepare.cls.io_cls.ExperimentalPandasOnDaskI": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnDaskFactory_ExperimentalPandasOnDaskFactory.prepare.cls.io_cls.ExperimentalPandasOnDaskI", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 585, "end_line": 594, "span_ids": ["ExperimentalPandasOnDaskFactory", "ExperimentalPandasOnDaskFactory.prepare"], "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": "@doc(_doc_factory_class, execution_name=\"experimental PandasOnDask\")\nclass ExperimentalPandasOnDaskFactory(ExperimentalBaseFactory, PandasOnDaskFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``ExperimentalPandasOnDaskIO``\")\n def prepare(cls):\n from modin.experimental.core.execution.dask.implementations.pandas_on_dask.io import (\n ExperimentalPandasOnDaskIO,\n )\n\n cls.io_cls = ExperimentalPandasOnDaskIO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnPythonFactory_ExperimentalPyarrowOnRayFactory.prepare.cls.io_cls.PyarrowOnRayIO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnPythonFactory_ExperimentalPyarrowOnRayFactory.prepare.cls.io_cls.PyarrowOnRayIO", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 597, "end_line": 611, "span_ids": ["ExperimentalPyarrowOnRayFactory.prepare", "ExperimentalPyarrowOnRayFactory", "ExperimentalPandasOnPythonFactory"], "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": "@doc(_doc_factory_class, execution_name=\"experimental PandasOnPython\")\nclass ExperimentalPandasOnPythonFactory(ExperimentalBaseFactory, PandasOnPythonFactory):\n pass\n\n\n@doc(_doc_factory_class, execution_name=\"experimental PyarrowOnRay\")\nclass ExperimentalPyarrowOnRayFactory(BaseFactory): # pragma: no cover\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"experimental ``PyarrowOnRayIO``\")\n def prepare(cls):\n from modin.experimental.core.execution.ray.implementations.pyarrow_on_ray.io import (\n PyarrowOnRayIO,\n )\n\n cls.io_cls = PyarrowOnRayIO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalRemoteFactory_ExperimentalRemoteFactory.prepare.cls.io_cls.WrappedIO_get_connection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalRemoteFactory_ExperimentalRemoteFactory.prepare.cls.io_cls.WrappedIO_get_connection_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 614, "end_line": 660, "span_ids": ["ExperimentalRemoteFactory.prepare", "ExperimentalRemoteFactory"], "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": "@doc(_doc_abstract_factory_class, role=\"experimental remote\")\nclass ExperimentalRemoteFactory(ExperimentalBaseFactory):\n wrapped_factory = BaseFactory\n\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"an underlying remote\")\n def prepare(cls):\n # query_compiler import is needed so remote PandasQueryCompiler\n # has an imported local counterpart;\n # if there isn't such counterpart rpyc generates some bogus\n # class type which raises TypeError()\n # upon checking its isinstance() or issubclass()\n import modin.core.storage_formats.pandas.query_compiler # noqa: F401\n from modin.experimental.cloud import get_connection\n\n # import a numpy overrider if it wasn't already imported\n import modin.experimental.pandas.numpy_wrap # noqa: F401\n\n class WrappedIO:\n def __init__(self, conn, factory):\n self.__conn = conn\n remote_factory = getattr(\n conn.modules[factory.__module__], factory.__name__\n )\n remote_factory.prepare()\n self.__io_cls = remote_factory.io_cls\n self.__reads = {\n name for name in BaseIO.__dict__ if name.startswith(\"read_\")\n }\n self.__wrappers = {}\n\n def __getattr__(self, name):\n if name in self.__reads:\n try:\n wrap = self.__wrappers[name]\n except KeyError:\n\n def wrap(*a, _original=getattr(self.__io_cls, name), **kw):\n a, kw = self.__conn.deliver(a, kw)\n return _original(*a, **kw)\n\n self.__wrappers[name] = wrap\n else:\n wrap = getattr(self.__io_cls, name)\n return wrap\n\n cls.io_cls = WrappedIO(get_connection(), cls.wrapped_factory)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnCloudrayFactory_ExperimentalHdkOnCloudnativeFactory.wrapped_factory.ExperimentalHdkOnNativeFa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnCloudrayFactory_ExperimentalHdkOnCloudnativeFactory.wrapped_factory.ExperimentalHdkOnNativeFa", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 663, "end_line": 687, "span_ids": ["ExperimentalHdkOnNativeFactory", "ExperimentalHdkOnNativeFactory.prepare", "ExperimentalPandasOnCloudpythonFactory", "ExperimentalHdkOnCloudnativeFactory", "ExperimentalPandasOnCloudrayFactory"], "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": "@doc(_doc_factory_class, execution_name=\"experimental remote PandasOnRay\")\nclass ExperimentalPandasOnCloudrayFactory(ExperimentalRemoteFactory):\n wrapped_factory = PandasOnRayFactory\n\n\n@doc(_doc_factory_class, execution_name=\"experimental remote PandasOnPython\")\nclass ExperimentalPandasOnCloudpythonFactory(ExperimentalRemoteFactory):\n wrapped_factory = PandasOnPythonFactory\n\n\n@doc(_doc_factory_class, execution_name=\"experimental HdkOnNative\")\nclass ExperimentalHdkOnNativeFactory(BaseFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"experimental ``HdkOnNativeIO``\")\n def prepare(cls):\n from modin.experimental.core.execution.native.implementations.hdk_on_native.io import (\n HdkOnNativeIO,\n )\n\n cls.io_cls = HdkOnNativeIO\n\n\n@doc(_doc_factory_class, execution_name=\"experimental remote HdkOnNative\")\nclass ExperimentalHdkOnCloudnativeFactory(ExperimentalRemoteFactory):\n wrapped_factory = ExperimentalHdkOnNativeFactory", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_PandasOnUnidistFactory_PandasOnUnidistFactory.prepare.cls.io_cls.PandasOnUnidistIO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_PandasOnUnidistFactory_PandasOnUnidistFactory.prepare.cls.io_cls.PandasOnUnidistIO", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 690, "end_line": 699, "span_ids": ["PandasOnUnidistFactory", "PandasOnUnidistFactory.prepare"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_factory_class, execution_name=\"PandasOnUnidist\")\nclass PandasOnUnidistFactory(BaseFactory):\n @classmethod\n @doc(_doc_factory_prepare_method, io_module_name=\"``PandasOnUnidistIO``\")\n def prepare(cls):\n from modin.core.execution.unidist.implementations.pandas_on_unidist.io import (\n PandasOnUnidistIO,\n )\n\n cls.io_cls = PandasOnUnidistIO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnUnidistFactory_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/factories.py_ExperimentalPandasOnUnidistFactory_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/factories.py", "file_name": "factories.py", "file_type": "text/x-python", "category": "implementation", "start_line": 702, "end_line": 716, "span_ids": ["ExperimentalPandasOnUnidistFactory.prepare", "ExperimentalPandasOnUnidistFactory"], "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": "@doc(_doc_factory_class, execution_name=\"experimental PandasOnUnidist\")\nclass ExperimentalPandasOnUnidistFactory(\n ExperimentalBaseFactory, PandasOnUnidistFactory\n):\n @classmethod\n @doc(\n _doc_factory_prepare_method, io_module_name=\"``ExperimentalPandasOnUnidistIO``\"\n )\n def prepare(cls):\n from modin.experimental.core.execution.unidist.implementations.pandas_on_unidist.io import (\n ExperimentalPandasOnUnidistIO,\n )\n\n cls.io_cls = ExperimentalPandasOnUnidistIO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/dispatching/factories/test/test_dispatcher.py_pytest_test_set_execution.with__switch_execution_B.assert_FactoryDispatcher_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/test_dispatcher.py_pytest_test_set_execution.with__switch_execution_B.assert_FactoryDispatcher_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/test/test_dispatcher.py", "file_name": "test_dispatcher.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 124, "span_ids": ["test_engine_wrong_factory", "FooOnBarFactory.prepare", "TestOnPythonFactory", "impl", "_switch_execution", "TestOnPythonFactory.prepare", "FooOnBarFactory", "_switch_value", "PandasOnTestFactory", "test_set_execution", "test_default_factory", "PandasOnTestFactory.prepare", "test_factory_switch", "docstring"], "tokens": 659}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 contextlib import contextmanager\n\nfrom modin.config import Parameter, Engine, StorageFormat\nfrom modin import set_execution\n\nfrom modin.core.execution.dispatching.factories.dispatcher import (\n FactoryDispatcher,\n FactoryNotFoundError,\n)\nfrom modin.core.execution.dispatching.factories import factories\nfrom modin.core.execution.python.implementations.pandas_on_python.io import (\n PandasOnPythonIO,\n)\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\n\nimport modin.pandas as pd\n\n\n@contextmanager\ndef _switch_execution(engine: str, storage_format: str):\n old_engine, old_storage = set_execution(engine, storage_format)\n try:\n yield\n finally:\n set_execution(old_engine, old_storage)\n\n\n@contextmanager\ndef _switch_value(config: Parameter, value: str):\n old_value = config.get()\n try:\n yield config.put(value)\n finally:\n config.put(old_value)\n\n\nclass PandasOnTestFactory(factories.BaseFactory):\n \"\"\"\n Stub factory to ensure we can switch execution engine to 'Test'\n \"\"\"\n\n @classmethod\n def prepare(cls):\n \"\"\"\n Fills in .io_cls class attribute lazily\n \"\"\"\n cls.io_cls = \"Foo\"\n\n\nclass TestOnPythonFactory(factories.BaseFactory):\n \"\"\"\n Stub factory to ensure we can switch partition format to 'Test'\n \"\"\"\n\n @classmethod\n def prepare(cls):\n \"\"\"\n Fills in .io_cls class attribute lazily\n \"\"\"\n cls.io_cls = \"Bar\"\n\n\nclass FooOnBarFactory(factories.BaseFactory):\n \"\"\"\n Stub factory to ensure we can switch engine and partition to 'Foo' and 'Bar'\n \"\"\"\n\n @classmethod\n def prepare(cls):\n \"\"\"\n Fills in .io_cls class attribute lazily\n \"\"\"\n cls.io_cls = \"Zug-zug\"\n\n\n# inject the stubs\nfactories.PandasOnTestFactory = PandasOnTestFactory\nfactories.TestOnPythonFactory = TestOnPythonFactory\nfactories.FooOnBarFactory = FooOnBarFactory\n\n# register them as known \"no init\" engines for modin.pandas\nEngine.NOINIT_ENGINES |= {\"Test\", \"Bar\"}\n\n\ndef test_default_factory():\n assert issubclass(FactoryDispatcher.get_factory(), factories.BaseFactory)\n assert FactoryDispatcher.get_factory().io_cls\n\n\ndef test_factory_switch():\n with _switch_execution(\"Python\", \"Pandas\"):\n with _switch_value(Engine, \"Test\"):\n assert FactoryDispatcher.get_factory() == PandasOnTestFactory\n assert FactoryDispatcher.get_factory().io_cls == \"Foo\"\n\n with _switch_value(StorageFormat, \"Test\"):\n assert FactoryDispatcher.get_factory() == TestOnPythonFactory\n assert FactoryDispatcher.get_factory().io_cls == \"Bar\"\n\n\ndef test_engine_wrong_factory():\n with pytest.raises(FactoryNotFoundError):\n with _switch_value(StorageFormat, \"Pyarrow\"):\n with _switch_value(Engine, \"Dask\"):\n pass\n\n\ndef test_set_execution():\n with _switch_execution(\"Bar\", \"Foo\"):\n assert FactoryDispatcher.get_factory() == FooOnBarFactory", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/test_dispatcher.py_test_add_option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/dispatching/factories/test/test_dispatcher.py_test_add_option_", "embedding": null, "metadata": {"file_path": "modin/core/execution/dispatching/factories/test/test_dispatcher.py", "file_name": "test_dispatcher.py", "file_type": "text/x-python", "category": "test", "start_line": 127, "end_line": 140, "span_ids": ["test_add_option"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add_option():\n class DifferentlyNamedFactory(factories.BaseFactory):\n @classmethod\n def prepare(cls):\n cls.io_cls = PandasOnPythonIO\n\n factories.StorageOnExecFactory = DifferentlyNamedFactory\n StorageFormat.add_option(\"sToragE\")\n Engine.add_option(\"Exec\")\n\n with _switch_execution(\"Exec\", \"Storage\"):\n df = pd.DataFrame([[1, 2, 3], [3, 4, 5], [5, 6, 7]])\n assert isinstance(df._query_compiler, PandasQueryCompiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_os_call_progress_bar.if_progress_bars_pbar_id_.progress_bars_pbar_id_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_os_call_progress_bar.if_progress_bars_pbar_id_.progress_bars_pbar_id_cl", "embedding": null, "metadata": {"file_path": "modin/core/execution/modin_aqp.py", "file_name": "modin_aqp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 115, "span_ids": ["call_progress_bar", "docstring"], "tokens": 732}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 time\nimport inspect\nimport threading\nimport warnings\n\nfrom modin.config import Engine, ProgressBar\n\n\nprogress_bars = {}\nbar_lock = threading.Lock()\n\n\ndef call_progress_bar(result_parts, line_no):\n \"\"\"\n Attach a progress bar to given `result_parts`.\n\n The progress bar is expected to be shown in a Jupyter Notebook cell.\n\n Parameters\n ----------\n result_parts : list of list of object refs (futures)\n Objects which are being computed for which progress is requested.\n line_no : int\n Line number in the call stack which we're displaying progress for.\n \"\"\"\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n try:\n from tqdm.autonotebook import tqdm as tqdm_notebook\n except ImportError:\n raise ImportError(\"Please pip install tqdm to use the progress bar\")\n from IPython import get_ipython\n\n try:\n cell_no = get_ipython().execution_count\n # This happens if we are not in ipython or jupyter.\n # No progress bar is supported in that case.\n except AttributeError:\n return\n pbar_id = f\"{cell_no}-{line_no}\"\n futures = [\n block\n for row in result_parts\n for partition in row\n for block in partition.list_of_blocks\n ]\n bar_format = (\n \"{l_bar}{bar}{r_bar}\"\n if \"DEBUG_PROGRESS_BAR\" in os.environ\n and os.environ[\"DEBUG_PROGRESS_BAR\"] == \"True\"\n else \"{desc}: {percentage:3.0f}%{bar} Elapsed time: {elapsed}, estimated remaining time: {remaining}\"\n )\n bar_lock.acquire()\n if pbar_id in progress_bars:\n if hasattr(progress_bars[pbar_id], \"container\"):\n if hasattr(progress_bars[pbar_id].container.children[0], \"max\"):\n index = 0\n else:\n index = 1\n progress_bars[pbar_id].container.children[index].max = progress_bars[\n pbar_id\n ].container.children[index].max + len(futures)\n progress_bars[pbar_id].total = progress_bars[pbar_id].total + len(futures)\n progress_bars[pbar_id].refresh()\n else:\n progress_bars[pbar_id] = tqdm_notebook(\n total=len(futures),\n desc=\"Estimated completion of line \" + str(line_no),\n bar_format=bar_format,\n )\n bar_lock.release()\n\n threading.Thread(target=_show_time_updates, args=(progress_bars[pbar_id],)).start()\n\n modin_engine = Engine.get()\n engine_wrapper = None\n if modin_engine == \"Ray\":\n from modin.core.execution.ray.common.engine_wrapper import RayWrapper\n\n engine_wrapper = RayWrapper\n elif modin_engine == \"Unidist\":\n from modin.core.execution.unidist.common.engine_wrapper import UnidistWrapper\n\n engine_wrapper = UnidistWrapper\n else:\n raise NotImplementedError(\n f\"ProgressBar feature is not supported for {modin_engine} engine.\"\n )\n\n for i in range(1, len(futures) + 1):\n engine_wrapper.wait(futures, num_returns=i)\n progress_bars[pbar_id].update(1)\n progress_bars[pbar_id].refresh()\n if progress_bars[pbar_id].n == progress_bars[pbar_id].total:\n progress_bars[pbar_id].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_modin-project__modin/modin/core/execution/modin_aqp.py_display_time_updates__show_time_updates.while_p_bar_total_p_bar.if_p_bar_total_p_bar_n_.p_bar_refresh_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_display_time_updates__show_time_updates.while_p_bar_total_p_bar.if_p_bar_total_p_bar_n_.p_bar_refresh_", "embedding": null, "metadata": {"file_path": "modin/core/execution/modin_aqp.py", "file_name": "modin_aqp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 142, "span_ids": ["_show_time_updates", "display_time_updates"], "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 display_time_updates(bar):\n \"\"\"\n Start displaying the progress `bar` in a notebook.\n\n Parameters\n ----------\n bar : tqdm.tqdm\n The progress bar wrapper to display in a notebook cell.\n \"\"\"\n threading.Thread(target=_show_time_updates, args=(bar,)).start()\n\n\ndef _show_time_updates(p_bar):\n \"\"\"\n Refresh displayed progress bar `p_bar` periodically until it is complete.\n\n Parameters\n ----------\n p_bar : tqdm.tqdm\n The progress bar wrapper being displayed to refresh.\n \"\"\"\n while p_bar.total > p_bar.n:\n time.sleep(1)\n if p_bar.total > p_bar.n:\n p_bar.refresh()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_progress_bar_wrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/modin_aqp.py_progress_bar_wrapper_", "embedding": null, "metadata": {"file_path": "modin/core/execution/modin_aqp.py", "file_name": "modin_aqp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 196, "span_ids": ["progress_bar_wrapper"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def progress_bar_wrapper(f):\n \"\"\"\n Wrap computation function inside a progress bar.\n\n Spawns another thread which displays a progress bar showing\n estimated completion time.\n\n Parameters\n ----------\n f : callable\n The name of the function to be wrapped.\n\n Returns\n -------\n callable\n Decorated version of `f` which reports progress.\n \"\"\"\n from functools import wraps\n\n @wraps(f)\n def magic(*args, **kwargs):\n result_parts = f(*args, **kwargs)\n if ProgressBar.get():\n current_frame = inspect.currentframe()\n function_name = None\n while function_name != \"\":\n (\n filename,\n line_number,\n function_name,\n lines,\n index,\n ) = inspect.getframeinfo(current_frame)\n current_frame = current_frame.f_back\n t = threading.Thread(\n target=call_progress_bar,\n args=(result_parts, line_number),\n )\n t.start()\n # We need to know whether or not we are in a jupyter notebook\n from IPython import get_ipython\n\n try:\n ipy_str = str(type(get_ipython()))\n if \"zmqshell\" not in ipy_str:\n t.join()\n except Exception:\n pass\n return result_parts\n\n return magic", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/python/common/__init__.py_PythonWrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/__init__.py_PythonWrapper_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/common/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 16}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .engine_wrapper import PythonWrapper\n\n__all__ = [\"PythonWrapper\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/engine_wrapper.py_PythonWrapper_PythonWrapper.deploy.return.func_args_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/engine_wrapper.py_PythonWrapper_PythonWrapper.deploy.return.func_args_kwargs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 42, "span_ids": ["PythonWrapper.deploy", "PythonWrapper"], "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 PythonWrapper:\n \"\"\"Python engine wrapper serving for the compatibility purpose with other engines.\"\"\"\n\n @classmethod\n def deploy(cls, func, f_args=None, f_kwargs=None, num_returns=1):\n \"\"\"\n Run the passed function.\n\n Parameters\n ----------\n func : callable\n f_args : sequence, optional\n Positional arguments to pass to the `func`.\n f_kwargs : dict, optional\n Keyword arguments to pass to the `func`.\n num_returns : int, default: 1\n Number of return values from the `func`.\n\n Returns\n -------\n object\n Returns the result of the `func`.\n \"\"\"\n args = [] if f_args is None else f_args\n kwargs = {} if f_kwargs is None else f_kwargs\n return func(*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_modin-project__modin/modin/core/execution/python/common/engine_wrapper.py_PythonWrapper.materialize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/common/engine_wrapper.py_PythonWrapper.materialize_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 82, "span_ids": ["PythonWrapper.materialize", "PythonWrapper.put"], "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 PythonWrapper:\n\n @classmethod\n def materialize(cls, obj_id):\n \"\"\"\n Get the data from the data storage.\n\n The method only serves for the compatibility purpose, what it actually\n does is just return the passed value as is.\n\n Parameters\n ----------\n obj_id : object\n\n Returns\n -------\n object\n The passed `obj_id` itself.\n \"\"\"\n return obj_id\n\n @classmethod\n def put(cls, data, **kwargs):\n \"\"\"\n Put data into the data storage.\n\n The method only serves for the compatibility purpose, what it actually\n does is just return the passed value as is.\n\n Parameters\n ----------\n data : object\n **kwargs : dict\n\n Returns\n -------\n object\n The passed `data` itself.\n \"\"\"\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/dataframe/dataframe.py_from_modin_core_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/dataframe/dataframe.py_from_modin_core_dataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 50, "span_ids": ["PandasOnPythonDataframe", "docstring"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\nfrom ..partitioning.partition_manager import PandasOnPythonDataframePartitionManager\n\n\nclass PandasOnPythonDataframe(PandasDataframe):\n \"\"\"\n Class for dataframes with pandas storage format and Python engine.\n\n ``PandasOnPythonDataframe`` doesn't implement any specific interfaces,\n all functionality is inherited from the ``PandasDataframe`` class.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence\n The index for the dataframe. Converted to a ``pandas.Index``.\n columns : sequence\n The columns object for the dataframe. Converted to a ``pandas.Index``.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = PandasOnPythonDataframePartitionManager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/io/__init__.py_PandasOnPythonIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/io/__init__.py_PandasOnPythonIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["docstring"], "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 .io import PandasOnPythonIO\n\n__all__ = [\n \"PandasOnPythonIO\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/io/io.py_from_modin_core_io_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/io/io.py_from_modin_core_io_import_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 32, "span_ids": ["PandasOnPythonIO", "docstring"], "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": "from modin.core.io import BaseIO\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.python.implementations.pandas_on_python.dataframe.dataframe import (\n PandasOnPythonDataframe,\n)\n\n\nclass PandasOnPythonIO(BaseIO):\n \"\"\"\n Class for storing IO functions operating on pandas storage format and Python engine.\n\n Inherits default function implementations from ``BaseIO`` parent class.\n \"\"\"\n\n frame_cls = PandasOnPythonDataframe\n query_compiler_cls = PandasQueryCompiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/__init__.py_PandasOnPythonDataframePartition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/__init__.py_PandasOnPythonDataframePartition_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 31, "span_ids": ["docstring"], "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": "from .partition import PandasOnPythonDataframePartition\nfrom .partition_manager import PandasOnPythonDataframePartitionManager\nfrom .virtual_partition import (\n PandasOnPythonDataframeAxisPartition,\n PandasOnPythonDataframeColumnPartition,\n PandasOnPythonDataframeRowPartition,\n)\n\n__all__ = [\n \"PandasOnPythonDataframePartition\",\n \"PandasOnPythonDataframePartitionManager\",\n \"PandasOnPythonDataframeAxisPartition\",\n \"PandasOnPythonDataframeColumnPartition\",\n \"PandasOnPythonDataframeRowPartition\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_from_modin_core_dataframe_PandasOnPythonDataframePartition.get.return.self__data_copy_if_hasa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_from_modin_core_dataframe_PandasOnPythonDataframePartition.get.return.self__data_copy_if_hasa", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 71, "span_ids": ["PandasOnPythonDataframePartition.__init__", "PandasOnPythonDataframePartition.get", "PandasOnPythonDataframePartition", "docstring"], "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 modin.core.dataframe.pandas.partitioning.partition import PandasDataframePartition\nfrom modin.core.execution.python.common import PythonWrapper\n\n\nclass PandasOnPythonDataframePartition(PandasDataframePartition):\n \"\"\"\n Partition class with interface for pandas storage format and Python engine.\n\n Class holds the data and metadata for a single partition and implements\n methods of parent abstract class ``PandasDataframePartition``.\n\n Parameters\n ----------\n data : pandas.DataFrame\n ``pandas.DataFrame`` that should be wrapped with this class.\n length : int, optional\n Length of `data` (number of rows in the input dataframe).\n width : int, optional\n Width of `data` (number of columns in the input dataframe).\n call_queue : list, optional\n Call queue of the partition (list with entities that should be called\n before partition materialization).\n\n Notes\n -----\n Objects of this class are treated as immutable by partition manager\n subclasses. There is no logic for updating in-place.\n \"\"\"\n\n execution_wrapper = PythonWrapper\n\n def __init__(self, data, length=None, width=None, call_queue=None):\n if hasattr(data, \"copy\"):\n data = data.copy()\n self._data = data\n if call_queue is None:\n call_queue = []\n self.call_queue = call_queue\n self._length_cache = length\n self._width_cache = width\n\n def get(self):\n \"\"\"\n Flush the `call_queue` and return copy of the data.\n\n Returns\n -------\n pandas.DataFrame\n Copy of DataFrame that was wrapped by this partition.\n\n Notes\n -----\n Since this object is a simple wrapper, just return the copy of data.\n \"\"\"\n self.drain_call_queue()\n return self._data.copy() if hasattr(self._data, \"copy\") else self._data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_PandasOnPythonDataframePartition.apply_PandasOnPythonDataframePartition.apply.return.self___constructor___func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_PandasOnPythonDataframePartition.apply_PandasOnPythonDataframePartition.apply.return.self___constructor___func", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 118, "span_ids": ["PandasOnPythonDataframePartition.apply"], "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 PandasOnPythonDataframePartition(PandasDataframePartition):\n\n def apply(self, func, *args, **kwargs):\n \"\"\"\n Apply a function to the object wrapped by this partition.\n\n Parameters\n ----------\n func : callable\n Function to apply.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasOnPythonDataframePartition\n New ``PandasOnPythonDataframePartition`` object.\n \"\"\"\n\n def call_queue_closure(data, call_queue):\n \"\"\"\n Apply callables from `call_queue` on copy of the `data` and return the result.\n\n Parameters\n ----------\n data : pandas.DataFrame or pandas.Series\n Data to use for computations.\n call_queue : array-like\n Array with callables and it's kwargs to be applied to the `data`.\n\n Returns\n -------\n pandas.DataFrame or pandas.Series\n \"\"\"\n result = data.copy()\n for func, f_args, f_kwargs in call_queue:\n try:\n result = func(result, *f_args, **f_kwargs)\n except Exception as err:\n self.call_queue = []\n raise err\n return result\n\n self._data = call_queue_closure(self._data, self.call_queue)\n self.call_queue = []\n return self.__constructor__(func(self._data.copy(), *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_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_PandasOnPythonDataframePartition.drain_call_queue_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py_PandasOnPythonDataframePartition.drain_call_queue_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 172, "span_ids": ["PandasOnPythonDataframePartition.preprocess_func", "PandasOnPythonDataframePartition.wait", "PandasOnPythonDataframePartition.put", "PandasOnPythonDataframePartition.drain_call_queue"], "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 PandasOnPythonDataframePartition(PandasDataframePartition):\n\n def drain_call_queue(self):\n \"\"\"Execute all operations stored in the call queue on the object wrapped by this partition.\"\"\"\n if len(self.call_queue) == 0:\n return\n self.apply(lambda x: x)\n\n def wait(self):\n \"\"\"\n Wait for completion of computations on the object wrapped by the partition.\n\n Internally will be done by flushing the call queue.\n \"\"\"\n self.drain_call_queue()\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Create partition containing `obj`.\n\n Parameters\n ----------\n obj : pandas.DataFrame\n DataFrame to be put into the new partition.\n\n Returns\n -------\n PandasOnPythonDataframePartition\n New ``PandasOnPythonDataframePartition`` object.\n \"\"\"\n return cls(obj.copy(), len(obj.index), len(obj.columns))\n\n @classmethod\n def preprocess_func(cls, func):\n \"\"\"\n Preprocess a function before an ``apply`` call.\n\n Parameters\n ----------\n func : callable\n Function to preprocess.\n\n Returns\n -------\n callable\n An object that can be accepted by ``apply``.\n\n Notes\n -----\n No special preprocessing action is required, so unmodified\n `func` will be returned.\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_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition_manager.py_from_modin_core_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/partition_manager.py_from_modin_core_dataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 38, "span_ids": ["PandasOnPythonDataframePartitionManager", "docstring"], "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": "from modin.core.dataframe.pandas.partitioning.partition_manager import (\n PandasDataframePartitionManager,\n)\nfrom .virtual_partition import (\n PandasOnPythonDataframeColumnPartition,\n PandasOnPythonDataframeRowPartition,\n)\nfrom .partition import PandasOnPythonDataframePartition\nfrom modin.core.execution.python.common import PythonWrapper\n\n\nclass PandasOnPythonDataframePartitionManager(PandasDataframePartitionManager):\n \"\"\"\n Class for managing partitions with pandas storage format and Python engine.\n\n Inherits all functionality from ``PandasDataframePartitionManager`` base class.\n \"\"\"\n\n _partition_class = PandasOnPythonDataframePartition\n _column_partitions_class = PandasOnPythonDataframeColumnPartition\n _row_partition_class = PandasOnPythonDataframeRowPartition\n _execution_wrapper = PythonWrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/virtual_partition.py_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/python/implementations/pandas_on_python/partitioning/virtual_partition.py_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/execution/python/implementations/pandas_on_python/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 61, "span_ids": ["PandasOnPythonDataframeAxisPartition", "PandasOnPythonDataframeColumnPartition", "PandasOnPythonDataframeRowPartition", "docstring"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\n\nfrom modin.core.dataframe.pandas.partitioning.axis_partition import (\n PandasDataframeAxisPartition,\n)\nfrom .partition import PandasOnPythonDataframePartition\nfrom modin.utils import _inherit_docstrings\n\n\nclass PandasOnPythonDataframeAxisPartition(PandasDataframeAxisPartition):\n \"\"\"\n Class defines axis partition interface with pandas storage format and Python engine.\n\n Inherits functionality from ``PandasDataframeAxisPartition`` class.\n\n Parameters\n ----------\n list_of_partitions : Union[list, PandasOnPythonDataframePartition]\n List of ``PandasOnPythonDataframePartition`` and\n ``PandasOnPythonDataframeVirtualPartition`` objects, or a single\n ``PandasOnPythonDataframePartition``.\n get_ip : bool, default: False\n Whether to get node IP addresses to conforming partitions or not.\n full_axis : bool, default: True\n Whether or not the virtual partition encompasses the whole axis.\n call_queue : list, optional\n A list of tuples (callable, args, kwargs) that contains deferred calls.\n length : int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n \"\"\"\n\n partition_type = PandasOnPythonDataframePartition\n instance_type = pandas.DataFrame\n\n\n@_inherit_docstrings(PandasOnPythonDataframeAxisPartition.__init__)\nclass PandasOnPythonDataframeColumnPartition(PandasOnPythonDataframeAxisPartition):\n axis = 0\n\n\n@_inherit_docstrings(PandasOnPythonDataframeAxisPartition.__init__)\nclass PandasOnPythonDataframeRowPartition(PandasOnPythonDataframeAxisPartition):\n axis = 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_modin-project__modin/modin/core/execution/ray/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/ray/common/__init__.py_RayWrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/__init__.py_RayWrapper_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 24, "span_ids": ["docstring"], "tokens": 39}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .engine_wrapper import RayWrapper, SignalActor\nfrom .utils import initialize_ray\n\n__all__ = [\n \"initialize_ray\",\n \"RayWrapper\",\n \"SignalActor\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_asyncio__deploy_ray_func.return.func_args_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_asyncio__deploy_ray_func.return.func_args_kwargs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 44, "span_ids": ["_deploy_ray_func", "docstring"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import asyncio\n\nimport ray\n\n\n@ray.remote\ndef _deploy_ray_func(func, *args, **kwargs): # pragma: no cover\n \"\"\"\n Wrap `func` to ease calling it remotely.\n\n Parameters\n ----------\n func : callable\n A local function that we want to call remotely.\n *args : iterable\n Positional arguments to pass to `func` when calling remotely.\n **kwargs : dict\n Keyword arguments to pass to `func` when calling remotely.\n\n Returns\n -------\n ray.ObjectRef or list\n Ray identifier of the result being put to Plasma store.\n \"\"\"\n return func(*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_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper_RayWrapper.deploy.return._deploy_ray_func_options_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper_RayWrapper.deploy.return._deploy_ray_func_options_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 75, "span_ids": ["RayWrapper", "RayWrapper.deploy"], "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 RayWrapper:\n \"\"\"Mixin that provides means of running functions remotely and getting local results.\"\"\"\n\n @classmethod\n def deploy(cls, func, f_args=None, f_kwargs=None, num_returns=1):\n \"\"\"\n Run local `func` remotely.\n\n Parameters\n ----------\n func : callable or ray.ObjectID\n The function to perform.\n f_args : list or tuple, optional\n Positional arguments to pass to ``func``.\n f_kwargs : dict, optional\n Keyword arguments to pass to ``func``.\n num_returns : int, default: 1\n Amount of return values expected from `func`.\n\n Returns\n -------\n ray.ObjectRef or list\n Ray identifier of the result being put to Plasma store.\n \"\"\"\n args = [] if f_args is None else f_args\n kwargs = {} if f_kwargs is None else f_kwargs\n return _deploy_ray_func.options(num_returns=num_returns).remote(\n func, *args, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper.materialize_RayWrapper.put.return.ray_put_data_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper.materialize_RayWrapper.put.return.ray_put_data_kwargs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 111, "span_ids": ["RayWrapper.put", "RayWrapper.materialize"], "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 RayWrapper:\n\n @classmethod\n def materialize(cls, obj_id):\n \"\"\"\n Get the value of object from the Plasma store.\n\n Parameters\n ----------\n obj_id : ray.ObjectID\n Ray object identifier to get the value by.\n\n Returns\n -------\n object\n Whatever was identified by `obj_id`.\n \"\"\"\n return ray.get(obj_id)\n\n @classmethod\n def put(cls, data, **kwargs):\n \"\"\"\n Store an object in the object store.\n\n Parameters\n ----------\n data : object\n The Python object to be stored.\n **kwargs : dict\n Additional keyword arguments.\n\n Returns\n -------\n ray.ObjectID\n Ray object identifier to get the value by.\n \"\"\"\n return ray.put(data, **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_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper.wait_RayWrapper.wait.ray_wait_unique_ids_num_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_RayWrapper.wait_RayWrapper.wait.ray_wait_unique_ids_num_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 131, "span_ids": ["RayWrapper.wait"], "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 RayWrapper:\n\n @classmethod\n def wait(cls, obj_ids, num_returns=None):\n \"\"\"\n Wait on the objects without materializing them (blocking operation).\n\n ``ray.wait`` assumes a list of unique object references: see\n https://github.com/modin-project/modin/issues/5045\n\n Parameters\n ----------\n obj_ids : list, scalar\n num_returns : int, optional\n \"\"\"\n if not isinstance(obj_ids, list):\n obj_ids = [obj_ids]\n unique_ids = list(set(obj_ids))\n if num_returns is None:\n num_returns = len(unique_ids)\n ray.wait(unique_ids, num_returns=num_returns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_SignalActor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/engine_wrapper.py_SignalActor_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 183, "span_ids": ["SignalActor.send", "SignalActor.wait", "SignalActor.is_set", "SignalActor.__init__", "SignalActor"], "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": "@ray.remote\nclass SignalActor: # pragma: no cover\n \"\"\"\n Help synchronize across tasks and actors on cluster.\n\n For details see: https://docs.ray.io/en/latest/advanced.html?highlight=signalactor#multi-node-synchronization-using-an-actor\n\n Parameters\n ----------\n event_count : int\n Number of events required for synchronization.\n \"\"\"\n\n def __init__(self, event_count: int):\n self.events = [asyncio.Event() for _ in range(event_count)]\n\n def send(self, event_idx: int):\n \"\"\"\n Indicate that event with `event_idx` has occured.\n\n Parameters\n ----------\n event_idx : int\n \"\"\"\n self.events[event_idx].set()\n\n async def wait(self, event_idx: int):\n \"\"\"\n Wait until event with `event_idx` has occured.\n\n Parameters\n ----------\n event_idx : int\n \"\"\"\n await self.events[event_idx].wait()\n\n def is_set(self, event_idx: int) -> bool:\n \"\"\"\n Check that event with `event_idx` had occured or not.\n\n Parameters\n ----------\n event_idx : int\n\n Returns\n -------\n bool\n \"\"\"\n return self.events[event_idx].is_set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_os_if_version_parse_ray___ve.ObjectIDType._ray_ObjectRef_ClientObj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_os_if_version_parse_ray___ve.ObjectIDType._ray_ObjectRef_ClientObj", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 54, "span_ids": ["docstring"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\nimport psutil\nfrom packaging import version\nfrom typing import Optional\nimport warnings\n\nimport ray\n\nfrom modin.config import (\n StorageFormat,\n IsRayCluster,\n RayRedisAddress,\n RayRedisPassword,\n CpuCount,\n GpuCount,\n Memory,\n NPartitions,\n ValueSource,\n GithubCI,\n CIAWSSecretAccessKey,\n CIAWSAccessKeyID,\n)\nfrom modin.error_message import ErrorMessage\nfrom .engine_wrapper import RayWrapper\n\n_OBJECT_STORE_TO_SYSTEM_MEMORY_RATIO = 0.6\n# This constant should be in sync with the limit in ray, which is private,\n# not exposed to users, and not documented:\n# https://github.com/ray-project/ray/blob/4692e8d8023e789120d3f22b41ffb136b50f70ea/python/ray/_private/ray_constants.py#L57-L62\n_MAC_OBJECT_STORE_LIMIT_BYTES = 2 * 2**30\n\n_RAY_IGNORE_UNHANDLED_ERRORS_VAR = \"RAY_IGNORE_UNHANDLED_ERRORS\"\n\nObjectIDType = ray.ObjectRef\nif version.parse(ray.__version__) >= version.parse(\"1.2.0\"):\n from ray.util.client.common import ClientObjectRef\n\n ObjectIDType = (ray.ObjectRef, ClientObjectRef)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray_initialize_ray.is_cluster.override_is_cluster_or_Is": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray_initialize_ray.is_cluster.override_is_cluster_or_Is", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 94, "span_ids": ["initialize_ray"], "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": "def initialize_ray(\n override_is_cluster=False,\n override_redis_address: str = None,\n override_redis_password: str = None,\n):\n \"\"\"\n Initialize Ray based on parameters, ``modin.config`` variables and internal defaults.\n\n Parameters\n ----------\n override_is_cluster : bool, default: False\n Whether to override the detection of Modin being run in a cluster\n and always assume this runs on cluster head node.\n This also overrides Ray worker detection and always runs the initialization\n function (runs from main thread only by default).\n If not specified, ``modin.config.IsRayCluster`` variable is used.\n override_redis_address : str, optional\n What Redis address to connect to when running in Ray cluster.\n If not specified, ``modin.config.RayRedisAddress`` is used.\n override_redis_password : str, optional\n What password to use when connecting to Redis.\n If not specified, ``modin.config.RayRedisPassword`` is used.\n \"\"\"\n # We need these vars to be set for each Ray's worker in order to ensure that\n # the `pandas` module has been fully imported inside of each process before\n # any execution begins:\n # https://github.com/modin-project/modin/pull/4603\n env_vars = {\"__MODIN_AUTOIMPORT_PANDAS__\": \"1\"}\n if GithubCI.get():\n # need these to write parquet to the moto service mocking s3.\n env_vars.update(\n {\n \"AWS_ACCESS_KEY_ID\": CIAWSAccessKeyID.get(),\n \"AWS_SECRET_ACCESS_KEY\": CIAWSSecretAccessKey.get(),\n }\n )\n extra_init_kw = {}\n is_cluster = override_is_cluster or IsRayCluster.get()\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_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray.if_not_ray_is_initialized_initialize_ray.num_gpus.int_ray_cluster_resources": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray.if_not_ray_is_initialized_initialize_ray.num_gpus.int_ray_cluster_resources", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 177, "span_ids": ["initialize_ray"], "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": "def initialize_ray(\n override_is_cluster=False,\n override_redis_address: str = None,\n override_redis_password: str = None,\n):\n # ... other code\n if not ray.is_initialized() or override_is_cluster:\n redis_address = override_redis_address or RayRedisAddress.get()\n redis_password = (\n (\n ray.ray_constants.REDIS_DEFAULT_PASSWORD\n if is_cluster\n else RayRedisPassword.get()\n )\n if override_redis_password is None\n and RayRedisPassword.get_value_source() == ValueSource.DEFAULT\n else override_redis_password or RayRedisPassword.get()\n )\n\n if is_cluster:\n extra_init_kw[\"runtime_env\"] = {\"env_vars\": env_vars}\n # We only start ray in a cluster setting for the head node.\n ray.init(\n address=redis_address or \"auto\",\n include_dashboard=False,\n ignore_reinit_error=True,\n _redis_password=redis_password,\n **extra_init_kw,\n )\n else:\n # This string is intentionally formatted this way. We want it indented in\n # the warning message.\n ErrorMessage.not_initialized(\n \"Ray\",\n f\"\"\"\n import ray\n ray.init({', '.join([f'{k}={v}' for k,v in extra_init_kw.items()])})\n\"\"\",\n )\n object_store_memory = _get_object_store_memory()\n ray_init_kwargs = {\n \"num_cpus\": CpuCount.get(),\n \"num_gpus\": GpuCount.get(),\n \"include_dashboard\": False,\n \"ignore_reinit_error\": True,\n \"object_store_memory\": object_store_memory,\n \"_redis_password\": redis_password,\n \"_memory\": object_store_memory,\n **extra_init_kw,\n }\n # It should be enough to simply set the required variables for the main process\n # for Ray to automatically propagate them to each new worker on the same node.\n # Although Ray doesn't guarantee this behavior it works as expected most of the\n # time and doesn't enforce us with any overhead that Ray's native `runtime_env`\n # is usually causing. You can visit this gh-issue for more info:\n # https://github.com/modin-project/modin/issues/5157#issuecomment-1500225150\n for key, value in env_vars.items():\n os.environ[key] = value\n ray.init(**ray_init_kwargs)\n\n if StorageFormat.get() == \"Cudf\":\n from modin.core.execution.ray.implementations.cudf_on_ray.partitioning import (\n GPUManager,\n GPU_MANAGERS,\n )\n\n # Check that GPU_MANAGERS is empty because _update_engine can be called multiple times\n if not GPU_MANAGERS:\n for i in range(GpuCount.get()):\n GPU_MANAGERS.append(GPUManager.remote(i))\n\n # Now ray is initialized, check runtime env config - especially useful if we join\n # an externally pre-configured cluster\n runtime_env_vars = ray.get_runtime_context().runtime_env.get(\"env_vars\", {})\n for varname, varvalue in env_vars.items():\n if str(runtime_env_vars.get(varname, \"\")) != str(varvalue):\n if is_cluster or (\n # Here we relax our requirements for a non-cluster case allowing for the `env_vars`\n # to be set at least as a process environment variable\n not is_cluster\n and os.environ.get(varname, \"\") != str(varvalue)\n ):\n ErrorMessage.single_warning(\n \"When using a pre-initialized Ray cluster, please ensure that the runtime env \"\n + f\"sets environment variable {varname} to {varvalue}\"\n )\n\n num_cpus = int(ray.cluster_resources()[\"CPU\"])\n num_gpus = int(ray.cluster_resources().get(\"GPU\", 0))\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_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray.if_StorageFormat_get__initialize_ray.if__RAY_IGNORE_UNHANDLED_.os_environ__RAY_IGNORE_UN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_initialize_ray.if_StorageFormat_get__initialize_ray.if__RAY_IGNORE_UNHANDLED_.os_environ__RAY_IGNORE_UN", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 189, "span_ids": ["initialize_ray"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def initialize_ray(\n override_is_cluster=False,\n override_redis_address: str = None,\n override_redis_password: str = None,\n):\n # ... other code\n if StorageFormat.get() == \"Cudf\":\n NPartitions._put(num_gpus)\n else:\n NPartitions._put(num_cpus)\n\n # TODO(https://github.com/ray-project/ray/issues/28216): remove this\n # workaround once Ray gives a better way to suppress task errors.\n # Ideally we would not set global environment variables.\n # If user has explicitly set _RAY_IGNORE_UNHANDLED_ERRORS_VAR, don't\n # don't override its value.\n if _RAY_IGNORE_UNHANDLED_ERRORS_VAR not in os.environ:\n os.environ[_RAY_IGNORE_UNHANDLED_ERRORS_VAR] = \"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_modin-project__modin/modin/core/execution/ray/common/utils.py__get_object_store_memory__get_object_store_memory.return.object_store_memory": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py__get_object_store_memory__get_object_store_memory.return.object_store_memory", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 249, "span_ids": ["_get_object_store_memory"], "tokens": 614}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_object_store_memory() -> Optional[int]:\n \"\"\"\n Get the object store memory we should start Ray with, in bytes.\n\n - If the ``Memory`` config variable is set, return that.\n - On Linux, take system memory from /dev/shm. On other systems use total\n virtual memory.\n - On Mac, never return more than Ray-specified upper limit.\n\n Returns\n -------\n Optional[int]\n The object store memory size in bytes, or None if we should use the Ray\n default.\n \"\"\"\n object_store_memory = Memory.get()\n if object_store_memory is not None:\n return object_store_memory\n virtual_memory = psutil.virtual_memory().total\n if sys.platform.startswith(\"linux\"):\n shm_fd = os.open(\"/dev/shm\", os.O_RDONLY)\n try:\n shm_stats = os.fstatvfs(shm_fd)\n system_memory = shm_stats.f_bsize * shm_stats.f_bavail\n if system_memory / (virtual_memory / 2) < 0.99:\n warnings.warn(\n f\"The size of /dev/shm is too small ({system_memory} bytes). The required size \"\n + f\"at least half of RAM ({virtual_memory // 2} bytes). Please, delete files in /dev/shm or \"\n + \"increase size of /dev/shm with --shm-size in Docker. Also, you can can override the memory \"\n + \"size for each Ray worker (in bytes) to the MODIN_MEMORY environment variable.\"\n )\n finally:\n os.close(shm_fd)\n else:\n system_memory = virtual_memory\n bytes_per_gb = 1e9\n object_store_memory = int(\n _OBJECT_STORE_TO_SYSTEM_MEMORY_RATIO\n * system_memory\n // bytes_per_gb\n * bytes_per_gb\n )\n if object_store_memory == 0:\n return None\n # Newer versions of ray don't allow us to initialize ray with object store\n # size larger than that _MAC_OBJECT_STORE_LIMIT_BYTES. It seems that\n # object store > the limit is too slow even on ray 1.0.0. However, limiting\n # the object store to _MAC_OBJECT_STORE_LIMIT_BYTES only seems to start\n # helping at ray version 1.3.0. So if ray version is at least 1.3.0, cap\n # the object store at _MAC_OBJECT_STORE_LIMIT_BYTES.\n # For background on the ray bug see:\n # - https://github.com/ray-project/ray/issues/20388\n # - https://github.com/modin-project/modin/issues/4872\n if sys.platform == \"darwin\" and version.parse(ray.__version__) >= version.parse(\n \"1.3.0\"\n ):\n object_store_memory = min(object_store_memory, _MAC_OBJECT_STORE_LIMIT_BYTES)\n return object_store_memory", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_deserialize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/common/utils.py_deserialize_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 290, "span_ids": ["deserialize"], "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 deserialize(obj): # pragma: no cover\n \"\"\"\n Deserialize a Ray object.\n\n Parameters\n ----------\n obj : ObjectIDType, iterable of ObjectIDType, or mapping of keys to ObjectIDTypes\n Object(s) to deserialize.\n\n Returns\n -------\n obj\n The deserialized object.\n \"\"\"\n if isinstance(obj, ObjectIDType):\n return RayWrapper.materialize(obj)\n elif isinstance(obj, (tuple, list)):\n # Ray will error if any elements are not ObjectIDType, but we still want ray to\n # perform batch deserialization for us -- thus, we must submit only the list elements\n # that are ObjectIDType, deserialize them, and restore them to their correct list index\n oid_indices, oids = [], []\n for i, ray_id in enumerate(obj):\n if isinstance(ray_id, ObjectIDType):\n oid_indices.append(i)\n oids.append(ray_id)\n ray_result = RayWrapper.materialize(oids)\n new_lst = list(obj[:])\n for i, deser_item in zip(oid_indices, ray_result):\n new_lst[i] = deser_item\n # Check that all objects have been deserialized\n assert not any([isinstance(o, ObjectIDType) for o in new_lst])\n return new_lst\n elif isinstance(obj, dict) and any(\n isinstance(val, ObjectIDType) for val in obj.values()\n ):\n return dict(zip(obj.keys(), RayWrapper.materialize(list(obj.values()))))\n else:\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_modin-project__modin/modin/core/execution/ray/generic/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/generic/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/ray/generic/io/__init__.py_RayIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/io/__init__.py_RayIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/generic/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 15}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import RayIO\n\n__all__ = [\"RayIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/io/io.py_from_modin_core_io_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/io/io.py_from_modin_core_io_import_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/generic/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["RayIO", "docstring"], "tokens": 27}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.io import BaseIO\n\n\nclass RayIO(BaseIO):\n \"\"\"Base class for doing I/O operations over Ray.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/partitioning/__init__.py_GenericRayDataframePartitionManager_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/partitioning/__init__.py_GenericRayDataframePartitionManager_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/generic/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["docstring"], "tokens": 27}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .partition_manager import GenericRayDataframePartitionManager\n\n__all__ = [\n \"GenericRayDataframePartitionManager\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/partitioning/partition_manager.py_np_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/generic/partitioning/partition_manager.py_np_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/generic/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 55, "span_ids": ["GenericRayDataframePartitionManager.to_numpy", "GenericRayDataframePartitionManager", "docstring"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\n\nfrom modin.core.dataframe.pandas.partitioning.partition_manager import (\n PandasDataframePartitionManager,\n)\nfrom modin.core.execution.ray.common import RayWrapper\n\n\nclass GenericRayDataframePartitionManager(PandasDataframePartitionManager):\n \"\"\"The class implements the interface in `PandasDataframePartitionManager`.\"\"\"\n\n @classmethod\n def to_numpy(cls, partitions, **kwargs):\n \"\"\"\n Convert `partitions` into a NumPy array.\n\n Parameters\n ----------\n partitions : NumPy array\n A 2-D array of partitions to convert to local NumPy array.\n **kwargs : dict\n Keyword arguments to pass to each partition ``.to_numpy()`` call.\n\n Returns\n -------\n NumPy array\n \"\"\"\n parts = RayWrapper.materialize(\n [\n obj.apply(lambda df, **kwargs: df.to_numpy(**kwargs)).list_of_blocks[0]\n for row in partitions\n for obj in row\n ]\n )\n n = partitions.shape[1]\n parts = [parts[i * n : (i + 1) * n] for i in list(range(partitions.shape[0]))]\n\n arr = np.block(parts)\n return arr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/__init__.py_cuDFOnRayDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/__init__.py_cuDFOnRayDataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["docstring"], "tokens": 27}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .dataframe import cuDFOnRayDataframe\n\n__all__ = [\n \"cuDFOnRayDataframe\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_from_typing_import_List__cuDFOnRayDataframe._partition_mgr_cls.cuDFOnRayDataframePartiti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_from_typing_import_List__cuDFOnRayDataframe._partition_mgr_cls.cuDFOnRayDataframePartiti", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 54, "span_ids": ["cuDFOnRayDataframe", "docstring"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List, Hashable, Optional\n\nimport numpy as np\n\nfrom modin.error_message import ErrorMessage\nfrom modin.pandas.utils import check_both_not_none\nfrom modin.core.execution.ray.implementations.pandas_on_ray.dataframe import (\n PandasOnRayDataframe,\n)\nfrom modin.core.execution.ray.common import RayWrapper\nfrom ..partitioning import (\n cuDFOnRayDataframePartition,\n cuDFOnRayDataframePartitionManager,\n)\n\n\nclass cuDFOnRayDataframe(PandasOnRayDataframe):\n \"\"\"\n The class implements the interface in ``PandasOnRayDataframe`` using cuDF.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence\n The index for the dataframe. Converted to a ``pandas.Index``.\n columns : sequence\n The columns object for the dataframe. Converted to a ``pandas.Index``.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = cuDFOnRayDataframePartitionManager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels_cuDFOnRayDataframe.synchronize_labels.cum_col_widths.np_cumsum_0_self_colu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels_cuDFOnRayDataframe.synchronize_labels.cum_col_widths.np_cumsum_0_self_colu", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 70, "span_ids": ["cuDFOnRayDataframe.synchronize_labels"], "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 cuDFOnRayDataframe(PandasOnRayDataframe):\n\n def synchronize_labels(self, axis=None):\n \"\"\"\n Synchronize labels by applying the index object (Index or Columns) to the partitions eagerly.\n\n Parameters\n ----------\n axis : {0, 1, None}, default: None\n The axis to apply to. If None, it applies to both axes.\n \"\"\"\n ErrorMessage.catch_bugs_and_request_email(\n axis is not None and axis not in [0, 1]\n )\n\n cum_row_lengths = np.cumsum([0] + self.row_lengths)\n cum_col_widths = np.cumsum([0] + self.column_widths)\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels.apply_idx_objs_cuDFOnRayDataframe.synchronize_labels.apply_idx_objs.if_axis_0_.else_.return.df_rename_index_idx_colu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels.apply_idx_objs_cuDFOnRayDataframe.synchronize_labels.apply_idx_objs.if_axis_0_.else_.return.df_rename_index_idx_colu", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 84, "span_ids": ["cuDFOnRayDataframe.synchronize_labels"], "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 cuDFOnRayDataframe(PandasOnRayDataframe):\n\n def synchronize_labels(self, axis=None):\n # ... other code\n\n def apply_idx_objs(df, idx, cols, axis):\n # cudf does not support set_axis. It only supports rename with 1-to-1 mapping.\n # Therefore, we need to create the dictionary that have the relationship between\n # current index and new ones.\n idx = {df.index[i]: idx[i] for i in range(len(idx))}\n cols = {df.index[i]: cols[i] for i in range(len(cols))}\n\n if axis == 0:\n return df.rename(index=idx)\n elif axis == 1:\n return df.rename(columns=cols)\n else:\n return df.rename(index=idx, columns=cols)\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels.keys_cuDFOnRayDataframe.synchronize_labels.self._partitions.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.synchronize_labels.keys_cuDFOnRayDataframe.synchronize_labels.self._partitions.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 118, "span_ids": ["cuDFOnRayDataframe.synchronize_labels"], "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 cuDFOnRayDataframe(PandasOnRayDataframe):\n\n def synchronize_labels(self, axis=None):\n # ... other code\n\n keys = np.array(\n [\n [\n self._partitions[i][j].apply(\n apply_idx_objs,\n idx=self.index[\n slice(cum_row_lengths[i], cum_row_lengths[i + 1])\n ],\n cols=self.columns[\n slice(cum_col_widths[j], cum_col_widths[j + 1])\n ],\n axis=axis,\n )\n for j in range(len(self._partitions[i]))\n ]\n for i in range(len(self._partitions))\n ]\n )\n\n self._partitions = np.array(\n [\n [\n cuDFOnRayDataframePartition(\n self._partitions[i][j].get_gpu_manager(),\n keys[i][j],\n self._partitions[i][j]._length_cache,\n self._partitions[i][j]._width_cache,\n )\n for j in range(len(keys[i]))\n ]\n for i in range(len(keys))\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.take_2d_labels_or_positional_cuDFOnRayDataframe.take_2d_labels_or_positional.if_col_labels_is_not_None.col_positions.self_columns_get_indexer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.take_2d_labels_or_positional_cuDFOnRayDataframe.take_2d_labels_or_positional.if_col_labels_is_not_None.col_positions.self_columns_get_indexer_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 197, "span_ids": ["cuDFOnRayDataframe.take_2d_labels_or_positional"], "tokens": 674}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframe(PandasOnRayDataframe):\n\n def take_2d_labels_or_positional(\n self,\n row_labels: Optional[List[Hashable]] = None,\n row_positions: Optional[List[int]] = None,\n col_labels: Optional[List[Hashable]] = None,\n col_positions: Optional[List[int]] = None,\n ):\n \"\"\"\n Lazily select columns or rows from given indices.\n\n Parameters\n ----------\n row_labels : list of hashable, optional\n The row labels to extract.\n row_positions : list of int, optional\n The row positions to extract.\n col_labels : list of hashable, optional\n The column labels to extract.\n col_positions : list of int, optional\n The column positions to extract.\n\n Returns\n -------\n cuDFOnRayDataframe\n A new ``cuDFOnRayDataframe`` from the mask provided.\n\n Notes\n -----\n If both `row_labels` and `row_positions` are provided, a ValueError is raised.\n The same rule applies for `col_labels` and `col_positions`.\n \"\"\"\n if check_both_not_none(row_labels, row_positions):\n raise ValueError(\n \"Both row_labels and row_positions were provided - please provide only one of row_labels and row_positions.\"\n )\n if check_both_not_none(col_labels, col_positions):\n raise ValueError(\n \"Both col_labels and col_positions were provided - please provide only one of col_labels and col_positions.\"\n )\n if isinstance(row_positions, slice) and (\n row_positions == slice(None) or row_positions == slice(0, None)\n ):\n row_positions = None\n if isinstance(col_positions, slice) and (\n col_positions == slice(None) or col_positions == slice(0, None)\n ):\n col_positions = None\n if (\n col_labels is None\n and col_positions is None\n and row_labels is None\n and row_positions is None\n ):\n return self.copy()\n if row_labels is not None:\n row_positions = self.index.get_indexer_for(row_labels)\n if row_positions is not None:\n row_partitions_list = self._get_dict_of_block_index(0, row_positions)\n if isinstance(row_positions, slice):\n # Row lengths for slice are calculated as the length of the slice\n # on the partition. Often this will be the same length as the current\n # length, but sometimes it is different, thus the extra calculation.\n new_row_lengths = [\n len(range(*idx.indices(self.row_lengths[p])))\n for p, idx in row_partitions_list.items()\n ]\n # Use the slice to calculate the new row index\n new_index = self.index[row_positions]\n else:\n new_row_lengths = [len(idx) for _, idx in row_partitions_list.items()]\n new_index = self.index[sorted(row_positions)]\n else:\n row_partitions_list = {i: slice(None) for i in range(len(self.row_lengths))}\n new_row_lengths = self.row_lengths\n new_index = self.index\n\n if col_labels is not None:\n col_positions = self.columns.get_indexer_for(col_labels)\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.take_2d_labels_or_positional.if_col_positions_is_not_N_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py_cuDFOnRayDataframe.take_2d_labels_or_positional.if_col_positions_is_not_N_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 288, "span_ids": ["cuDFOnRayDataframe.take_2d_labels_or_positional"], "tokens": 762}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframe(PandasOnRayDataframe):\n\n def take_2d_labels_or_positional(\n self,\n row_labels: Optional[List[Hashable]] = None,\n row_positions: Optional[List[int]] = None,\n col_labels: Optional[List[Hashable]] = None,\n col_positions: Optional[List[int]] = None,\n ):\n # ... other code\n if col_positions is not None:\n col_partitions_list = self._get_dict_of_block_index(1, col_positions)\n if isinstance(col_positions, slice):\n # Column widths for slice are calculated as the length of the slice\n # on the partition. Often this will be the same length as the current\n # length, but sometimes it is different, thus the extra calculation.\n new_col_widths = [\n len(range(*idx.indices(self.column_widths[p])))\n for p, idx in col_partitions_list.items()\n ]\n # Use the slice to calculate the new columns\n new_columns = self.columns[col_positions]\n assert sum(new_col_widths) == len(\n new_columns\n ), \"{} != {}.\\n{}\\n{}\\n{}\".format(\n sum(new_col_widths),\n len(new_columns),\n col_positions,\n self.column_widths,\n col_partitions_list,\n )\n if self.has_materialized_dtypes:\n new_dtypes = self.dtypes[col_positions]\n else:\n new_dtypes = None\n else:\n new_col_widths = [len(idx) for _, idx in col_partitions_list.items()]\n new_columns = self.columns[sorted(col_positions)]\n if self.has_materialized_dtypes:\n new_dtypes = self.dtypes.iloc[sorted(col_positions)]\n else:\n new_dtypes = None\n else:\n col_partitions_list = {\n i: slice(None) for i in range(len(self.column_widths))\n }\n new_col_widths = self.column_widths\n new_columns = self.columns\n if self.has_materialized_dtypes:\n new_dtypes = self.dtypes\n else:\n new_dtypes = None\n\n key_and_gpus = np.array(\n [\n [\n [\n self._partitions[row_idx][col_idx].mask(\n row_internal_indices, col_internal_indices\n ),\n self._partitions[row_idx][col_idx].get_gpu_manager(),\n ]\n for col_idx, col_internal_indices in col_partitions_list.items()\n if isinstance(col_internal_indices, slice)\n or len(col_internal_indices) > 0\n ]\n for row_idx, row_internal_indices in row_partitions_list.items()\n if isinstance(row_internal_indices, slice)\n or len(row_internal_indices) > 0\n ]\n )\n\n shape = key_and_gpus.shape[:2]\n keys = RayWrapper.materialize(key_and_gpus[:, :, 0].flatten().tolist())\n gpu_managers = key_and_gpus[:, :, 1].flatten().tolist()\n new_partitions = self._partition_mgr_cls._create_partitions(\n keys, gpu_managers\n ).reshape(shape)\n intermediate = self.__constructor__(\n new_partitions,\n new_index,\n new_columns,\n new_row_lengths,\n new_col_widths,\n new_dtypes,\n )\n\n sorted_row_positions = sorted_col_positions = None\n if row_positions is not None:\n sorted_row_positions = sorted(row_positions)\n if col_positions is not None:\n sorted_col_positions = sorted(col_positions)\n\n return self._maybe_reorder_labels(\n intermediate,\n row_positions,\n sorted_row_positions,\n col_positions,\n sorted_col_positions,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/__init__.py_cuDFOnRayIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/__init__.py_cuDFOnRayIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 22, "span_ids": ["docstring"], "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 .io import cuDFOnRayIO\n\n\n__all__ = [\n \"cuDFOnRayIO\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/io.py_from_modin_core_io_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/io.py_from_modin_core_io_import_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 42, "span_ids": ["cuDFOnRayIO", "docstring"], "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 modin.core.io import BaseIO\nfrom modin.core.storage_formats.cudf.query_compiler import cuDFQueryCompiler\nfrom modin.core.storage_formats.cudf.parser import cuDFCSVParser\nfrom modin.core.execution.ray.common import RayWrapper\nfrom ..dataframe import cuDFOnRayDataframe\nfrom ..partitioning import (\n cuDFOnRayDataframePartition,\n cuDFOnRayDataframePartitionManager,\n)\nfrom .text import cuDFCSVDispatcher\n\n\nclass cuDFOnRayIO(BaseIO):\n \"\"\"The class implements ``BaseIO`` class using cuDF-entities.\"\"\"\n\n frame_cls = cuDFOnRayDataframe\n query_compiler_cls = cuDFQueryCompiler\n\n build_args = dict(\n frame_partition_cls=cuDFOnRayDataframePartition,\n query_compiler_cls=cuDFQueryCompiler,\n frame_cls=cuDFOnRayDataframe,\n frame_partition_mgr_cls=cuDFOnRayDataframePartitionManager,\n )\n\n read_csv = type(\"\", (RayWrapper, cuDFCSVParser, cuDFCSVDispatcher), build_args).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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/__init__.py_cuDFCSVDispatcher_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/__init__.py_cuDFCSVDispatcher_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/io/text/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 22, "span_ids": ["docstring"], "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 .csv_dispatcher import cuDFCSVDispatcher\n\n\n__all__ = [\n \"cuDFCSVDispatcher\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py_np_cuDFCSVDispatcher.build_partition.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py_np_cuDFCSVDispatcher.build_partition.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py", "file_name": "csv_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 66, "span_ids": ["cuDFCSVDispatcher", "cuDFCSVDispatcher.build_partition", "docstring"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\n\nfrom modin.core.io import CSVDispatcher\nfrom modin.core.execution.ray.implementations.cudf_on_ray.partitioning.partition_manager import (\n GPU_MANAGERS,\n)\nfrom typing import Tuple\n\n\nclass cuDFCSVDispatcher(CSVDispatcher):\n \"\"\"\n The class implements ``CSVDispatcher`` using cuDF storage format.\n\n This class handles utils for reading `.csv` files.\n \"\"\"\n\n @classmethod\n def build_partition(cls, partition_ids, row_lengths, column_widths):\n \"\"\"\n Build array with partitions of `cls.frame_partition_cls` class.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n row_lengths : list\n Partitions rows lengths.\n column_widths : list\n Number of columns in each partition.\n\n Returns\n -------\n np.ndarray\n Array with shape equals to the shape of `partition_ids` and\n filed with partitions objects.\n \"\"\"\n\n def create_partition(i, j):\n return cls.frame_partition_cls(\n GPU_MANAGERS[i],\n partition_ids[i][j],\n length=row_lengths[i],\n width=column_widths[j],\n )\n\n return np.array(\n [\n [create_partition(i, j) for j in range(len(partition_ids[i]))]\n for i in range(len(partition_ids))\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py_cuDFCSVDispatcher._launch_tasks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py_cuDFCSVDispatcher._launch_tasks_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/io/text/csv_dispatcher.py", "file_name": "csv_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 103, "span_ids": ["cuDFCSVDispatcher._launch_tasks"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFCSVDispatcher(CSVDispatcher):\n\n @classmethod\n def _launch_tasks(cls, splits: list, **partition_kwargs) -> Tuple[list, list, list]:\n \"\"\"\n Launch tasks to read partitions.\n\n Parameters\n ----------\n splits : list\n List of tuples with partitions data, which defines\n parser task (start/end read bytes and etc).\n **partition_kwargs : dict\n Dictionary with keyword args that will be passed to the parser function.\n\n Returns\n -------\n partition_ids : list\n List with references to the partitions data.\n index_ids : list\n List with references to the partitions index objects.\n dtypes_ids : list\n List with references to the partitions dtypes objects.\n \"\"\"\n partition_ids = [None] * len(splits)\n index_ids = [None] * len(splits)\n dtypes_ids = [None] * len(splits)\n gpu_manager = 0\n for idx, (start, end) in enumerate(splits):\n partition_kwargs.update({\"start\": start, \"end\": end, \"gpu\": gpu_manager})\n *partition_ids[idx], index_ids[idx], dtypes_ids[idx] = cls.deploy(\n func=cls.parse,\n f_kwargs=partition_kwargs,\n num_returns=partition_kwargs.get(\"num_splits\") + 2,\n )\n gpu_manager += 1\n return partition_ids, index_ids, dtypes_ids", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/__init__.py_GPUManager_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/__init__.py_GPUManager_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 26, "span_ids": ["docstring"], "tokens": 78}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .gpu_manager import GPUManager\nfrom .partition_manager import cuDFOnRayDataframePartitionManager, GPU_MANAGERS\nfrom .partition import cuDFOnRayDataframePartition\n\n__all__ = [\n \"GPUManager\",\n \"GPU_MANAGERS\",\n \"cuDFOnRayDataframePartitionManager\",\n \"cuDFOnRayDataframePartition\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cudf_cuDFOnRayDataframeAxisPartition.instance_type.cudf_DataFrame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cudf_cuDFOnRayDataframeAxisPartition.instance_type.cudf_DataFrame", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 36, "span_ids": ["cuDFOnRayDataframeAxisPartition.__init__", "cuDFOnRayDataframeAxisPartition:3", "cuDFOnRayDataframeAxisPartition", "docstring"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import cudf\n\nfrom modin.core.execution.ray.common import RayWrapper\nfrom .partition import cuDFOnRayDataframePartition\n\n\nclass cuDFOnRayDataframeAxisPartition(object):\n \"\"\"\n Base class for any axis partition class for cuDF storage format.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``cuDFOnRayDataframePartition``-s.\n \"\"\"\n\n def __init__(self, partitions):\n self.partitions = [obj for obj in partitions]\n\n partition_type = cuDFOnRayDataframePartition\n instance_type = cudf.DataFrame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cuDFOnRayDataframeColumnPartition_cuDFOnRayDataframeColumnPartition.reduce.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cuDFOnRayDataframeColumnPartition_cuDFOnRayDataframeColumnPartition.reduce.return.result", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 79, "span_ids": ["cuDFOnRayDataframeColumnPartition", "cuDFOnRayDataframeColumnPartition.reduce"], "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 cuDFOnRayDataframeColumnPartition(cuDFOnRayDataframeAxisPartition):\n \"\"\"\n The column partition implementation of ``cuDFOnRayDataframeAxisPartition``.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``cuDFOnRayDataframePartition``-s.\n \"\"\"\n\n axis = 0\n\n def reduce(self, func):\n \"\"\"\n Reduce partitions along `self.axis` and apply `func`.\n\n Parameters\n ----------\n func : callable\n A func to apply.\n\n Returns\n -------\n cuDFOnRayDataframePartition\n \"\"\"\n keys = [partition.get_key() for partition in self.partitions]\n gpu_managers = [partition.get_gpu_manager() for partition in self.partitions]\n head_gpu_manager = gpu_managers[0]\n cudf_dataframe_object_ids = [\n gpu_manager.get.remote(key) for gpu_manager, key in zip(gpu_managers, keys)\n ]\n\n # FIXME: The signature of `head_gpu_manager.reduce` requires\n # (first, others, func, axis=0, **kwargs) parameters, but `first`\n # parameter isn't present.\n key = head_gpu_manager.reduce.remote(\n cudf_dataframe_object_ids, axis=self.axis, func=func\n )\n key = RayWrapper.materialize(key)\n result = cuDFOnRayDataframePartition(gpu_manager=head_gpu_manager, key=key)\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cuDFOnRayDataframeRowPartition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py_cuDFOnRayDataframeRowPartition_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 119, "span_ids": ["cuDFOnRayDataframeRowPartition.reduce", "cuDFOnRayDataframeRowPartition"], "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 cuDFOnRayDataframeRowPartition(cuDFOnRayDataframeAxisPartition):\n \"\"\"\n The row partition implementation of ``cuDFOnRayDataframeAxisPartition``.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``cuDFOnRayDataframePartition``-s.\n \"\"\"\n\n axis = 1\n\n def reduce(self, func):\n \"\"\"\n Reduce partitions along `self.axis` and apply `func`.\n\n Parameters\n ----------\n func : calalble\n A func to apply.\n\n Returns\n -------\n cuDFOnRayDataframePartition\n\n Notes\n -----\n Since we are using row partitions, we can bypass the Ray plasma\n store during axis reduce functions.\n \"\"\"\n keys = [partition.get_key() for partition in self.partitions]\n gpu = self.partitions[0].get_gpu_manager()\n\n # FIXME: Method `gpu_manager.reduce_key_list` does not exist.\n key = gpu.reduce_key_list.remote(keys, func)\n key = RayWrapper.materialize(key)\n return cuDFOnRayDataframePartition(gpu_manager=gpu, key=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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_ray_GPUManager.apply_non_persistent.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_ray_GPUManager.apply_non_persistent.return.result", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py", "file_name": "gpu_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 67, "span_ids": ["GPUManager", "GPUManager.__init__", "GPUManager.apply_non_persistent", "docstring"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import ray\nimport cudf\nimport pandas\n\nfrom modin.core.execution.ray.common import RayWrapper\n\n\n@ray.remote(num_gpus=1)\nclass GPUManager(object):\n \"\"\"\n Ray actor-class to store ``cudf.DataFrame``-s and execute functions on it.\n\n Parameters\n ----------\n gpu_id : int\n The identifier of GPU.\n \"\"\"\n\n def __init__(self, gpu_id):\n self.key = 0\n self.cudf_dataframe_dict = {}\n self.gpu_id = gpu_id\n\n # TODO(#45): Merge apply and apply_non_persistent\n def apply_non_persistent(self, first, other, func, **kwargs):\n \"\"\"\n Apply `func` to values associated with `first`/`other` keys of `self.cudf_dataframe_dict`.\n\n Parameters\n ----------\n first : int\n The first key associated with dataframe from `self.cudf_dataframe_dict`.\n other : int\n The second key associated with dataframe from `self.cudf_dataframe_dict`.\n If it isn't a real key, the `func` will be applied to the `first` only.\n func : callable\n A function to apply.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n The type of return of `func`\n The result of the `func` (will be a ``ray.ObjectRef`` in outside level).\n \"\"\"\n df1 = self.cudf_dataframe_dict[first]\n df2 = self.cudf_dataframe_dict[other] if other else None\n if not df2:\n result = func(df1, **kwargs)\n else:\n result = func(df1, df2, **kwargs)\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.apply_GPUManager.apply.return.self_store_new_df_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.apply_GPUManager.apply.return.self_store_new_df_result_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py", "file_name": "gpu_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 104, "span_ids": ["GPUManager.apply"], "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": "@ray.remote(num_gpus=1)\nclass GPUManager(object):\n\n def apply(self, first, other, func, **kwargs):\n \"\"\"\n Apply `func` to values associated with `first`/`other` keys of `self.cudf_dataframe_dict` with storing of the result.\n\n Store the return value of `func` (a new ``cudf.DataFrame``)\n into `self.cudf_dataframe_dict`.\n\n Parameters\n ----------\n first : int\n The first key associated with dataframe from `self.cudf_dataframe_dict`.\n other : int or ray.ObjectRef\n The second key associated with dataframe from `self.cudf_dataframe_dict`.\n If it isn't a real key, the `func` will be applied to the `first` only.\n func : callable\n A function to apply.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n int\n The new key of the new dataframe stored in `self.cudf_dataframe_dict`\n (will be a ``ray.ObjectRef`` in outside level).\n \"\"\"\n df1 = self.cudf_dataframe_dict[first]\n if not other:\n result = func(df1, **kwargs)\n return self.store_new_df(result)\n if not isinstance(other, int):\n assert isinstance(other, ray.ObjectRef)\n df2 = RayWrapper.materialize(other)\n else:\n df2 = self.cudf_dataframe_dict[other]\n result = func(df1, df2, **kwargs)\n return self.store_new_df(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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.reduce_GPUManager.reduce.return.self_store_new_df_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.reduce_GPUManager.reduce.return.self_store_new_df_result_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py", "file_name": "gpu_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 153, "span_ids": ["GPUManager.reduce"], "tokens": 471}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@ray.remote(num_gpus=1)\nclass GPUManager(object):\n\n def reduce(self, first, others, func, axis=0, **kwargs):\n \"\"\"\n Apply `func` to values associated with `first` key and `others` keys of `self.cudf_dataframe_dict` with storing of the result.\n\n Dataframes associated with `others` keys will be concatenated to one\n dataframe.\n\n Store the return value of `func` (a new ``cudf.DataFrame``)\n into `self.cudf_dataframe_dict`.\n\n Parameters\n ----------\n first : int\n The first key associated with dataframe from `self.cudf_dataframe_dict`.\n others : list of int / list of ray.ObjectRef\n The list of keys associated with dataframe from `self.cudf_dataframe_dict`.\n func : callable\n A function to apply.\n axis : {0, 1}, default: 0\n An axis corresponding to a particular row/column of the dataframe.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n int\n The new key of the new dataframe stored in `self.cudf_dataframe_dict`\n (will be a ``ray.ObjectRef`` in outside level).\n\n Notes\n -----\n If ``len(others) == 0`` `func` should be able to work with 2nd\n positional argument with None value.\n \"\"\"\n # TODO: Try to use `axis` parameter of cudf.concat\n join_func = (\n cudf.DataFrame.join if not axis else lambda x, y: cudf.concat([x, y])\n )\n if not isinstance(others[0], int):\n other_dfs = RayWrapper.materialize(others)\n else:\n other_dfs = [self.cudf_dataframe_dict[i] for i in others]\n df1 = self.cudf_dataframe_dict[first]\n df2 = others[0] if len(others) >= 1 else None\n for i in range(1, len(others)):\n df2 = join_func(df2, other_dfs[i])\n result = func(df1, df2, **kwargs)\n return self.store_new_df(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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.store_new_df_GPUManager.get_oid.return.self_cudf_dataframe_dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.store_new_df_GPUManager.get_oid.return.self_cudf_dataframe_dict_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py", "file_name": "gpu_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 213, "span_ids": ["GPUManager.store_new_df", "GPUManager.get_id", "GPUManager.free", "GPUManager.get_oid"], "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": "@ray.remote(num_gpus=1)\nclass GPUManager(object):\n\n def store_new_df(self, df):\n \"\"\"\n Store `df` in `self.cudf_dataframe_dict`.\n\n Parameters\n ----------\n df : cudf.DataFrame\n The ``cudf.DataFrame`` to be added.\n\n Returns\n -------\n int\n The key associated with added dataframe\n (will be a ``ray.ObjectRef`` in outside level).\n \"\"\"\n self.key += 1\n self.cudf_dataframe_dict[self.key] = df\n return self.key\n\n def free(self, key):\n \"\"\"\n Free the dataFrame and associated `key` out of `self.cudf_dataframe_dict`.\n\n Parameters\n ----------\n key : int\n The key to be deleted.\n \"\"\"\n if key in self.cudf_dataframe_dict:\n del self.cudf_dataframe_dict[key]\n\n def get_id(self):\n \"\"\"\n Get the `self.gpu_id` from this object.\n\n Returns\n -------\n int\n The gpu_id from this object\n (will be a ``ray.ObjectRef`` in outside level).\n \"\"\"\n return self.gpu_id\n\n def get_oid(self, key):\n \"\"\"\n Get the value from `self.cudf_dataframe_dict` by `key`.\n\n Parameters\n ----------\n key : int\n The key to get value.\n\n Returns\n -------\n cudf.DataFrame\n Dataframe corresponding to `key`(will be a ``ray.ObjectRef``\n in outside level).\n \"\"\"\n return self.cudf_dataframe_dict[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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.put_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py_GPUManager.put_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/gpu_manager.py", "file_name": "gpu_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 233, "span_ids": ["GPUManager.put"], "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": "@ray.remote(num_gpus=1)\nclass GPUManager(object):\n\n def put(self, pandas_df):\n \"\"\"\n Convert `pandas_df` to ``cudf.DataFrame`` and put it to `self.cudf_dataframe_dict`.\n\n Parameters\n ----------\n pandas_df : pandas.DataFrame/pandas.Series\n A pandas DataFrame/Series to be added.\n\n Returns\n -------\n int\n The key associated with added dataframe\n (will be a ``ray.ObjectRef`` in outside level).\n \"\"\"\n if isinstance(pandas_df, pandas.Series):\n pandas_df = pandas_df.to_frame()\n return self.store_new_df(cudf.from_pandas(pandas_df))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_ray_cuDFOnRayDataframePartition.__copy__.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_ray_cuDFOnRayDataframePartition.__copy__.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 63, "span_ids": ["cuDFOnRayDataframePartition.__copy__", "cuDFOnRayDataframePartition.__init__", "cuDFOnRayDataframePartition", "docstring"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import ray\nimport cudf\nimport cupy\nimport numpy as np\nimport cupy as cp\n\nfrom modin.core.dataframe.pandas.partitioning.partition import PandasDataframePartition\nfrom pandas.core.dtypes.common import is_list_like\nfrom modin.core.execution.ray.common import RayWrapper\nfrom modin.core.execution.ray.common.utils import ObjectIDType\n\n\nclass cuDFOnRayDataframePartition(PandasDataframePartition):\n \"\"\"\n The class implements the interface in ``PandasDataframePartition`` using cuDF on Ray.\n\n Parameters\n ----------\n gpu_manager : modin.core.execution.ray.implementations.cudf_on_ray.partitioning.GPUManager\n A gpu manager to store cuDF dataframes.\n key : ray.ObjectRef or int\n An integer key (or reference to key) associated with\n ``cudf.DataFrame`` stored in `gpu_manager`.\n length : ray.ObjectRef or int, optional\n Length or reference to it of wrapped ``pandas.DataFrame``.\n width : ray.ObjectRef or int, optional\n Width or reference to it of wrapped ``pandas.DataFrame``.\n \"\"\"\n\n def __init__(self, gpu_manager, key, length=None, width=None):\n self.gpu_manager = gpu_manager\n self.key = key\n self._length_cache = length\n self._width_cache = width\n\n def __copy__(self):\n \"\"\"\n Create a copy of this object.\n\n Returns\n -------\n cuDFOnRayDataframePartition\n A copy of this object.\n \"\"\"\n # Shallow copy.\n return self.__constructor__(\n self.gpu_manager, self.key, self._length_cache, self._width_cache\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.put_cuDFOnRayDataframePartition.put.return.gpu_manager_put_remote_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.put_cuDFOnRayDataframePartition.put.return.gpu_manager_put_remote_pa", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 83, "span_ids": ["cuDFOnRayDataframePartition.put"], "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 cuDFOnRayDataframePartition(PandasDataframePartition):\n\n @classmethod\n def put(cls, gpu_manager, pandas_dataframe):\n \"\"\"\n Put `pandas_dataframe` to `gpu_manager`.\n\n Parameters\n ----------\n gpu_manager : modin.core.execution.ray.implementations.cudf_on_ray.partitioning.GPUManager\n A gpu manager to store cuDF dataframes.\n pandas_dataframe : pandas.DataFrame/pandas.Series\n A ``pandas.DataFrame/pandas.Series`` to put.\n\n Returns\n -------\n ray.ObjectRef\n A reference to integer key of added pandas.DataFrame\n to internal dict-storage in `gpu_manager`.\n \"\"\"\n return gpu_manager.put.remote(pandas_dataframe)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.apply_cuDFOnRayDataframePartition.apply.return.self_gpu_manager_apply_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.apply_cuDFOnRayDataframePartition.apply.return.self_gpu_manager_apply_re", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 106, "span_ids": ["cuDFOnRayDataframePartition.apply"], "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 cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def apply(self, func, *args, **kwargs):\n \"\"\"\n Apply `func` to this partition.\n\n Parameters\n ----------\n func : callable\n A function to apply.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n ray.ObjectRef\n A reference to integer key of result\n in internal dict-storage of `self.gpu_manager`.\n \"\"\"\n return self.gpu_manager.apply.remote(\n self.get_key(), None, func, *args, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition._TODO_Check_the_need_of_cuDFOnRayDataframePartition.apply_result_not_dataframe.return.self_gpu_manager_apply_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition._TODO_Check_the_need_of_cuDFOnRayDataframePartition.apply_result_not_dataframe.return.self_gpu_manager_apply_re", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 129, "span_ids": ["cuDFOnRayDataframePartition.apply_result_not_dataframe", "cuDFOnRayDataframePartition.apply"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframePartition(PandasDataframePartition):\n\n # TODO: Check the need of this method\n def apply_result_not_dataframe(self, func, **kwargs):\n \"\"\"\n Apply `func` to this partition.\n\n Parameters\n ----------\n func : callable\n A function to apply.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n ray.ObjectRef\n A reference to integer key of result\n in internal dict-storage of `self.gpu_manager`.\n \"\"\"\n # FIXME: Can't find `gpu_manager.apply_result_not_dataframe` method.\n return self.gpu_manager.apply_result_not_dataframe.remote(\n self.get_key(), func, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.add_to_apply_calls_cuDFOnRayDataframePartition.add_to_apply_calls.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.add_to_apply_calls_cuDFOnRayDataframePartition.add_to_apply_calls.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 162, "span_ids": ["cuDFOnRayDataframePartition.add_to_apply_calls"], "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 cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def add_to_apply_calls(self, func, length=None, width=None, *args, **kwargs):\n \"\"\"\n Apply `func` to this partition and create new.\n\n Parameters\n ----------\n func : callable\n A function to apply.\n length : ray.ObjectRef or int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : ray.ObjectRef or int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n *args : tuple\n Positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n cuDFOnRayDataframePartition\n New partition based on result of `func`.\n\n Notes\n -----\n We eagerly schedule the apply `func` and produce a new ``cuDFOnRayDataframePartition``.\n \"\"\"\n return self.__constructor__(\n self.gpu_manager,\n self.apply(func, *args, **kwargs),\n length=length,\n width=width,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.preprocess_func_cuDFOnRayDataframePartition.length.return.self__length_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.preprocess_func_cuDFOnRayDataframePartition.length.return.self__length_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 202, "span_ids": ["cuDFOnRayDataframePartition.preprocess_func", "cuDFOnRayDataframePartition.length"], "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 cuDFOnRayDataframePartition(PandasDataframePartition):\n\n @classmethod\n def preprocess_func(cls, func):\n \"\"\"\n Put `func` to Ray object store.\n\n Parameters\n ----------\n func : callable\n Function to put.\n\n Returns\n -------\n ray.ObjectRef\n A reference to `func` in Ray object store.\n \"\"\"\n return RayWrapper.put(func)\n\n def length(self, materialize=True):\n \"\"\"\n Get the length of the object wrapped by this partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or ray.ObjectRef\n The length (or reference to length) of the object.\n \"\"\"\n if self._length_cache:\n return self._length_cache\n self._length_cache = self.gpu_manager.length.remote(self.get_key())\n if isinstance(self._length_cache, ObjectIDType) and materialize:\n self._length_cache = RayWrapper.materialize(self._length_cache)\n return self._length_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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.width_cuDFOnRayDataframePartition.width.return.self__width_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.width_cuDFOnRayDataframePartition.width.return.self__width_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 225, "span_ids": ["cuDFOnRayDataframePartition.width"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def width(self, materialize=True):\n \"\"\"\n Get the width of the object wrapped by this partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or ray.ObjectRef\n The width (or reference to width) of the object.\n \"\"\"\n if self._width_cache:\n return self._width_cache\n self._width_cache = self.gpu_manager.width.remote(self.get_key())\n if isinstance(self._width_cache, ObjectIDType) and materialize:\n self._width_cache = RayWrapper.materialize(self._width_cache)\n return self._width_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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.mask_cuDFOnRayDataframePartition.mask.return.self_gpu_manager_apply_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.mask_cuDFOnRayDataframePartition.mask.return.self_gpu_manager_apply_re", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 282, "span_ids": ["cuDFOnRayDataframePartition.mask"], "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": "class cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def mask(self, row_labels, col_labels):\n \"\"\"\n Select columns or rows from given indices.\n\n Parameters\n ----------\n row_labels : list of hashable\n The row labels to extract.\n col_labels : list of hashable\n The column labels to extract.\n\n Returns\n -------\n ray.ObjectRef\n A reference to integer key of result\n in internal dict-storage of `self.gpu_manager`.\n \"\"\"\n if (\n (isinstance(row_labels, slice) and row_labels == slice(None))\n or (\n not isinstance(row_labels, slice)\n and self._length_cache is not None\n and len(row_labels) == self._length_cache\n )\n ) and (\n (isinstance(col_labels, slice) and col_labels == slice(None))\n or (\n not isinstance(col_labels, slice)\n and self._width_cache is not None\n and len(col_labels) == self._width_cache\n )\n ):\n return self.__copy__()\n\n # CuDF currently does not support indexing multiindices with arrays,\n # so we have to create a boolean array where the desire indices are true.\n # TODO(kvu35): Check if this functionality is fixed in the latest version of cudf\n def iloc(df, row_labels, col_labels):\n if isinstance(df.index, cudf.core.multiindex.MultiIndex) and is_list_like(\n row_labels\n ):\n new_row_labels = cp.full(\n (1, df.index.size), False, dtype=bool\n ).squeeze()\n new_row_labels[row_labels] = True\n row_labels = new_row_labels\n return df.iloc[row_labels, col_labels]\n\n iloc = cuDFOnRayDataframePartition.preprocess_func(iloc)\n return self.gpu_manager.apply.remote(\n self.key,\n None,\n iloc,\n col_labels=col_labels,\n row_labels=row_labels,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.get_gpu_manager_cuDFOnRayDataframePartition.to_pandas.return.RayWrapper_materialize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.get_gpu_manager_cuDFOnRayDataframePartition.to_pandas.return.RayWrapper_materialize_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 345, "span_ids": ["cuDFOnRayDataframePartition.get", "cuDFOnRayDataframePartition.get_key", "cuDFOnRayDataframePartition.get_gpu_manager", "cuDFOnRayDataframePartition.get_object_id", "cuDFOnRayDataframePartition.to_pandas"], "tokens": 353}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def get_gpu_manager(self):\n \"\"\"\n Get gpu manager associated with this partition.\n\n Returns\n -------\n modin.core.execution.ray.implementations.cudf_on_ray.partitioning.GPUManager\n ``GPUManager`` associated with this object.\n \"\"\"\n return self.gpu_manager\n\n def get_key(self):\n \"\"\"\n Get integer key of this partition in dict-storage of `self.gpu_manager`.\n\n Returns\n -------\n int\n \"\"\"\n return (\n RayWrapper.materialize(self.key)\n if isinstance(self.key, ray.ObjectRef)\n else self.key\n )\n\n def get_object_id(self):\n \"\"\"\n Get object stored for this partition from `self.gpu_manager`.\n\n Returns\n -------\n ray.ObjectRef\n \"\"\"\n # FIXME: Can't find `gpu_manager.get_object_id` method. Probably, method\n # `gpu_manager.get_oid` should be used.\n return self.gpu_manager.get_object_id.remote(self.get_key())\n\n def get(self):\n \"\"\"\n Get object stored by this partition from `self.gpu_manager`.\n\n Returns\n -------\n ray.ObjectRef\n \"\"\"\n # FIXME: Can't find `gpu_manager.get` method. Probably, method\n # `gpu_manager.get_oid` should be used.\n return self.gpu_manager.get.remote(self.get_key())\n\n def to_pandas(self):\n \"\"\"\n Convert this partition to pandas.DataFrame.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n return RayWrapper.materialize(\n self.gpu_manager.apply_non_persistent.remote(\n self.get_key(), None, cudf.DataFrame.to_pandas\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_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.to_numpy_cuDFOnRayDataframePartition.to_numpy.return.self_gpu_manager_apply_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.to_numpy_cuDFOnRayDataframePartition.to_numpy.return.self_gpu_manager_apply_re", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 347, "end_line": 371, "span_ids": ["cuDFOnRayDataframePartition.to_numpy"], "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 cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def to_numpy(self):\n \"\"\"\n Convert this partition to NumPy array.\n\n Returns\n -------\n NumPy array\n \"\"\"\n\n def convert(df):\n \"\"\"Convert `df` to NumPy array.\"\"\"\n if len(df.columns == 1):\n df = df.iloc[:, 0]\n if isinstance(df, cudf.Series): # convert to column vector\n return cupy.asnumpy(df.to_array())[:, np.newaxis]\n elif isinstance(\n df, cudf.DataFrame\n ): # dataframes do not support df.values with strings\n return cupy.asnumpy(df.values)\n\n # FIXME: Can't find `gpu_manager.apply_result_not_dataframe` method.\n return self.gpu_manager.apply_result_not_dataframe.remote(\n self.get_key(),\n convert,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.free_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py_cuDFOnRayDataframePartition.free_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 395, "span_ids": ["cuDFOnRayDataframePartition.free", "cuDFOnRayDataframePartition.copy"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframePartition(PandasDataframePartition):\n\n def free(self):\n \"\"\"Free the dataFrame and associated `self.key` out of `self.gpu_manager`.\"\"\"\n self.gpu_manager.free.remote(self.get_key())\n\n def copy(self):\n \"\"\"\n Create a full copy of this object.\n\n Returns\n -------\n cuDFOnRayDataframePartition\n \"\"\"\n new_key = self.gpu_manager.apply.remote(\n self.get_key(),\n lambda x: x,\n )\n new_key = RayWrapper.materialize(new_key)\n return self.__constructor__(self.gpu_manager, new_key)\n\n # TODO(kvu35): buggy garbage collector reference issue #43\n # def __del__(self):\n # self.free()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_np_GPU_MANAGERS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_np_GPU_MANAGERS._", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 32, "span_ids": ["docstring"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#\n\nimport numpy as np\nimport ray\n\nfrom .axis_partition import (\n cuDFOnRayDataframeColumnPartition,\n cuDFOnRayDataframeRowPartition,\n)\nfrom .partition import cuDFOnRayDataframePartition\nfrom modin.core.storage_formats.pandas.utils import split_result_of_axis_func_pandas\nfrom modin.config import GpuCount\nfrom modin.core.execution.ray.generic.partitioning import (\n GenericRayDataframePartitionManager,\n)\nfrom modin.core.execution.ray.common import RayWrapper\n\n# Global view of GPU Actors\nGPU_MANAGERS = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py__TODO_Check_the_need_fo_func.return.apply_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py__TODO_Check_the_need_fo_func.return.apply_func_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 59, "span_ids": ["func", "docstring"], "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": "# TODO: Check the need for this func\n@ray.remote(num_cpus=1, num_gpus=0.5)\ndef func(df, other, apply_func):\n \"\"\"\n Perform remotely `apply_func` on `df` and `other` objects.\n\n Parameters\n ----------\n df : cuDFOnRayDataframePartition\n Object to be processed.\n other : cuDFOnRayDataframePartition\n Object to be processed.\n apply_func : callable\n Function to apply.\n\n Returns\n -------\n The type of return of `apply_func`\n The result of the `apply_func`\n (will be a ``ray.ObjectRef`` in outside level).\n \"\"\"\n return apply_func(\n RayWrapper.materialize(df.get.remote()),\n RayWrapper.materialize(other.get.remote()),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager_cuDFOnRayDataframePartitionManager._get_gpu_managers.return.GPU_MANAGERS": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager_cuDFOnRayDataframePartitionManager._get_gpu_managers.return.GPU_MANAGERS", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 104, "span_ids": ["cuDFOnRayDataframePartitionManager._create_partitions", "cuDFOnRayDataframePartitionManager", "cuDFOnRayDataframePartitionManager._get_gpu_managers"], "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 cuDFOnRayDataframePartitionManager(GenericRayDataframePartitionManager):\n \"\"\"The class implements the interface in ``GenericRayDataframePartitionManager`` using cuDF on Ray.\"\"\"\n\n _partition_class = cuDFOnRayDataframePartition\n _column_partitions_class = cuDFOnRayDataframeColumnPartition\n _row_partition_class = cuDFOnRayDataframeRowPartition\n\n @classmethod\n def _create_partitions(cls, keys, gpu_managers):\n \"\"\"\n Create NumPy array of partitions.\n\n Parameters\n ----------\n keys : list\n List of keys associated with dataframes in\n `gpu_managers`.\n gpu_managers : list\n List of ``GPUManager`` objects, which store\n dataframes.\n\n Returns\n -------\n np.ndarray\n A NumPy array of ``cuDFOnRayDataframePartition`` objects.\n \"\"\"\n return np.array(\n [\n cls._partition_class(gpu_managers[i], keys[i])\n for i in range(len(gpu_managers))\n ]\n )\n\n @classmethod\n def _get_gpu_managers(cls):\n \"\"\"\n Get list of gpu managers.\n\n Returns\n -------\n list\n \"\"\"\n return GPU_MANAGERS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager.from_pandas_cuDFOnRayDataframePartitionManager.from_pandas.if_not_return_dims_.else_.return.parts_row_lengths_col_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager.from_pandas_cuDFOnRayDataframePartitionManager.from_pandas.if_not_return_dims_.else_.return.parts_row_lengths_col_w", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 143, "span_ids": ["cuDFOnRayDataframePartitionManager.from_pandas"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFOnRayDataframePartitionManager(GenericRayDataframePartitionManager):\n\n @classmethod\n def from_pandas(cls, df, return_dims=False):\n \"\"\"\n Create partitions from ``pandas.DataFrame/pandas.Series``.\n\n Parameters\n ----------\n df : pandas.DataFrame/pandas.Series\n A ``pandas.DataFrame`` to add.\n return_dims : boolean, default: False\n Is return dimensions or not.\n\n Returns\n -------\n list or tuple\n List of partitions in case `return_dims` == False,\n tuple (partitions, row lengths, col widths) in other case.\n \"\"\"\n num_splits = GpuCount.get()\n put_func = cls._partition_class.put\n # For now, we default to row partitioning\n pandas_dfs = split_result_of_axis_func_pandas(0, num_splits, df)\n keys = [\n put_func(cls._get_gpu_managers()[i], pandas_dfs[i])\n for i in range(num_splits)\n ]\n keys = RayWrapper.materialize(keys)\n parts = cls._create_partitions(keys, cls._get_gpu_managers()).reshape(\n (num_splits, 1)\n )\n if not return_dims:\n return parts\n else:\n row_lengths = [len(df.index) for df in pandas_dfs]\n col_widths = [\n len(df.columns)\n ] # single value since we only have row partitions\n return parts, row_lengths, col_widths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager.lazy_map_partitions_cuDFOnRayDataframePartitionManager.lazy_map_partitions.return.cls__create_partitions_ke": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager.lazy_map_partitions_cuDFOnRayDataframePartitionManager.lazy_map_partitions.return.cls__create_partitions_ke", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 176, "span_ids": ["cuDFOnRayDataframePartitionManager.lazy_map_partitions"], "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 cuDFOnRayDataframePartitionManager(GenericRayDataframePartitionManager):\n\n @classmethod\n def lazy_map_partitions(cls, partitions, map_func):\n \"\"\"\n Apply `map_func` to every partition lazily.\n\n Compared to Modin-CPU, Modin-GPU lazy version represents:\n\n (1) A scheduled function in the Ray task graph.\n\n (2) A non-materialized key.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with partitions.\n map_func : callable\n The function to apply.\n\n Returns\n -------\n np.ndarray\n A NumPy array of ``cuDFOnRayDataframePartition`` objects.\n \"\"\"\n preprocessed_map_func = cls.preprocess_func(map_func)\n partitions_flat = partitions.flatten()\n key_futures = [\n partition.apply(preprocessed_map_func) for partition in partitions_flat\n ]\n gpu_managers = [partition.get_gpu_manager() for partition in partitions_flat]\n return cls._create_partitions(key_futures, gpu_managers).reshape(\n partitions.shape\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager._apply_func_to_list_of_partitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py_cuDFOnRayDataframePartitionManager._apply_func_to_list_of_partitions_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/cudf_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 210, "span_ids": ["cuDFOnRayDataframePartitionManager._apply_func_to_list_of_partitions"], "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 cuDFOnRayDataframePartitionManager(GenericRayDataframePartitionManager):\n\n @classmethod\n def _apply_func_to_list_of_partitions(cls, func, partitions, **kwargs):\n \"\"\"\n Apply `func` to a list of remote partitions from `partitions`.\n\n Parameters\n ----------\n func : callable\n The function to apply.\n partitions : np.ndarray\n NumPy array with partitions.\n **kwargs : dict\n Additional keywords arguments to be passed in `func`.\n\n Returns\n -------\n np.ndarray\n A NumPy array of ``cuDFOnRayDataframePartition`` objects.\n\n Notes\n -----\n This preprocesses the `func` first before applying it to the partitions.\n \"\"\"\n preprocessed_map_func = cls.preprocess_func(func)\n key_futures = RayWrapper.materialize(\n [\n partition.apply(preprocessed_map_func, **kwargs)\n for partition in partitions\n ]\n )\n gpu_managers = [partition.get_gpu_manager() for partition in partitions]\n return cls._create_partitions(key_futures, gpu_managers)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/dataframe/__init__.py_PandasOnRayDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/dataframe/__init__.py_PandasOnRayDataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "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 .dataframe import PandasOnRayDataframe\n\n__all__ = [\"PandasOnRayDataframe\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/dataframe/dataframe.py_PandasOnRayDataframePartitionManager_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/dataframe/dataframe.py_PandasOnRayDataframePartitionManager_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 43, "span_ids": ["PandasOnRayDataframe", "docstring"], "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": "from ..partitioning.partition_manager import PandasOnRayDataframePartitionManager\nfrom modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\n\n\nclass PandasOnRayDataframe(PandasDataframe):\n \"\"\"\n The class implements the interface in ``PandasDataframe`` using Ray.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence\n The index for the dataframe. Converted to a ``pandas.Index``.\n columns : sequence\n The columns object for the dataframe. Converted to a ``pandas.Index``.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = PandasOnRayDataframePartitionManager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/__init__.py_PandasOnRayIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/__init__.py_PandasOnRayIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 21}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import PandasOnRayIO\n\n__all__ = [\"PandasOnRayIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_io_PandasOnRayDataframePartition": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_io_PandasOnRayDataframePartition", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 43, "span_ids": ["docstring"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#\n\nimport io\n\nimport pandas\nfrom pandas.io.common import get_handle\n\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.ray.generic.io import RayIO\nfrom modin.core.io import (\n CSVDispatcher,\n FWFDispatcher,\n JSONDispatcher,\n ParquetDispatcher,\n FeatherDispatcher,\n SQLDispatcher,\n ExcelDispatcher,\n)\nfrom modin.core.storage_formats.pandas.parsers import (\n PandasCSVParser,\n PandasFWFParser,\n PandasJSONParser,\n PandasParquetParser,\n PandasFeatherParser,\n PandasSQLParser,\n PandasExcelParser,\n)\nfrom modin.core.execution.ray.common import RayWrapper, SignalActor\nfrom ..dataframe import PandasOnRayDataframe\nfrom ..partitioning import PandasOnRayDataframePartition", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO_PandasOnRayIO.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO_PandasOnRayIO.None_4", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 79, "span_ids": ["PandasOnRayIO.__make_write", "PandasOnRayIO:9", "PandasOnRayIO.__make_read", "PandasOnRayIO"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayIO(RayIO):\n \"\"\"Factory providing methods for performing I/O operations using pandas as storage format on Ray as engine.\"\"\"\n\n frame_cls = PandasOnRayDataframe\n query_compiler_cls = PandasQueryCompiler\n build_args = dict(\n frame_partition_cls=PandasOnRayDataframePartition,\n query_compiler_cls=PandasQueryCompiler,\n frame_cls=PandasOnRayDataframe,\n base_io=RayIO,\n )\n\n def __make_read(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (RayWrapper, *classes), build_args).read\n\n def __make_write(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (RayWrapper, *classes), build_args).write\n\n read_csv = __make_read(PandasCSVParser, CSVDispatcher)\n read_fwf = __make_read(PandasFWFParser, FWFDispatcher)\n read_json = __make_read(PandasJSONParser, JSONDispatcher)\n read_parquet = __make_read(PandasParquetParser, ParquetDispatcher)\n to_parquet = __make_write(ParquetDispatcher)\n # Blocked on pandas-dev/pandas#12236. It is faster to default to pandas.\n # read_hdf = __make_read(PandasHDFParser, HDFReader)\n read_feather = __make_read(PandasFeatherParser, FeatherDispatcher)\n read_sql = __make_read(PandasSQLParser, SQLDispatcher)\n to_sql = __make_write(SQLDispatcher)\n read_excel = __make_read(PandasExcelParser, ExcelDispatcher)\n\n del __make_read # to not pollute class namespace\n del __make_write # to not pollute class namespace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO._to_csv_check_support_PandasOnRayIO._to_csv_check_support.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO._to_csv_check_support_PandasOnRayIO._to_csv_check_support.return.True", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 116, "span_ids": ["PandasOnRayIO._to_csv_check_support"], "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 PandasOnRayIO(RayIO):\n\n @staticmethod\n def _to_csv_check_support(kwargs):\n \"\"\"\n Check if parallel version of ``to_csv`` could be used.\n\n Parameters\n ----------\n kwargs : dict\n Keyword arguments passed to ``.to_csv()``.\n\n Returns\n -------\n bool\n Whether parallel version of ``to_csv`` is applicable.\n \"\"\"\n path_or_buf = kwargs[\"path_or_buf\"]\n compression = kwargs[\"compression\"]\n if not isinstance(path_or_buf, str):\n return False\n # case when the pointer is placed at the beginning of the file.\n if \"r\" in kwargs[\"mode\"] and \"+\" in kwargs[\"mode\"]:\n return False\n # encodings with BOM don't support;\n # instead of one mark in result bytes we will have them by the number of partitions\n # so we should fallback in pandas for `utf-16`, `utf-32` with all aliases, in instance\n # (`utf_32_be`, `utf_16_le` and so on)\n if kwargs[\"encoding\"] is not None:\n encoding = kwargs[\"encoding\"].lower()\n if \"u\" in encoding or \"utf\" in encoding:\n if \"16\" in encoding or \"32\" in encoding:\n return False\n if compression is None or not compression == \"infer\":\n return False\n if any((path_or_buf.endswith(ext) for ext in [\".gz\", \".bz2\", \".zip\", \".xz\"])):\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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv_PandasOnRayIO.to_csv.signals.SignalActor_remote_len_qc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv_PandasOnRayIO.to_csv.signals.SignalActor_remote_len_qc", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 133, "span_ids": ["PandasOnRayIO.to_csv"], "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 PandasOnRayIO(RayIO):\n\n @classmethod\n def to_csv(cls, qc, **kwargs):\n \"\"\"\n Write records stored in the `qc` to a CSV file.\n\n Parameters\n ----------\n qc : BaseQueryCompiler\n The query compiler of the Modin dataframe that we want to run ``to_csv`` on.\n **kwargs : dict\n Parameters for ``pandas.to_csv(**kwargs)``.\n \"\"\"\n if not cls._to_csv_check_support(kwargs):\n return RayIO.to_csv(qc, **kwargs)\n\n signals = SignalActor.remote(len(qc._modin_frame._partitions) + 1)\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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv.func_PandasOnRayIO.to_csv.func.return.pandas_DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv.func_PandasOnRayIO.to_csv.func.return.pandas_DataFrame_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 189, "span_ids": ["PandasOnRayIO.to_csv"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayIO(RayIO):\n\n @classmethod\n def to_csv(cls, qc, **kwargs):\n # ... other code\n\n def func(df, **kw): # pragma: no cover\n \"\"\"\n Dump a chunk of rows as csv, then save them to target maintaining order.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A chunk of rows to write to a CSV file.\n **kw : dict\n Arguments to pass to ``pandas.to_csv(**kw)`` plus an extra argument\n `partition_idx` serving as chunk index to maintain rows order.\n \"\"\"\n partition_idx = kw[\"partition_idx\"]\n # the copy is made to not implicitly change the input parameters;\n # to write to an intermediate buffer, we need to change `path_or_buf` in kwargs\n csv_kwargs = kwargs.copy()\n if partition_idx != 0:\n # we need to create a new file only for first recording\n # all the rest should be recorded in appending mode\n if \"w\" in csv_kwargs[\"mode\"]:\n csv_kwargs[\"mode\"] = csv_kwargs[\"mode\"].replace(\"w\", \"a\")\n # It is enough to write the header for the first partition\n csv_kwargs[\"header\"] = False\n\n # for parallelization purposes, each partition is written to an intermediate buffer\n path_or_buf = csv_kwargs[\"path_or_buf\"]\n is_binary = \"b\" in csv_kwargs[\"mode\"]\n csv_kwargs[\"path_or_buf\"] = io.BytesIO() if is_binary else io.StringIO()\n storage_options = csv_kwargs.pop(\"storage_options\", None)\n df.to_csv(**csv_kwargs)\n csv_kwargs.update({\"storage_options\": storage_options})\n content = csv_kwargs[\"path_or_buf\"].getvalue()\n csv_kwargs[\"path_or_buf\"].close()\n\n # each process waits for its turn to write to a file\n RayWrapper.materialize(signals.wait.remote(partition_idx))\n\n # preparing to write data from the buffer to a file\n with get_handle(\n path_or_buf,\n # in case when using URL in implicit text mode\n # pandas try to open `path_or_buf` in binary mode\n csv_kwargs[\"mode\"] if is_binary else csv_kwargs[\"mode\"] + \"t\",\n encoding=kwargs[\"encoding\"],\n errors=kwargs[\"errors\"],\n compression=kwargs[\"compression\"],\n storage_options=kwargs.get(\"storage_options\", None),\n is_text=not is_binary,\n ) as handles:\n handles.handle.write(content)\n\n # signal that the next process can start writing to the file\n RayWrapper.materialize(signals.send.remote(partition_idx + 1))\n # used for synchronization purposes\n return pandas.DataFrame()\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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv._signaling_that_the_part_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py_PandasOnRayIO.to_csv._signaling_that_the_part_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 208, "span_ids": ["PandasOnRayIO.to_csv"], "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 PandasOnRayIO(RayIO):\n\n @classmethod\n def to_csv(cls, qc, **kwargs):\n\n # signaling that the partition with id==0 can be written to the file\n RayWrapper.materialize(signals.send.remote(0))\n # Ensure that the metadata is syncrhonized\n qc._modin_frame._propagate_index_objs(axis=None)\n result = qc._modin_frame._partition_mgr_cls.map_axis_partitions(\n axis=1,\n partitions=qc._modin_frame._partitions,\n map_func=func,\n keep_partitioning=True,\n lengths=None,\n enumerate_partitions=True,\n max_retries=0,\n )\n # pending completion\n RayWrapper.materialize(\n [part.list_of_blocks[0] for row in result for part in row]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/__init__.py_PandasOnRayDataframePartition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/__init__.py_PandasOnRayDataframePartition_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 31, "span_ids": ["docstring"], "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": "from .partition import PandasOnRayDataframePartition\nfrom .partition_manager import PandasOnRayDataframePartitionManager\nfrom .virtual_partition import (\n PandasOnRayDataframeVirtualPartition,\n PandasOnRayDataframeColumnPartition,\n PandasOnRayDataframeRowPartition,\n)\n\n__all__ = [\n \"PandasOnRayDataframePartition\",\n \"PandasOnRayDataframePartitionManager\",\n \"PandasOnRayDataframeVirtualPartition\",\n \"PandasOnRayDataframeColumnPartition\",\n \"PandasOnRayDataframeRowPartition\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_ray_PandasOnRayDataframePartition.__init__.self__is_debug_log_and_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_ray_PandasOnRayDataframePartition.__init__.self__is_debug_log_and_l", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 66, "span_ids": ["PandasOnRayDataframePartition", "PandasOnRayDataframePartition.__init__", "docstring"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import ray\nfrom ray.util import get_node_ip_address\n\nfrom modin.core.execution.ray.common.utils import deserialize, ObjectIDType\nfrom modin.core.execution.ray.common import RayWrapper\nfrom modin.core.dataframe.pandas.partitioning.partition import PandasDataframePartition\nfrom modin.pandas.indexing import compute_sliced_len\nfrom modin.logging import get_logger\n\ncompute_sliced_len = ray.remote(compute_sliced_len)\n\n\nclass PandasOnRayDataframePartition(PandasDataframePartition):\n \"\"\"\n The class implements the interface in ``PandasDataframePartition``.\n\n Parameters\n ----------\n data : ray.ObjectRef\n A reference to ``pandas.DataFrame`` that need to be wrapped with this class.\n length : ray.ObjectRef or int, optional\n Length or reference to it of wrapped ``pandas.DataFrame``.\n width : ray.ObjectRef or int, optional\n Width or reference to it of wrapped ``pandas.DataFrame``.\n ip : ray.ObjectRef or str, optional\n Node IP address or reference to it that holds wrapped ``pandas.DataFrame``.\n call_queue : list\n Call queue that needs to be executed on wrapped ``pandas.DataFrame``.\n \"\"\"\n\n execution_wrapper = RayWrapper\n\n def __init__(self, data, length=None, width=None, ip=None, call_queue=None):\n assert isinstance(data, ObjectIDType)\n self._data = data\n if call_queue is None:\n call_queue = []\n self.call_queue = call_queue\n self._length_cache = length\n self._width_cache = width\n self._ip_cache = ip\n\n log = get_logger()\n self._is_debug(log) and log.debug(\n \"Partition ID: {}, Height: {}, Width: {}, Node IP: {}\".format(\n self._identity,\n str(self._length_cache),\n str(self._width_cache),\n str(self._ip_cache),\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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.apply_PandasOnRayDataframePartition.apply.return.self___constructor___resu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.apply_PandasOnRayDataframePartition.apply.return.self___constructor___resu", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 109, "span_ids": ["PandasOnRayDataframePartition.apply"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayDataframePartition(PandasDataframePartition):\n\n def apply(self, func, *args, **kwargs):\n \"\"\"\n Apply a function to the object wrapped by this partition.\n\n Parameters\n ----------\n func : callable or ray.ObjectRef\n A function to apply.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasOnRayDataframePartition\n A new ``PandasOnRayDataframePartition`` object.\n\n Notes\n -----\n It does not matter if `func` is callable or an ``ray.ObjectRef``. Ray will\n handle it correctly either way. The keyword arguments are sent as a dictionary.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.apply::{self._identity}\")\n data = self._data\n call_queue = self.call_queue + [[func, args, kwargs]]\n if len(call_queue) > 1:\n self._is_debug(log) and log.debug(\n f\"SUBMIT::_apply_list_of_funcs::{self._identity}\"\n )\n result, length, width, ip = _apply_list_of_funcs.remote(call_queue, data)\n else:\n # We handle `len(call_queue) == 1` in a different way because\n # this dramatically improves performance.\n func, f_args, f_kwargs = call_queue[0]\n result, length, width, ip = _apply_func.remote(\n data, func, *f_args, **f_kwargs\n )\n self._is_debug(log) and log.debug(f\"SUBMIT::_apply_func::{self._identity}\")\n self._is_debug(log) and log.debug(f\"EXIT::Partition.apply::{self._identity}\")\n return self.__constructor__(result, length, width, ip)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.drain_call_queue_PandasOnRayDataframePartition.drain_call_queue.if_not_isinstance_self__w.self._width_cache.new_width": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.drain_call_queue_PandasOnRayDataframePartition.drain_call_queue.if_not_isinstance_self__w.self._width_cache.new_width", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 152, "span_ids": ["PandasOnRayDataframePartition.drain_call_queue"], "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 PandasOnRayDataframePartition(PandasDataframePartition):\n\n def drain_call_queue(self):\n \"\"\"Execute all operations stored in the call queue on the object wrapped by this partition.\"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(\n f\"ENTER::Partition.drain_call_queue::{self._identity}\"\n )\n if len(self.call_queue) == 0:\n return\n data = self._data\n call_queue = self.call_queue\n if len(call_queue) > 1:\n self._is_debug(log) and log.debug(\n f\"SUBMIT::_apply_list_of_funcs::{self._identity}\"\n )\n (\n self._data,\n new_length,\n new_width,\n self._ip_cache,\n ) = _apply_list_of_funcs.remote(call_queue, data)\n else:\n # We handle `len(call_queue) == 1` in a different way because\n # this dramatically improves performance.\n func, f_args, f_kwargs = call_queue[0]\n self._is_debug(log) and log.debug(f\"SUBMIT::_apply_func::{self._identity}\")\n (\n self._data,\n new_length,\n new_width,\n self._ip_cache,\n ) = _apply_func.remote(data, func, *f_args, **f_kwargs)\n self._is_debug(log) and log.debug(\n f\"EXIT::Partition.drain_call_queue::{self._identity}\"\n )\n self.call_queue = []\n\n # GH#4732 if we already have evaluated width/length cached as ints,\n # don't overwrite that cache with non-evaluated values.\n if not isinstance(self._length_cache, int):\n self._length_cache = new_length\n if not isinstance(self._width_cache, int):\n self._width_cache = new_width", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.wait_PandasOnRayDataframePartition._iloc.execution_wrapper_put_Pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.wait_PandasOnRayDataframePartition._iloc.execution_wrapper_put_Pan", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 178, "span_ids": ["PandasOnRayDataframePartition.wait", "PandasOnRayDataframePartition:5", "PandasOnRayDataframePartition.__copy__"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayDataframePartition(PandasDataframePartition):\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\n self.drain_call_queue()\n RayWrapper.wait(self._data)\n\n def __copy__(self):\n \"\"\"\n Create a copy of this partition.\n\n Returns\n -------\n PandasOnRayDataframePartition\n A copy of this partition.\n \"\"\"\n return self.__constructor__(\n self._data,\n length=self._length_cache,\n width=self._width_cache,\n ip=self._ip_cache,\n call_queue=self.call_queue,\n )\n\n # If Ray has not been initialized yet by Modin,\n # it will be initialized when calling `RayWrapper.put`.\n _iloc = execution_wrapper.put(PandasDataframePartition._iloc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.mask_PandasOnRayDataframePartition.mask.return.new_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.mask_PandasOnRayDataframePartition.mask.return.new_obj", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 220, "span_ids": ["PandasOnRayDataframePartition.mask"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayDataframePartition(PandasDataframePartition):\n\n def mask(self, row_labels, col_labels):\n \"\"\"\n Lazily create a mask that extracts the indices provided.\n\n Parameters\n ----------\n row_labels : list-like, slice or label\n The row labels for the rows to extract.\n col_labels : list-like, slice or label\n The column labels for the columns to extract.\n\n Returns\n -------\n PandasOnRayDataframePartition\n A new ``PandasOnRayDataframePartition`` object.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.mask::{self._identity}\")\n new_obj = super().mask(row_labels, col_labels)\n if isinstance(row_labels, slice) and isinstance(\n self._length_cache, ObjectIDType\n ):\n if row_labels == slice(None):\n # fast path - full axis take\n new_obj._length_cache = self._length_cache\n else:\n new_obj._length_cache = compute_sliced_len.remote(\n row_labels, self._length_cache\n )\n if isinstance(col_labels, slice) and isinstance(\n self._width_cache, ObjectIDType\n ):\n if col_labels == slice(None):\n # fast path - full axis take\n new_obj._width_cache = self._width_cache\n else:\n new_obj._width_cache = compute_sliced_len.remote(\n col_labels, self._width_cache\n )\n self._is_debug(log) and log.debug(f\"EXIT::Partition.mask::{self._identity}\")\n return new_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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.put_PandasOnRayDataframePartition.preprocess_func.return.cls_execution_wrapper_put": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.put_PandasOnRayDataframePartition.preprocess_func.return.cls_execution_wrapper_put", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 254, "span_ids": ["PandasOnRayDataframePartition.preprocess_func", "PandasOnRayDataframePartition.put"], "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 PandasOnRayDataframePartition(PandasDataframePartition):\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Put an object into Plasma store and wrap it with partition object.\n\n Parameters\n ----------\n obj : any\n An object to be put.\n\n Returns\n -------\n PandasOnRayDataframePartition\n A new ``PandasOnRayDataframePartition`` object.\n \"\"\"\n return cls(cls.execution_wrapper.put(obj), len(obj.index), len(obj.columns))\n\n @classmethod\n def preprocess_func(cls, func):\n \"\"\"\n Put a function into the Plasma store to use in ``apply``.\n\n Parameters\n ----------\n func : callable\n A function to preprocess.\n\n Returns\n -------\n ray.ObjectRef\n A reference to `func`.\n \"\"\"\n return cls.execution_wrapper.put(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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.length_PandasOnRayDataframePartition.length.return.self__length_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.length_PandasOnRayDataframePartition.length.return.self__length_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 281, "span_ids": ["PandasOnRayDataframePartition.length"], "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 PandasOnRayDataframePartition(PandasDataframePartition):\n\n def length(self, materialize=True):\n \"\"\"\n Get the length of the object wrapped by this partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or ray.ObjectRef\n The length of the object.\n \"\"\"\n if self._length_cache is None:\n if len(self.call_queue):\n self.drain_call_queue()\n else:\n self._length_cache, self._width_cache = _get_index_and_columns.remote(\n self._data\n )\n if isinstance(self._length_cache, ObjectIDType) and materialize:\n self._length_cache = RayWrapper.materialize(self._length_cache)\n return self._length_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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.width_PandasOnRayDataframePartition.width.return.self__width_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.width_PandasOnRayDataframePartition.width.return.self__width_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 283, "end_line": 308, "span_ids": ["PandasOnRayDataframePartition.width"], "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 PandasOnRayDataframePartition(PandasDataframePartition):\n\n def width(self, materialize=True):\n \"\"\"\n Get the width of the object wrapped by the partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or ray.ObjectRef\n The width of the object.\n \"\"\"\n if self._width_cache is None:\n if len(self.call_queue):\n self.drain_call_queue()\n else:\n self._length_cache, self._width_cache = _get_index_and_columns.remote(\n self._data\n )\n if isinstance(self._width_cache, ObjectIDType) and materialize:\n self._width_cache = RayWrapper.materialize(self._width_cache)\n return self._width_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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.ip__get_index_and_columns.return.len_df_index_len_df_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py_PandasOnRayDataframePartition.ip__get_index_and_columns.return.len_df_index_len_df_col", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 346, "span_ids": ["_get_index_and_columns", "PandasOnRayDataframePartition.ip"], "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 PandasOnRayDataframePartition(PandasDataframePartition):\n\n def ip(self):\n \"\"\"\n Get the node IP address of the object wrapped by this partition.\n\n Returns\n -------\n str\n IP address of the node that holds the data.\n \"\"\"\n if self._ip_cache is None:\n if len(self.call_queue):\n self.drain_call_queue()\n else:\n self._ip_cache = self.apply(lambda df: df)._ip_cache\n if isinstance(self._ip_cache, ObjectIDType):\n self._ip_cache = RayWrapper.materialize(self._ip_cache)\n return self._ip_cache\n\n\n@ray.remote(num_returns=2)\ndef _get_index_and_columns(df): # pragma: no cover\n \"\"\"\n Get the number of rows and columns of a pandas DataFrame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A pandas DataFrame which dimensions are needed.\n\n Returns\n -------\n int\n The number of rows.\n int\n The number of columns.\n \"\"\"\n return len(df.index), len(df.columns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py__apply_func__apply_func.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py__apply_func__apply_func.return._", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 393, "span_ids": ["_apply_func"], "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": "@ray.remote(num_returns=4)\ndef _apply_func(partition, func, *args, **kwargs): # pragma: no cover\n \"\"\"\n Execute a function on the partition in a worker process.\n\n Parameters\n ----------\n partition : pandas.DataFrame\n A pandas DataFrame the function needs to be executed on.\n func : callable\n The function to perform on the partition.\n *args : list\n Positional arguments to pass to ``func``.\n **kwargs : dict\n Keyword arguments to pass to ``func``.\n\n Returns\n -------\n pandas.DataFrame\n The resulting pandas DataFrame.\n int\n The number of rows of the resulting pandas DataFrame.\n int\n The number of columns of the resulting pandas DataFrame.\n str\n The node IP address of the worker process.\n\n Notes\n -----\n Directly passing a call queue entry (i.e. a list of [func, args, kwargs]) instead of\n destructuring it causes a performance penalty.\n \"\"\"\n try:\n result = func(partition, *args, **kwargs)\n # Sometimes Arrow forces us to make a copy of an object before we operate on it. We\n # don't want the error to propagate to the user, and we want to avoid copying unless\n # we absolutely have to.\n except ValueError:\n result = func(partition.copy(), *args, **kwargs)\n return (\n result,\n len(result) if hasattr(result, \"__len__\") else 0,\n len(result.columns) if hasattr(result, \"columns\") else 0,\n get_node_ip_address(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py__apply_list_of_funcs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py__apply_list_of_funcs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 396, "end_line": 437, "span_ids": ["_apply_list_of_funcs"], "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": "@ray.remote(num_returns=4)\ndef _apply_list_of_funcs(call_queue, partition): # pragma: no cover\n \"\"\"\n Execute all operations stored in the call queue on the partition in a worker process.\n\n Parameters\n ----------\n call_queue : list\n A call queue that needs to be executed on the partition.\n partition : pandas.DataFrame\n A pandas DataFrame the call queue needs to be executed on.\n\n Returns\n -------\n pandas.DataFrame\n The resulting pandas DataFrame.\n int\n The number of rows of the resulting pandas DataFrame.\n int\n The number of columns of the resulting pandas DataFrame.\n str\n The node IP address of the worker process.\n \"\"\"\n for func, f_args, f_kwargs in call_queue:\n func = deserialize(func)\n args = deserialize(f_args)\n kwargs = deserialize(f_kwargs)\n try:\n partition = func(partition, *args, **kwargs)\n # Sometimes Arrow forces us to make a copy of an object before we operate on it. We\n # don't want the error to propagate to the user, and we want to avoid copying unless\n # we absolutely have to.\n except ValueError:\n partition = func(partition.copy(), *args, **kwargs)\n\n return (\n partition,\n len(partition) if hasattr(partition, \"__len__\") else 0,\n len(partition.columns) if hasattr(partition, \"columns\") else 0,\n get_node_ip_address(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py_from_modin_core_execution_PandasOnRayDataframePartitionManager.wait_partitions.RayWrapper_wait_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py_from_modin_core_execution_PandasOnRayDataframePartitionManager.wait_partitions.RayWrapper_wait_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 51, "span_ids": ["PandasOnRayDataframePartitionManager.wait_partitions", "PandasOnRayDataframePartitionManager", "docstring"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.execution.ray.generic.partitioning import (\n GenericRayDataframePartitionManager,\n)\nfrom modin.core.execution.ray.common import RayWrapper\nfrom .virtual_partition import (\n PandasOnRayDataframeColumnPartition,\n PandasOnRayDataframeRowPartition,\n)\nfrom .partition import PandasOnRayDataframePartition\nfrom modin.core.execution.modin_aqp import progress_bar_wrapper\n\n\nclass PandasOnRayDataframePartitionManager(GenericRayDataframePartitionManager):\n \"\"\"The class implements the interface in `PandasDataframePartitionManager`.\"\"\"\n\n # This object uses RayRemotePartition objects as the underlying store.\n _partition_class = PandasOnRayDataframePartition\n _column_partitions_class = PandasOnRayDataframeColumnPartition\n _row_partition_class = PandasOnRayDataframeRowPartition\n _execution_wrapper = RayWrapper\n\n @classmethod\n def wait_partitions(cls, partitions):\n \"\"\"\n Wait on the objects wrapped by `partitions` in parallel, without materializing them.\n\n This method will block until all computations in the list have completed.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``PandasDataframePartition``-s.\n \"\"\"\n RayWrapper.wait(\n [block for partition in partitions for block in partition.list_of_blocks]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py__make_wrapped_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py__make_wrapped_method_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 90, "span_ids": ["_make_wrapped_method", "impl"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _make_wrapped_method(name: str):\n \"\"\"\n Define new attribute that should work with progress bar.\n\n Parameters\n ----------\n name : str\n Name of `GenericRayDataframePartitionManager` attribute that should be reused.\n\n Notes\n -----\n - `classmethod` decorator shouldn't be applied twice, so we refer to `__func__` attribute.\n - New attribute is defined for `PandasOnRayDataframePartitionManager`.\n \"\"\"\n setattr(\n PandasOnRayDataframePartitionManager,\n name,\n classmethod(\n progress_bar_wrapper(\n getattr(GenericRayDataframePartitionManager, name).__func__\n )\n ),\n )\n\n\nfor method in (\n \"map_partitions\",\n \"lazy_map_partitions\",\n \"map_axis_partitions\",\n \"_apply_func_to_list_of_partitions\",\n \"apply_func_to_select_indices\",\n \"apply_func_to_select_indices_along_full_axis\",\n \"apply_func_to_indices_both_axis\",\n \"n_ary_operation\",\n):\n _make_wrapped_method(method)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_pandas_PandasOnRayDataframeVirtualPartition.list_of_ips.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_pandas_PandasOnRayDataframeVirtualPartition.list_of_ips.return.result", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 98, "span_ids": ["PandasOnRayDataframeVirtualPartition._get_drain_func", "PandasOnRayDataframeVirtualPartition", "PandasOnRayDataframeVirtualPartition.list_of_ips", "PandasOnRayDataframeVirtualPartition._get_deploy_split_func", "PandasOnRayDataframeVirtualPartition._get_deploy_axis_func", "docstring"], "tokens": 690}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport ray\nfrom ray.util import get_node_ip_address\n\nfrom modin.core.dataframe.pandas.partitioning.axis_partition import (\n PandasDataframeAxisPartition,\n)\nfrom modin.core.execution.ray.common.utils import deserialize\nfrom modin.core.execution.ray.common import RayWrapper\nfrom .partition import PandasOnRayDataframePartition\nfrom modin.utils import _inherit_docstrings\n\n\nclass PandasOnRayDataframeVirtualPartition(PandasDataframeAxisPartition):\n \"\"\"\n The class implements the interface in ``PandasDataframeAxisPartition``.\n\n Parameters\n ----------\n list_of_partitions : Union[list, PandasOnRayDataframePartition]\n List of ``PandasOnRayDataframePartition`` and\n ``PandasOnRayDataframeVirtualPartition`` objects, or a single\n ``PandasOnRayDataframePartition``.\n get_ip : bool, default: False\n Whether to get node IP addresses to conforming partitions or not.\n full_axis : bool, default: True\n Whether or not the virtual partition encompasses the whole axis.\n call_queue : list, optional\n A list of tuples (callable, args, kwargs) that contains deferred calls.\n length : ray.ObjectRef or int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : ray.ObjectRef or int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n \"\"\"\n\n _PARTITIONS_METADATA_LEN = 3 # (length, width, ip)\n partition_type = PandasOnRayDataframePartition\n instance_type = ray.ObjectRef\n axis = None\n\n # these variables are intentionally initialized at runtime (see #6023)\n _DEPLOY_AXIS_FUNC = None\n _DEPLOY_SPLIT_FUNC = None\n _DRAIN_FUNC = None\n\n @classmethod\n def _get_deploy_axis_func(cls): # noqa: GL08\n if cls._DEPLOY_AXIS_FUNC is None:\n cls._DEPLOY_AXIS_FUNC = RayWrapper.put(\n PandasDataframeAxisPartition.deploy_axis_func\n )\n return cls._DEPLOY_AXIS_FUNC\n\n @classmethod\n def _get_deploy_split_func(cls): # noqa: GL08\n if cls._DEPLOY_SPLIT_FUNC is None:\n cls._DEPLOY_SPLIT_FUNC = RayWrapper.put(\n PandasDataframeAxisPartition.deploy_splitting_func\n )\n return cls._DEPLOY_SPLIT_FUNC\n\n @classmethod\n def _get_drain_func(cls): # noqa: GL08\n if cls._DRAIN_FUNC is None:\n cls._DRAIN_FUNC = RayWrapper.put(PandasDataframeAxisPartition.drain)\n return cls._DRAIN_FUNC\n\n @property\n def list_of_ips(self):\n \"\"\"\n Get the IPs holding the physical objects composing this partition.\n\n Returns\n -------\n List\n A list of IPs as ``ray.ObjectRef`` or str.\n \"\"\"\n # Defer draining call queue until we get the ip address\n result = [None] * len(self.list_of_block_partitions)\n for idx, partition in enumerate(self.list_of_block_partitions):\n partition.drain_call_queue()\n result[idx] = partition._ip_cache\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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_splitting_func_PandasOnRayDataframeVirtualPartition.deploy_splitting_func.return._deploy_ray_func_options_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_splitting_func_PandasOnRayDataframeVirtualPartition.deploy_splitting_func.return._deploy_ray_func_options_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 125, "span_ids": ["PandasOnRayDataframeVirtualPartition.deploy_splitting_func"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n @_inherit_docstrings(PandasDataframeAxisPartition.deploy_splitting_func)\n def deploy_splitting_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n extract_metadata=False,\n ):\n return _deploy_ray_func.options(\n num_returns=num_splits * (1 + cls._PARTITIONS_METADATA_LEN)\n if extract_metadata\n else num_splits,\n ).remote(\n cls._get_deploy_split_func(),\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n extract_metadata=extract_metadata,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_axis_func_PandasOnRayDataframeVirtualPartition.deploy_axis_func.return._deploy_ray_func_options_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_axis_func_PandasOnRayDataframeVirtualPartition.deploy_axis_func.return._deploy_ray_func_options_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 188, "span_ids": ["PandasOnRayDataframeVirtualPartition.deploy_axis_func"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n def deploy_axis_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n lengths=None,\n manual_partition=False,\n max_retries=None,\n ):\n \"\"\"\n Deploy a function along a full axis.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see ``split_result_of_axis_func_pandas``).\n maintain_partitioning : bool\n If True, keep the old partitioning if possible.\n If False, create a new partition layout.\n *partitions : iterable\n All partitions that make up the full axis (row or column).\n lengths : list, optional\n The list of lengths to shuffle the object.\n manual_partition : bool, default: False\n If True, partition the result with `lengths`.\n max_retries : int, default: None\n The max number of times to retry the func.\n\n Returns\n -------\n list\n A list of ``ray.ObjectRef``-s.\n \"\"\"\n return _deploy_ray_func.options(\n num_returns=(num_splits if lengths is None else len(lengths))\n * (1 + cls._PARTITIONS_METADATA_LEN),\n **({\"max_retries\": max_retries} if max_retries is not None else {}),\n ).remote(\n cls._get_deploy_axis_func(),\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n manual_partition=manual_partition,\n lengths=lengths,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnRayDataframeRowPartition.axis.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py_PandasOnRayDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnRayDataframeRowPartition.axis.1", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 258, "span_ids": ["PandasOnRayDataframeVirtualPartition.wait", "PandasOnRayDataframeColumnPartition", "PandasOnRayDataframeVirtualPartition.deploy_func_between_two_axis_partitions", "PandasOnRayDataframeRowPartition"], "tokens": 487}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnRayDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n def deploy_func_between_two_axis_partitions(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n ):\n \"\"\"\n Deploy a function along a full axis between two data sets.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see ``split_result_of_axis_func_pandas``).\n len_of_left : int\n The number of values in `partitions` that belong to the left data set.\n other_shape : np.ndarray\n The shape of right frame in terms of partitions, i.e.\n (other_shape[i-1], other_shape[i]) will indicate slice to restore i-1 axis partition.\n *partitions : iterable\n All partitions that make up the full axis (row or column) for both data sets.\n\n Returns\n -------\n list\n A list of ``ray.ObjectRef``-s.\n \"\"\"\n return _deploy_ray_func.options(\n num_returns=num_splits * (1 + cls._PARTITIONS_METADATA_LEN)\n ).remote(\n PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n )\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\n self.drain_call_queue()\n futures = self.list_of_blocks\n RayWrapper.wait(futures)\n\n\n@_inherit_docstrings(PandasOnRayDataframeVirtualPartition.__init__)\nclass PandasOnRayDataframeColumnPartition(PandasOnRayDataframeVirtualPartition):\n axis = 0\n\n\n@_inherit_docstrings(PandasOnRayDataframeVirtualPartition.__init__)\nclass PandasOnRayDataframeRowPartition(PandasOnRayDataframeVirtualPartition):\n axis = 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_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py__deploy_ray_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py__deploy_ray_func_", "embedding": null, "metadata": {"file_path": "modin/core/execution/ray/implementations/pandas_on_ray/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 323, "span_ids": ["_deploy_ray_func"], "tokens": 558}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@ray.remote\ndef _deploy_ray_func(\n deployer,\n axis,\n f_to_deploy,\n f_args,\n f_kwargs,\n *args,\n extract_metadata=True,\n **kwargs,\n): # pragma: no cover\n \"\"\"\n Execute a function on an axis partition in a worker process.\n\n This is ALWAYS called on either ``PandasDataframeAxisPartition.deploy_axis_func``\n or ``PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions``, which both\n serve to deploy another dataframe function on a Ray worker process. The provided ``f_args``\n is thus are deserialized here (on the Ray worker) before the function is called (``f_kwargs``\n will never contain more Ray objects, and thus does not require deserialization).\n\n Parameters\n ----------\n deployer : callable\n A `PandasDataFrameAxisPartition.deploy_*` method that will call ``f_to_deploy``.\n axis : {0, 1}\n The axis to perform the function along.\n f_to_deploy : callable or RayObjectID\n The function to deploy.\n f_args : list or tuple\n Positional arguments to pass to ``f_to_deploy``.\n f_kwargs : dict\n Keyword arguments to pass to ``f_to_deploy``.\n *args : list\n Positional arguments to pass to ``deployer``.\n extract_metadata : bool, default: True\n Whether to return metadata (length, width, ip) of the result. Passing `False` may relax\n the load on object storage as the remote function would return 4 times fewer futures.\n Passing `False` makes sense for temporary results where you know for sure that the\n metadata will never be requested.\n **kwargs : dict\n Keyword arguments to pass to ``deployer``.\n\n Returns\n -------\n list : Union[tuple, list]\n The result of the function call, and metadata for it.\n\n Notes\n -----\n Ray functions are not detected by codecov (thus pragma: no cover).\n \"\"\"\n f_args = deserialize(f_args)\n result = deployer(axis, f_to_deploy, f_args, f_kwargs, *args, **kwargs)\n if not extract_metadata:\n return result\n ip = get_node_ip_address()\n if isinstance(result, pandas.DataFrame):\n return result, len(result), len(result.columns), ip\n elif all(isinstance(r, pandas.DataFrame) for r in result):\n return [i for r in result for i in [r, len(r), len(r.columns), ip]]\n else:\n return [i for r in result for i in [r, None, None, ip]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/unidist/common/__init__.py_UnidistWrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/__init__.py_UnidistWrapper_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 24, "span_ids": ["docstring"], "tokens": 47}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .engine_wrapper import UnidistWrapper, SignalActor\nfrom .utils import initialize_unidist\n\n__all__ = [\n \"initialize_unidist\",\n \"UnidistWrapper\",\n \"SignalActor\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_asyncio__deploy_unidist_func.return.func_args_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_asyncio__deploy_unidist_func.return.func_args_kwargs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 43, "span_ids": ["_deploy_unidist_func", "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": "import asyncio\nimport unidist\n\n\n@unidist.remote\ndef _deploy_unidist_func(func, *args, **kwargs): # pragma: no cover\n \"\"\"\n Wrap `func` to ease calling it remotely.\n\n Parameters\n ----------\n func : callable\n A local function that we want to call remotely.\n *args : iterable\n Positional arguments to pass to `func` when calling remotely.\n **kwargs : dict\n Keyword arguments to pass to `func` when calling remotely.\n\n Returns\n -------\n unidist.ObjectRef or list[unidist.ObjectRef]\n Unidist identifier of the result being put to object store.\n \"\"\"\n return func(*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_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper_UnidistWrapper.deploy.return._deploy_unidist_func_opti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper_UnidistWrapper.deploy.return._deploy_unidist_func_opti", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 74, "span_ids": ["UnidistWrapper.deploy", "UnidistWrapper"], "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 UnidistWrapper:\n \"\"\"Mixin that provides means of running functions remotely and getting local results.\"\"\"\n\n @classmethod\n def deploy(cls, func, f_args=None, f_kwargs=None, num_returns=1):\n \"\"\"\n Run local `func` remotely.\n\n Parameters\n ----------\n func : callable or unidist.ObjectRef\n The function to perform.\n f_args : list or tuple, optional\n Positional arguments to pass to ``func``.\n f_kwargs : dict, optional\n Keyword arguments to pass to ``func``.\n num_returns : int, default: 1\n Amount of return values expected from `func`.\n\n Returns\n -------\n unidist.ObjectRef or list\n Unidist identifier of the result being put to object store.\n \"\"\"\n args = [] if f_args is None else f_args\n kwargs = {} if f_kwargs is None else f_kwargs\n return _deploy_unidist_func.options(num_returns=num_returns).remote(\n func, *args, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper.materialize_UnidistWrapper.put.return.unidist_put_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper.materialize_UnidistWrapper.put.return.unidist_put_data_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 110, "span_ids": ["UnidistWrapper.put", "UnidistWrapper.materialize"], "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 UnidistWrapper:\n\n @classmethod\n def materialize(cls, obj_id):\n \"\"\"\n Get the value of object from the object store.\n\n Parameters\n ----------\n obj_id : unidist.ObjectRef\n Unidist object identifier to get the value by.\n\n Returns\n -------\n object\n Whatever was identified by `obj_id`.\n \"\"\"\n return unidist.get(obj_id)\n\n @classmethod\n def put(cls, data, **kwargs):\n \"\"\"\n Put data into the object store.\n\n Parameters\n ----------\n data : object\n Data to be put.\n **kwargs : dict\n Additional keyword arguments (mostly for compatibility).\n\n Returns\n -------\n unidist.ObjectRef\n A reference to `data`.\n \"\"\"\n return unidist.put(data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper.wait_UnidistWrapper.wait.unidist_wait_unique_ids_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_UnidistWrapper.wait_UnidistWrapper.wait.unidist_wait_unique_ids_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 130, "span_ids": ["UnidistWrapper.wait"], "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 UnidistWrapper:\n\n @classmethod\n def wait(cls, obj_ids, num_returns=None):\n \"\"\"\n Wait on the objects without materializing them (blocking operation).\n\n ``unidist.wait`` assumes a list of unique object references: see\n https://github.com/modin-project/modin/issues/5045\n\n Parameters\n ----------\n obj_ids : list, scalar\n num_returns : int, optional\n \"\"\"\n if not isinstance(obj_ids, list):\n obj_ids = [obj_ids]\n unique_ids = list(set(obj_ids))\n if num_returns is None:\n num_returns = len(unique_ids)\n unidist.wait(unique_ids, num_returns=num_returns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_SignalActor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/engine_wrapper.py_SignalActor_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/engine_wrapper.py", "file_name": "engine_wrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 133, "end_line": 170, "span_ids": ["SignalActor", "SignalActor.send", "SignalActor.wait", "SignalActor.__init__"], "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": "@unidist.remote\nclass SignalActor: # pragma: no cover\n \"\"\"\n Help synchronize across tasks and actors on cluster.\n\n Parameters\n ----------\n event_count : int\n Number of events required for synchronization.\n\n Notes\n -----\n For details see: https://docs.ray.io/en/latest/advanced.html?highlight=signalactor#multi-node-synchronization-using-an-actor.\n \"\"\"\n\n def __init__(self, event_count: int):\n self.events = [asyncio.Event() for _ in range(event_count)]\n\n def send(self, event_idx: int):\n \"\"\"\n Indicate that event with `event_idx` has occured.\n\n Parameters\n ----------\n event_idx : int\n \"\"\"\n self.events[event_idx].set()\n\n async def wait(self, event_idx: int):\n \"\"\"\n Wait until event with `event_idx` has occured.\n\n Parameters\n ----------\n event_idx : int\n \"\"\"\n await self.events[event_idx].wait()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/utils.py_unidist_initialize_unidist.modin_cfg_NPartitions__pu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/utils.py_unidist_initialize_unidist.modin_cfg_NPartitions__pu", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 51, "span_ids": ["initialize_unidist", "docstring"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unidist\nimport unidist.config as unidist_cfg\n\nimport modin.config as modin_cfg\nfrom modin.error_message import ErrorMessage\nfrom .engine_wrapper import UnidistWrapper\n\n\ndef initialize_unidist():\n \"\"\"\n Initialize unidist based on ``modin.config`` variables and internal defaults.\n \"\"\"\n\n if unidist_cfg.Backend.get() != \"mpi\":\n raise RuntimeError(\n f\"Modin only supports unidist on MPI for now, got unidist backend '{unidist_cfg.Backend.get()}'\"\n )\n\n if not unidist.is_initialized():\n modin_cfg.CpuCount.subscribe(\n lambda cpu_count: unidist_cfg.CpuCount.put(cpu_count.get())\n )\n # This string is intentionally formatted this way. We want it indented in\n # the warning message.\n ErrorMessage.not_initialized(\n \"unidist\",\n \"\"\"\n import unidist\n unidist.init()\n \"\"\",\n )\n\n unidist.init()\n\n num_cpus = sum(v[\"CPU\"] for v in unidist.cluster_resources().values())\n modin_cfg.NPartitions._put(num_cpus)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/utils.py_deserialize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/common/utils.py_deserialize_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/common/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 92, "span_ids": ["deserialize"], "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": "def deserialize(obj): # pragma: no cover\n \"\"\"\n Deserialize a unidist object.\n\n Parameters\n ----------\n obj : unidist.ObjectRef, iterable of unidist.ObjectRef, or mapping of keys to unidist.ObjectRef\n Object(s) to deserialize.\n\n Returns\n -------\n obj\n The deserialized object(s).\n \"\"\"\n if unidist.is_object_ref(obj):\n return UnidistWrapper.materialize(obj)\n elif isinstance(obj, (tuple, list)):\n # Unidist will error if any elements are not ObjectRef, but we still want unidist to\n # perform batch deserialization for us -- thus, we must submit only the list elements\n # that are ObjectRef, deserialize them, and restore them to their correct list index\n ref_indices, refs = [], []\n for i, unidist_ref in enumerate(obj):\n if unidist.is_object_ref(unidist_ref):\n ref_indices.append(i)\n refs.append(unidist_ref)\n unidist_result = UnidistWrapper.materialize(refs)\n new_lst = list(obj)\n for i, deser_item in zip(ref_indices, unidist_result):\n new_lst[i] = deser_item\n # Check that all objects have been deserialized\n assert not any(unidist.is_object_ref(o) for o in new_lst)\n return new_lst\n elif isinstance(obj, dict) and any(\n unidist.is_object_ref(val) for val in obj.values()\n ):\n return dict(zip(obj.keys(), deserialize(tuple(obj.values()))))\n else:\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_modin-project__modin/modin/core/execution/unidist/generic/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/generic/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/unidist/generic/io/__init__.py_UnidistIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/io/__init__.py_UnidistIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/generic/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 19}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import UnidistIO\n\n__all__ = [\"UnidistIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/io/io.py_from_modin_core_io_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/io/io.py_from_modin_core_io_import_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/generic/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["UnidistIO", "docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.io import BaseIO\n\n\nclass UnidistIO(BaseIO):\n \"\"\"Base class for doing I/O operations over unidist.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/partitioning/__init__.py_GenericUnidistDataframePartitionManager_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/partitioning/__init__.py_GenericUnidistDataframePartitionManager_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/generic/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .partition_manager import GenericUnidistDataframePartitionManager\n\n__all__ = [\n \"GenericUnidistDataframePartitionManager\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/partitioning/partition_manager.py_np_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/generic/partitioning/partition_manager.py_np_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/generic/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 53, "span_ids": ["GenericUnidistDataframePartitionManager", "GenericUnidistDataframePartitionManager.to_numpy", "docstring"], "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 numpy as np\n\nfrom modin.core.dataframe.pandas.partitioning.partition_manager import (\n PandasDataframePartitionManager,\n)\nfrom modin.core.execution.unidist.common import UnidistWrapper\n\n\nclass GenericUnidistDataframePartitionManager(PandasDataframePartitionManager):\n \"\"\"The class implements the interface in `PandasDataframePartitionManager`.\"\"\"\n\n @classmethod\n def to_numpy(cls, partitions, **kwargs):\n \"\"\"\n Convert `partitions` into a NumPy array.\n\n Parameters\n ----------\n partitions : NumPy array\n A 2-D array of partitions to convert to local NumPy array.\n **kwargs : dict\n Keyword arguments to pass to each partition ``.to_numpy()`` call.\n\n Returns\n -------\n NumPy array\n \"\"\"\n parts = UnidistWrapper.materialize(\n [\n obj.apply(lambda df, **kwargs: df.to_numpy(**kwargs)).list_of_blocks[0]\n for row in partitions\n for obj in row\n ]\n )\n rows, cols = partitions.shape\n parts = [parts[i * cols : (i + 1) * cols] for i in range(rows)]\n return np.block(parts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/__init__.py_PandasOnUnidistDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/__init__.py_PandasOnUnidistDataframe_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "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 .dataframe import PandasOnUnidistDataframe\n\n__all__ = [\"PandasOnUnidistDataframe\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/dataframe.py_PandasOnUnidistDataframePartitionManager_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/dataframe.py_PandasOnUnidistDataframePartitionManager_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 43, "span_ids": ["PandasOnUnidistDataframe", "docstring"], "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": "from ..partitioning.partition_manager import PandasOnUnidistDataframePartitionManager\nfrom modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\n\n\nclass PandasOnUnidistDataframe(PandasDataframe):\n \"\"\"\n The class implements the interface in ``PandasDataframe`` using unidist.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence\n The index for the dataframe. Converted to a ``pandas.Index``.\n columns : sequence\n The columns object for the dataframe. Converted to a ``pandas.Index``.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = PandasOnUnidistDataframePartitionManager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py_PandasOnUnidistIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py_PandasOnUnidistIO_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 25}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import PandasOnUnidistIO\n\n__all__ = [\"PandasOnUnidistIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_io_PandasOnUnidistDataframePartition": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_io_PandasOnUnidistDataframePartition", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 42, "span_ids": ["docstring"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import io\n\nimport pandas\n\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.unidist.generic.io import UnidistIO\nfrom modin.core.io import (\n CSVDispatcher,\n FWFDispatcher,\n JSONDispatcher,\n ParquetDispatcher,\n FeatherDispatcher,\n SQLDispatcher,\n ExcelDispatcher,\n)\nfrom modin.core.storage_formats.pandas.parsers import (\n PandasCSVParser,\n PandasFWFParser,\n PandasJSONParser,\n PandasParquetParser,\n PandasFeatherParser,\n PandasSQLParser,\n PandasExcelParser,\n)\nfrom modin.core.execution.unidist.common import UnidistWrapper, SignalActor\nfrom ..dataframe import PandasOnUnidistDataframe\nfrom ..partitioning import PandasOnUnidistDataframePartition", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO_PandasOnUnidistIO.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO_PandasOnUnidistIO.None_4", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 78, "span_ids": ["PandasOnUnidistIO", "PandasOnUnidistIO.__make_write", "PandasOnUnidistIO:9", "PandasOnUnidistIO.__make_read"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistIO(UnidistIO):\n \"\"\"Factory providing methods for performing I/O operations using pandas as storage format on unidist as engine.\"\"\"\n\n frame_cls = PandasOnUnidistDataframe\n query_compiler_cls = PandasQueryCompiler\n build_args = dict(\n frame_partition_cls=PandasOnUnidistDataframePartition,\n query_compiler_cls=PandasQueryCompiler,\n frame_cls=PandasOnUnidistDataframe,\n base_io=UnidistIO,\n )\n\n def __make_read(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (UnidistWrapper, *classes), build_args).read\n\n def __make_write(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (UnidistWrapper, *classes), build_args).write\n\n read_csv = __make_read(PandasCSVParser, CSVDispatcher)\n read_fwf = __make_read(PandasFWFParser, FWFDispatcher)\n read_json = __make_read(PandasJSONParser, JSONDispatcher)\n read_parquet = __make_read(PandasParquetParser, ParquetDispatcher)\n to_parquet = __make_write(ParquetDispatcher)\n # Blocked on pandas-dev/pandas#12236. It is faster to default to pandas.\n # read_hdf = __make_read(PandasHDFParser, HDFReader)\n read_feather = __make_read(PandasFeatherParser, FeatherDispatcher)\n read_sql = __make_read(PandasSQLParser, SQLDispatcher)\n to_sql = __make_write(SQLDispatcher)\n read_excel = __make_read(PandasExcelParser, ExcelDispatcher)\n\n del __make_read # to not pollute class namespace\n del __make_write # to not pollute class namespace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO._to_csv_check_support_PandasOnUnidistIO._to_csv_check_support.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO._to_csv_check_support_PandasOnUnidistIO._to_csv_check_support.return.True", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 115, "span_ids": ["PandasOnUnidistIO._to_csv_check_support"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistIO(UnidistIO):\n\n @staticmethod\n def _to_csv_check_support(kwargs):\n \"\"\"\n Check if parallel version of ``to_csv`` could be used.\n\n Parameters\n ----------\n kwargs : dict\n Keyword arguments passed to ``.to_csv()``.\n\n Returns\n -------\n bool\n Whether parallel version of ``to_csv`` is applicable.\n \"\"\"\n path_or_buf = kwargs[\"path_or_buf\"]\n compression = kwargs[\"compression\"]\n if not isinstance(path_or_buf, str):\n return False\n # case when the pointer is placed at the beginning of the file.\n if \"r\" in kwargs[\"mode\"] and \"+\" in kwargs[\"mode\"]:\n return False\n # encodings with BOM don't support;\n # instead of one mark in result bytes we will have them by the number of partitions\n # so we should fallback in pandas for `utf-16`, `utf-32` with all aliases, in instance\n # (`utf_32_be`, `utf_16_le` and so on)\n if kwargs[\"encoding\"] is not None:\n encoding = kwargs[\"encoding\"].lower()\n if \"u\" in encoding or \"utf\" in encoding:\n if \"16\" in encoding or \"32\" in encoding:\n return False\n if compression is None or not compression == \"infer\":\n return False\n if any((path_or_buf.endswith(ext) for ext in [\".gz\", \".bz2\", \".zip\", \".xz\"])):\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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv_PandasOnUnidistIO.to_csv.signals.SignalActor_remote_len_qc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv_PandasOnUnidistIO.to_csv.signals.SignalActor_remote_len_qc", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 132, "span_ids": ["PandasOnUnidistIO.to_csv"], "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 PandasOnUnidistIO(UnidistIO):\n\n @classmethod\n def to_csv(cls, qc, **kwargs):\n \"\"\"\n Write records stored in the `qc` to a CSV file.\n\n Parameters\n ----------\n qc : BaseQueryCompiler\n The query compiler of the Modin dataframe that we want to run ``to_csv`` on.\n **kwargs : dict\n Parameters for ``pandas.to_csv(**kwargs)``.\n \"\"\"\n if not cls._to_csv_check_support(kwargs):\n return UnidistIO.to_csv(qc, **kwargs)\n\n signals = SignalActor.remote(len(qc._modin_frame._partitions) + 1)\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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv.func_PandasOnUnidistIO.to_csv.func.return.pandas_DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv.func_PandasOnUnidistIO.to_csv.func.return.pandas_DataFrame_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 188, "span_ids": ["PandasOnUnidistIO.to_csv"], "tokens": 589}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistIO(UnidistIO):\n\n @classmethod\n def to_csv(cls, qc, **kwargs):\n # ... other code\n\n def func(df, **kw): # pragma: no cover\n \"\"\"\n Dump a chunk of rows as csv, then save them to target maintaining order.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A chunk of rows to write to a CSV file.\n **kw : dict\n Arguments to pass to ``pandas.to_csv(**kw)`` plus an extra argument\n `partition_idx` serving as chunk index to maintain rows order.\n \"\"\"\n partition_idx = kw[\"partition_idx\"]\n # the copy is made to not implicitly change the input parameters;\n # to write to an intermediate buffer, we need to change `path_or_buf` in kwargs\n csv_kwargs = kwargs.copy()\n if partition_idx != 0:\n # we need to create a new file only for first recording\n # all the rest should be recorded in appending mode\n if \"w\" in csv_kwargs[\"mode\"]:\n csv_kwargs[\"mode\"] = csv_kwargs[\"mode\"].replace(\"w\", \"a\")\n # It is enough to write the header for the first partition\n csv_kwargs[\"header\"] = False\n\n # for parallelization purposes, each partition is written to an intermediate buffer\n path_or_buf = csv_kwargs[\"path_or_buf\"]\n is_binary = \"b\" in csv_kwargs[\"mode\"]\n csv_kwargs[\"path_or_buf\"] = io.BytesIO() if is_binary else io.StringIO()\n storage_options = csv_kwargs.pop(\"storage_options\", None)\n df.to_csv(**csv_kwargs)\n csv_kwargs.update({\"storage_options\": storage_options})\n content = csv_kwargs[\"path_or_buf\"].getvalue()\n csv_kwargs[\"path_or_buf\"].close()\n\n # each process waits for its turn to write to a file\n UnidistWrapper.materialize(signals.wait.remote(partition_idx))\n\n # preparing to write data from the buffer to a file\n with pandas.io.common.get_handle(\n path_or_buf,\n # in case when using URL in implicit text mode\n # pandas try to open `path_or_buf` in binary mode\n csv_kwargs[\"mode\"] if is_binary else csv_kwargs[\"mode\"] + \"t\",\n encoding=kwargs[\"encoding\"],\n errors=kwargs[\"errors\"],\n compression=kwargs[\"compression\"],\n storage_options=kwargs.get(\"storage_options\", None),\n is_text=not is_binary,\n ) as handles:\n handles.handle.write(content)\n\n # signal that the next process can start writing to the file\n UnidistWrapper.materialize(signals.send.remote(partition_idx + 1))\n # used for synchronization purposes\n return pandas.DataFrame()\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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv._signaling_that_the_part_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_PandasOnUnidistIO.to_csv._signaling_that_the_part_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 207, "span_ids": ["PandasOnUnidistIO.to_csv"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistIO(UnidistIO):\n\n @classmethod\n def to_csv(cls, qc, **kwargs):\n\n # signaling that the partition with id==0 can be written to the file\n UnidistWrapper.materialize(signals.send.remote(0))\n # Ensure that the metadata is syncrhonized\n qc._modin_frame._propagate_index_objs(axis=None)\n result = qc._modin_frame._partition_mgr_cls.map_axis_partitions(\n axis=1,\n partitions=qc._modin_frame._partitions,\n map_func=func,\n keep_partitioning=True,\n lengths=None,\n enumerate_partitions=True,\n max_retries=0,\n )\n # pending completion\n UnidistWrapper.materialize(\n [part.list_of_blocks[0] for row in result for part in row]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/__init__.py_PandasOnUnidistDataframePartition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/__init__.py_PandasOnUnidistDataframePartition_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 31, "span_ids": ["docstring"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .partition import PandasOnUnidistDataframePartition\nfrom .partition_manager import PandasOnUnidistDataframePartitionManager\nfrom .virtual_partition import (\n PandasOnUnidistDataframeVirtualPartition,\n PandasOnUnidistDataframeColumnPartition,\n PandasOnUnidistDataframeRowPartition,\n)\n\n__all__ = [\n \"PandasOnUnidistDataframePartitionManager\",\n \"PandasOnUnidistDataframePartition\",\n \"PandasOnUnidistDataframeVirtualPartition\",\n \"PandasOnUnidistDataframeColumnPartition\",\n \"PandasOnUnidistDataframeRowPartition\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_unidist_PandasOnUnidistDataframePartition.__init__.self__is_debug_log_and_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_unidist_PandasOnUnidistDataframePartition.__init__.self__is_debug_log_and_l", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 63, "span_ids": ["PandasOnUnidistDataframePartition", "PandasOnUnidistDataframePartition.__init__", "docstring"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unidist\n\nfrom modin.core.execution.unidist.common import UnidistWrapper\nfrom modin.core.execution.unidist.common.utils import deserialize\nfrom modin.core.dataframe.pandas.partitioning.partition import PandasDataframePartition\nfrom modin.pandas.indexing import compute_sliced_len\nfrom modin.logging import get_logger\n\ncompute_sliced_len = unidist.remote(compute_sliced_len)\n\n\nclass PandasOnUnidistDataframePartition(PandasDataframePartition):\n \"\"\"\n The class implements the interface in ``PandasDataframePartition``.\n\n Parameters\n ----------\n data : unidist.ObjectRef\n A reference to ``pandas.DataFrame`` that need to be wrapped with this class.\n length : unidist.ObjectRef or int, optional\n Length or reference to it of wrapped ``pandas.DataFrame``.\n width : unidist.ObjectRef or int, optional\n Width or reference to it of wrapped ``pandas.DataFrame``.\n ip : unidist.ObjectRef or str, optional\n Node IP address or reference to it that holds wrapped ``pandas.DataFrame``.\n call_queue : list\n Call queue that needs to be executed on wrapped ``pandas.DataFrame``.\n \"\"\"\n\n execution_wrapper = UnidistWrapper\n\n def __init__(self, data, length=None, width=None, ip=None, call_queue=None):\n assert unidist.is_object_ref(data)\n self._data = data\n self.call_queue = call_queue if call_queue is not None else []\n self._length_cache = length\n self._width_cache = width\n self._ip_cache = ip\n\n log = get_logger()\n self._is_debug(log) and log.debug(\n \"Partition ID: {}, Height: {}, Width: {}, Node IP: {}\".format(\n self._identity,\n str(self._length_cache),\n str(self._width_cache),\n str(self._ip_cache),\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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.apply_PandasOnUnidistDataframePartition.apply.return.self___constructor___resu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.apply_PandasOnUnidistDataframePartition.apply.return.self___constructor___resu", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 103, "span_ids": ["PandasOnUnidistDataframePartition.apply"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n def apply(self, func, *args, **kwargs):\n \"\"\"\n Apply a function to the object wrapped by this partition.\n\n Parameters\n ----------\n func : callable or unidist.ObjectRef\n A function to apply.\n *args : iterable\n Additional positional arguments to be passed in `func`.\n **kwargs : dict\n Additional keyword arguments to be passed in `func`.\n\n Returns\n -------\n PandasOnUnidistDataframePartition\n A new ``PandasOnUnidistDataframePartition`` object.\n\n Notes\n -----\n It does not matter if `func` is callable or an ``unidist.ObjectRef``. Unidist will\n handle it correctly either way. The keyword arguments are sent as a dictionary.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.apply::{self._identity}\")\n data = self._data\n call_queue = self.call_queue + [[func, args, kwargs]]\n if len(call_queue) > 1:\n self._is_debug(log) and log.debug(\n f\"SUBMIT::_apply_list_of_funcs::{self._identity}\"\n )\n result, length, width, ip = _apply_list_of_funcs.remote(call_queue, data)\n else:\n # We handle `len(call_queue) == 1` in a different way because\n # this dramatically improves performance.\n result, length, width, ip = _apply_func.remote(data, func, *args, **kwargs)\n self._is_debug(log) and log.debug(f\"SUBMIT::_apply_func::{self._identity}\")\n self._is_debug(log) and log.debug(f\"EXIT::Partition.apply::{self._identity}\")\n return self.__constructor__(result, length, width, ip)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.drain_call_queue_PandasOnUnidistDataframePartition.drain_call_queue.if_not_isinstance_self__w.self._width_cache.new_width": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.drain_call_queue_PandasOnUnidistDataframePartition.drain_call_queue.if_not_isinstance_self__w.self._width_cache.new_width", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 146, "span_ids": ["PandasOnUnidistDataframePartition.drain_call_queue"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n def drain_call_queue(self):\n \"\"\"Execute all operations stored in the call queue on the object wrapped by this partition.\"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(\n f\"ENTER::Partition.drain_call_queue::{self._identity}\"\n )\n if len(self.call_queue) == 0:\n return\n data = self._data\n call_queue = self.call_queue\n if len(call_queue) > 1:\n self._is_debug(log) and log.debug(\n f\"SUBMIT::_apply_list_of_funcs::{self._identity}\"\n )\n (\n self._data,\n new_length,\n new_width,\n self._ip_cache,\n ) = _apply_list_of_funcs.remote(call_queue, data)\n else:\n # We handle `len(call_queue) == 1` in a different way because\n # this dramatically improves performance.\n func, f_args, f_kwargs = call_queue[0]\n self._is_debug(log) and log.debug(f\"SUBMIT::_apply_func::{self._identity}\")\n (\n self._data,\n new_length,\n new_width,\n self._ip_cache,\n ) = _apply_func.remote(data, func, *f_args, **f_kwargs)\n self._is_debug(log) and log.debug(\n f\"EXIT::Partition.drain_call_queue::{self._identity}\"\n )\n self.call_queue = []\n\n # GH#4732 if we already have evaluated width/length cached as ints,\n # don't overwrite that cache with non-evaluated values.\n if not isinstance(self._length_cache, int):\n self._length_cache = new_length\n if not isinstance(self._width_cache, int):\n self._width_cache = new_width", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.wait_PandasOnUnidistDataframePartition.mask.return.new_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.wait_PandasOnUnidistDataframePartition.mask.return.new_obj", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 194, "span_ids": ["PandasOnUnidistDataframePartition:5", "PandasOnUnidistDataframePartition.wait", "PandasOnUnidistDataframePartition.mask"], "tokens": 434}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\n self.drain_call_queue()\n UnidistWrapper.wait(self._data)\n\n # If unidist has not been initialized yet by Modin,\n # unidist itself handles initialization when calling `unidist.put`,\n # which is called inside of `UnidistWrapper.put`.\n _iloc = execution_wrapper.put(PandasDataframePartition._iloc)\n\n def mask(self, row_labels, col_labels):\n \"\"\"\n Lazily create a mask that extracts the indices provided.\n\n Parameters\n ----------\n row_labels : list-like, slice or label\n The row labels for the rows to extract.\n col_labels : list-like, slice or label\n The column labels for the columns to extract.\n\n Returns\n -------\n PandasOnUnidistDataframePartition\n A new ``PandasOnUnidistDataframePartition`` object.\n \"\"\"\n log = get_logger()\n self._is_debug(log) and log.debug(f\"ENTER::Partition.mask::{self._identity}\")\n new_obj = super().mask(row_labels, col_labels)\n if isinstance(row_labels, slice) and unidist.is_object_ref(self._length_cache):\n if row_labels == slice(None):\n # fast path - full axis take\n new_obj._length_cache = self._length_cache\n else:\n new_obj._length_cache = compute_sliced_len.remote(\n row_labels, self._length_cache\n )\n if isinstance(col_labels, slice) and unidist.is_object_ref(self._width_cache):\n if col_labels == slice(None):\n # fast path - full axis take\n new_obj._width_cache = self._width_cache\n else:\n new_obj._width_cache = compute_sliced_len.remote(\n col_labels, self._width_cache\n )\n self._is_debug(log) and log.debug(f\"EXIT::Partition.mask::{self._identity}\")\n return new_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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.put_PandasOnUnidistDataframePartition.preprocess_func.return.cls_execution_wrapper_put": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.put_PandasOnUnidistDataframePartition.preprocess_func.return.cls_execution_wrapper_put", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 228, "span_ids": ["PandasOnUnidistDataframePartition.put", "PandasOnUnidistDataframePartition.preprocess_func"], "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 PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Put an object into object store and wrap it with partition object.\n\n Parameters\n ----------\n obj : any\n An object to be put.\n\n Returns\n -------\n PandasOnUnidistDataframePartition\n A new ``PandasOnUnidistDataframePartition`` object.\n \"\"\"\n return cls(cls.execution_wrapper.put(obj), len(obj.index), len(obj.columns))\n\n @classmethod\n def preprocess_func(cls, func):\n \"\"\"\n Put a function into the object store to use in ``apply``.\n\n Parameters\n ----------\n func : callable\n A function to preprocess.\n\n Returns\n -------\n unidist.ObjectRef\n A reference to `func`.\n \"\"\"\n return cls.execution_wrapper.put(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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.length_PandasOnUnidistDataframePartition.length.return.self__length_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.length_PandasOnUnidistDataframePartition.length.return.self__length_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 256, "span_ids": ["PandasOnUnidistDataframePartition.length"], "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 PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n def length(self, materialize=True):\n \"\"\"\n Get the length of the object wrapped by this partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or unidist.ObjectRef\n The length of the object.\n \"\"\"\n if self._length_cache is None:\n if len(self.call_queue):\n self.drain_call_queue()\n else:\n (\n self._length_cache,\n self._width_cache,\n ) = _get_index_and_columns_size.remote(self._data)\n if unidist.is_object_ref(self._length_cache) and materialize:\n self._length_cache = UnidistWrapper.materialize(self._length_cache)\n return self._length_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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.width_PandasOnUnidistDataframePartition.width.return.self__width_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.width_PandasOnUnidistDataframePartition.width.return.self__width_cache", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 284, "span_ids": ["PandasOnUnidistDataframePartition.width"], "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 PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n def width(self, materialize=True):\n \"\"\"\n Get the width of the object wrapped by the partition.\n\n Parameters\n ----------\n materialize : bool, default: True\n Whether to forcibly materialize the result into an integer. If ``False``\n was specified, may return a future of the result if it hasn't been\n materialized yet.\n\n Returns\n -------\n int or unidist.ObjectRef\n The width of the object.\n \"\"\"\n if self._width_cache is None:\n if len(self.call_queue):\n self.drain_call_queue()\n else:\n (\n self._length_cache,\n self._width_cache,\n ) = _get_index_and_columns_size.remote(self._data)\n if unidist.is_object_ref(self._width_cache) and materialize:\n self._width_cache = UnidistWrapper.materialize(self._width_cache)\n return self._width_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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.ip__get_index_and_columns_size.return.len_df_index_len_df_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py_PandasOnUnidistDataframePartition.ip__get_index_and_columns_size.return.len_df_index_len_df_col", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 286, "end_line": 322, "span_ids": ["_get_index_and_columns_size", "PandasOnUnidistDataframePartition.ip"], "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 PandasOnUnidistDataframePartition(PandasDataframePartition):\n\n def ip(self):\n \"\"\"\n Get the node IP address of the object wrapped by this partition.\n\n Returns\n -------\n str\n IP address of the node that holds the data.\n \"\"\"\n if self._ip_cache is None:\n if len(self.call_queue):\n self.drain_call_queue()\n else:\n self._ip_cache = self.apply(lambda df: df)._ip_cache\n if unidist.is_object_ref(self._ip_cache):\n self._ip_cache = UnidistWrapper.materialize(self._ip_cache)\n return self._ip_cache\n\n\n@unidist.remote(num_returns=2)\ndef _get_index_and_columns_size(df): # pragma: no cover\n \"\"\"\n Get the number of rows and columns of a pandas DataFrame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A pandas DataFrame which dimensions are needed.\n\n Returns\n -------\n int\n The number of rows.\n int\n The number of columns.\n \"\"\"\n return len(df.index), len(df.columns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py__apply_func__apply_func.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py__apply_func__apply_func.return._", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 325, "end_line": 369, "span_ids": ["_apply_func"], "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": "@unidist.remote(num_returns=4)\ndef _apply_func(partition, func, *args, **kwargs): # pragma: no cover\n \"\"\"\n Execute a function on the partition in a worker process.\n\n Parameters\n ----------\n partition : pandas.DataFrame\n A pandas DataFrame the function needs to be executed on.\n func : callable\n The function to perform on the partition.\n *args : list\n Positional arguments to pass to ``func``.\n **kwargs : dict\n Keyword arguments to pass to ``func``.\n\n Returns\n -------\n pandas.DataFrame\n The resulting pandas DataFrame.\n int\n The number of rows of the resulting pandas DataFrame.\n int\n The number of columns of the resulting pandas DataFrame.\n str\n The node IP address of the worker process.\n\n Notes\n -----\n Directly passing a call queue entry (i.e. a list of [func, args, kwargs]) instead of\n destructuring it causes a performance penalty.\n \"\"\"\n try:\n result = func(partition, *args, **kwargs)\n # Sometimes Arrow forces us to make a copy of an object before we operate on it. We\n # don't want the error to propagate to the user, and we want to avoid copying unless\n # we absolutely have to.\n except ValueError:\n result = func(partition.copy(), *args, **kwargs)\n return (\n result,\n len(result) if hasattr(result, \"__len__\") else 0,\n len(getattr(result, \"columns\", ())),\n unidist.get_ip(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py__apply_list_of_funcs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py__apply_list_of_funcs_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 372, "end_line": 413, "span_ids": ["_apply_list_of_funcs"], "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": "@unidist.remote(num_returns=4)\ndef _apply_list_of_funcs(call_queue, partition): # pragma: no cover\n \"\"\"\n Execute all operations stored in the call queue on the partition in a worker process.\n\n Parameters\n ----------\n call_queue : list\n A call queue that needs to be executed on the partition.\n partition : pandas.DataFrame\n A pandas DataFrame the call queue needs to be executed on.\n\n Returns\n -------\n pandas.DataFrame\n The resulting pandas DataFrame.\n int\n The number of rows of the resulting pandas DataFrame.\n int\n The number of columns of the resulting pandas DataFrame.\n str\n The node IP address of the worker process.\n \"\"\"\n for func, f_args, f_kwargs in call_queue:\n func = deserialize(func)\n args = deserialize(f_args)\n kwargs = deserialize(f_kwargs)\n try:\n partition = func(partition, *args, **kwargs)\n # Sometimes Arrow forces us to make a copy of an object before we operate on it. We\n # don't want the error to propagate to the user, and we want to avoid copying unless\n # we absolutely have to.\n except ValueError:\n partition = func(partition.copy(), *args, **kwargs)\n\n return (\n partition,\n len(partition) if hasattr(partition, \"__len__\") else 0,\n len(partition.columns) if hasattr(partition, \"columns\") else 0,\n unidist.get_ip(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py_from_modin_core_execution_PandasOnUnidistDataframePartitionManager.wait_partitions.UnidistWrapper_wait_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py_from_modin_core_execution_PandasOnUnidistDataframePartitionManager.wait_partitions.UnidistWrapper_wait_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 51, "span_ids": ["PandasOnUnidistDataframePartitionManager", "PandasOnUnidistDataframePartitionManager.wait_partitions", "docstring"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.execution.unidist.generic.partitioning import (\n GenericUnidistDataframePartitionManager,\n)\nfrom modin.core.execution.unidist.common import UnidistWrapper\nfrom .virtual_partition import (\n PandasOnUnidistDataframeColumnPartition,\n PandasOnUnidistDataframeRowPartition,\n)\nfrom .partition import PandasOnUnidistDataframePartition\nfrom modin.core.execution.modin_aqp import progress_bar_wrapper\n\n\nclass PandasOnUnidistDataframePartitionManager(GenericUnidistDataframePartitionManager):\n \"\"\"The class implements the interface in `PandasDataframePartitionManager`.\"\"\"\n\n # This object uses PandasOnUnidistDataframePartition objects as the underlying store.\n _partition_class = PandasOnUnidistDataframePartition\n _column_partitions_class = PandasOnUnidistDataframeColumnPartition\n _row_partition_class = PandasOnUnidistDataframeRowPartition\n _execution_wrapper = UnidistWrapper\n\n @classmethod\n def wait_partitions(cls, partitions):\n \"\"\"\n Wait on the objects wrapped by `partitions` in parallel, without materializing them.\n\n This method will block until all computations in the list have completed.\n\n Parameters\n ----------\n partitions : np.ndarray\n NumPy array with ``PandasDataframePartition``-s.\n \"\"\"\n UnidistWrapper.wait(\n [block for partition in partitions for block in partition.list_of_blocks]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py__make_wrapped_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py__make_wrapped_method_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 90, "span_ids": ["_make_wrapped_method", "impl"], "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 _make_wrapped_method(name: str):\n \"\"\"\n Define new attribute that should work with progress bar.\n\n Parameters\n ----------\n name : str\n Name of `GenericUnidistDataframePartitionManager` attribute that should be reused.\n\n Notes\n -----\n - `classmethod` decorator shouldn't be applied twice, so we refer to `__func__` attribute.\n - New attribute is defined for `PandasOnUnidistDataframePartitionManager`.\n \"\"\"\n setattr(\n PandasOnUnidistDataframePartitionManager,\n name,\n classmethod(\n progress_bar_wrapper(\n getattr(GenericUnidistDataframePartitionManager, name).__func__\n )\n ),\n )\n\n\nfor method in (\n \"map_partitions\",\n \"lazy_map_partitions\",\n \"map_axis_partitions\",\n \"_apply_func_to_list_of_partitions\",\n \"apply_func_to_select_indices\",\n \"apply_func_to_select_indices_along_full_axis\",\n \"apply_func_to_indices_both_axis\",\n \"n_ary_operation\",\n):\n _make_wrapped_method(method)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_pandas_PandasOnUnidistDataframeVirtualPartition._get_drain_func.return.cls__DRAIN_FUNC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_pandas_PandasOnUnidistDataframeVirtualPartition._get_drain_func.return.cls__DRAIN_FUNC", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 80, "span_ids": ["PandasOnUnidistDataframeVirtualPartition", "PandasOnUnidistDataframeVirtualPartition._get_drain_func", "docstring", "PandasOnUnidistDataframeVirtualPartition._get_deploy_split_func", "PandasOnUnidistDataframeVirtualPartition._get_deploy_axis_func"], "tokens": 606}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport unidist\n\nfrom modin.core.dataframe.pandas.partitioning.axis_partition import (\n PandasDataframeAxisPartition,\n)\nfrom modin.core.execution.unidist.common.utils import deserialize\nfrom modin.core.execution.unidist.common import UnidistWrapper\nfrom .partition import PandasOnUnidistDataframePartition\nfrom modin.utils import _inherit_docstrings\n\n\nclass PandasOnUnidistDataframeVirtualPartition(PandasDataframeAxisPartition):\n \"\"\"\n The class implements the interface in ``PandasDataframeAxisPartition``.\n\n Parameters\n ----------\n list_of_partitions : Union[list, PandasOnUnidistDataframePartition]\n List of ``PandasOnUnidistDataframePartition`` and\n ``PandasOnUnidistDataframeVirtualPartition`` objects, or a single\n ``PandasOnUnidistDataframePartition``.\n get_ip : bool, default: False\n Whether to get node IP addresses to conforming partitions or not.\n full_axis : bool, default: True\n Whether or not the virtual partition encompasses the whole axis.\n call_queue : list, optional\n A list of tuples (callable, args, kwargs) that contains deferred calls.\n length : unidist.ObjectRef or int, optional\n Length, or reference to length, of wrapped ``pandas.DataFrame``.\n width : unidist.ObjectRef or int, optional\n Width, or reference to width, of wrapped ``pandas.DataFrame``.\n \"\"\"\n\n _PARTITIONS_METADATA_LEN = 3 # (length, width, ip)\n partition_type = PandasOnUnidistDataframePartition\n instance_type = unidist.core.base.object_ref.ObjectRef\n axis = None\n\n # these variables are intentionally initialized at runtime (see #6023)\n _DEPLOY_AXIS_FUNC = None\n _DEPLOY_SPLIT_FUNC = None\n _DRAIN_FUNC = None\n\n @classmethod\n def _get_deploy_axis_func(cls): # noqa: GL08\n if cls._DEPLOY_AXIS_FUNC is None:\n cls._DEPLOY_AXIS_FUNC = UnidistWrapper.put(\n PandasDataframeAxisPartition.deploy_axis_func\n )\n return cls._DEPLOY_AXIS_FUNC\n\n @classmethod\n def _get_deploy_split_func(cls): # noqa: GL08\n if cls._DEPLOY_SPLIT_FUNC is None:\n cls._DEPLOY_SPLIT_FUNC = UnidistWrapper.put(\n PandasDataframeAxisPartition.deploy_splitting_func\n )\n return cls._DEPLOY_SPLIT_FUNC\n\n @classmethod\n def _get_drain_func(cls): # noqa: GL08\n if cls._DRAIN_FUNC is None:\n cls._DRAIN_FUNC = UnidistWrapper.put(PandasDataframeAxisPartition.drain)\n return cls._DRAIN_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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.list_of_ips_PandasOnUnidistDataframeVirtualPartition.list_of_ips.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.list_of_ips_PandasOnUnidistDataframeVirtualPartition.list_of_ips.return.result", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 97, "span_ids": ["PandasOnUnidistDataframeVirtualPartition.list_of_ips"], "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 PandasOnUnidistDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @property\n def list_of_ips(self):\n \"\"\"\n Get the IPs holding the physical objects composing this partition.\n\n Returns\n -------\n List\n A list of IPs as ``unidist.ObjectRef`` or str.\n \"\"\"\n # Defer draining call queue until we get the ip address\n result = [None] * len(self.list_of_block_partitions)\n for idx, partition in enumerate(self.list_of_block_partitions):\n partition.drain_call_queue()\n result[idx] = partition._ip_cache\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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func_PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func.return._deploy_unidist_func_opti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func_PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func.return._deploy_unidist_func_opti", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 124, "span_ids": ["PandasOnUnidistDataframeVirtualPartition.deploy_splitting_func"], "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 PandasOnUnidistDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n @_inherit_docstrings(PandasDataframeAxisPartition.deploy_splitting_func)\n def deploy_splitting_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n extract_metadata=False,\n ):\n return _deploy_unidist_func.options(\n num_returns=num_splits * (1 + cls._PARTITIONS_METADATA_LEN)\n if extract_metadata\n else num_splits,\n ).remote(\n cls._get_deploy_split_func(),\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n *partitions,\n extract_metadata=extract_metadata,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_axis_func_PandasOnUnidistDataframeVirtualPartition.deploy_axis_func.return._deploy_unidist_func_opti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_axis_func_PandasOnUnidistDataframeVirtualPartition.deploy_axis_func.return._deploy_unidist_func_opti", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 187, "span_ids": ["PandasOnUnidistDataframeVirtualPartition.deploy_axis_func"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasOnUnidistDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n def deploy_axis_func(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n lengths=None,\n manual_partition=False,\n max_retries=None,\n ):\n \"\"\"\n Deploy a function along a full axis.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see ``split_result_of_axis_func_pandas``).\n maintain_partitioning : bool\n If True, keep the old partitioning if possible.\n If False, create a new partition layout.\n *partitions : iterable\n All partitions that make up the full axis (row or column).\n lengths : list, optional\n The list of lengths to shuffle the object.\n manual_partition : bool, default: False\n If True, partition the result with `lengths`.\n max_retries : int, default: None\n The max number of times to retry the func.\n\n Returns\n -------\n list\n A list of ``unidist.ObjectRef``-s.\n \"\"\"\n return _deploy_unidist_func.options(\n num_returns=(num_splits if lengths is None else len(lengths))\n * (1 + cls._PARTITIONS_METADATA_LEN),\n **({\"max_retries\": max_retries} if max_retries is not None else {}),\n ).remote(\n cls._get_deploy_axis_func(),\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n maintain_partitioning,\n *partitions,\n manual_partition=manual_partition,\n lengths=lengths,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnUnidistDataframeRowPartition.axis.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py_PandasOnUnidistDataframeVirtualPartition.deploy_func_between_two_axis_partitions_PandasOnUnidistDataframeRowPartition.axis.1", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 257, "span_ids": ["PandasOnUnidistDataframeRowPartition", "PandasOnUnidistDataframeColumnPartition", "PandasOnUnidistDataframeVirtualPartition.deploy_func_between_two_axis_partitions", "PandasOnUnidistDataframeVirtualPartition.wait"], "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 PandasOnUnidistDataframeVirtualPartition(PandasDataframeAxisPartition):\n\n @classmethod\n def deploy_func_between_two_axis_partitions(\n cls,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n ):\n \"\"\"\n Deploy a function along a full axis between two data sets.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return (see ``split_result_of_axis_func_pandas``).\n len_of_left : int\n The number of values in `partitions` that belong to the left data set.\n other_shape : np.ndarray\n The shape of right frame in terms of partitions, i.e.\n (other_shape[i-1], other_shape[i]) will indicate slice to restore i-1 axis partition.\n *partitions : iterable\n All partitions that make up the full axis (row or column) for both data sets.\n\n Returns\n -------\n list\n A list of ``unidist.ObjectRef``-s.\n \"\"\"\n return _deploy_unidist_func.options(\n num_returns=num_splits * (1 + cls._PARTITIONS_METADATA_LEN)\n ).remote(\n PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions,\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n other_shape,\n *partitions,\n )\n\n def wait(self):\n \"\"\"Wait completing computations on the object wrapped by the partition.\"\"\"\n self.drain_call_queue()\n futures = self.list_of_blocks\n UnidistWrapper.wait(futures)\n\n\n@_inherit_docstrings(PandasOnUnidistDataframeVirtualPartition.__init__)\nclass PandasOnUnidistDataframeColumnPartition(PandasOnUnidistDataframeVirtualPartition):\n axis = 0\n\n\n@_inherit_docstrings(PandasOnUnidistDataframeVirtualPartition.__init__)\nclass PandasOnUnidistDataframeRowPartition(PandasOnUnidistDataframeVirtualPartition):\n axis = 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_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py__deploy_unidist_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py__deploy_unidist_func_", "embedding": null, "metadata": {"file_path": "modin/core/execution/unidist/implementations/pandas_on_unidist/partitioning/virtual_partition.py", "file_name": "virtual_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 322, "span_ids": ["_deploy_unidist_func"], "tokens": 573}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@unidist.remote\ndef _deploy_unidist_func(\n deployer,\n axis,\n f_to_deploy,\n f_args,\n f_kwargs,\n *args,\n extract_metadata=True,\n **kwargs,\n): # pragma: no cover\n \"\"\"\n Execute a function on an axis partition in a worker process.\n\n This is ALWAYS called on either ``PandasDataframeAxisPartition.deploy_axis_func``\n or ``PandasDataframeAxisPartition.deploy_func_between_two_axis_partitions``, which both\n serve to deploy another dataframe function on a unidist worker process. The provided ``f_args``\n is thus are deserialized here (on the unidist worker) before the function is called (``f_kwargs``\n will never contain more unidist objects, and thus does not require deserialization).\n\n Parameters\n ----------\n deployer : callable\n A `PandasDataFrameAxisPartition.deploy_*` method that will call ``f_to_deploy``.\n axis : {0, 1}\n The axis to perform the function along.\n f_to_deploy : callable or unidist.ObjectRef\n The function to deploy.\n f_args : list or tuple\n Positional arguments to pass to ``f_to_deploy``.\n f_kwargs : dict\n Keyword arguments to pass to ``f_to_deploy``.\n *args : list\n Positional arguments to pass to ``deployer``.\n extract_metadata : bool, default: True\n Whether to return metadata (length, width, ip) of the result. Passing `False` may relax\n the load on object storage as the remote function would return 4 times fewer futures.\n Passing `False` makes sense for temporary results where you know for sure that the\n metadata will never be requested.\n **kwargs : dict\n Keyword arguments to pass to ``deployer``.\n\n Returns\n -------\n list : Union[tuple, list]\n The result of the function call, and metadata for it.\n\n Notes\n -----\n Unidist functions are not detected by codecov (thus pragma: no cover).\n \"\"\"\n f_args = deserialize(f_args)\n result = deployer(axis, f_to_deploy, f_args, f_kwargs, *args, **kwargs)\n if not extract_metadata:\n return result\n ip = unidist.get_ip()\n if isinstance(result, pandas.DataFrame):\n return result, len(result), len(result.columns), ip\n elif all(isinstance(r, pandas.DataFrame) for r in result):\n return [i for r in result for i in [r, len(r), len(r.columns), ip]]\n else:\n return [i for r in result for i in [r, None, None, ip]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/__init__.py_BaseIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/__init__.py_BaseIO_", "embedding": null, "metadata": {"file_path": "modin/core/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 41, "span_ids": ["docstring"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import BaseIO\nfrom .text.csv_dispatcher import CSVDispatcher\nfrom .text.fwf_dispatcher import FWFDispatcher\nfrom .text.json_dispatcher import JSONDispatcher\nfrom .text.excel_dispatcher import ExcelDispatcher\nfrom .file_dispatcher import FileDispatcher\nfrom .text.text_file_dispatcher import TextFileDispatcher\nfrom .column_stores.parquet_dispatcher import ParquetDispatcher\nfrom .column_stores.hdf_dispatcher import HDFDispatcher\nfrom .column_stores.feather_dispatcher import FeatherDispatcher\nfrom .sql.sql_dispatcher import SQLDispatcher\n\n__all__ = [\n \"BaseIO\",\n \"CSVDispatcher\",\n \"FWFDispatcher\",\n \"JSONDispatcher\",\n \"FileDispatcher\",\n \"TextFileDispatcher\",\n \"ParquetDispatcher\",\n \"HDFDispatcher\",\n \"FeatherDispatcher\",\n \"SQLDispatcher\",\n \"ExcelDispatcher\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_np_ColumnStoreDispatcher.call_deploy.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_np_ColumnStoreDispatcher.call_deploy.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/column_store_dispatcher.py", "file_name": "column_store_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 71, "span_ids": ["ColumnStoreDispatcher.call_deploy", "ColumnStoreDispatcher", "docstring"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pandas\n\nfrom modin.core.storage_formats.pandas.utils import compute_chunksize\nfrom modin.core.io.file_dispatcher import FileDispatcher\nfrom modin.config import NPartitions\n\n\nclass ColumnStoreDispatcher(FileDispatcher):\n \"\"\"\n Class handles utils for reading columnar store format files.\n\n Inherits some util functions for processing files from `FileDispatcher` class.\n \"\"\"\n\n @classmethod\n def call_deploy(cls, fname, col_partitions, **kwargs):\n \"\"\"\n Deploy remote tasks to the workers with passed parameters.\n\n Parameters\n ----------\n fname : str, path object or file-like object\n Name of the file to read.\n col_partitions : list\n List of arrays with columns names that should be read\n by each partition.\n **kwargs : dict\n Parameters of deploying read_* function.\n\n Returns\n -------\n np.ndarray\n Array with references to the task deploy result for each partition.\n \"\"\"\n return np.array(\n [\n cls.deploy(\n func=cls.parse,\n f_kwargs={\n \"fname\": fname,\n \"columns\": cols,\n \"num_splits\": NPartitions.get(),\n **kwargs,\n },\n num_returns=NPartitions.get() + 2,\n )\n for cols in col_partitions\n ]\n ).T", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_partition_ColumnStoreDispatcher.build_partition.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_partition_ColumnStoreDispatcher.build_partition.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/column_store_dispatcher.py", "file_name": "column_store_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 105, "span_ids": ["ColumnStoreDispatcher.build_partition"], "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 ColumnStoreDispatcher(FileDispatcher):\n\n @classmethod\n def build_partition(cls, partition_ids, row_lengths, column_widths):\n \"\"\"\n Build array with partitions of `cls.frame_partition_cls` class.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n row_lengths : list\n Partitions rows lengths.\n column_widths : list\n Number of columns in each partition.\n\n Returns\n -------\n np.ndarray\n array with shape equals to the shape of `partition_ids` and\n filed with partition objects.\n \"\"\"\n return np.array(\n [\n [\n cls.frame_partition_cls(\n partition_ids[i][j],\n length=row_lengths[i],\n width=column_widths[j],\n )\n for j in range(len(partition_ids[i]))\n ]\n for i in range(len(partition_ids))\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_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_index_ColumnStoreDispatcher.build_index.return.index_row_lengths": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_index_ColumnStoreDispatcher.build_index.return.index_row_lengths", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/column_store_dispatcher.py", "file_name": "column_store_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 143, "span_ids": ["ColumnStoreDispatcher.build_index"], "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 ColumnStoreDispatcher(FileDispatcher):\n\n @classmethod\n def build_index(cls, partition_ids):\n \"\"\"\n Compute index and its split sizes of resulting Modin DataFrame.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n\n Returns\n -------\n index : pandas.Index\n Index of resulting Modin DataFrame.\n row_lengths : list\n List with lengths of index chunks.\n \"\"\"\n num_partitions = NPartitions.get()\n index_len = (\n 0 if len(partition_ids) == 0 else cls.materialize(partition_ids[-2][0])\n )\n if isinstance(index_len, int):\n index = pandas.RangeIndex(index_len)\n else:\n index = index_len\n index_len = len(index)\n index_chunksize = compute_chunksize(index_len, num_partitions)\n if index_chunksize > index_len:\n row_lengths = [index_len] + [0 for _ in range(num_partitions - 1)]\n else:\n row_lengths = [\n index_chunksize\n if (i + 1) * index_chunksize < index_len\n else max(0, index_len - (index_chunksize * i))\n for i in range(num_partitions)\n ]\n return index, row_lengths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_columns_ColumnStoreDispatcher.build_columns.return.col_partitions_column_wi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_columns_ColumnStoreDispatcher.build_columns.return.col_partitions_column_wi", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/column_store_dispatcher.py", "file_name": "column_store_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 177, "span_ids": ["ColumnStoreDispatcher.build_columns"], "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 ColumnStoreDispatcher(FileDispatcher):\n\n @classmethod\n def build_columns(cls, columns):\n \"\"\"\n Split columns into chunks that should be read by workers.\n\n Parameters\n ----------\n columns : list\n List of columns that should be read from file.\n\n Returns\n -------\n col_partitions : list\n List of lists with columns for reading by workers.\n column_widths : list\n List with lengths of `col_partitions` subarrays\n (number of columns that should be read by workers).\n \"\"\"\n columns_length = len(columns)\n if columns_length == 0:\n return [], []\n num_partitions = NPartitions.get()\n column_splits = (\n columns_length // num_partitions\n if columns_length % num_partitions == 0\n else columns_length // num_partitions + 1\n )\n col_partitions = [\n columns[i : i + column_splits]\n for i in range(0, columns_length, column_splits)\n ]\n column_widths = [len(c) for c in col_partitions]\n return col_partitions, column_widths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_dtypes_ColumnStoreDispatcher.build_dtypes.return.dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_dtypes_ColumnStoreDispatcher.build_dtypes.return.dtypes", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/column_store_dispatcher.py", "file_name": "column_store_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 198, "span_ids": ["ColumnStoreDispatcher.build_dtypes"], "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 ColumnStoreDispatcher(FileDispatcher):\n\n @classmethod\n def build_dtypes(cls, partition_ids, columns):\n \"\"\"\n Compute common for all partitions `dtypes` for each of the DataFrame column.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n columns : list\n List of columns that should be read from file.\n\n Returns\n -------\n dtypes : pandas.Series\n Series with dtypes for columns.\n \"\"\"\n dtypes = pandas.concat(cls.materialize(list(partition_ids)), axis=0)\n dtypes.index = columns\n return dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/column_store_dispatcher.py_ColumnStoreDispatcher.build_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/column_store_dispatcher.py", "file_name": "column_store_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 239, "span_ids": ["ColumnStoreDispatcher.build_query_compiler"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ColumnStoreDispatcher(FileDispatcher):\n\n @classmethod\n def build_query_compiler(cls, path, columns, **kwargs):\n \"\"\"\n Build query compiler from deployed tasks outputs.\n\n Parameters\n ----------\n path : str, path object or file-like object\n Path to the file to read.\n columns : list\n List of columns that should be read from file.\n **kwargs : dict\n Parameters of deploying read_* function.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n col_partitions, column_widths = cls.build_columns(columns)\n partition_ids = cls.call_deploy(path, col_partitions, **kwargs)\n index, row_lens = cls.build_index(partition_ids)\n remote_parts = cls.build_partition(partition_ids[:-2], row_lens, column_widths)\n dtypes = (\n cls.build_dtypes(partition_ids[-1], columns)\n if len(partition_ids) > 0\n else None\n )\n new_query_compiler = cls.query_compiler_cls(\n cls.frame_cls(\n remote_parts,\n index,\n columns,\n row_lens,\n column_widths,\n dtypes=dtypes,\n )\n )\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/feather_dispatcher.py_from_modin_core_io_column_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/feather_dispatcher.py_from_modin_core_io_column_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/feather_dispatcher.py", "file_name": "feather_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 77, "span_ids": ["FeatherDispatcher", "FeatherDispatcher._read", "docstring"], "tokens": 476}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.io.column_stores.column_store_dispatcher import ColumnStoreDispatcher\nfrom modin.utils import import_optional_dependency\nfrom modin.core.io.file_dispatcher import OpenFile\n\n\nclass FeatherDispatcher(ColumnStoreDispatcher):\n \"\"\"Class handles utils for reading `.feather` files.\"\"\"\n\n @classmethod\n def _read(cls, path, columns=None, **kwargs):\n \"\"\"\n Read data from the file path, returning a query compiler.\n\n Parameters\n ----------\n path : str or file-like object\n The filepath of the feather file.\n columns : array-like, optional\n Columns to read from file. If not provided, all columns are read.\n **kwargs : dict\n `read_feather` function kwargs.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler with imported data for further processing.\n\n Notes\n -----\n `PyArrow` engine and local files only are supported for now,\n multi threading is set to False by default.\n PyArrow feather is used. Please refer to the documentation here\n https://arrow.apache.org/docs/python/api.html#feather-format\n \"\"\"\n path = cls.get_path(path)\n if columns is None:\n import_optional_dependency(\n \"pyarrow\", \"pyarrow is required to read feather files.\"\n )\n from pyarrow import ipc\n\n with OpenFile(\n path,\n **(kwargs.get(\"storage_options\", None) or {}),\n ) as file:\n # Opens the file to extract its metadata\n reader = ipc.open_file(file)\n # TODO: pyarrow's schema contains much more metadata than just column names, it also\n # has dtypes and index information that we could use when building a dataframe\n index_cols = frozenset(\n col\n for col in reader.schema.pandas_metadata[\"index_columns\"]\n # 'index_columns' field may also contain dictionary fields describing actual\n # RangeIndices, so we're only filtering here for string column names\n if isinstance(col, str)\n )\n # Filtering out the columns that describe the frame's index\n columns = [col for col in reader.schema.names if col not in index_cols]\n return cls.build_query_compiler(\n path, columns, use_threads=False, dtype_backend=kwargs[\"dtype_backend\"]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/hdf_dispatcher.py_pandas_HDFDispatcher._validate_hdf_format.return.format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/hdf_dispatcher.py_pandas_HDFDispatcher._validate_hdf_format.return.format", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/hdf_dispatcher.py", "file_name": "hdf_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 51, "span_ids": ["HDFDispatcher", "HDFDispatcher._validate_hdf_format", "docstring"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\n\nfrom modin.core.io.column_stores.column_store_dispatcher import ColumnStoreDispatcher\n\n\nclass HDFDispatcher(ColumnStoreDispatcher): # pragma: no cover\n \"\"\"\n Class handles utils for reading hdf data.\n\n Inherits some common for columnar store files util functions from\n `ColumnStoreDispatcher` class.\n \"\"\"\n\n @classmethod\n def _validate_hdf_format(cls, path_or_buf):\n \"\"\"\n Validate `path_or_buf` and then return `table_type` parameter of store group attribute.\n\n Parameters\n ----------\n path_or_buf : str, buffer or path object\n Path to the file to open, or an open :class:`pandas.HDFStore` object.\n\n Returns\n -------\n str\n `table_type` parameter of store group attribute.\n \"\"\"\n s = pandas.HDFStore(path_or_buf)\n groups = s.groups()\n if len(groups) == 0:\n raise ValueError(\"No dataset in HDF5 file.\")\n candidate_only_group = groups[0]\n format = getattr(candidate_only_group._v_attrs, \"table_type\", None)\n s.close()\n return format", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/hdf_dispatcher.py_HDFDispatcher._read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/hdf_dispatcher.py_HDFDispatcher._read_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/hdf_dispatcher.py", "file_name": "hdf_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 91, "span_ids": ["HDFDispatcher._read"], "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 HDFDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def _read(cls, path_or_buf, **kwargs):\n \"\"\"\n Load an h5 file from the file path or buffer, returning a query compiler.\n\n Parameters\n ----------\n path_or_buf : str, buffer or path object\n Path to the file to open, or an open :class:`pandas.HDFStore` object.\n **kwargs : dict\n Pass into pandas.read_hdf function.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n if cls._validate_hdf_format(path_or_buf=path_or_buf) is None:\n return cls.single_worker_read(\n path_or_buf,\n reason=\"File format seems to be `fixed`. For better distribution consider \"\n + \"saving the file in `table` format. df.to_hdf(format=`table`).\",\n **kwargs\n )\n\n columns = kwargs.pop(\"columns\", None)\n # Have to do this because of Dask's keyword arguments\n kwargs[\"_key\"] = kwargs.pop(\"key\", None)\n if not columns:\n start = kwargs.pop(\"start\", None)\n stop = kwargs.pop(\"stop\", None)\n empty_pd_df = pandas.read_hdf(path_or_buf, start=0, stop=0, **kwargs)\n if start is not None:\n kwargs[\"start\"] = start\n if stop is not None:\n kwargs[\"stop\"] = stop\n columns = empty_pd_df.columns\n return cls.build_query_compiler(path_or_buf, columns, **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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_os_ColumnStoreDataset.fs.return.self__fs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_os_ColumnStoreDataset.fs.return.self__fs", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 117, "span_ids": ["ColumnStoreDataset", "ColumnStoreDataset.columns", "ColumnStoreDataset.engine", "ColumnStoreDataset.pandas_metadata", "ColumnStoreDataset.files", "docstring", "ColumnStoreDataset.row_groups_per_file", "ColumnStoreDataset.__init__", "ColumnStoreDataset.fs"], "tokens": 708}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport re\nimport json\n\nimport fsspec\nfrom fsspec.core import url_to_fs\nfrom fsspec.spec import AbstractBufferedFile\nimport numpy as np\nfrom pandas.io.common import stringify_path\nimport pandas\nimport pandas._libs.lib as lib\nfrom packaging import version\n\nfrom modin.core.storage_formats.pandas.utils import compute_chunksize\nfrom modin.config import NPartitions\n\n\nfrom modin.core.io.column_stores.column_store_dispatcher import ColumnStoreDispatcher\nfrom modin.utils import _inherit_docstrings\n\n\nclass ColumnStoreDataset:\n \"\"\"\n Base class that encapsulates Parquet engine-specific details.\n\n This class exposes a set of functions that are commonly used in the\n `read_parquet` implementation.\n\n Attributes\n ----------\n path : str, path object or file-like object\n The filepath of the parquet file in local filesystem or hdfs.\n storage_options : dict\n Parameters for specific storage engine.\n _fs_path : str, path object or file-like object\n The filepath or handle of the parquet dataset specific to the\n filesystem implementation. E.g. for `s3://test/example`, _fs\n would be set to S3FileSystem and _fs_path would be `test/example`.\n _fs : Filesystem\n Filesystem object specific to the given parquet file/dataset.\n dataset : ParquetDataset or ParquetFile\n Underlying dataset implementation for PyArrow and fastparquet\n respectively.\n _row_groups_per_file : list\n List that contains the number of row groups for each file in the\n given parquet dataset.\n _files : list\n List that contains the full paths of the parquet files in the dataset.\n \"\"\"\n\n def __init__(self, path, storage_options): # noqa : PR01\n self.path = path.__fspath__() if isinstance(path, os.PathLike) else path\n self.storage_options = storage_options\n self._fs_path = None\n self._fs = None\n self.dataset = self._init_dataset()\n self._row_groups_per_file = None\n self._files = None\n\n @property\n def pandas_metadata(self):\n \"\"\"Return the pandas metadata of the dataset.\"\"\"\n raise NotImplementedError\n\n @property\n def columns(self):\n \"\"\"Return the list of columns in the dataset.\"\"\"\n raise NotImplementedError\n\n @property\n def engine(self):\n \"\"\"Return string representing what engine is being used.\"\"\"\n raise NotImplementedError\n\n # TODO: make this cache_readonly after docstring inheritance is fixed.\n @property\n def files(self):\n \"\"\"Return the list of formatted file paths of the dataset.\"\"\"\n raise NotImplementedError\n\n # TODO: make this cache_readonly after docstring inheritance is fixed.\n @property\n def row_groups_per_file(self):\n \"\"\"Return a list with the number of row groups per file.\"\"\"\n raise NotImplementedError\n\n @property\n def fs(self):\n \"\"\"\n Return the filesystem object associated with the dataset path.\n\n Returns\n -------\n filesystem\n Filesystem object.\n \"\"\"\n if self._fs is None:\n if isinstance(self.path, AbstractBufferedFile):\n self._fs = self.path.fs\n else:\n self._fs, self._fs_path = url_to_fs(self.path, **self.storage_options)\n return self._fs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ColumnStoreDataset.fs_path_ColumnStoreDataset.to_pandas_dataframe.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ColumnStoreDataset.fs_path_ColumnStoreDataset.to_pandas_dataframe.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 145, "span_ids": ["ColumnStoreDataset.to_pandas_dataframe", "ColumnStoreDataset.fs_path"], "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 ColumnStoreDataset:\n\n @property\n def fs_path(self):\n \"\"\"\n Return the filesystem-specific path or file handle.\n\n Returns\n -------\n fs_path : str, path object or file-like object\n String path specific to filesystem or a file handle.\n \"\"\"\n if self._fs_path is None:\n if isinstance(self.path, AbstractBufferedFile):\n self._fs_path = self.path\n else:\n self._fs, self._fs_path = url_to_fs(self.path, **self.storage_options)\n return self._fs_path\n\n def to_pandas_dataframe(self, columns):\n \"\"\"\n Read the given columns as a pandas dataframe.\n\n Parameters\n ----------\n columns : list\n List of columns that should be read from file.\n \"\"\"\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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ColumnStoreDataset._get_files_ColumnStoreDataset._get_files.return.fs_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ColumnStoreDataset._get_files_ColumnStoreDataset._get_files.return.fs_files", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 180, "span_ids": ["ColumnStoreDataset._get_files"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ColumnStoreDataset:\n\n def _get_files(self, files):\n \"\"\"\n Retrieve list of formatted file names in dataset path.\n\n Parameters\n ----------\n files : list\n List of files from path.\n\n Returns\n -------\n fs_files : list\n List of files from path with fs-protocol prepended.\n \"\"\"\n # Older versions of fsspec doesn't support unstrip_protocol(). It\n # was only added relatively recently:\n # https://github.com/fsspec/filesystem_spec/pull/828\n\n def _unstrip_protocol(protocol, path):\n protos = (protocol,) if isinstance(protocol, str) else protocol\n for protocol in protos:\n if path.startswith(f\"{protocol}://\"):\n return path\n return f\"{protos[0]}://{path}\"\n\n if isinstance(self.path, AbstractBufferedFile):\n return [self.path]\n # version.parse() is expensive, so we can split this into two separate loops\n if version.parse(fsspec.__version__) < version.parse(\"2022.5.0\"):\n fs_files = [_unstrip_protocol(self.fs.protocol, fpath) for fpath in files]\n else:\n fs_files = [self.fs.unstrip_protocol(fpath) for fpath in files]\n\n return fs_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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_PyArrowDataset_PyArrowDataset.row_groups_per_file.return.self__row_groups_per_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_PyArrowDataset_PyArrowDataset.row_groups_per_file.return.self__row_groups_per_file", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 217, "span_ids": ["PyArrowDataset", "PyArrowDataset.pandas_metadata", "PyArrowDataset.row_groups_per_file", "PyArrowDataset.engine", "PyArrowDataset.columns", "PyArrowDataset._init_dataset"], "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": "@_inherit_docstrings(ColumnStoreDataset)\nclass PyArrowDataset(ColumnStoreDataset):\n def _init_dataset(self): # noqa: GL08\n from pyarrow.parquet import ParquetDataset\n\n return ParquetDataset(\n self.fs_path, filesystem=self.fs, use_legacy_dataset=False\n )\n\n @property\n def pandas_metadata(self):\n return self.dataset.schema.pandas_metadata\n\n @property\n def columns(self):\n return self.dataset.schema.names\n\n @property\n def engine(self):\n return \"pyarrow\"\n\n @property\n def row_groups_per_file(self):\n from pyarrow.parquet import ParquetFile\n\n if self._row_groups_per_file is None:\n row_groups_per_file = []\n # Count up the total number of row groups across all files and\n # keep track of row groups per file to use later.\n for file in self.files:\n with self.fs.open(file) as f:\n row_groups = ParquetFile(f).num_row_groups\n row_groups_per_file.append(row_groups)\n self._row_groups_per_file = row_groups_per_file\n return self._row_groups_per_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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_PyArrowDataset.files_PyArrowDataset.to_pandas_dataframe.return.read_table_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_PyArrowDataset.files_PyArrowDataset.to_pandas_dataframe.return.read_table_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 238, "span_ids": ["PyArrowDataset.files", "PyArrowDataset.to_pandas_dataframe"], "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": "@_inherit_docstrings(ColumnStoreDataset)\nclass PyArrowDataset(ColumnStoreDataset):\n\n @property\n def files(self):\n if self._files is None:\n try:\n files = self.dataset.files\n except AttributeError:\n # compatibility at least with 3.0.0 <= pyarrow < 8.0.0\n files = self.dataset._dataset.files\n self._files = self._get_files(files)\n return self._files\n\n def to_pandas_dataframe(\n self,\n columns,\n ):\n from pyarrow.parquet import read_table\n\n return read_table(\n self._fs_path, columns=columns, filesystem=self.fs\n ).to_pandas()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_FastParquetDataset_FastParquetDataset.row_groups_per_file.return.self__row_groups_per_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_FastParquetDataset_FastParquetDataset.row_groups_per_file.return.self__row_groups_per_file", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 241, "end_line": 275, "span_ids": ["FastParquetDataset.columns", "FastParquetDataset", "FastParquetDataset._init_dataset", "FastParquetDataset.row_groups_per_file", "FastParquetDataset.pandas_metadata", "FastParquetDataset.engine"], "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": "@_inherit_docstrings(ColumnStoreDataset)\nclass FastParquetDataset(ColumnStoreDataset):\n def _init_dataset(self): # noqa: GL08\n from fastparquet import ParquetFile\n\n return ParquetFile(self.fs_path, fs=self.fs)\n\n @property\n def pandas_metadata(self):\n if \"pandas\" not in self.dataset.key_value_metadata:\n return {}\n return json.loads(self.dataset.key_value_metadata[\"pandas\"])\n\n @property\n def columns(self):\n return self.dataset.columns\n\n @property\n def engine(self):\n return \"fastparquet\"\n\n @property\n def row_groups_per_file(self):\n from fastparquet import ParquetFile\n\n if self._row_groups_per_file is None:\n row_groups_per_file = []\n # Count up the total number of row groups across all files and\n # keep track of row groups per file to use later.\n for file in self.files:\n with self.fs.open(file) as f:\n row_groups = ParquetFile(f).info[\"row_groups\"]\n row_groups_per_file.append(row_groups)\n self._row_groups_per_file = row_groups_per_file\n return self._row_groups_per_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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_FastParquetDataset.files_FastParquetDataset._get_fastparquet_files.return.files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_FastParquetDataset.files_FastParquetDataset._get_fastparquet_files.return.files", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 299, "span_ids": ["FastParquetDataset._get_fastparquet_files", "FastParquetDataset.files", "FastParquetDataset.to_pandas_dataframe"], "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": "@_inherit_docstrings(ColumnStoreDataset)\nclass FastParquetDataset(ColumnStoreDataset):\n\n @property\n def files(self):\n if self._files is None:\n self._files = self._get_files(self._get_fastparquet_files())\n return self._files\n\n def to_pandas_dataframe(self, columns):\n return self.dataset.to_pandas(columns=columns)\n\n def _get_fastparquet_files(self): # noqa: GL08\n # fastparquet doesn't have a nice method like PyArrow, so we\n # have to copy some of their logic here while we work on getting\n # an easier method to get a list of valid files.\n # See: https://github.com/dask/fastparquet/issues/795\n if \"*\" in self.path:\n files = self.fs.glob(self.path)\n else:\n files = [\n f\n for f in self.fs.find(self.path)\n if f.endswith(\".parquet\") or f.endswith(\".parq\")\n ]\n return 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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher_ParquetDispatcher.get_dataset.if_engine_auto_.else_.raise_ValueError_engine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher_ParquetDispatcher.get_dataset.if_engine_auto_.else_.raise_ValueError_engine_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 351, "span_ids": ["ParquetDispatcher", "ParquetDispatcher.get_dataset"], "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": "class ParquetDispatcher(ColumnStoreDispatcher):\n \"\"\"Class handles utils for reading `.parquet` files.\"\"\"\n\n index_regex = re.compile(r\"__index_level_\\d+__\")\n\n @classmethod\n def get_dataset(cls, path, engine, storage_options):\n \"\"\"\n Retrieve Parquet engine specific Dataset implementation.\n\n Parameters\n ----------\n path : str, path object or file-like object\n The filepath of the parquet file in local filesystem or hdfs.\n engine : str\n Parquet library to use (only 'PyArrow' is supported for now).\n storage_options : dict\n Parameters for specific storage engine.\n\n Returns\n -------\n Dataset\n Either a PyArrowDataset or FastParquetDataset object.\n \"\"\"\n if engine == \"auto\":\n # We follow in concordance with pandas\n engine_classes = [PyArrowDataset, FastParquetDataset]\n\n error_msgs = \"\"\n for engine_class in engine_classes:\n try:\n return engine_class(path, storage_options)\n except ImportError as err:\n error_msgs += \"\\n - \" + str(err)\n\n raise ImportError(\n \"Unable to find a usable engine; \"\n + \"tried using: 'pyarrow', 'fastparquet'.\\n\"\n + \"A suitable version of \"\n + \"pyarrow or fastparquet is required for parquet \"\n + \"support.\\n\"\n + \"Trying to import the above resulted in these errors:\"\n + f\"{error_msgs}\"\n )\n elif engine == \"pyarrow\":\n return PyArrowDataset(path, storage_options)\n elif engine == \"fastparquet\":\n return FastParquetDataset(path, storage_options)\n else:\n raise ValueError(\"engine must be one of 'pyarrow', 'fastparquet'\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.call_deploy_ParquetDispatcher.call_deploy.return.all_partitions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.call_deploy_ParquetDispatcher.call_deploy.return.all_partitions", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 353, "end_line": 454, "span_ids": ["ParquetDispatcher.call_deploy"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def call_deploy(cls, dataset, col_partitions, storage_options, **kwargs):\n \"\"\"\n Deploy remote tasks to the workers with passed parameters.\n\n Parameters\n ----------\n dataset : Dataset\n Dataset object of Parquet file/files.\n col_partitions : list\n List of arrays with columns names that should be read\n by each partition.\n storage_options : dict\n Parameters for specific storage engine.\n **kwargs : dict\n Parameters of deploying read_* function.\n\n Returns\n -------\n List\n Array with references to the task deploy result for each partition.\n \"\"\"\n from modin.core.storage_formats.pandas.parsers import ParquetFileToRead\n\n # If we don't have any columns to read, we should just return an empty\n # set of references.\n if len(col_partitions) == 0:\n return []\n\n row_groups_per_file = dataset.row_groups_per_file\n num_row_groups = sum(row_groups_per_file)\n parquet_files = dataset.files\n\n # step determines how many row groups are going to be in a partition\n step = compute_chunksize(\n num_row_groups,\n NPartitions.get(),\n min_block_size=1,\n )\n current_partition_size = 0\n file_index = 0\n partition_files = [] # 2D array - each element contains list of chunks to read\n row_groups_used_in_current_file = 0\n total_row_groups_added = 0\n # On each iteration, we add a chunk of one file. That will\n # take us either to the end of a partition, or to the end\n # of a file.\n while total_row_groups_added < num_row_groups:\n if current_partition_size == 0:\n partition_files.append([])\n partition_file = partition_files[-1]\n file_path = parquet_files[file_index]\n row_group_start = row_groups_used_in_current_file\n row_groups_left_in_file = (\n row_groups_per_file[file_index] - row_groups_used_in_current_file\n )\n row_groups_left_for_this_partition = step - current_partition_size\n if row_groups_left_for_this_partition <= row_groups_left_in_file:\n # File has at least what we need to finish partition\n # So finish this partition and start a new one.\n num_row_groups_to_add = row_groups_left_for_this_partition\n current_partition_size = 0\n else:\n # File doesn't have enough to complete this partition. Add\n # it into current partition and go to next file.\n num_row_groups_to_add = row_groups_left_in_file\n current_partition_size += num_row_groups_to_add\n if num_row_groups_to_add == row_groups_left_in_file:\n file_index += 1\n row_groups_used_in_current_file = 0\n else:\n row_groups_used_in_current_file += num_row_groups_to_add\n partition_file.append(\n ParquetFileToRead(\n file_path, row_group_start, row_group_start + num_row_groups_to_add\n )\n )\n total_row_groups_added += num_row_groups_to_add\n\n assert (\n total_row_groups_added == num_row_groups\n ), \"row groups added does not match total num of row groups across parquet files\"\n\n all_partitions = []\n for files_to_read in partition_files:\n all_partitions.append(\n [\n cls.deploy(\n func=cls.parse,\n f_kwargs={\n \"files_for_parser\": files_to_read,\n \"columns\": cols,\n \"engine\": dataset.engine,\n \"storage_options\": storage_options,\n **kwargs,\n },\n num_returns=3,\n )\n for cols in col_partitions\n ]\n )\n return all_partitions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_partition_ParquetDispatcher.build_partition.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_partition_ParquetDispatcher.build_partition.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 456, "end_line": 492, "span_ids": ["ParquetDispatcher.build_partition"], "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 ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def build_partition(cls, partition_ids, column_widths):\n \"\"\"\n Build array with partitions of `cls.frame_partition_cls` class.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n column_widths : list\n Number of columns in each partition.\n\n Returns\n -------\n np.ndarray\n array with shape equals to the shape of `partition_ids` and\n filed with partition objects.\n\n Notes\n -----\n The second level of partitions_ids contains a list of object references\n for each read call:\n partition_ids[i][j] -> [ObjectRef(df), ObjectRef(df.index), ObjectRef(len(df))].\n \"\"\"\n return np.array(\n [\n [\n cls.frame_partition_cls(\n part_id[0],\n length=part_id[2],\n width=col_width,\n )\n for part_id, col_width in zip(part_ids, column_widths)\n ]\n for part_ids in partition_ids\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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_index_ParquetDispatcher.build_index.return.complete_index_range_ind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_index_ParquetDispatcher.build_index.return.complete_index_range_ind", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 494, "end_line": 546, "span_ids": ["ParquetDispatcher.build_index"], "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": "class ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def build_index(cls, dataset, partition_ids, index_columns):\n \"\"\"\n Compute index and its split sizes of resulting Modin DataFrame.\n\n Parameters\n ----------\n dataset : Dataset\n Dataset object of Parquet file/files.\n partition_ids : list\n Array with references to the partitions data.\n index_columns : list\n List of index columns specified by pandas metadata.\n\n Returns\n -------\n index : pandas.Index\n Index of resulting Modin DataFrame.\n needs_index_sync : bool\n Whether the partition indices need to be synced with frame\n index because there's no index column, or at least one\n index column is a RangeIndex.\n\n Notes\n -----\n See `build_partition` for more detail on the contents of partitions_ids.\n \"\"\"\n range_index = True\n column_names_to_read = []\n for column in index_columns:\n # According to https://arrow.apache.org/docs/python/generated/pyarrow.Schema.html,\n # only RangeIndex will be stored as metadata. Otherwise, the default behavior is\n # to store the index as a column.\n if isinstance(column, str):\n column_names_to_read.append(column)\n range_index = False\n elif column[\"name\"] is not None:\n column_names_to_read.append(column[\"name\"])\n\n # For the second check, let us consider the case where we have an empty dataframe,\n # that has a valid index.\n if range_index or (len(partition_ids) == 0 and len(column_names_to_read) != 0):\n complete_index = dataset.to_pandas_dataframe(\n columns=column_names_to_read\n ).index\n # Empty DataFrame case\n elif len(partition_ids) == 0:\n return [], False\n else:\n index_ids = [part_id[0][1] for part_id in partition_ids if len(part_id) > 0]\n index_objs = cls.materialize(index_ids)\n complete_index = index_objs[0].append(index_objs[1:])\n return complete_index, range_index or (len(index_columns) == 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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_query_compiler_ParquetDispatcher.build_query_compiler.return.cls_query_compiler_cls_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.build_query_compiler_ParquetDispatcher.build_query_compiler.return.cls_query_compiler_cls_fr", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 548, "end_line": 590, "span_ids": ["ParquetDispatcher.build_query_compiler"], "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 ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def build_query_compiler(cls, dataset, columns, index_columns, **kwargs):\n \"\"\"\n Build query compiler from deployed tasks outputs.\n\n Parameters\n ----------\n dataset : Dataset\n Dataset object of Parquet file/files.\n columns : list\n List of columns that should be read from file.\n index_columns : list\n List of index columns specified by pandas metadata.\n **kwargs : dict\n Parameters of deploying read_* function.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n storage_options = kwargs.pop(\"storage_options\", {}) or {}\n col_partitions, column_widths = cls.build_columns(columns)\n partition_ids = cls.call_deploy(\n dataset, col_partitions, storage_options, **kwargs\n )\n index, sync_index = cls.build_index(dataset, partition_ids, index_columns)\n remote_parts = cls.build_partition(partition_ids, column_widths)\n if len(partition_ids) > 0:\n row_lengths = [part.length() for part in remote_parts.T[0]]\n else:\n row_lengths = None\n frame = cls.frame_cls(\n remote_parts,\n index,\n columns,\n row_lengths=row_lengths,\n column_widths=column_widths,\n dtypes=None,\n )\n if sync_index:\n frame.synchronize_labels(axis=0)\n return cls.query_compiler_cls(frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher._read_ParquetDispatcher._read.return.cls_build_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher._read_ParquetDispatcher._read.return.cls_build_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 592, "end_line": 696, "span_ids": ["ParquetDispatcher._read"], "tokens": 860}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def _read(cls, path, engine, columns, use_nullable_dtypes, dtype_backend, **kwargs):\n \"\"\"\n Load a parquet object from the file path, returning a query compiler.\n\n Parameters\n ----------\n path : str, path object or file-like object\n The filepath of the parquet file in local filesystem or hdfs.\n engine : {\"auto\", \"pyarrow\", \"fastparquet\"}\n Parquet library to use.\n columns : list\n If not None, only these columns will be read from the file.\n use_nullable_dtypes : Union[bool, lib.NoDefault]\n dtype_backend : {\"numpy_nullable\", \"pyarrow\", lib.no_default}\n **kwargs : dict\n Keyword arguments.\n\n Returns\n -------\n BaseQueryCompiler\n A new Query Compiler.\n\n Notes\n -----\n ParquetFile API is used. Please refer to the documentation here\n https://arrow.apache.org/docs/python/parquet.html\n \"\"\"\n if (\n any(arg not in (\"storage_options\",) for arg in kwargs)\n or use_nullable_dtypes != lib.no_default\n ):\n return cls.single_worker_read(\n path,\n engine=engine,\n columns=columns,\n use_nullable_dtypes=use_nullable_dtypes,\n dtype_backend=dtype_backend,\n reason=\"Parquet options that are not currently supported\",\n **kwargs,\n )\n path = stringify_path(path)\n if isinstance(path, list):\n # TODO(https://github.com/modin-project/modin/issues/5723): read all\n # files in parallel.\n compilers: list[cls.query_compiler_cls] = [\n cls._read(\n p, engine, columns, use_nullable_dtypes, dtype_backend, **kwargs\n )\n for p in path\n ]\n return compilers[0].concat(axis=0, other=compilers[1:], ignore_index=True)\n if isinstance(path, str):\n if os.path.isdir(path):\n path_generator = os.walk(path)\n else:\n storage_options = kwargs.get(\"storage_options\")\n if storage_options is not None:\n fs, fs_path = url_to_fs(path, **storage_options)\n else:\n fs, fs_path = url_to_fs(path)\n path_generator = fs.walk(fs_path)\n partitioned_columns = set()\n # We do a tree walk of the path directory because partitioned\n # parquet directories have a unique column at each directory level.\n # Thus, we can use os.walk(), which does a dfs search, to walk\n # through the different columns that the data is partitioned on\n for _, dir_names, files in path_generator:\n if dir_names:\n partitioned_columns.add(dir_names[0].split(\"=\")[0])\n if files:\n # Metadata files, git files, .DSStore\n # TODO: fix conditional for column partitioning, see issue #4637\n if len(files[0]) > 0 and files[0][0] == \".\":\n continue\n break\n partitioned_columns = list(partitioned_columns)\n if len(partitioned_columns):\n return cls.single_worker_read(\n path,\n engine=engine,\n columns=columns,\n use_nullable_dtypes=use_nullable_dtypes,\n dtype_backend=dtype_backend,\n reason=\"Mixed partitioning columns in Parquet\",\n **kwargs,\n )\n\n dataset = cls.get_dataset(path, engine, kwargs.get(\"storage_options\") or {})\n index_columns = (\n dataset.pandas_metadata.get(\"index_columns\", [])\n if dataset.pandas_metadata\n else []\n )\n # If we have columns as None, then we default to reading in all the columns\n column_names = columns if columns else dataset.columns\n columns = [\n c\n for c in column_names\n if c not in index_columns and not cls.index_regex.match(c)\n ]\n\n return cls.build_query_compiler(\n dataset, columns, index_columns, dtype_backend=dtype_backend, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher._to_parquet_check_support_ParquetDispatcher._to_parquet_check_support.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher._to_parquet_check_support_ParquetDispatcher._to_parquet_check_support.return.True", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 698, "end_line": 721, "span_ids": ["ParquetDispatcher._to_parquet_check_support"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ParquetDispatcher(ColumnStoreDispatcher):\n\n @staticmethod\n def _to_parquet_check_support(kwargs):\n \"\"\"\n Check if parallel version of `to_parquet` could be used.\n\n Parameters\n ----------\n kwargs : dict\n Keyword arguments passed to `.to_parquet()`.\n\n Returns\n -------\n bool\n Whether parallel version of `to_parquet` is applicable.\n \"\"\"\n path = kwargs[\"path\"]\n compression = kwargs[\"compression\"]\n if not isinstance(path, str):\n return False\n if any((path.endswith(ext) for ext in [\".gz\", \".bz2\", \".zip\", \".xz\"])):\n return False\n if compression is None or not compression == \"snappy\":\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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.write_ParquetDispatcher.write.fs_mkdirs_url_exist_ok_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.write_ParquetDispatcher.write.fs_mkdirs_url_exist_ok_T", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 723, "end_line": 741, "span_ids": ["ParquetDispatcher.write"], "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 ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def write(cls, qc, **kwargs):\n \"\"\"\n Write a ``DataFrame`` to the binary parquet format.\n\n Parameters\n ----------\n qc : BaseQueryCompiler\n The query compiler of the Modin dataframe that we want to run `to_parquet` on.\n **kwargs : dict\n Parameters for `pandas.to_parquet(**kwargs)`.\n \"\"\"\n if not cls._to_parquet_check_support(kwargs):\n return cls.base_io.to_parquet(qc, **kwargs)\n\n output_path = kwargs[\"path\"]\n client_kwargs = (kwargs.get(\"storage_options\") or {}).get(\"client_kwargs\", {})\n fs, url = fsspec.core.url_to_fs(output_path, client_kwargs=client_kwargs)\n fs.mkdirs(url, exist_ok=True)\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_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.write.func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/column_stores/parquet_dispatcher.py_ParquetDispatcher.write.func_", "embedding": null, "metadata": {"file_path": "modin/core/io/column_stores/parquet_dispatcher.py", "file_name": "parquet_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 743, "end_line": 775, "span_ids": ["ParquetDispatcher.write"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ParquetDispatcher(ColumnStoreDispatcher):\n\n @classmethod\n def write(cls, qc, **kwargs):\n # ... other code\n\n def func(df, **kw): # pragma: no cover\n \"\"\"\n Dump a chunk of rows as parquet, then save them to target maintaining order.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A chunk of rows to write to a parquet file.\n **kw : dict\n Arguments to pass to ``pandas.to_parquet(**kwargs)`` plus an extra argument\n `partition_idx` serving as chunk index to maintain rows order.\n \"\"\"\n compression = kwargs[\"compression\"]\n partition_idx = kw[\"partition_idx\"]\n kwargs[\n \"path\"\n ] = f\"{output_path}/part-{partition_idx:04d}.{compression}.parquet\"\n df.to_parquet(**kwargs)\n return pandas.DataFrame()\n\n # Ensure that the metadata is synchronized\n qc._modin_frame._propagate_index_objs(axis=None)\n result = qc._modin_frame._partition_mgr_cls.map_axis_partitions(\n axis=1,\n partitions=qc._modin_frame._partitions,\n map_func=func,\n keep_partitioning=True,\n lengths=None,\n enumerate_partitions=True,\n )\n # pending completion\n cls.materialize([part.list_of_blocks[0] for row in result for part in row])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_os_OpenFile.__init__.self.kwargs.kwargs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_os_OpenFile.__init__.self.kwargs.kwargs", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 73, "span_ids": ["OpenFile.__init__", "OpenFile", "docstring"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport fsspec\nimport numpy as np\nfrom pandas.io.common import is_url, is_fsspec_url\n\nfrom modin.logging import ClassLogger\nfrom modin.config import AsyncReadMode\nfrom modin.utils import ModinAssumptionError\n\n\nNOT_IMPLEMENTED_MESSAGE = \"Implement in children classes!\"\n\n\nclass OpenFile:\n \"\"\"\n OpenFile is a context manager for an input file.\n\n OpenFile uses fsspec to open files on __enter__. On __exit__, it closes the\n fsspec file. This class exists to encapsulate the special behavior in\n __enter__ around anon=False and anon=True for s3 buckets.\n\n Parameters\n ----------\n file_path : str\n String that represents the path to the file (paths to S3 buckets\n are also acceptable).\n mode : str, default: \"rb\"\n String, which defines which mode file should be open.\n compression : str, default: \"infer\"\n File compression name.\n **kwargs : dict\n Keywords arguments to be passed into ``fsspec.open`` function.\n\n Attributes\n ----------\n file_path : str\n String that represents the path to the file\n mode : str\n String that defines which mode the file should be opened in.\n compression : str\n File compression name.\n file : fsspec.core.OpenFile\n The opened file.\n kwargs : dict\n Keywords arguments to be passed into ``fsspec.open`` function.\n \"\"\"\n\n def __init__(self, file_path, mode=\"rb\", compression=\"infer\", **kwargs):\n self.file_path = file_path\n self.mode = mode\n self.compression = compression\n self.kwargs = 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_modin-project__modin/modin/core/io/file_dispatcher.py_OpenFile.__enter___OpenFile.__exit__.self_file_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_OpenFile.__enter___OpenFile.__exit__.self_file_close_", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 75, "end_line": 113, "span_ids": ["OpenFile.__enter__", "OpenFile.__exit__"], "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 OpenFile:\n\n def __enter__(self):\n \"\"\"\n Open the file with fsspec and return the opened file.\n\n Returns\n -------\n fsspec.core.OpenFile\n The opened file.\n \"\"\"\n try:\n from botocore.exceptions import NoCredentialsError\n\n credential_error_type = (\n NoCredentialsError,\n PermissionError,\n )\n except ModuleNotFoundError:\n credential_error_type = ()\n\n args = (self.file_path, self.mode, self.compression)\n\n self.file = fsspec.open(*args, **self.kwargs)\n try:\n return self.file.open()\n except credential_error_type:\n self.kwargs[\"anon\"] = True\n self.file = fsspec.open(*args, **self.kwargs)\n return self.file.open()\n\n def __exit__(self, *args):\n \"\"\"\n Close the file.\n\n Parameters\n ----------\n *args : any type\n Variable positional arguments, all unused.\n \"\"\"\n self.file.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_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher_FileDispatcher.read.return.query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher_FileDispatcher.read.return.query_compiler", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 174, "span_ids": ["FileDispatcher", "FileDispatcher.read"], "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": "class FileDispatcher(ClassLogger):\n \"\"\"\n Class handles util functions for reading data from different kinds of files.\n\n Notes\n -----\n `_read`, `deploy`, `parse` and `materialize` are abstract methods and should be\n implemented in the child classes (functions signatures can differ between child\n classes).\n \"\"\"\n\n BUFFER_UNSUPPORTED_MSG = (\n \"Reading from buffers or other non-path-like objects is not supported\"\n )\n\n frame_cls = None\n frame_partition_cls = None\n query_compiler_cls = None\n\n @classmethod\n def read(cls, *args, **kwargs):\n \"\"\"\n Read data according passed `args` and `kwargs`.\n\n Parameters\n ----------\n *args : iterable\n Positional arguments to be passed into `_read` function.\n **kwargs : dict\n Keywords arguments to be passed into `_read` function.\n\n Returns\n -------\n query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n\n Notes\n -----\n `read` is high-level function that calls specific for defined storage format, engine and\n dispatcher class `_read` function with passed parameters and performs some\n postprocessing work on the resulting query_compiler object.\n \"\"\"\n try:\n query_compiler = cls._read(*args, **kwargs)\n except ModinAssumptionError as err:\n param_name = \"path_or_buf\" if \"path_or_buf\" in kwargs else \"fname\"\n fname = kwargs.pop(param_name)\n return cls.single_worker_read(fname, *args, reason=str(err), **kwargs)\n # TextFileReader can also be returned from `_read`.\n if not AsyncReadMode.get() and hasattr(query_compiler, \"dtypes\"):\n # at the moment it is not possible to use `wait_partitions` function;\n # in a situation where the reading function is called in a row with the\n # same parameters, `wait_partitions` considers that we have waited for\n # the end of remote calculations, however, when trying to materialize the\n # received data, it is clear that the calculations have not yet ended.\n # for example, `test_io_exp.py::test_read_evaluated_dict` is failed because of that.\n # see #5944 for details\n _ = query_compiler.dtypes\n return query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher._read_FileDispatcher.get_path.if_is_fsspec_url_file_pat.else_.return.os_path_abspath_file_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher._read_FileDispatcher.get_path.if_is_fsspec_url_file_pat.else_.return.os_path_abspath_file_path", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 216, "span_ids": ["FileDispatcher.get_path", "FileDispatcher._read"], "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 FileDispatcher(ClassLogger):\n\n @classmethod\n def _read(cls, *args, **kwargs):\n \"\"\"\n Perform reading of the data from file.\n\n Should be implemented in the child class.\n\n Parameters\n ----------\n *args : iterable\n Positional arguments of the function.\n **kwargs : dict\n Keywords arguments of the function.\n \"\"\"\n raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n @classmethod\n def get_path(cls, file_path):\n \"\"\"\n Process `file_path` in accordance to it's type.\n\n Parameters\n ----------\n file_path : str, os.PathLike[str] object or file-like object\n The file, or a path to the file. Paths to S3 buckets are also\n acceptable.\n\n Returns\n -------\n str\n Updated or verified `file_path` parameter.\n\n Notes\n -----\n if `file_path` is a URL, parameter will be returned as is, otherwise\n absolute path will be returned.\n \"\"\"\n if is_fsspec_url(file_path) or is_url(file_path):\n return file_path\n else:\n return os.path.abspath(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_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.file_size_FileDispatcher.file_size.return.size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.file_size_FileDispatcher.file_size.return.size", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 218, "end_line": 237, "span_ids": ["FileDispatcher.file_size"], "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 FileDispatcher(ClassLogger):\n\n @classmethod\n def file_size(cls, f):\n \"\"\"\n Get the size of file associated with file handle `f`.\n\n Parameters\n ----------\n f : file-like object\n File-like object, that should be used to get file size.\n\n Returns\n -------\n int\n File size in bytes.\n \"\"\"\n cur_pos = f.tell()\n f.seek(0, os.SEEK_END)\n size = f.tell()\n f.seek(cur_pos, os.SEEK_SET)\n return 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_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.file_exists_FileDispatcher.file_exists.return.exists": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.file_exists_FileDispatcher.file_exists.return.exists", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 239, "end_line": 285, "span_ids": ["FileDispatcher.file_exists"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FileDispatcher(ClassLogger):\n\n @classmethod\n def file_exists(cls, file_path, storage_options=None):\n \"\"\"\n Check if `file_path` exists.\n\n Parameters\n ----------\n file_path : str\n String that represents the path to the file (paths to S3 buckets\n are also acceptable).\n storage_options : dict, optional\n Keyword from `read_*` functions.\n\n Returns\n -------\n bool\n Whether file exists or not.\n \"\"\"\n if not is_fsspec_url(file_path) and not is_url(file_path):\n return os.path.exists(file_path)\n\n from botocore.exceptions import (\n NoCredentialsError,\n EndpointConnectionError,\n ConnectTimeoutError,\n )\n\n if storage_options is not None:\n new_storage_options = dict(storage_options)\n new_storage_options.pop(\"anon\", None)\n else:\n new_storage_options = {}\n\n fs, _ = fsspec.core.url_to_fs(file_path, **new_storage_options)\n exists = False\n try:\n exists = fs.exists(file_path)\n except (\n NoCredentialsError,\n PermissionError,\n EndpointConnectionError,\n ConnectTimeoutError,\n ):\n fs, _ = fsspec.core.url_to_fs(file_path, anon=True, **new_storage_options)\n exists = fs.exists(file_path)\n\n return exists", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.deploy_FileDispatcher.materialize.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.deploy_FileDispatcher.materialize.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 311, "span_ids": ["FileDispatcher.deploy", "FileDispatcher.parse", "FileDispatcher.materialize"], "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 FileDispatcher(ClassLogger):\n\n @classmethod\n def deploy(cls, func, *args, num_returns=1, **kwargs): # noqa: PR01\n \"\"\"\n Deploy remote task.\n\n Should be implemented in the task class (for example in the `RayWrapper`).\n \"\"\"\n raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n def parse(self, func, args, num_returns): # noqa: PR01\n \"\"\"\n Parse file's data in the worker process.\n\n Should be implemented in the parser class (for example in the `PandasCSVParser`).\n \"\"\"\n raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n @classmethod\n def materialize(cls, obj_id): # noqa: PR01\n \"\"\"\n Get results from worker.\n\n Should be implemented in the task class (for example in the `RayWrapper`).\n \"\"\"\n raise NotImplementedError(NOT_IMPLEMENTED_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_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.build_partition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/file_dispatcher.py_FileDispatcher.build_partition_", "embedding": null, "metadata": {"file_path": "modin/core/io/file_dispatcher.py", "file_name": "file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 313, "end_line": 350, "span_ids": ["FileDispatcher.build_partition", "FileDispatcher._file_not_found_msg"], "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 FileDispatcher(ClassLogger):\n\n @classmethod\n def build_partition(cls, partition_ids, row_lengths, column_widths):\n \"\"\"\n Build array with partitions of `cls.frame_partition_cls` class.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n row_lengths : list\n Partitions rows lengths.\n column_widths : list\n Number of columns in each partition.\n\n Returns\n -------\n np.ndarray\n array with shape equals to the shape of `partition_ids` and\n filed with partition objects.\n \"\"\"\n return np.array(\n [\n [\n cls.frame_partition_cls(\n partition_ids[i][j],\n length=row_lengths[i],\n width=column_widths[j],\n )\n for j in range(len(partition_ids[i]))\n ]\n for i in range(len(partition_ids))\n ]\n )\n\n @classmethod\n def _file_not_found_msg(cls, filename: str): # noqa: GL08\n return f\"No such file: '{filename}'\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_from_collections_import_O__doc_returns_qc_or_parser._BaseQueryCompiler_or_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_from_collections_import_O__doc_returns_qc_or_parser._BaseQueryCompiler_or_T", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 45, "span_ids": ["docstring"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import OrderedDict\nfrom typing import Any\n\nimport pandas\nfrom pandas.util._decorators import doc\nfrom pandas._libs.lib import no_default\n\nfrom modin.db_conn import ModinDatabaseConnection\nfrom modin.error_message import ErrorMessage\nfrom modin.core.storage_formats.base.query_compiler import BaseQueryCompiler\nfrom modin.utils import _inherit_docstrings\n\n_doc_default_io_method = \"\"\"\n{summary} using pandas.\nFor parameters description please refer to pandas API.\n\nReturns\n-------\n{returns}\n\"\"\"\n\n_doc_returns_qc = \"\"\"BaseQueryCompiler\n QueryCompiler with read data.\"\"\"\n\n_doc_returns_qc_or_parser = \"\"\"BaseQueryCompiler or TextParser\n QueryCompiler or TextParser with read data.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO_BaseIO.from_dataframe.return.cls_query_compiler_cls_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO_BaseIO.from_dataframe.return.cls_query_compiler_cls_fr", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 117, "span_ids": ["BaseIO.from_dataframe", "BaseIO.from_pandas", "BaseIO.from_non_pandas", "BaseIO.from_arrow", "BaseIO"], "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 BaseIO:\n \"\"\"Class for basic utils and default implementation of IO functions.\"\"\"\n\n query_compiler_cls: BaseQueryCompiler = None\n frame_cls = None\n\n @classmethod\n def from_non_pandas(cls, *args, **kwargs):\n \"\"\"\n Create a Modin `query_compiler` from a non-pandas `object`.\n\n Parameters\n ----------\n *args : iterable\n Positional arguments to be passed into `func`.\n **kwargs : dict\n Keyword arguments to be passed into `func`.\n \"\"\"\n return None\n\n @classmethod\n def from_pandas(cls, df):\n \"\"\"\n Create a Modin `query_compiler` from a `pandas.DataFrame`.\n\n Parameters\n ----------\n df : pandas.DataFrame\n The pandas DataFrame to convert from.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing data from the `pandas.DataFrame`.\n \"\"\"\n return cls.query_compiler_cls.from_pandas(df, cls.frame_cls)\n\n @classmethod\n def from_arrow(cls, at):\n \"\"\"\n Create a Modin `query_compiler` from a `pyarrow.Table`.\n\n Parameters\n ----------\n at : Arrow Table\n The Arrow Table to convert from.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing data from the Arrow Table.\n \"\"\"\n return cls.query_compiler_cls.from_arrow(at, cls.frame_cls)\n\n @classmethod\n def from_dataframe(cls, df):\n \"\"\"\n Create a Modin QueryCompiler from a DataFrame supporting the DataFrame exchange protocol `__dataframe__()`.\n\n Parameters\n ----------\n df : DataFrame\n The DataFrame object supporting the DataFrame exchange protocol.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing data from the DataFrame.\n \"\"\"\n return cls.query_compiler_cls.from_dataframe(df, cls.frame_cls)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_parquet_BaseIO.read_parquet.return.cls_from_pandas_pandas_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_parquet_BaseIO.read_parquet.return.cls_from_pandas_pandas_re", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 128, "span_ids": ["BaseIO.read_parquet"], "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": "class BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_parquet, apilink=\"pandas.read_parquet\")\n @doc(\n _doc_default_io_method,\n summary=\"Load a parquet object from the file path, returning a query compiler\",\n returns=_doc_returns_qc,\n )\n def read_parquet(cls, **kwargs): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_parquet`\")\n return cls.from_pandas(pandas.read_parquet(**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_modin-project__modin/modin/core/io/io.py_BaseIO.read_csv_BaseIO.read_json.return.cls_from_pandas_pandas_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_csv_BaseIO.read_json.return.cls_from_pandas_pandas_re", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 165, "span_ids": ["BaseIO.read_csv", "BaseIO.read_json"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_csv, apilink=\"pandas.read_csv\")\n @doc(\n _doc_default_io_method,\n summary=\"Read a comma-separated values (CSV) file into query compiler\",\n returns=_doc_returns_qc_or_parser,\n )\n def read_csv(\n cls,\n filepath_or_buffer,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_csv`\")\n pd_obj = pandas.read_csv(filepath_or_buffer, **kwargs)\n if isinstance(pd_obj, pandas.DataFrame):\n return cls.from_pandas(pd_obj)\n if isinstance(pd_obj, pandas.io.parsers.TextFileReader):\n # Overwriting the read method should return a Modin DataFrame for calls\n # to __next__ and get_chunk\n pd_read = pd_obj.read\n pd_obj.read = lambda *args, **kw: cls.from_pandas(pd_read(*args, **kw))\n return pd_obj\n\n @classmethod\n @_inherit_docstrings(pandas.read_json, apilink=\"pandas.read_json\")\n @doc(\n _doc_default_io_method,\n summary=\"Convert a JSON string to query compiler\",\n returns=_doc_returns_qc,\n )\n def read_json(\n cls,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_json`\")\n return cls.from_pandas(pandas.read_json(**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_modin-project__modin/modin/core/io/io.py_BaseIO.read_gbq_BaseIO.read_gbq.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_gbq_BaseIO.read_gbq.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 209, "span_ids": ["BaseIO.read_gbq"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_gbq, apilink=\"pandas.read_gbq\")\n @doc(\n _doc_default_io_method,\n summary=\"Load data from Google BigQuery into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_gbq(\n cls,\n query: str,\n project_id=None,\n index_col=None,\n col_order=None,\n reauth=False,\n auth_local_webserver=False,\n dialect=None,\n location=None,\n configuration=None,\n credentials=None,\n use_bqstorage_api=None,\n private_key=None,\n verbose=None,\n progress_bar_type=None,\n max_results=None,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_gbq`\")\n return cls.from_pandas(\n pandas.read_gbq(\n query,\n project_id=project_id,\n index_col=index_col,\n col_order=col_order,\n reauth=reauth,\n auth_local_webserver=auth_local_webserver,\n dialect=dialect,\n location=location,\n configuration=configuration,\n credentials=credentials,\n use_bqstorage_api=use_bqstorage_api,\n progress_bar_type=progress_bar_type,\n max_results=max_results,\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_modin-project__modin/modin/core/io/io.py_BaseIO.read_html_BaseIO.read_html.return._cls_from_pandas_df_for_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_html_BaseIO.read_html.return._cls_from_pandas_df_for_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 257, "span_ids": ["BaseIO.read_html"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_html, apilink=\"pandas.read_html\")\n @doc(\n _doc_default_io_method,\n summary=\"Read HTML tables into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_html(\n cls,\n io,\n *,\n match=\".+\",\n flavor=None,\n header=None,\n index_col=None,\n skiprows=None,\n attrs=None,\n parse_dates=False,\n thousands=\",\",\n encoding=None,\n decimal=\".\",\n converters=None,\n na_values=None,\n keep_default_na=True,\n displayed_only=True,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_html`\")\n result = pandas.read_html(\n io=io,\n match=match,\n flavor=flavor,\n header=header,\n index_col=index_col,\n skiprows=skiprows,\n attrs=attrs,\n parse_dates=parse_dates,\n thousands=thousands,\n encoding=encoding,\n decimal=decimal,\n converters=converters,\n na_values=na_values,\n keep_default_na=keep_default_na,\n displayed_only=displayed_only,\n **kwargs,\n )\n return (cls.from_pandas(df) for df in 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_modin-project__modin/modin/core/io/io.py_BaseIO.read_clipboard_BaseIO.read_clipboard.return.cls_from_pandas_pandas_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_clipboard_BaseIO.read_clipboard.return.cls_from_pandas_pandas_re", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 268, "span_ids": ["BaseIO.read_clipboard"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_clipboard, apilink=\"pandas.read_clipboard\")\n @doc(\n _doc_default_io_method,\n summary=\"Read text from clipboard into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_clipboard(cls, sep=r\"\\s+\", **kwargs): # pragma: no cover # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_clipboard`\")\n return cls.from_pandas(pandas.read_clipboard(sep=sep, **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_modin-project__modin/modin/core/io/io.py_BaseIO.read_excel_BaseIO.read_excel.if_isinstance_intermediat.else_.return.cls_from_pandas_intermedi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_excel_BaseIO.read_excel.if_isinstance_intermediat.else_.return.cls_from_pandas_intermedi", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 270, "end_line": 287, "span_ids": ["BaseIO.read_excel"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_excel, apilink=\"pandas.read_excel\")\n @doc(\n _doc_default_io_method,\n summary=\"Read an Excel file into query compiler\",\n returns=\"\"\"BaseQueryCompiler or dict/OrderedDict :\n QueryCompiler or OrderedDict/dict with read data.\"\"\",\n )\n def read_excel(cls, **kwargs): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_excel`\")\n intermediate = pandas.read_excel(**kwargs)\n if isinstance(intermediate, (OrderedDict, dict)):\n parsed = type(intermediate)()\n for key in intermediate.keys():\n parsed[key] = cls.from_pandas(intermediate.get(key))\n return parsed\n else:\n return cls.from_pandas(intermediate)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_hdf_BaseIO.read_hdf.return.cls_from_pandas_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_hdf_BaseIO.read_hdf.return.cls_from_pandas_df_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 289, "end_line": 332, "span_ids": ["BaseIO.read_hdf"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_hdf, apilink=\"pandas.read_hdf\")\n @doc(\n _doc_default_io_method,\n summary=\"Read data from hdf store into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_hdf(\n cls,\n path_or_buf,\n key=None,\n mode: str = \"r\",\n errors: str = \"strict\",\n where=None,\n start=None,\n stop=None,\n columns=None,\n iterator=False,\n chunksize=None,\n **kwargs,\n ): # noqa: PR01\n from modin.pandas.io import HDFStore\n\n ErrorMessage.default_to_pandas(\"`read_hdf`\")\n modin_store = isinstance(path_or_buf, HDFStore)\n if modin_store:\n path_or_buf._return_modin_dataframe = False\n df = pandas.read_hdf(\n path_or_buf,\n key=key,\n mode=mode,\n columns=columns,\n errors=errors,\n where=where,\n start=start,\n stop=stop,\n iterator=iterator,\n chunksize=chunksize,\n **kwargs,\n )\n if modin_store:\n path_or_buf._return_modin_dataframe = True\n\n return cls.from_pandas(df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_feather_BaseIO.read_feather.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_feather_BaseIO.read_feather.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 352, "span_ids": ["BaseIO.read_feather"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_feather, apilink=\"pandas.read_feather\")\n @doc(\n _doc_default_io_method,\n summary=\"Load a feather-format object from the file path into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_feather(\n cls,\n path,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_feather`\")\n return cls.from_pandas(\n pandas.read_feather(\n path,\n **kwargs,\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_modin-project__modin/modin/core/io/io.py_BaseIO.read_stata_BaseIO.read_stata.return.cls_from_pandas_pandas_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_stata_BaseIO.read_stata.return.cls_from_pandas_pandas_re", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 367, "span_ids": ["BaseIO.read_stata"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_stata, apilink=\"pandas.read_stata\")\n @doc(\n _doc_default_io_method,\n summary=\"Read Stata file into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_stata(\n cls,\n filepath_or_buffer,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_stata`\")\n return cls.from_pandas(pandas.read_stata(filepath_or_buffer, **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_modin-project__modin/modin/core/io/io.py_BaseIO.read_sas_BaseIO.read_sas.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sas_BaseIO.read_sas.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 398, "span_ids": ["BaseIO.read_sas"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_sas, apilink=\"pandas.read_sas\")\n @doc(\n _doc_default_io_method,\n summary=\"Read SAS files stored as either XPORT or SAS7BDAT format files\\ninto query compiler\",\n returns=_doc_returns_qc,\n )\n def read_sas(\n cls,\n filepath_or_buffer,\n *,\n format=None,\n index=None,\n encoding=None,\n chunksize=None,\n iterator=False,\n **kwargs,\n ): # pragma: no cover # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_sas`\")\n return cls.from_pandas(\n pandas.read_sas(\n filepath_or_buffer,\n format=format,\n index=index,\n encoding=encoding,\n chunksize=chunksize,\n iterator=iterator,\n **kwargs,\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_modin-project__modin/modin/core/io/io.py_BaseIO.read_pickle_BaseIO.read_pickle.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_pickle_BaseIO.read_pickle.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 418, "span_ids": ["BaseIO.read_pickle"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_pickle, apilink=\"pandas.read_pickle\")\n @doc(\n _doc_default_io_method,\n summary=\"Load pickled pandas object (or any object) from file into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_pickle(\n cls,\n filepath_or_buffer,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_pickle`\")\n return cls.from_pandas(\n pandas.read_pickle(\n filepath_or_buffer,\n **kwargs,\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_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_BaseIO.read_sql.return._cls_from_pandas_df_for_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_BaseIO.read_sql.return._cls_from_pandas_df_for_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 420, "end_line": 458, "span_ids": ["BaseIO.read_sql"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_sql, apilink=\"pandas.read_sql\")\n @doc(\n _doc_default_io_method,\n summary=\"Read SQL query or database table into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_sql(\n cls,\n sql,\n con,\n index_col=None,\n coerce_float=True,\n params=None,\n parse_dates=None,\n columns=None,\n chunksize=None,\n dtype_backend=no_default,\n dtype=None,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_sql`\")\n if isinstance(con, ModinDatabaseConnection):\n con = con.get_connection()\n result = pandas.read_sql(\n sql,\n con,\n index_col=index_col,\n coerce_float=coerce_float,\n params=params,\n parse_dates=parse_dates,\n columns=columns,\n chunksize=chunksize,\n dtype_backend=dtype_backend,\n dtype=dtype,\n )\n\n if isinstance(result, (pandas.DataFrame, pandas.Series)):\n return cls.from_pandas(result)\n return (cls.from_pandas(df) for df in 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_modin-project__modin/modin/core/io/io.py_BaseIO.read_fwf_BaseIO.read_fwf.return.pd_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_fwf_BaseIO.read_fwf.return.pd_obj", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 460, "end_line": 495, "span_ids": ["BaseIO.read_fwf"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_fwf, apilink=\"pandas.read_fwf\")\n @doc(\n _doc_default_io_method,\n summary=\"Read a table of fixed-width formatted lines into query compiler\",\n returns=_doc_returns_qc_or_parser,\n )\n def read_fwf(\n cls,\n filepath_or_buffer,\n *,\n colspecs=\"infer\",\n widths=None,\n infer_nrows=100,\n dtype_backend=no_default,\n **kwds,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_fwf`\")\n pd_obj = pandas.read_fwf(\n filepath_or_buffer,\n colspecs=colspecs,\n widths=widths,\n infer_nrows=infer_nrows,\n dtype_backend=dtype_backend,\n **kwds,\n )\n if isinstance(pd_obj, pandas.DataFrame):\n return cls.from_pandas(pd_obj)\n if isinstance(pd_obj, pandas.io.parsers.TextFileReader):\n # Overwriting the read method should return a Modin DataFrame for calls\n # to __next__ and get_chunk\n pd_read = pd_obj.read\n pd_obj.read = lambda *args, **kwargs: cls.from_pandas(\n pd_read(*args, **kwargs)\n )\n return pd_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_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_table_BaseIO.read_sql_table.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_table_BaseIO.read_sql_table.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 529, "span_ids": ["BaseIO.read_sql_table"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_sql_table, apilink=\"pandas.read_sql_table\")\n @doc(\n _doc_default_io_method,\n summary=\"Read SQL database table into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_sql_table(\n cls,\n table_name,\n con,\n schema=None,\n index_col=None,\n coerce_float=True,\n parse_dates=None,\n columns=None,\n chunksize=None,\n dtype_backend=no_default,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_sql_table`\")\n return cls.from_pandas(\n pandas.read_sql_table(\n table_name,\n con,\n schema=schema,\n index_col=index_col,\n coerce_float=coerce_float,\n parse_dates=parse_dates,\n columns=columns,\n chunksize=chunksize,\n dtype_backend=dtype_backend,\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_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_query_BaseIO.read_sql_query.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_sql_query_BaseIO.read_sql_query.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 531, "end_line": 551, "span_ids": ["BaseIO.read_sql_query"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_sql_query, apilink=\"pandas.read_sql_query\")\n @doc(\n _doc_default_io_method,\n summary=\"Read SQL query into query compiler\",\n returns=_doc_returns_qc,\n )\n def read_sql_query(\n cls,\n sql,\n con,\n **kwargs,\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_sql_query`\")\n return cls.from_pandas(\n pandas.read_sql_query(\n sql,\n con,\n **kwargs,\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_modin-project__modin/modin/core/io/io.py_BaseIO.read_spss_BaseIO.read_spss.return.cls_from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.read_spss_BaseIO.read_spss.return.cls_from_pandas_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 553, "end_line": 571, "span_ids": ["BaseIO.read_spss"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.read_spss, apilink=\"pandas.read_spss\")\n @doc(\n _doc_default_io_method,\n summary=\"Load an SPSS file from the file path, returning a query compiler\",\n returns=_doc_returns_qc,\n )\n def read_spss(\n cls, path, usecols, convert_categoricals, dtype_backend\n ): # noqa: PR01\n ErrorMessage.default_to_pandas(\"`read_spss`\")\n return cls.from_pandas(\n pandas.read_spss(\n path,\n usecols=usecols,\n convert_categoricals=convert_categoricals,\n dtype_backend=dtype_backend,\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_modin-project__modin/modin/core/io/io.py_BaseIO.to_sql_BaseIO.to_sql.df_to_sql_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_sql_BaseIO.to_sql.df_to_sql_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 573, "end_line": 605, "span_ids": ["BaseIO.to_sql"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.DataFrame.to_sql, apilink=\"pandas.DataFrame.to_sql\")\n def to_sql(\n cls,\n qc,\n name,\n con,\n schema=None,\n if_exists=\"fail\",\n index=True,\n index_label=None,\n chunksize=None,\n dtype=None,\n method=None,\n ): # noqa: PR01\n \"\"\"\n Write records stored in a DataFrame to a SQL database using pandas.\n\n For parameters description please refer to pandas API.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`to_sql`\")\n df = qc.to_pandas()\n df.to_sql(\n name=name,\n con=con,\n schema=schema,\n if_exists=if_exists,\n index=index,\n index_label=index_label,\n chunksize=chunksize,\n dtype=dtype,\n method=method,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_pickle_BaseIO.to_pickle.return.pandas_to_pickle_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_pickle_BaseIO.to_pickle.return.pandas_to_pickle_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 607, "end_line": 628, "span_ids": ["BaseIO.to_pickle"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(\n pandas.DataFrame.to_pickle, apilink=\"pandas.DataFrame.to_pickle\"\n )\n def to_pickle(\n cls,\n obj: Any,\n filepath_or_buffer,\n **kwargs,\n ): # noqa: PR01, D200\n \"\"\"\n Pickle (serialize) object to file.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`to_pickle`\")\n if isinstance(obj, BaseQueryCompiler):\n obj = obj.to_pandas()\n\n return pandas.to_pickle(\n obj,\n filepath_or_buffer=filepath_or_buffer,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_csv_BaseIO.to_csv.return.obj_to_csv_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_csv_BaseIO.to_csv.return.obj_to_csv_kwargs_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 630, "end_line": 642, "span_ids": ["BaseIO.to_csv"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(pandas.DataFrame.to_csv, apilink=\"pandas.DataFrame.to_csv\")\n def to_csv(cls, obj, **kwargs): # noqa: PR01\n \"\"\"\n Write object to a comma-separated values (CSV) file using pandas.\n\n For parameters description please refer to pandas API.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`to_csv`\")\n if isinstance(obj, BaseQueryCompiler):\n obj = obj.to_pandas()\n\n return obj.to_csv(**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_modin-project__modin/modin/core/io/io.py_BaseIO.to_parquet_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/io.py_BaseIO.to_parquet_", "embedding": null, "metadata": {"file_path": "modin/core/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 644, "end_line": 659, "span_ids": ["BaseIO.to_parquet"], "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 BaseIO:\n\n @classmethod\n @_inherit_docstrings(\n pandas.DataFrame.to_parquet, apilink=\"pandas.DataFrame.to_parquet\"\n )\n def to_parquet(cls, obj, **kwargs): # noqa: PR01\n \"\"\"\n Write object to the binary parquet format using pandas.\n\n For parameters description please refer to pandas API.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`to_parquet`\")\n if isinstance(obj, BaseQueryCompiler):\n obj = obj.to_pandas()\n\n return obj.to_parquet(**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_modin-project__modin/modin/core/io/sql/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/sql/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/io/sql/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/io/sql/sql_dispatcher.py_math_SQLDispatcher._read.return.cls_query_compiler_cls_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/sql/sql_dispatcher.py_math_SQLDispatcher._read.return.cls_query_compiler_cls_ne", "embedding": null, "metadata": {"file_path": "modin/core/io/sql/sql_dispatcher.py", "file_name": "sql_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 111, "span_ids": ["SQLDispatcher._read", "SQLDispatcher", "docstring"], "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": "import math\nimport numpy as np\nimport pandas\n\nfrom modin.core.io.file_dispatcher import FileDispatcher\nfrom modin.db_conn import ModinDatabaseConnection\nfrom modin.config import NPartitions, ReadSqlEngine\n\n\nclass SQLDispatcher(FileDispatcher):\n \"\"\"Class handles utils for reading SQL queries or database tables.\"\"\"\n\n @classmethod\n def _read(cls, sql, con, index_col=None, **kwargs):\n \"\"\"\n Read a SQL query or database table into a query compiler.\n\n Parameters\n ----------\n sql : str or SQLAlchemy Selectable (select or text object)\n SQL query to be executed or a table name.\n con : SQLAlchemy connectable, str, sqlite3 connection, or ModinDatabaseConnection\n Connection object to database.\n index_col : str or list of str, optional\n Column(s) to set as index(MultiIndex).\n **kwargs : dict\n Parameters to pass into `pandas.read_sql` function.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n if isinstance(con, str):\n con = ModinDatabaseConnection(\"sqlalchemy\", con)\n if not isinstance(con, ModinDatabaseConnection):\n return cls.single_worker_read(\n sql,\n con=con,\n index_col=index_col,\n read_sql_engine=ReadSqlEngine.get(),\n reason=\"To use the parallel implementation of `read_sql`, pass either \"\n + \"the SQL connection string or a ModinDatabaseConnection \"\n + \"with the arguments required to make a connection, instead \"\n + f\"of {type(con)}. For documentation on the ModinDatabaseConnection, see \"\n + \"https://modin.readthedocs.io/en/latest/supported_apis/io_supported.html#connecting-to-a-database-for-read-sql\",\n **kwargs,\n )\n row_count_query = con.row_count_query(sql)\n connection_for_pandas = con.get_connection()\n colum_names_query = con.column_names_query(sql)\n row_cnt = pandas.read_sql(row_count_query, connection_for_pandas).squeeze()\n cols_names_df = pandas.read_sql(\n colum_names_query, connection_for_pandas, index_col=index_col\n )\n cols_names = cols_names_df.columns\n num_partitions = NPartitions.get()\n partition_ids = [None] * num_partitions\n index_ids = [None] * num_partitions\n dtypes_ids = [None] * num_partitions\n limit = math.ceil(row_cnt / num_partitions)\n for part in range(num_partitions):\n offset = part * limit\n query = con.partition_query(sql, limit, offset)\n *partition_ids[part], index_ids[part], dtypes_ids[part] = cls.deploy(\n func=cls.parse,\n f_kwargs={\n \"num_splits\": num_partitions,\n \"sql\": query,\n \"con\": con,\n \"index_col\": index_col,\n \"read_sql_engine\": ReadSqlEngine.get(),\n **kwargs,\n },\n num_returns=num_partitions + 2,\n )\n partition_ids[part] = [\n cls.frame_partition_cls(obj) for obj in partition_ids[part]\n ]\n if index_col is None: # sum all lens returned from partitions\n index_lens = cls.materialize(index_ids)\n new_index = pandas.RangeIndex(sum(index_lens))\n else: # concat index returned from partitions\n index_lst = [\n x for part_index in cls.materialize(index_ids) for x in part_index\n ]\n new_index = pandas.Index(index_lst).set_names(index_col)\n new_frame = cls.frame_cls(np.array(partition_ids), new_index, cols_names)\n new_frame.synchronize_labels(axis=0)\n return cls.query_compiler_cls(new_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/core/io/text/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/core/io/text/csv_dispatcher.py_from_modin_core_io_text_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/csv_dispatcher.py_from_modin_core_io_text_t_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/csv_dispatcher.py", "file_name": "csv_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 21, "span_ids": ["CSVDispatcher", "docstring"], "tokens": 33}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.io.text.text_file_dispatcher import TextFileDispatcher\n\n\nclass CSVDispatcher(TextFileDispatcher):\n \"\"\"Class handles utils for reading `.csv` 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_modin-project__modin/modin/core/io/text/excel_dispatcher.py_pandas_ExcelDispatcher._read._preserve_original_kwarg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/excel_dispatcher.py_pandas_ExcelDispatcher._read._preserve_original_kwarg", "embedding": null, "metadata": {"file_path": "modin/core/io/text/excel_dispatcher.py", "file_name": "excel_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 97, "span_ids": ["ExcelDispatcher._read", "ExcelDispatcher", "docstring"], "tokens": 624}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport re\nimport warnings\n\nfrom modin.core.io.text.text_file_dispatcher import TextFileDispatcher\nfrom modin.config import NPartitions\n\nEXCEL_READ_BLOCK_SIZE = 4096\n\n\nclass ExcelDispatcher(TextFileDispatcher):\n \"\"\"Class handles utils for reading excel files.\"\"\"\n\n @classmethod\n def _read(cls, io, **kwargs):\n \"\"\"\n Read data from `io` according to the passed `read_excel` `kwargs` parameters.\n\n Parameters\n ----------\n io : str, bytes, ExcelFile, xlrd.Book, path object, or file-like object\n `io` parameter of `read_excel` function.\n **kwargs : dict\n Parameters of `read_excel` function.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n if (\n kwargs.get(\"engine\", None) is not None\n and kwargs.get(\"engine\") != \"openpyxl\"\n ):\n return cls.single_worker_read(\n io,\n reason=\"Modin only implements parallel `read_excel` with `openpyxl` engine, \"\n + 'please specify `engine=None` or `engine=\"openpyxl\"` to '\n + \"use Modin's parallel implementation.\",\n **kwargs\n )\n\n from zipfile import ZipFile\n from openpyxl.worksheet.worksheet import Worksheet\n from openpyxl.worksheet._reader import WorksheetReader\n from openpyxl.reader.excel import ExcelReader\n from modin.core.storage_formats.pandas.parsers import PandasExcelParser\n\n sheet_name = kwargs.get(\"sheet_name\", 0)\n if sheet_name is None or isinstance(sheet_name, list):\n return cls.single_worker_read(\n io,\n reason=\"`read_excel` functionality is only implemented for a single sheet at a \"\n + \"time. Multiple sheet reading coming soon!\",\n **kwargs\n )\n\n warnings.warn(\n \"Parallel `read_excel` is a new feature! If you run into any \"\n + \"problems, please visit https://github.com/modin-project/modin/issues. \"\n + \"If you find a new issue and can't file it on GitHub, please \"\n + \"email bug_reports@modin.org.\"\n )\n\n # NOTE: ExcelReader() in read-only mode does not close file handle by itself\n # work around that by passing file object if we received some path\n io_file = open(io, \"rb\") if isinstance(io, str) else io\n try:\n ex = ExcelReader(io_file, read_only=True)\n ex.read()\n wb = ex.wb\n\n # Get shared strings\n ex.read_manifest()\n ex.read_strings()\n ws = Worksheet(wb)\n finally:\n if isinstance(io, str):\n # close only if it were us who opened the object\n io_file.close()\n\n pandas_kw = dict(kwargs) # preserve original kwargs\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_modin-project__modin/modin/core/io/text/excel_dispatcher.py_ExcelDispatcher._read.with_ZipFile_io_as_z__ExcelDispatcher._read.with_ZipFile_io_as_z_.while_f_tell_total_by.if_b_sheetData_in_chu.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/excel_dispatcher.py_ExcelDispatcher._read.with_ZipFile_io_as_z__ExcelDispatcher._read.with_ZipFile_io_as_z_.while_f_tell_total_by.if_b_sheetData_in_chu.break", "embedding": null, "metadata": {"file_path": "modin/core/io/text/excel_dispatcher.py", "file_name": "excel_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 225, "span_ids": ["ExcelDispatcher._read"], "tokens": 1204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExcelDispatcher(TextFileDispatcher):\n\n @classmethod\n def _read(cls, io, **kwargs):\n # ... other code\n with ZipFile(io) as z:\n from io import BytesIO\n\n # Convert index to sheet name in file\n if isinstance(sheet_name, int):\n sheet_name = \"sheet{}\".format(sheet_name + 1)\n else:\n sheet_name = \"sheet{}\".format(wb.sheetnames.index(sheet_name) + 1)\n if any(sheet_name.lower() in name for name in z.namelist()):\n sheet_name = sheet_name.lower()\n elif any(sheet_name.title() in name for name in z.namelist()):\n sheet_name = sheet_name.title()\n else:\n raise ValueError(\"Sheet {} not found\".format(sheet_name.lower()))\n # Pass this value to the workers\n kwargs[\"sheet_name\"] = sheet_name\n\n f = z.open(\"xl/worksheets/{}.xml\".format(sheet_name))\n f = BytesIO(f.read())\n total_bytes = cls.file_size(f)\n\n # Read some bytes from the sheet so we can extract the XML header and first\n # line. We need to make sure we get the first line of the data as well\n # because that is where the column names are. The header information will\n # be extracted and sent to all of the nodes.\n sheet_block = f.read(EXCEL_READ_BLOCK_SIZE)\n end_of_row_tag = b\"\"\n while end_of_row_tag not in sheet_block:\n sheet_block += f.read(EXCEL_READ_BLOCK_SIZE)\n idx_of_header_end = sheet_block.index(end_of_row_tag) + len(end_of_row_tag)\n sheet_header_with_first_row = sheet_block[:idx_of_header_end]\n\n if kwargs[\"header\"] is not None:\n # Reset the file pointer to begin at the end of the header information.\n f.seek(idx_of_header_end)\n sheet_header = sheet_header_with_first_row\n else:\n start_of_row_tag = b\"\"\n # Use openpyxml to parse the data\n common_args = (\n ws,\n BytesIO(sheet_header_with_first_row + footer),\n ex.shared_strings,\n False,\n )\n if cls.need_rich_text_param:\n reader = WorksheetReader(*common_args, rich_text=False)\n else:\n reader = WorksheetReader(*common_args)\n # Attach cells to the worksheet\n reader.bind_cells()\n data = PandasExcelParser.get_sheet_data(\n ws, kwargs.get(\"convert_float\", True)\n )\n # Extract column names from parsed data.\n if kwargs[\"header\"] is None:\n column_names = pandas.RangeIndex(len(data[0]))\n else:\n column_names = pandas.Index(data[0])\n index_col = kwargs.get(\"index_col\", None)\n # Remove column names that are specified as `index_col`\n if index_col is not None:\n column_names = column_names.drop(column_names[index_col])\n\n if not all(column_names) or kwargs.get(\"usecols\"):\n # some column names are empty, use pandas reader to take the names from it\n pandas_kw[\"nrows\"] = 1\n df = pandas.read_excel(io, **pandas_kw)\n column_names = df.columns\n\n # Compute partition metadata upfront so it is uniform for all partitions\n chunk_size = max(1, (total_bytes - f.tell()) // NPartitions.get())\n column_widths, num_splits = cls._define_metadata(\n pandas.DataFrame(columns=column_names), column_names\n )\n kwargs[\"fname\"] = io\n # Skiprows will be used to inform a partition how many rows come before it.\n kwargs[\"skiprows\"] = 0\n row_count = 0\n data_ids = []\n index_ids = []\n dtypes_ids = []\n\n kwargs[\"num_splits\"] = num_splits\n\n while f.tell() < total_bytes:\n args = kwargs\n args[\"skiprows\"] = row_count + args[\"skiprows\"]\n args[\"start\"] = f.tell()\n chunk = f.read(chunk_size)\n # This edge case can happen when we have reached the end of the data\n # but not the end of the file.\n if b\"\"\n row_count = re.subn(row_close_tag, b\"\", chunk)[1]\n\n # Make sure we are reading at least one row.\n while row_count == 0:\n chunk += f.read(chunk_size)\n row_count += re.subn(row_close_tag, b\"\", chunk)[1]\n\n last_index = chunk.rindex(row_close_tag)\n f.seek(-(len(chunk) - last_index) + len(row_close_tag), 1)\n args[\"end\"] = f.tell()\n\n # If there is no data, exit before triggering computation.\n if b\"\" not in chunk and b\"\" in chunk:\n break\n remote_results_list = cls.deploy(\n func=cls.parse,\n f_kwargs=args,\n num_returns=num_splits + 2,\n )\n data_ids.append(remote_results_list[:-2])\n index_ids.append(remote_results_list[-2])\n dtypes_ids.append(remote_results_list[-1])\n\n # The end of the spreadsheet\n if b\"\" in chunk:\n break\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_modin-project__modin/modin/core/io/text/excel_dispatcher.py_ExcelDispatcher._read._Compute_the_index_based_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/excel_dispatcher.py_ExcelDispatcher._read._Compute_the_index_based_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/excel_dispatcher.py", "file_name": "excel_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 257, "span_ids": ["ExcelDispatcher._read"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExcelDispatcher(TextFileDispatcher):\n\n @classmethod\n def _read(cls, io, **kwargs):\n\n # Compute the index based on a sum of the lengths of each partition (by default)\n # or based on the column(s) that were requested.\n if index_col is None:\n row_lengths = cls.materialize(index_ids)\n new_index = pandas.RangeIndex(sum(row_lengths))\n else:\n index_objs = cls.materialize(index_ids)\n row_lengths = [len(o) for o in index_objs]\n new_index = index_objs[0].append(index_objs[1:])\n\n data_ids = cls.build_partition(data_ids, row_lengths, column_widths)\n\n # Compute dtypes by getting collecting and combining all of the partitions. The\n # reported dtypes from differing rows can be different based on the inference in\n # the limited data seen by each worker. We use pandas to compute the exact dtype\n # over the whole column for each column. The index is set below.\n dtypes = cls.get_dtypes(dtypes_ids, column_names)\n\n new_frame = cls.frame_cls(\n data_ids,\n new_index,\n column_names,\n row_lengths,\n column_widths,\n dtypes=dtypes,\n )\n new_query_compiler = cls.query_compiler_cls(new_frame)\n if index_col is None:\n new_query_compiler._modin_frame.synchronize_labels(axis=0)\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/fwf_dispatcher.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/fwf_dispatcher.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/fwf_dispatcher.py", "file_name": "fwf_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 62, "span_ids": ["FWFDispatcher.check_parameters_support", "FWFDispatcher", "docstring"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Union, Sequence, Tuple\n\nfrom modin.core.io.text.text_file_dispatcher import TextFileDispatcher\n\n\nclass FWFDispatcher(TextFileDispatcher):\n \"\"\"Class handles utils for reading of tables with fixed-width formatted lines.\"\"\"\n\n @classmethod\n def check_parameters_support(\n cls,\n filepath_or_buffer,\n read_kwargs: dict,\n skiprows_md: Union[Sequence, callable, int],\n header_size: int,\n ) -> Tuple[bool, Optional[str]]:\n \"\"\"\n Check support of parameters of `read_fwf` function.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of `read_fwf` function.\n read_kwargs : dict\n Parameters of `read_fwf` function.\n skiprows_md : int, array or callable\n `skiprows` parameter modified for easier handling by Modin.\n header_size : int\n Number of rows that are used by header.\n\n Returns\n -------\n bool\n Whether passed parameters are supported or not.\n Optional[str]\n `None` if parameters are supported, otherwise an error\n message describing why parameters are not supported.\n \"\"\"\n if read_kwargs[\"infer_nrows\"] > 100:\n return (\n False,\n \"`infer_nrows` is a significant portion of the number of rows, so Pandas may be faster\",\n )\n return super().check_parameters_support(\n filepath_or_buffer, read_kwargs, skiprows_md, header_size\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/json_dispatcher.py_from_modin_core_io_file_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/json_dispatcher.py_from_modin_core_io_file_d_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/json_dispatcher.py", "file_name": "json_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 105, "span_ids": ["JSONDispatcher", "JSONDispatcher._read", "docstring"], "tokens": 777}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.io.file_dispatcher import OpenFile\nfrom modin.core.io.text.text_file_dispatcher import TextFileDispatcher\nfrom io import BytesIO\nimport pandas\nimport numpy as np\n\nfrom modin.config import NPartitions\n\n\nclass JSONDispatcher(TextFileDispatcher):\n \"\"\"Class handles utils for reading `.json` files.\"\"\"\n\n @classmethod\n def _read(cls, path_or_buf, **kwargs):\n \"\"\"\n Read data from `path_or_buf` according to the passed `read_json` `kwargs` parameters.\n\n Parameters\n ----------\n path_or_buf : str, path object or file-like object\n `path_or_buf` parameter of `read_json` function.\n **kwargs : dict\n Parameters of `read_json` function.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n path_or_buf = cls.get_path_or_buffer(path_or_buf)\n if isinstance(path_or_buf, str):\n if not cls.file_exists(path_or_buf):\n return cls.single_worker_read(\n path_or_buf, reason=cls._file_not_found_msg(path_or_buf), **kwargs\n )\n path_or_buf = cls.get_path(path_or_buf)\n elif not cls.pathlib_or_pypath(path_or_buf):\n return cls.single_worker_read(\n path_or_buf, reason=cls.BUFFER_UNSUPPORTED_MSG, **kwargs\n )\n if not kwargs.get(\"lines\", False):\n return cls.single_worker_read(\n path_or_buf, reason=\"`lines` argument not supported\", **kwargs\n )\n with OpenFile(path_or_buf, \"rb\") as f:\n columns = pandas.read_json(BytesIO(b\"\" + f.readline()), lines=True).columns\n kwargs[\"columns\"] = columns\n empty_pd_df = pandas.DataFrame(columns=columns)\n\n with OpenFile(path_or_buf, \"rb\", kwargs.get(\"compression\", \"infer\")) as f:\n column_widths, num_splits = cls._define_metadata(empty_pd_df, columns)\n args = {\"fname\": path_or_buf, \"num_splits\": num_splits, **kwargs}\n splits, _ = cls.partitioned_file(\n f,\n num_partitions=NPartitions.get(),\n )\n partition_ids = [None] * len(splits)\n index_ids = [None] * len(splits)\n dtypes_ids = [None] * len(splits)\n for idx, (start, end) in enumerate(splits):\n args.update({\"start\": start, \"end\": end})\n *partition_ids[idx], index_ids[idx], dtypes_ids[idx], _ = cls.deploy(\n func=cls.parse,\n f_kwargs=args,\n num_returns=num_splits + 3,\n )\n # partition_id[-1] contains the columns for each partition, which will be useful\n # for implementing when `lines=False`.\n row_lengths = cls.materialize(index_ids)\n new_index = pandas.RangeIndex(sum(row_lengths))\n\n partition_ids = cls.build_partition(partition_ids, row_lengths, column_widths)\n\n # Compute dtypes by getting collecting and combining all of the partitions. The\n # reported dtypes from differing rows can be different based on the inference in\n # the limited data seen by each worker. We use pandas to compute the exact dtype\n # over the whole column for each column. The index is set below.\n dtypes = cls.get_dtypes(dtypes_ids, columns)\n\n new_frame = cls.frame_cls(\n np.array(partition_ids),\n new_index,\n columns,\n row_lengths,\n column_widths,\n dtypes=dtypes,\n )\n new_frame.synchronize_labels(axis=0)\n return cls.query_compiler_cls(new_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_warnings_IndexColType.Union_int_str_bool_Seq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_warnings_IndexColType.Union_int_str_bool_Seq", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 39, "span_ids": ["docstring"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import warnings\nimport os\nimport io\nimport codecs\nfrom typing import Union, Sequence, Optional, Tuple, Callable\nfrom csv import QUOTE_NONE\n\nimport numpy as np\nimport pandas\nimport pandas._libs.lib as lib\nfrom pandas.core.dtypes.common import is_list_like\n\nfrom modin.core.io.file_dispatcher import FileDispatcher, OpenFile\nfrom modin.core.storage_formats.pandas.utils import compute_chunksize\nfrom modin.utils import _inherit_docstrings\nfrom modin.core.io.text.utils import CustomNewlineIterator\nfrom modin.config import NPartitions\n\nColumnNamesTypes = Tuple[Union[pandas.Index, pandas.MultiIndex]]\nIndexColType = Union[int, str, bool, Sequence[int], Sequence[str], 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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher_TextFileDispatcher.get_path_or_buffer.return.filepath_or_buffer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher_TextFileDispatcher.get_path_or_buffer.return.filepath_or_buffer", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 80, "span_ids": ["TextFileDispatcher", "TextFileDispatcher.get_path_or_buffer"], "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 TextFileDispatcher(FileDispatcher):\n \"\"\"Class handles utils for reading text formats files.\"\"\"\n\n @classmethod\n def get_path_or_buffer(cls, filepath_or_buffer):\n \"\"\"\n Extract path from `filepath_or_buffer`.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of `read_csv` function.\n\n Returns\n -------\n str or path object\n verified `filepath_or_buffer` parameter.\n\n Notes\n -----\n Given a buffer, try and extract the filepath from it so that we can\n use it without having to fall back to pandas and share file objects between\n workers. Given a filepath, return it immediately.\n \"\"\"\n if (\n hasattr(filepath_or_buffer, \"name\")\n and hasattr(filepath_or_buffer, \"seekable\")\n and filepath_or_buffer.seekable()\n and filepath_or_buffer.tell() == 0\n ):\n buffer_filepath = filepath_or_buffer.name\n if cls.file_exists(buffer_filepath):\n warnings.warn(\n \"For performance reasons, the filepath will be \"\n + \"used in place of the file handle passed in \"\n + \"to load the data\"\n )\n return cls.get_path(buffer_filepath)\n return filepath_or_buffer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.build_partition_TextFileDispatcher.build_partition.return.np_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.build_partition_TextFileDispatcher.build_partition.return.np_array_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 114, "span_ids": ["TextFileDispatcher.build_partition"], "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 TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def build_partition(cls, partition_ids, row_lengths, column_widths):\n \"\"\"\n Build array with partitions of `cls.frame_partition_cls` class.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n row_lengths : list\n Partitions rows lengths.\n column_widths : list\n Number of columns in each partition.\n\n Returns\n -------\n np.ndarray\n array with shape equals to the shape of `partition_ids` and\n filed with partitions objects.\n \"\"\"\n return np.array(\n [\n [\n cls.frame_partition_cls(\n partition_ids[i][j],\n length=row_lengths[i],\n width=column_widths[j],\n )\n for j in range(len(partition_ids[i]))\n ]\n for i in range(len(partition_ids))\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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.pathlib_or_pypath_TextFileDispatcher.pathlib_or_pypath.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.pathlib_or_pypath_TextFileDispatcher.pathlib_or_pypath.return.False", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 146, "span_ids": ["TextFileDispatcher.pathlib_or_pypath"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def pathlib_or_pypath(cls, filepath_or_buffer):\n \"\"\"\n Check if `filepath_or_buffer` is instance of `py.path.local` or `pathlib.Path`.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of `read_csv` function.\n\n Returns\n -------\n bool\n Whether or not `filepath_or_buffer` is instance of `py.path.local`\n or `pathlib.Path`.\n \"\"\"\n try:\n import py\n\n if isinstance(filepath_or_buffer, py.path.local):\n return True\n except ImportError: # pragma: no cover\n pass\n try:\n import pathlib\n\n if isinstance(filepath_or_buffer, pathlib.Path):\n return True\n except ImportError: # pragma: no cover\n pass\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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.offset_TextFileDispatcher.offset.return.outside_quotes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.offset_TextFileDispatcher.offset.return.outside_quotes", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 203, "span_ids": ["TextFileDispatcher.offset"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def offset(\n cls,\n f,\n offset_size: int,\n quotechar: bytes = b'\"',\n is_quoting: bool = True,\n encoding: str = None,\n newline: bytes = None,\n ):\n \"\"\"\n Move the file offset at the specified amount of bytes.\n\n Parameters\n ----------\n f : file-like object\n File handle that should be used for offset movement.\n offset_size : int\n Number of bytes to read and ignore.\n quotechar : bytes, default: b'\"'\n Indicate quote in a file.\n is_quoting : bool, default: True\n Whether or not to consider quotes.\n encoding : str, optional\n Encoding of `f`.\n newline : bytes, optional\n Byte or sequence of bytes indicating line endings.\n\n Returns\n -------\n bool\n If file pointer reached the end of the file, but did not find\n closing quote returns `False`. `True` in any other case.\n \"\"\"\n if is_quoting:\n chunk = f.read(offset_size)\n outside_quotes = not chunk.count(quotechar) % 2\n else:\n f.seek(offset_size, os.SEEK_CUR)\n outside_quotes = True\n\n # after we read `offset_size` bytes, we most likely break the line but\n # the modin implementation doesn't work correctly in the case, so we must\n # make sure that the line is read completely to the lineterminator,\n # which is what the `_read_rows` does\n outside_quotes, _ = cls._read_rows(\n f,\n nrows=1,\n quotechar=quotechar,\n is_quoting=is_quoting,\n outside_quotes=outside_quotes,\n encoding=encoding,\n newline=newline,\n )\n\n return outside_quotes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.partitioned_file_TextFileDispatcher.partitioned_file.start.f_tell_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.partitioned_file_TextFileDispatcher.partitioned_file.start.f_tell_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 205, "end_line": 307, "span_ids": ["TextFileDispatcher.partitioned_file"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def partitioned_file(\n cls,\n f,\n num_partitions: int = None,\n nrows: int = None,\n skiprows: int = None,\n quotechar: bytes = b'\"',\n is_quoting: bool = True,\n encoding: str = None,\n newline: bytes = None,\n header_size: int = 0,\n pre_reading: int = 0,\n read_callback_kw: dict = None,\n ):\n \"\"\"\n Compute chunk sizes in bytes for every partition.\n\n Parameters\n ----------\n f : file-like object\n File handle of file to be partitioned.\n num_partitions : int, optional\n For what number of partitions split a file.\n If not specified grabs the value from `modin.config.NPartitions.get()`.\n nrows : int, optional\n Number of rows of file to read.\n skiprows : int, optional\n Specifies rows to skip.\n quotechar : bytes, default: b'\"'\n Indicate quote in a file.\n is_quoting : bool, default: True\n Whether or not to consider quotes.\n encoding : str, optional\n Encoding of `f`.\n newline : bytes, optional\n Byte or sequence of bytes indicating line endings.\n header_size : int, default: 0\n Number of rows, that occupied by header.\n pre_reading : int, default: 0\n Number of rows between header and skipped rows, that should be read.\n read_callback_kw : dict, optional\n Keyword arguments for `cls.read_callback` to compute metadata if needed.\n This option is not compatible with `pre_reading!=0`.\n\n Returns\n -------\n list\n List with the next elements:\n int : partition start read byte\n int : partition end read byte\n pandas.DataFrame or None\n Dataframe from which metadata can be retrieved. Can be None if `read_callback_kw=None`.\n \"\"\"\n if read_callback_kw is not None and pre_reading != 0:\n raise ValueError(\n f\"Incompatible combination of parameters: {read_callback_kw=}, {pre_reading=}\"\n )\n read_rows_counter = 0\n outside_quotes = True\n\n if num_partitions is None:\n num_partitions = NPartitions.get() - 1 if pre_reading else NPartitions.get()\n\n rows_skipper = cls.rows_skipper_builder(\n f, quotechar, is_quoting=is_quoting, encoding=encoding, newline=newline\n )\n result = []\n\n file_size = cls.file_size(f)\n\n pd_df_metadata = None\n if pre_reading:\n rows_skipper(header_size)\n pre_reading_start = f.tell()\n outside_quotes, read_rows = cls._read_rows(\n f,\n nrows=pre_reading,\n quotechar=quotechar,\n is_quoting=is_quoting,\n outside_quotes=outside_quotes,\n encoding=encoding,\n newline=newline,\n )\n read_rows_counter += read_rows\n\n result.append((pre_reading_start, f.tell()))\n\n # add outside_quotes\n if is_quoting and not outside_quotes:\n warnings.warn(\"File has mismatched quotes\")\n rows_skipper(skiprows)\n else:\n rows_skipper(skiprows)\n if read_callback_kw:\n start = f.tell()\n # For correct behavior, if we want to avoid double skipping rows,\n # we need to get metadata after skipping.\n pd_df_metadata = cls.read_callback(f, **read_callback_kw)\n f.seek(start)\n rows_skipper(header_size)\n\n start = f.tell()\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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.partitioned_file.if_nrows__TextFileDispatcher.partitioned_file.return.result_pd_df_metadata": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.partitioned_file.if_nrows__TextFileDispatcher.partitioned_file.return.result_pd_df_metadata", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 347, "span_ids": ["TextFileDispatcher.partitioned_file"], "tokens": 400}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def partitioned_file(\n cls,\n f,\n num_partitions: int = None,\n nrows: int = None,\n skiprows: int = None,\n quotechar: bytes = b'\"',\n is_quoting: bool = True,\n encoding: str = None,\n newline: bytes = None,\n header_size: int = 0,\n pre_reading: int = 0,\n read_callback_kw: dict = None,\n ):\n # ... other code\n if nrows:\n partition_size = max(1, num_partitions, nrows // num_partitions)\n while f.tell() < file_size and read_rows_counter < nrows:\n if read_rows_counter + partition_size > nrows:\n # it's possible only if is_quoting==True\n partition_size = nrows - read_rows_counter\n outside_quotes, read_rows = cls._read_rows(\n f,\n nrows=partition_size,\n quotechar=quotechar,\n is_quoting=is_quoting,\n encoding=encoding,\n newline=newline,\n )\n result.append((start, f.tell()))\n start = f.tell()\n read_rows_counter += read_rows\n\n # add outside_quotes\n if is_quoting and not outside_quotes:\n warnings.warn(\"File has mismatched quotes\")\n else:\n partition_size = max(1, num_partitions, file_size // num_partitions)\n while f.tell() < file_size:\n outside_quotes = cls.offset(\n f,\n offset_size=partition_size,\n quotechar=quotechar,\n is_quoting=is_quoting,\n encoding=encoding,\n newline=newline,\n )\n\n result.append((start, f.tell()))\n start = f.tell()\n\n # add outside_quotes\n if is_quoting and not outside_quotes:\n warnings.warn(\"File has mismatched quotes\")\n return result, pd_df_metadata", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read_rows_TextFileDispatcher._read_rows.return.outside_quotes_rows_read": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read_rows_TextFileDispatcher._read_rows.return.outside_quotes_rows_read", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 418, "span_ids": ["TextFileDispatcher._read_rows"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _read_rows(\n cls,\n f,\n nrows: int,\n quotechar: bytes = b'\"',\n is_quoting: bool = True,\n outside_quotes: bool = True,\n encoding: str = None,\n newline: bytes = None,\n ):\n \"\"\"\n Move the file offset at the specified amount of rows.\n\n Parameters\n ----------\n f : file-like object\n File handle that should be used for offset movement.\n nrows : int\n Number of rows to read.\n quotechar : bytes, default: b'\"'\n Indicate quote in a file.\n is_quoting : bool, default: True\n Whether or not to consider quotes.\n outside_quotes : bool, default: True\n Whether the file pointer is within quotes or not at the time this function is called.\n encoding : str, optional\n Encoding of `f`.\n newline : bytes, optional\n Byte or sequence of bytes indicating line endings.\n\n Returns\n -------\n bool\n If file pointer reached the end of the file, but did not find closing quote\n returns `False`. `True` in any other case.\n int\n Number of rows that were read.\n \"\"\"\n if nrows is not None and nrows <= 0:\n return True, 0\n\n rows_read = 0\n\n if encoding and (\n \"utf\" in encoding\n and \"8\" not in encoding\n or encoding == \"unicode_escape\"\n or encoding.replace(\"-\", \"_\") == \"utf_8_sig\"\n ):\n iterator = CustomNewlineIterator(f, newline)\n else:\n iterator = f\n\n for line in iterator:\n if is_quoting and line.count(quotechar) % 2:\n outside_quotes = not outside_quotes\n if outside_quotes:\n rows_read += 1\n if rows_read >= nrows:\n break\n\n if isinstance(iterator, CustomNewlineIterator):\n iterator.seek()\n\n # case when EOF\n if not outside_quotes:\n rows_read += 1\n\n return outside_quotes, rows_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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.compute_newline_TextFileDispatcher.compute_newline.return.newline_quotechar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.compute_newline_TextFileDispatcher.compute_newline.return.newline_quotechar", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 420, "end_line": 472, "span_ids": ["TextFileDispatcher.compute_newline"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def compute_newline(cls, file_like, encoding, quotechar):\n \"\"\"\n Compute byte or sequence of bytes indicating line endings.\n\n Parameters\n ----------\n file_like : file-like object\n File handle that should be used for line endings computing.\n encoding : str\n Encoding of `file_like`.\n quotechar : str\n Quotechar used for parsing `file-like`.\n\n Returns\n -------\n bytes\n line endings\n \"\"\"\n newline = None\n\n if encoding is None:\n return newline, quotechar.encode(\"UTF-8\")\n\n quotechar = quotechar.encode(encoding)\n encoding = encoding.replace(\"-\", \"_\")\n\n if (\n \"utf\" in encoding\n and \"8\" not in encoding\n or encoding == \"unicode_escape\"\n or encoding == \"utf_8_sig\"\n ):\n # trigger for computing f.newlines\n file_like.readline()\n # in bytes\n newline = file_like.newlines.encode(encoding)\n boms = ()\n if encoding == \"utf_8_sig\":\n boms = (codecs.BOM_UTF8,)\n elif \"16\" in encoding:\n boms = (codecs.BOM_UTF16_BE, codecs.BOM_UTF16_LE)\n elif \"32\" in encoding:\n boms = (codecs.BOM_UTF32_BE, codecs.BOM_UTF32_LE)\n\n for bom in boms:\n if newline.startswith(bom):\n bom_len = len(bom)\n newline = newline[bom_len:]\n quotechar = quotechar[bom_len:]\n break\n\n return newline, quotechar", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.__read_helper_functions_TextFileDispatcher.rows_skipper_builder.return.skipper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.__read_helper_functions_TextFileDispatcher.rows_skipper_builder.return.skipper", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 514, "span_ids": ["TextFileDispatcher.rows_skipper_builder", "TextFileDispatcher.compute_newline"], "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 TextFileDispatcher(FileDispatcher):\n\n # _read helper functions\n @classmethod\n def rows_skipper_builder(\n cls, f, quotechar, is_quoting, encoding=None, newline=None\n ):\n \"\"\"\n Build object for skipping passed number of lines.\n\n Parameters\n ----------\n f : file-like object\n File handle that should be used for offset movement.\n quotechar : bytes\n Indicate quote in a file.\n is_quoting : bool\n Whether or not to consider quotes.\n encoding : str, optional\n Encoding of `f`.\n newline : bytes, optional\n Byte or sequence of bytes indicating line endings.\n\n Returns\n -------\n object\n skipper object.\n \"\"\"\n\n def skipper(n):\n if n == 0 or n is None:\n return 0\n else:\n return cls._read_rows(\n f,\n quotechar=quotechar,\n is_quoting=is_quoting,\n nrows=n,\n encoding=encoding,\n newline=newline,\n )[1]\n\n return skipper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_header_size_TextFileDispatcher._define_header_size.return.header_size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_header_size_TextFileDispatcher._define_header_size.return.header_size", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 545, "span_ids": ["TextFileDispatcher._define_header_size"], "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 TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _define_header_size(\n cls,\n header: Union[int, Sequence[int], str, None] = \"infer\",\n names: Optional[Sequence] = lib.no_default,\n ) -> int:\n \"\"\"\n Define the number of rows that are used by header.\n\n Parameters\n ----------\n header : int, list of int or str, default: \"infer\"\n Original `header` parameter of `read_csv` function.\n names : array-like, optional\n Original names parameter of `read_csv` function.\n\n Returns\n -------\n header_size : int\n The number of rows that are used by header.\n \"\"\"\n header_size = 0\n if header == \"infer\" and names in [lib.no_default, None]:\n header_size += 1\n elif isinstance(header, int):\n header_size += header + 1\n elif hasattr(header, \"__iter__\") and not isinstance(header, str):\n header_size += max(header) + 1\n\n return header_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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_metadata_TextFileDispatcher._define_metadata.return.column_widths_num_splits": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_metadata_TextFileDispatcher._define_metadata.return.column_widths_num_splits", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 547, "end_line": 592, "span_ids": ["TextFileDispatcher._define_metadata"], "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 TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _define_metadata(\n cls,\n df: pandas.DataFrame,\n column_names: ColumnNamesTypes,\n ) -> Tuple[list, int]:\n \"\"\"\n Define partitioning metadata.\n\n Parameters\n ----------\n df : pandas.DataFrame\n The DataFrame to split.\n column_names : ColumnNamesTypes\n Column names of df.\n\n Returns\n -------\n column_widths : list\n Column width to use during new frame creation (number of\n columns for each partition).\n num_splits : int\n The maximum number of splits to separate the DataFrame into.\n \"\"\"\n # This is the number of splits for the columns\n num_splits = min(len(column_names) or 1, NPartitions.get())\n column_chunksize = compute_chunksize(df.shape[1], num_splits)\n if column_chunksize > len(column_names):\n column_widths = [len(column_names)]\n # This prevents us from unnecessarily serializing a bunch of empty\n # objects.\n num_splits = 1\n else:\n # split columns into chunks with maximal size column_chunksize, for example\n # if num_splits == 4, len(column_names) == 80 and column_chunksize == 32,\n # column_widths will be [32, 32, 16, 0]\n column_widths = [\n column_chunksize\n if len(column_names) > (column_chunksize * (i + 1))\n else 0\n if len(column_names) < (column_chunksize * i)\n else len(column_names) - (column_chunksize * i)\n for i in range(num_splits)\n ]\n\n return column_widths, num_splits", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._parse_func_TextFileDispatcher._launch_tasks.return.partition_ids_index_ids_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._parse_func_TextFileDispatcher._launch_tasks.return.partition_ids_index_ids_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 594, "end_line": 642, "span_ids": ["TextFileDispatcher:3", "TextFileDispatcher.preprocess_func", "TextFileDispatcher._launch_tasks"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n _parse_func = None\n\n @classmethod\n def preprocess_func(cls): # noqa: RT01\n \"\"\"Prepare a function for transmission to remote workers.\"\"\"\n if cls._parse_func is None:\n cls._parse_func = cls.put(cls.parse)\n return cls._parse_func\n\n @classmethod\n def _launch_tasks(\n cls, splits: list, *partition_args, **partition_kwargs\n ) -> Tuple[list, list, list]:\n \"\"\"\n Launch tasks to read partitions.\n\n Parameters\n ----------\n splits : list\n List of tuples with partitions data, which defines\n parser task (start/end read bytes and etc.).\n *partition_args : tuple\n Positional arguments to be passed to the parser function.\n **partition_kwargs : dict\n `kwargs` that should be passed to the parser function.\n\n Returns\n -------\n partition_ids : list\n array with references to the partitions data.\n index_ids : list\n array with references to the partitions index objects.\n dtypes_ids : list\n array with references to the partitions dtypes objects.\n \"\"\"\n partition_ids = [None] * len(splits)\n index_ids = [None] * len(splits)\n dtypes_ids = [None] * len(splits)\n # this is done mostly for performance; see PR#5678 for details\n func = cls.preprocess_func()\n for idx, (start, end) in enumerate(splits):\n partition_kwargs.update({\"start\": start, \"end\": end})\n *partition_ids[idx], index_ids[idx], dtypes_ids[idx] = cls.deploy(\n func=func,\n f_args=partition_args,\n f_kwargs=partition_kwargs,\n num_returns=partition_kwargs.get(\"num_splits\") + 2,\n )\n return partition_ids, index_ids, dtypes_ids", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.check_parameters_support_TextFileDispatcher.check_parameters_support.return._True_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher.check_parameters_support_TextFileDispatcher.check_parameters_support.return._True_None_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 644, "end_line": 717, "span_ids": ["TextFileDispatcher.check_parameters_support"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def check_parameters_support(\n cls,\n filepath_or_buffer,\n read_kwargs: dict,\n skiprows_md: Union[Sequence, callable, int],\n header_size: int,\n ) -> Tuple[bool, Optional[str]]:\n \"\"\"\n Check support of only general parameters of `read_*` function.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of `read_*` function.\n read_kwargs : dict\n Parameters of `read_*` function.\n skiprows_md : int, array or callable\n `skiprows` parameter modified for easier handling by Modin.\n header_size : int\n Number of rows that are used by header.\n\n Returns\n -------\n bool\n Whether passed parameters are supported or not.\n Optional[str]\n `None` if parameters are supported, otherwise an error\n message describing why parameters are not supported.\n \"\"\"\n skiprows = read_kwargs.get(\"skiprows\")\n if isinstance(filepath_or_buffer, str):\n if not cls.file_exists(\n filepath_or_buffer, read_kwargs.get(\"storage_options\")\n ):\n return (False, cls._file_not_found_msg(filepath_or_buffer))\n elif not cls.pathlib_or_pypath(filepath_or_buffer):\n return (False, cls.BUFFER_UNSUPPORTED_MSG)\n\n if read_kwargs[\"chunksize\"] is not None:\n return (False, \"`chunksize` parameter is not supported\")\n\n if read_kwargs.get(\"dialect\") is not None:\n return (False, \"`dialect` parameter is not supported\")\n\n if read_kwargs[\"lineterminator\"] is not None:\n return (False, \"`lineterminator` parameter is not supported\")\n\n if read_kwargs[\"escapechar\"] is not None:\n return (False, \"`escapechar` parameter is not supported\")\n\n if read_kwargs.get(\"skipfooter\"):\n if read_kwargs.get(\"nrows\") or read_kwargs.get(\"engine\") == \"c\":\n return (False, \"Exception is raised by pandas itself\")\n\n skiprows_supported = True\n if is_list_like(skiprows_md) and skiprows_md[0] < header_size:\n skiprows_supported = False\n elif callable(skiprows):\n # check if `skiprows` callable gives True for any of header indices\n is_intersection = any(\n cls._get_skip_mask(pandas.RangeIndex(header_size), skiprows)\n )\n if is_intersection:\n skiprows_supported = False\n\n if not skiprows_supported:\n return (\n False,\n \"Values of `header` and `skiprows` parameters have intersections; \"\n + \"this case is unsupported by Modin\",\n )\n\n return (True, 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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._validate_usecols_arg_TextFileDispatcher._validate_usecols_arg.return.usecols_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._validate_usecols_arg_TextFileDispatcher._validate_usecols_arg.return.usecols_None", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 719, "end_line": 741, "span_ids": ["TextFileDispatcher._validate_usecols_arg"], "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 TextFileDispatcher(FileDispatcher):\n\n @classmethod\n @_inherit_docstrings(pandas.io.parsers.base_parser.ParserBase._validate_usecols_arg)\n def _validate_usecols_arg(cls, usecols):\n msg = (\n \"'usecols' must either be list-like of all strings, all unicode, \"\n + \"all integers or a callable.\"\n )\n if usecols is not None:\n if callable(usecols):\n return usecols, None\n\n if not is_list_like(usecols):\n raise ValueError(msg)\n\n usecols_dtype = lib.infer_dtype(usecols, skipna=False)\n\n if usecols_dtype not in (\"empty\", \"integer\", \"string\"):\n raise ValueError(msg)\n\n usecols = set(usecols)\n\n return usecols, usecols_dtype\n return usecols, 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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._manage_skiprows_parameter_TextFileDispatcher._manage_skiprows_parameter._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._manage_skiprows_parameter_TextFileDispatcher._manage_skiprows_parameter._", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 743, "end_line": 822, "span_ids": ["TextFileDispatcher._manage_skiprows_parameter"], "tokens": 958}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _manage_skiprows_parameter(\n cls,\n skiprows: Union[int, Sequence[int], Callable, None] = None,\n header_size: int = 0,\n ) -> Tuple[Union[int, Sequence, Callable], bool, int]:\n \"\"\"\n Manage `skiprows` parameter of read_csv and read_fwf functions.\n\n Change `skiprows` parameter in the way Modin could more optimally\n process it. `csv_dispatcher` and `fwf_dispatcher` have two mechanisms of rows skipping:\n\n 1) During file partitioning (setting of file limits that should be read\n by each partition) exact rows can be excluded from partitioning scope,\n thus they won't be read at all and can be considered as skipped. This is\n the most effective way of rows skipping (since it doesn't require any\n actual data reading and postprocessing), but in this case `skiprows`\n parameter can be an integer only. When it possible Modin always uses\n this approach by setting of `skiprows_partitioning` return value.\n\n 2) Rows for skipping can be dropped after full dataset import. This is\n more expensive way since it requires extra IO work and postprocessing\n afterwards, but `skiprows` parameter can be of any non-integer type\n supported by any pandas read function. These rows is\n specified by setting of `skiprows_md` return value.\n\n In some cases, if `skiprows` is uniformly distributed array (e.g. [1,2,3]),\n `skiprows` can be \"squashed\" and represented as integer to make a fastpath.\n If there is a gap between the first row for skipping and the last line of\n the header (that will be skipped too), then assign to read this gap first\n (assign the first partition to read these rows be setting of `pre_reading`\n return value). See `Examples` section for details.\n\n Parameters\n ----------\n skiprows : int, array or callable, optional\n Original `skiprows` parameter of any pandas read function.\n header_size : int, default: 0\n Number of rows that are used by header.\n\n Returns\n -------\n skiprows_md : int, array or callable\n Updated skiprows parameter. If `skiprows` is an array, this\n array will be sorted. Also parameter will be aligned to\n actual data in the `query_compiler` (which, for example,\n doesn't contain header rows)\n pre_reading : int\n The number of rows that should be read before data file\n splitting for further reading (the number of rows for\n the first partition).\n skiprows_partitioning : int\n The number of rows that should be skipped virtually (skipped during\n data file partitioning).\n\n Examples\n --------\n Let's consider case when `header`=\"infer\" and `skiprows`=[3,4,5]. In\n this specific case fastpath can be done since `skiprows` is uniformly\n distributed array, so we can \"squash\" it to integer and set\n `skiprows_partitioning`=3. But if no additional action will be done,\n these three rows will be skipped right after header line, that corresponds\n to `skiprows`=[1,2,3]. Now, to avoid this discrepancy, we need to assign\n the first partition to read data between header line and the first\n row for skipping by setting of `pre_reading` parameter, so setting\n `pre_reading`=2. During data file partitiong, these lines will be assigned\n for reading for the first partition, and then file position will be set at\n the beginning of rows that should be skipped by `skiprows_partitioning`.\n After skipping of these rows, the rest data will be divided between the\n rest of partitions, see rows assignement below:\n\n 0 - header line (skip during partitioning)\n 1 - pre_reading (assign to read by the first partition)\n 2 - pre_reading (assign to read by the first partition)\n 3 - skiprows_partitioning (skip during partitioning)\n 4 - skiprows_partitioning (skip during partitioning)\n 5 - skiprows_partitioning (skip during partitioning)\n 6 - data to partition (divide between the rest of partitions)\n 7 - data to partition (divide between the rest of partitions)\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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._manage_skiprows_parameter.pre_reading_TextFileDispatcher._manage_skiprows_parameter.return.skiprows_md_pre_reading_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._manage_skiprows_parameter.pre_reading_TextFileDispatcher._manage_skiprows_parameter.return.skiprows_md_pre_reading_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 823, "end_line": 844, "span_ids": ["TextFileDispatcher._manage_skiprows_parameter"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _manage_skiprows_parameter(\n cls,\n skiprows: Union[int, Sequence[int], Callable, None] = None,\n header_size: int = 0,\n ) -> Tuple[Union[int, Sequence, Callable], bool, int]:\n pre_reading = skiprows_partitioning = skiprows_md = 0\n if isinstance(skiprows, int):\n skiprows_partitioning = skiprows\n elif is_list_like(skiprows) and len(skiprows) > 0:\n skiprows_md = np.sort(skiprows)\n if np.all(np.diff(skiprows_md) == 1):\n # `skiprows` is uniformly distributed array.\n pre_reading = (\n skiprows_md[0] - header_size if skiprows_md[0] > header_size else 0\n )\n skiprows_partitioning = len(skiprows_md)\n skiprows_md = 0\n elif skiprows_md[0] > header_size:\n skiprows_md = skiprows_md - header_size\n elif callable(skiprows):\n\n def skiprows_func(x):\n return skiprows(x + header_size)\n\n skiprows_md = skiprows_func\n\n return skiprows_md, pre_reading, skiprows_partitioning", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_index_TextFileDispatcher._define_index.return.new_index_row_lengths": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._define_index_TextFileDispatcher._define_index.return.new_index_row_lengths", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 846, "end_line": 879, "span_ids": ["TextFileDispatcher._define_index"], "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 TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _define_index(\n cls,\n index_ids: list,\n index_name: str,\n ) -> Tuple[IndexColType, list]:\n \"\"\"\n Compute the resulting DataFrame index and index lengths for each of partitions.\n\n Parameters\n ----------\n index_ids : list\n Array with references to the partitions index objects.\n index_name : str\n Name that should be assigned to the index if `index_col`\n is not provided.\n\n Returns\n -------\n new_index : IndexColType\n Index that should be passed to the new_frame constructor.\n row_lengths : list\n Partitions rows lengths.\n \"\"\"\n index_objs = cls.materialize(index_ids)\n if len(index_objs) == 0 or isinstance(index_objs[0], int):\n row_lengths = index_objs\n new_index = pandas.RangeIndex(sum(index_objs))\n else:\n row_lengths = [len(o) for o in index_objs]\n new_index = index_objs[0].append(index_objs[1:])\n new_index.name = index_name\n\n return new_index, row_lengths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._get_new_qc_TextFileDispatcher._get_new_qc.return.new_query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._get_new_qc_TextFileDispatcher._get_new_qc.return.new_query_compiler", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 881, "end_line": 976, "span_ids": ["TextFileDispatcher._get_new_qc"], "tokens": 734}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _get_new_qc(\n cls,\n partition_ids: list,\n index_ids: list,\n dtypes_ids: list,\n index_col: IndexColType,\n index_name: str,\n column_widths: list,\n column_names: ColumnNamesTypes,\n skiprows_md: Union[Sequence, callable, None] = None,\n header_size: int = None,\n **kwargs,\n ):\n \"\"\"\n Get new query compiler from data received from workers.\n\n Parameters\n ----------\n partition_ids : list\n Array with references to the partitions data.\n index_ids : list\n Array with references to the partitions index objects.\n dtypes_ids : list\n Array with references to the partitions dtypes objects.\n index_col : IndexColType\n `index_col` parameter of `read_csv` function.\n index_name : str\n Name that should be assigned to the index if `index_col`\n is not provided.\n column_widths : list\n Number of columns in each partition.\n column_names : ColumnNamesTypes\n Array with columns names.\n skiprows_md : array-like or callable, optional\n Specifies rows to skip.\n header_size : int, default: 0\n Number of rows, that occupied by header.\n **kwargs : dict\n Parameters of `read_csv` function needed for postprocessing.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n New query compiler, created from `new_frame`.\n \"\"\"\n partition_ids = cls.build_partition(\n partition_ids, [None] * len(index_ids), column_widths\n )\n\n new_frame = cls.frame_cls(\n partition_ids,\n lambda: cls._define_index(index_ids, index_name),\n column_names,\n None,\n column_widths,\n dtypes=lambda: cls.get_dtypes(dtypes_ids, column_names),\n )\n new_query_compiler = cls.query_compiler_cls(new_frame)\n skipfooter = kwargs.get(\"skipfooter\", None)\n if skipfooter:\n new_query_compiler = new_query_compiler.drop(\n new_query_compiler.index[-skipfooter:]\n )\n if skiprows_md is not None:\n # skip rows that passed as array or callable\n nrows = kwargs.get(\"nrows\", None)\n index_range = pandas.RangeIndex(len(new_query_compiler.index))\n if is_list_like(skiprows_md):\n new_query_compiler = new_query_compiler.take_2d_positional(\n index=index_range.delete(skiprows_md)\n )\n elif callable(skiprows_md):\n skip_mask = cls._get_skip_mask(index_range, skiprows_md)\n if not isinstance(skip_mask, np.ndarray):\n skip_mask = skip_mask.to_numpy(\"bool\")\n view_idx = index_range[~skip_mask]\n new_query_compiler = new_query_compiler.take_2d_positional(\n index=view_idx\n )\n else:\n raise TypeError(\n f\"Not acceptable type of `skiprows` parameter: {type(skiprows_md)}\"\n )\n\n if not isinstance(new_query_compiler.index, pandas.MultiIndex):\n new_query_compiler = new_query_compiler.reset_index(drop=True)\n\n if nrows:\n new_query_compiler = new_query_compiler.take_2d_positional(\n pandas.RangeIndex(len(new_query_compiler.index))[:nrows]\n )\n if index_col is None or index_col is False:\n new_query_compiler._modin_frame.synchronize_labels(axis=0)\n\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read_TextFileDispatcher._read.read_callback_kw.dict_kwargs_nrows_1_ski": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read_TextFileDispatcher._read.read_callback_kw.dict_kwargs_nrows_1_ski", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 978, "end_line": 1056, "span_ids": ["TextFileDispatcher._read"], "tokens": 609}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _read(cls, filepath_or_buffer, **kwargs):\n \"\"\"\n Read data from `filepath_or_buffer` according to `kwargs` parameters.\n\n Used in `read_csv` and `read_fwf` Modin implementations.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of read functions.\n **kwargs : dict\n Parameters of read functions.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n filepath_or_buffer_md = (\n cls.get_path(filepath_or_buffer)\n if isinstance(filepath_or_buffer, str)\n else cls.get_path_or_buffer(filepath_or_buffer)\n )\n compression_infered = cls.infer_compression(\n filepath_or_buffer, kwargs[\"compression\"]\n )\n # Getting frequently used kwargs;\n # They should be defined in higher level\n names = kwargs[\"names\"]\n index_col = kwargs[\"index_col\"]\n encoding = kwargs[\"encoding\"]\n skiprows = kwargs[\"skiprows\"]\n header = kwargs[\"header\"]\n # Define header size for further skipping (Header can be skipped because header\n # information will be obtained further from empty_df, so no need to handle it\n # by workers)\n header_size = cls._define_header_size(\n header,\n names,\n )\n (\n skiprows_md,\n pre_reading,\n skiprows_partitioning,\n ) = cls._manage_skiprows_parameter(skiprows, header_size)\n should_handle_skiprows = skiprows_md is not None and not isinstance(\n skiprows_md, int\n )\n\n (use_modin_impl, fallback_reason) = cls.check_parameters_support(\n filepath_or_buffer_md,\n kwargs,\n skiprows_md,\n header_size,\n )\n if not use_modin_impl:\n return cls.single_worker_read(\n filepath_or_buffer,\n kwargs,\n reason=fallback_reason,\n )\n\n is_quoting = kwargs[\"quoting\"] != QUOTE_NONE\n usecols = kwargs[\"usecols\"]\n use_inferred_column_names = cls._uses_inferred_column_names(\n names, skiprows, kwargs[\"skipfooter\"], usecols\n )\n\n # Computing metadata simultaneously with skipping rows allows us to not\n # do extra work and improve performance for certain cases, as otherwise,\n # it would require double re-reading of skipped rows in order to retrieve metadata.\n can_compute_metadata_while_skipping_rows = (\n # basic supported case: isinstance(skiprows, int) without any additional params\n isinstance(skiprows, int)\n and (usecols is None or skiprows is None)\n and pre_reading == 0\n )\n read_callback_kw = dict(kwargs, nrows=1, skipfooter=0, index_col=index_col)\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_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read.if_not_can_compute_metada_TextFileDispatcher._read.return.new_query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._read.if_not_can_compute_metada_TextFileDispatcher._read.return.new_query_compiler", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1057, "end_line": 1145, "span_ids": ["TextFileDispatcher._read"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _read(cls, filepath_or_buffer, **kwargs):\n # ... other code\n if not can_compute_metadata_while_skipping_rows:\n pd_df_metadata = cls.read_callback(\n filepath_or_buffer_md,\n **read_callback_kw,\n )\n column_names = pd_df_metadata.columns\n column_widths, num_splits = cls._define_metadata(\n pd_df_metadata, column_names\n )\n read_callback_kw = None\n else:\n read_callback_kw = dict(read_callback_kw, skiprows=None)\n # `memory_map` doesn't work with file-like object so we can't use it here.\n # We can definitely skip it without violating the reading logic\n # since this parameter is intended to optimize reading.\n # For reading a couple of lines, this is not essential.\n read_callback_kw.pop(\"memory_map\", None)\n # These parameters are already used when opening file `f`,\n # they do not need to be used again.\n read_callback_kw.pop(\"storage_options\", None)\n read_callback_kw.pop(\"compression\", None)\n\n with OpenFile(\n filepath_or_buffer_md,\n \"rb\",\n compression_infered,\n **(kwargs.get(\"storage_options\", None) or {}),\n ) as f:\n old_pos = f.tell()\n fio = io.TextIOWrapper(f, encoding=encoding, newline=\"\")\n newline, quotechar = cls.compute_newline(\n fio, encoding, kwargs.get(\"quotechar\", '\"')\n )\n f.seek(old_pos)\n\n splits, pd_df_metadata_temp = cls.partitioned_file(\n f,\n num_partitions=NPartitions.get(),\n nrows=kwargs[\"nrows\"] if not should_handle_skiprows else None,\n skiprows=skiprows_partitioning,\n quotechar=quotechar,\n is_quoting=is_quoting,\n encoding=encoding,\n newline=newline,\n header_size=header_size,\n pre_reading=pre_reading,\n read_callback_kw=read_callback_kw,\n )\n if can_compute_metadata_while_skipping_rows:\n pd_df_metadata = pd_df_metadata_temp\n\n column_names = pd_df_metadata.columns\n column_widths, num_splits = cls._define_metadata(pd_df_metadata, column_names)\n # kwargs that will be passed to the workers\n partition_kwargs = dict(\n kwargs,\n header_size=0 if use_inferred_column_names else header_size,\n names=column_names if use_inferred_column_names else names,\n header=\"infer\" if use_inferred_column_names else header,\n skipfooter=0,\n skiprows=None,\n nrows=None,\n compression=compression_infered,\n )\n # this is done mostly for performance; see PR#5678 for details\n filepath_or_buffer_md_ref = cls.put(filepath_or_buffer_md)\n kwargs_ref = cls.put(partition_kwargs)\n partition_ids, index_ids, dtypes_ids = cls._launch_tasks(\n splits,\n filepath_or_buffer_md_ref,\n kwargs_ref,\n num_splits=num_splits,\n )\n\n new_query_compiler = cls._get_new_qc(\n partition_ids=partition_ids,\n index_ids=index_ids,\n dtypes_ids=dtypes_ids,\n index_col=index_col,\n index_name=pd_df_metadata.index.name,\n column_widths=column_widths,\n column_names=column_names,\n skiprows_md=skiprows_md if should_handle_skiprows else None,\n header_size=header_size,\n skipfooter=kwargs[\"skipfooter\"],\n parse_dates=kwargs[\"parse_dates\"],\n nrows=kwargs[\"nrows\"] if should_handle_skiprows else None,\n )\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._get_skip_mask_TextFileDispatcher._get_skip_mask.return.mask": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._get_skip_mask_TextFileDispatcher._get_skip_mask.return.mask", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1147, "end_line": 1175, "span_ids": ["TextFileDispatcher._get_skip_mask"], "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 TextFileDispatcher(FileDispatcher):\n\n @classmethod\n def _get_skip_mask(cls, rows_index: pandas.Index, skiprows: Callable):\n \"\"\"\n Get mask of skipped by callable `skiprows` rows.\n\n Parameters\n ----------\n rows_index : pandas.Index\n Rows index to get mask for.\n skiprows : Callable\n Callable to check whether row index should be skipped.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n try:\n # direct `skiprows` call is more efficient than using of\n # map method, but in some cases it can work incorrectly, e.g.\n # when `skiprows` contains `in` operator\n mask = skiprows(rows_index)\n assert is_list_like(mask)\n except (ValueError, TypeError, AssertionError):\n # ValueError can be raised if `skiprows` callable contains membership operator\n # TypeError is raised if `skiprows` callable contains bitwise operator\n # AssertionError is raised if unexpected behavior was detected\n mask = rows_index.map(skiprows)\n\n return mask", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._uses_inferred_column_names_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/text_file_dispatcher.py_TextFileDispatcher._uses_inferred_column_names_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/text_file_dispatcher.py", "file_name": "text_file_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1177, "end_line": 1223, "span_ids": ["TextFileDispatcher._uses_inferred_column_names"], "tokens": 491}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextFileDispatcher(FileDispatcher):\n\n @staticmethod\n def _uses_inferred_column_names(names, skiprows, skipfooter, usecols):\n \"\"\"\n Tell whether need to use inferred column names in workers or not.\n\n 1) ``False`` is returned in 2 cases and means next:\n 1.a) `names` parameter was provided from the API layer. In this case parameter\n `names` must be provided as `names` parameter for ``read_csv`` in the workers.\n 1.b) `names` parameter wasn't provided from the API layer. In this case column names\n inference must happen in each partition.\n 2) ``True`` is returned in case when inferred column names from pre-reading stage must be\n provided as `names` parameter for ``read_csv`` in the workers.\n\n In case `names` was provided, the other parameters aren't checked. Otherwise, inferred column\n names should be used in a case of not full data reading which is defined by `skipfooter` parameter,\n when need to skip lines at the bottom of file or by `skiprows` parameter, when need to skip lines at\n the top of file (but if `usecols` was provided, column names inference must happen in the workers).\n\n Parameters\n ----------\n names : array-like\n List of column names to use.\n skiprows : list-like, int or callable\n Line numbers to skip (0-indexed) or number of lines to skip (int) at\n the start of the file. If callable, the callable function will be\n evaluated against the row indices, returning ``True`` if the row should\n be skipped and ``False`` otherwise.\n skipfooter : int\n Number of lines at bottom of the file to skip.\n usecols : list-like or callable\n Subset of the columns.\n\n Returns\n -------\n bool\n Whether to use inferred column names in ``read_csv`` of the workers or not.\n \"\"\"\n if names not in [None, lib.no_default]:\n return False\n if skipfooter != 0:\n return True\n if isinstance(skiprows, int) and skiprows == 0:\n return False\n if is_list_like(skiprows):\n return usecols is None\n return skiprows 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_modin-project__modin/modin/core/io/text/utils.py_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/text/utils.py_io_", "embedding": null, "metadata": {"file_path": "modin/core/io/text/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 64, "span_ids": ["CustomNewlineIterator.__init__", "CustomNewlineIterator", "CustomNewlineIterator.seek", "CustomNewlineIterator.__iter__", "docstring"], "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": "import io\n\n\nclass CustomNewlineIterator:\n r\"\"\"\n Used to iterate through files in binary mode line by line where newline != b'\\n'.\n\n Parameters\n ----------\n _file : file-like object\n File-like object to iterate over.\n newline : bytes\n Byte or sequence of bytes indicating line endings.\n \"\"\"\n\n def __init__(self, _file, newline):\n self.file = _file\n self.newline = newline\n self.bytes_read = self.chunk_size = 0\n\n def __iter__(self):\n \"\"\"\n Iterate over lines.\n\n Yields\n ------\n bytes\n Data from file.\n \"\"\"\n buffer_size = io.DEFAULT_BUFFER_SIZE\n chunk = self.file.read(buffer_size)\n self.chunk_size = 0\n while chunk:\n self.bytes_read = 0\n self.chunk_size = len(chunk)\n # split remove newline bytes from line\n lines = chunk.split(self.newline)\n for line in lines[:-1]:\n self.bytes_read += len(line) + len(self.newline)\n yield line\n chunk = self.file.read(buffer_size)\n if lines[-1]:\n # last line can be read without newline bytes\n chunk = lines[-1] + chunk\n\n def seek(self):\n \"\"\"Change the stream positition to where the last returned line ends.\"\"\"\n self.file.seek(self.bytes_read - self.chunk_size, 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_modin-project__modin/modin/core/storage_formats/__init__.py_BaseQueryCompiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/__init__.py_BaseQueryCompiler_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 20, "span_ids": ["docstring"], "tokens": 33}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .base import BaseQueryCompiler\nfrom .pandas import PandasQueryCompiler\n\n__all__ = [\"BaseQueryCompiler\", \"PandasQueryCompiler\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/__init__.py_BaseQueryCompiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/__init__.py_BaseQueryCompiler_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 18}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .query_compiler import BaseQueryCompiler\n\n__all__ = [\"BaseQueryCompiler\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_from_functools_import_par_add_one_column_warning.append_to_docstring__one_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_from_functools_import_par_add_one_column_warning.append_to_docstring__one_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 37, "span_ids": ["docstring"], "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": "from functools import partial\nfrom modin.utils import append_to_docstring, format_string, align_indents\n\n\n_one_column_warning = \"\"\"\n.. warning::\n This method is supported only by one-column query compilers.\n\"\"\"\n\n_deprecation_warning = \"\"\"\n.. warning::\n This method duplicates logic of ``{0}`` and will be removed soon.\n\"\"\"\n\n_refer_to_note = \"\"\"\nNotes\n-----\nPlease refer to ``modin.pandas.{0}`` for more information\nabout parameters and output format.\n\"\"\"\n\nadd_one_column_warning = append_to_docstring(_one_column_warning)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_add_deprecation_warning_add_refer_to.return.append_to_docstring_note_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_add_deprecation_warning_add_refer_to.return.append_to_docstring_note_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 75, "span_ids": ["add_refer_to", "add_deprecation_warning"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_deprecation_warning(replacement_method):\n \"\"\"\n Build decorator which appends deprecation warning to the function's docstring.\n\n Appended warning indicates that the current method duplicates functionality of\n some other method and so is slated to be removed in the future.\n\n Parameters\n ----------\n replacement_method : str\n Name of the method to use instead of deprecated.\n\n Returns\n -------\n callable\n \"\"\"\n message = _deprecation_warning.format(replacement_method)\n return append_to_docstring(message)\n\n\ndef add_refer_to(method):\n \"\"\"\n Build decorator which appends link to the high-level equivalent method to the function's docstring.\n\n Parameters\n ----------\n method : str\n Method name in ``modin.pandas`` module to refer to.\n\n Returns\n -------\n callable\n \"\"\"\n # FIXME: this would break numpydoc if there already is a `Notes` section\n note = _refer_to_note.format(method)\n return append_to_docstring(note)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_qc_method_doc_qc_method.return.decorator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_qc_method_doc_qc_method.return.decorator", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 135, "span_ids": ["doc_qc_method"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def doc_qc_method(\n template,\n params=None,\n refer_to=None,\n refer_to_module_name=None,\n one_column_method=False,\n **kwargs,\n):\n \"\"\"\n Build decorator which adds docstring for query compiler method.\n\n Parameters\n ----------\n template : str\n Method docstring in the NumPy docstyle format. Must contain {params}\n placeholder.\n params : str, optional\n Method parameters in the NumPy docstyle format to substitute\n in the `template`. `params` string should not include the \"Parameters\"\n header.\n refer_to : str, optional\n Method name in `refer_to_module_name` module to refer to for more information\n about parameters and output format.\n refer_to_module_name : str, optional\n one_column_method : bool, default: False\n Whether to append note that this method is for one-column\n query compilers only.\n **kwargs : dict\n Values to substitute in the `template`.\n\n Returns\n -------\n callable\n \"\"\"\n params_template = \"\"\"\n\n Parameters\n ----------\n {params}\n \"\"\"\n\n params = format_string(params_template, params=params) if params else \"\"\n substituted = format_string(template, params=params, refer_to=refer_to, **kwargs)\n if refer_to_module_name:\n refer_to = f\"{refer_to_module_name}.{refer_to}\"\n\n def decorator(func):\n func.__doc__ = substituted\n appendix = \"\"\n if refer_to:\n appendix += _refer_to_note.format(refer_to)\n if one_column_method:\n appendix += _one_column_warning\n if appendix:\n func = append_to_docstring(appendix)(func)\n return func\n\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_binary_method_doc_binary_method.return.doc_qc_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_binary_method_doc_binary_method.return.doc_qc_method_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 207, "span_ids": ["doc_binary_method"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def doc_binary_method(operation, sign, self_on_right=False, op_type=\"arithmetic\"):\n \"\"\"\n Build decorator which adds docstring for binary method.\n\n Parameters\n ----------\n operation : str\n Name of the binary operation.\n sign : str\n Sign which represents specified binary operation.\n self_on_right : bool, default: False\n Whether `self` is the right operand.\n op_type : {\"arithmetic\", \"logical\", \"comparison\"}, default: \"arithmetic\"\n Type of the binary operation.\n\n Returns\n -------\n callable\n \"\"\"\n template = \"\"\"\n Perform element-wise {operation} (``{verbose}``).\n\n If axes are not equal, perform frames alignment first.\n\n Parameters\n ----------\n other : BaseQueryCompiler, scalar or array-like\n Other operand of the binary operation.\n broadcast : bool, default: False\n If `other` is a one-column query compiler, indicates whether it is a Series or not.\n Frames and Series have to be processed differently, however we can't distinguish them\n at the query compiler level, so this parameter is a hint that is passed from a high-level API.\n {extra_params}**kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Result of binary operation.\n \"\"\"\n\n extra_params = {\n \"logical\": \"\"\"\n level : int or label\n In case of MultiIndex match index values on the passed level.\n axis : {{0, 1}}\n Axis to match indices along for 1D `other` (list or QueryCompiler that represents Series).\n 0 is for index, when 1 is for columns.\n \"\"\",\n \"arithmetic\": \"\"\"\n level : int or label\n In case of MultiIndex match index values on the passed level.\n axis : {{0, 1}}\n Axis to match indices along for 1D `other` (list or QueryCompiler that represents Series).\n 0 is for index, when 1 is for columns.\n fill_value : float or None\n Value to fill missing elements during frame alignment.\n \"\"\",\n }\n\n verbose_substitution = (\n f\"other {sign} self\" if self_on_right else f\"self {sign} other\"\n )\n params_substitution = extra_params.get(op_type, \"\")\n return doc_qc_method(\n template,\n extra_params=params_substitution,\n operation=operation,\n verbose=verbose_substitution,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_reduce_agg_doc_reduce_agg.return.doc_qc_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_reduce_agg_doc_reduce_agg.return.doc_qc_method_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 277, "span_ids": ["doc_reduce_agg"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def doc_reduce_agg(method, refer_to, params=None, extra_params=None):\n \"\"\"\n Build decorator which adds docstring for the reduce method.\n\n Parameters\n ----------\n method : str\n The result of the method.\n refer_to : str\n Method name in ``modin.pandas.DataFrame`` module to refer to for\n more information about parameters and output format.\n params : str, optional\n Method parameters in the NumPy docstyle format to substitute\n to the docstring template.\n extra_params : sequence of str, optional\n Method parameter names to append to the docstring template. Parameter\n type and description will be grabbed from ``extra_params_map`` (Please\n refer to the source code of this function to explore the map).\n\n Returns\n -------\n callable\n \"\"\"\n template = \"\"\"\n Get the {method} for each column or row.\n {params}\n Returns\n -------\n BaseQueryCompiler\n One-column QueryCompiler with index labels of the specified axis,\n where each row contains the {method} for the corresponding\n row or column.\n \"\"\"\n\n if params is None:\n params = \"\"\"\n axis : {{0, 1}}\n numeric_only : bool, optional\"\"\"\n\n extra_params_map = {\n \"skipna\": \"\"\"\n skipna : bool, default: True\"\"\",\n \"min_count\": \"\"\"\n min_count : int\"\"\",\n \"ddof\": \"\"\"\n ddof : int\"\"\",\n \"*args\": \"\"\"\n *args : iterable\n Serves the compatibility purpose. Does not affect the result.\"\"\",\n \"**kwargs\": \"\"\"\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\"\"\",\n }\n\n params += \"\".join(\n [\n align_indents(\n source=params, target=extra_params_map.get(param, f\"\\n{param} : object\")\n )\n for param in (extra_params or [])\n ]\n )\n return doc_qc_method(\n template,\n params=params,\n method=method,\n refer_to=f\"DataFrame.{refer_to}\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_cum_agg_doc_resample.partial_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_cum_agg_doc_resample.partial_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 323, "span_ids": ["impl:9"], "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": "doc_cum_agg = partial(\n doc_qc_method,\n template=\"\"\"\n Get cumulative {method} for every row or column.\n\n Parameters\n ----------\n fold_axis : {{0, 1}}\n skipna : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler of the same shape as `self`, where each element is the {method}\n of all the previous values in this row or column.\n \"\"\",\n refer_to_module_name=\"DataFrame\",\n)\n\ndoc_resample = partial(\n doc_qc_method,\n template=\"\"\"\n Resample time-series data and apply aggregation on it.\n\n Group data into intervals by time-series row/column with\n a specified frequency and {action}.\n\n Parameters\n ----------\n resample_kwargs : dict\n Resample parameters as expected by ``modin.pandas.DataFrame.resample`` signature.\n {extra_params}\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the result of resample aggregation built by the\n following rules:\n\n {build_rules}\n \"\"\",\n refer_to_module_name=\"resample.Resampler\",\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_reduce_doc_resample_reduce.return.doc_resample_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_reduce_doc_resample_reduce.return.doc_resample_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 326, "end_line": 380, "span_ids": ["doc_resample_reduce"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def doc_resample_reduce(result, refer_to, params=None, compatibility_params=True):\n \"\"\"\n Build decorator which adds docstring for the resample reduce method.\n\n Parameters\n ----------\n result : str\n The result of the method.\n refer_to : str\n Method name in ``modin.pandas.resample.Resampler`` module to refer to for\n more information about parameters and output format.\n params : str, optional\n Method parameters in the NumPy docstyle format to substitute\n to the docstring template.\n compatibility_params : bool, default: True\n Whether method takes `*args` and `**kwargs` that do not affect\n the result.\n\n Returns\n -------\n callable\n \"\"\"\n action = f\"compute {result} for each group\"\n\n params_substitution = (\n (\n \"\"\"\n *args : iterable\n Serves the compatibility purpose. Does not affect the result.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n \"\"\"\n )\n if compatibility_params\n else \"\"\n )\n\n if params:\n params_substitution = format_string(\n \"{params}\\n{params_substitution}\",\n params=params,\n params_substitution=params_substitution,\n )\n\n build_rules = f\"\"\"\n - Labels on the specified axis are the group names (time-stamps)\n - Labels on the opposite of specified axis are preserved.\n - Each element of QueryCompiler is the {result} for the\n corresponding group and column/row.\"\"\"\n return doc_resample(\n action=action,\n extra_params=params_substitution,\n build_rules=build_rules,\n refer_to=refer_to,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_agg_doc_resample_agg.return.doc_resample_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_agg_doc_resample_agg.return.doc_resample_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 431, "span_ids": ["doc_resample_agg"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def doc_resample_agg(action, output, refer_to, params=None):\n \"\"\"\n Build decorator which adds docstring for the resample aggregation method.\n\n Parameters\n ----------\n action : str\n What method does with the resampled data.\n output : str\n What is the content of column names in the result.\n refer_to : str\n Method name in ``modin.pandas.resample.Resampler`` module to refer to for\n more information about parameters and output format.\n params : str, optional\n Method parameters in the NumPy docstyle format to substitute\n to the docstring template.\n\n Returns\n -------\n callable\n \"\"\"\n action = f\"{action} for each group over the specified axis\"\n\n params_substitution = \"\"\"\n *args : iterable\n Positional arguments to pass to the aggregation function.\n **kwargs : dict\n Keyword arguments to pass to the aggregation function.\n \"\"\"\n\n if params:\n params_substitution = format_string(\n \"{params}\\n{params_substitution}\",\n params=params,\n params_substitution=params_substitution,\n )\n\n build_rules = f\"\"\"\n - Labels on the specified axis are the group names (time-stamps)\n - Labels on the opposite of specified axis are a MultiIndex, where first level\n contains preserved labels of this axis and the second level is the {output}.\n - Each element of QueryCompiler is the result of corresponding function for the\n corresponding group and column/row.\"\"\"\n return doc_resample(\n action=action,\n extra_params=params_substitution,\n build_rules=build_rules,\n refer_to=refer_to,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_fillna_doc_resample_fillna.return.doc_resample_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_resample_fillna_doc_resample_fillna.return.doc_resample_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 434, "end_line": 477, "span_ids": ["doc_resample_fillna"], "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": "def doc_resample_fillna(method, refer_to, params=None, overwrite_template_params=False):\n \"\"\"\n Build decorator which adds docstring for the resample fillna query compiler method.\n\n Parameters\n ----------\n method : str\n Fillna method name.\n refer_to : str\n Method name in ``modin.pandas.resample.Resampler`` module to refer to for\n more information about parameters and output format.\n params : str, optional\n Method parameters in the NumPy docstyle format to substitute\n to the docstring template.\n overwrite_template_params : bool, default: False\n If `params` is specified indicates whether to overwrite method parameters in\n the docstring template or append then at the end.\n\n Returns\n -------\n callable\n \"\"\"\n action = f\"fill missing values in each group independently using {method} method\"\n params_substitution = \"limit : int\\n\"\n\n if params:\n params_substitution = (\n params\n if overwrite_template_params\n else format_string(\n \"{params}\\n{params_substitution}\",\n params=params,\n params_substitution=params_substitution,\n )\n )\n\n build_rules = \"- QueryCompiler contains unsampled data with missing values filled.\"\n\n return doc_resample(\n action=action,\n extra_params=params_substitution,\n build_rules=build_rules,\n refer_to=refer_to,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_dt_doc_str_method.partial_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_dt_doc_str_method.partial_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 532, "span_ids": ["impl:13"], "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": "doc_dt = partial(\n doc_qc_method,\n template=\"\"\"\n Get {prop} for each {dt_type} value.\n {params}\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with the same shape as `self`, where each element is\n {prop} for the corresponding {dt_type} value.\n \"\"\",\n one_column_method=True,\n refer_to_module_name=\"Series.dt\",\n)\n\ndoc_dt_timestamp = partial(doc_dt, dt_type=\"datetime\")\ndoc_dt_interval = partial(doc_dt, dt_type=\"interval\")\ndoc_dt_period = partial(doc_dt, dt_type=\"period\")\n\ndoc_dt_round = partial(\n doc_qc_method,\n template=\"\"\"\n Perform {refer_to} operation on the underlying time-series data to the specified `freq`.\n\n Parameters\n ----------\n freq : str\n ambiguous : {{\"raise\", \"infer\", \"NaT\"}} or bool mask, default: \"raise\"\n nonexistent : {{\"raise\", \"shift_forward\", \"shift_backward\", \"NaT\"}} or timedelta, default: \"raise\"\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with performed {refer_to} operation on every element.\n \"\"\",\n one_column_method=True,\n refer_to_module_name=\"Series.dt\",\n)\n\ndoc_str_method = partial(\n doc_qc_method,\n template=\"\"\"\n Apply \"{refer_to}\" function to each string value in QueryCompiler.\n {params}\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the result of execution of the \"{refer_to}\" function\n against each string element.\n \"\"\",\n one_column_method=True,\n refer_to_module_name=\"Series.str\",\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_window_method_doc_window_method.return.doc_qc_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_window_method_doc_window_method.return.doc_qc_method_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 535, "end_line": 624, "span_ids": ["doc_window_method"], "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 doc_window_method(\n window_cls_name,\n result,\n refer_to,\n action=None,\n win_type=\"rolling window\",\n params=None,\n build_rules=\"aggregation\",\n):\n \"\"\"\n Build decorator which adds docstring for a window method.\n\n Parameters\n ----------\n window_cls_name : str\n The Window class the method is on.\n result : str\n The result of the method.\n refer_to : str\n Method name in ``modin.pandas.window.Window`` module to refer to\n for more information about parameters and output format.\n action : str, optional\n What method does with the created window.\n win_type : str, default: \"rolling_window\"\n Type of window that the method creates.\n params : str, optional\n Method parameters in the NumPy docstyle format to substitute\n to the docstring template.\n build_rules : str, default: \"aggregation\"\n Description of the data output format.\n\n Returns\n -------\n callable\n \"\"\"\n template = \"\"\"\n Create {win_type} and {action} for each window over the given axis.\n\n Parameters\n ----------\n fold_axis : {{0, 1}}\n {window_args_name} : list\n Rolling windows arguments with the same signature as ``modin.pandas.DataFrame.rolling``.\n {extra_params}\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing {result} for each window, built by the following\n rules:\n\n {build_rules}\n \"\"\"\n doc_build_rules = {\n \"aggregation\": f\"\"\"\n - Output QueryCompiler has the same shape and axes labels as the source.\n - Each element is the {result} for the corresponding window.\"\"\",\n \"udf_aggregation\": \"\"\"\n - Labels on the specified axis are preserved.\n - Labels on the opposite of specified axis are MultiIndex, where first level\n contains preserved labels of this axis and the second level has the function names.\n - Each element of QueryCompiler is the result of corresponding function for the\n corresponding window and column/row.\"\"\",\n }\n if action is None:\n action = f\"compute {result}\"\n if win_type == \"rolling window\":\n window_args_name = \"rolling_args\"\n elif win_type == \"expanding window\":\n window_args_name = \"expanding_args\"\n else:\n window_args_name = \"window_args\"\n\n # We need that `params` value ended with new line to have\n # an empty line between \"parameters\" and \"return\" sections\n if params and params[-1] != \"\\n\":\n params += \"\\n\"\n\n if params is None:\n params = \"\"\n\n return doc_qc_method(\n template,\n result=result,\n action=action,\n win_type=win_type,\n extra_params=params,\n build_rules=doc_build_rules.get(build_rules, build_rules),\n refer_to=f\"{window_cls_name}.{refer_to}\",\n window_args_name=window_args_name,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_groupby_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/doc_utils.py_doc_groupby_method_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/doc_utils.py", "file_name": "doc_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 627, "end_line": 690, "span_ids": ["doc_groupby_method"], "tokens": 528}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def doc_groupby_method(result, refer_to, action=None):\n \"\"\"\n Build decorator which adds docstring for the groupby reduce method.\n\n Parameters\n ----------\n result : str\n The result of reduce.\n refer_to : str\n Method name in ``modin.pandas.groupby`` module to refer to\n for more information about parameters and output format.\n action : str, optional\n What method does with groups.\n\n Returns\n -------\n callable\n \"\"\"\n template = \"\"\"\n Group QueryCompiler data and {action} for every group.\n\n Parameters\n ----------\n by : BaseQueryCompiler, column or index label, Grouper or list of such\n Object that determine groups.\n axis : {{0, 1}}\n Axis to group and apply aggregation function along.\n 0 is for index, when 1 is for columns.\n groupby_kwargs : dict\n GroupBy parameters as expected by ``modin.pandas.DataFrame.groupby`` signature.\n agg_args : list-like\n Positional arguments to pass to the `agg_func`.\n agg_kwargs : dict\n Key arguments to pass to the `agg_func`.\n drop : bool, default: False\n If `by` is a QueryCompiler indicates whether or not by-data came\n from the `self`.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing the result of groupby reduce built by the\n following rules:\n\n - Labels on the opposite of specified axis are preserved.\n - If groupby_args[\"as_index\"] is True then labels on the specified axis\n are the group names, otherwise labels would be default: 0, 1 ... n.\n - If groupby_args[\"as_index\"] is False, then first N columns/rows of the frame\n contain group names, where N is the columns/rows to group on.\n - Each element of QueryCompiler is the {result} for the\n corresponding group and column/row.\n\n .. warning\n `map_args` and `reduce_args` parameters are deprecated. They're leaked here from\n ``PandasQueryCompiler.groupby_*``, pandas storage format implements groupby via TreeReduce\n approach, but for other storage formats these parameters make no sense, and so they'll be removed in the future.\n \"\"\"\n if action is None:\n action = f\"compute {result}\"\n\n return doc_qc_method(\n template, result=result, action=action, refer_to=f\"GroupBy.{refer_to}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_abc__set_axis.return.axis_setter": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_abc__set_axis.return.axis_setter", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 90, "span_ids": ["_set_axis", "_get_axis", "docstring"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import abc\n\nfrom modin.core.dataframe.algebra.default2pandas import (\n DataFrameDefault,\n SeriesDefault,\n DateTimeDefault,\n StrDefault,\n BinaryDefault,\n ResampleDefault,\n RollingDefault,\n ExpandingDefault,\n CatDefault,\n GroupByDefault,\n SeriesGroupByDefault,\n)\nfrom modin.error_message import ErrorMessage\nfrom . import doc_utils\nfrom modin.logging import ClassLogger\nfrom modin.utils import MODIN_UNNAMED_SERIES_LABEL, try_cast_to_pandas\nfrom modin.config import StorageFormat\n\nfrom pandas.core.dtypes.common import is_scalar, is_number\nimport pandas.core.resample\nimport pandas\nfrom pandas._typing import IndexLabel, Suffixes, DtypeBackend\nimport numpy as np\nfrom typing import List, Hashable, Optional\n\n\ndef _get_axis(axis):\n \"\"\"\n Build index labels getter of the specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to get labels from.\n\n Returns\n -------\n callable(BaseQueryCompiler) -> pandas.Index\n \"\"\"\n\n def axis_getter(self):\n ErrorMessage.default_to_pandas(f\"DataFrame.get_axis({axis})\")\n return self.to_pandas().axes[axis]\n\n return axis_getter\n\n\ndef _set_axis(axis):\n \"\"\"\n Build index labels setter of the specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to set labels on.\n\n Returns\n -------\n callable(BaseQueryCompiler)\n \"\"\"\n\n def axis_setter(self, labels):\n new_qc = DataFrameDefault.register(pandas.DataFrame.set_axis)(\n self, axis=axis, labels=labels\n )\n self.__dict__.update(new_qc.__dict__)\n\n return axis_setter", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py__FIXME_many_of_the_Base_BaseQueryCompiler.__wrap_in_qc.None_1.else_.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py__FIXME_many_of_the_Base_BaseQueryCompiler.__wrap_in_qc.None_1.else_.return.obj", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 141, "span_ids": ["_set_axis", "BaseQueryCompiler.__wrap_in_qc", "BaseQueryCompiler"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# FIXME: many of the BaseQueryCompiler methods are hiding actual arguments\n# by using *args and **kwargs. They should be spread into actual parameters.\n# Currently actual arguments are placed in the methods docstrings, but since they're\n# not presented in the function's signature it makes linter to raise `PR02: unknown parameters`\n# warning. For now, they're silenced by using `noqa` (Modin issue #3108).\nclass BaseQueryCompiler(ClassLogger, abc.ABC):\n \"\"\"\n Abstract class that handles the queries to Modin dataframes.\n\n This class defines common query compilers API, most of the methods\n are already implemented and defaulting to pandas.\n\n Attributes\n ----------\n lazy_execution : bool\n Whether underlying execution engine is designed to be executed in a lazy mode only.\n If True, such QueryCompiler will be handled differently at the front-end in order\n to reduce execution triggering as much as possible.\n _shape_hint : {\"row\", \"column\", None}, default: None\n Shape hint for frames known to be a column or a row, otherwise None.\n\n Notes\n -----\n See the Abstract Methods and Fields section immediately below this\n for a list of requirements for subclassing this object.\n \"\"\"\n\n def __wrap_in_qc(self, obj):\n \"\"\"\n Wrap `obj` in query compiler.\n\n Parameters\n ----------\n obj : any\n Object to wrap.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler wrapping the object.\n \"\"\"\n if isinstance(obj, pandas.Series):\n if obj.name is None:\n obj.name = MODIN_UNNAMED_SERIES_LABEL\n obj = obj.to_frame()\n if isinstance(obj, pandas.DataFrame):\n return self.from_pandas(obj, type(self._modin_frame))\n else:\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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.default_to_pandas_BaseQueryCompiler.from_dataframe.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.default_to_pandas_BaseQueryCompiler.from_dataframe.pass", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 453, "span_ids": ["BaseQueryCompiler.default_to_pandas", "BaseQueryCompiler.add_prefix", "BaseQueryCompiler.from_arrow", "BaseQueryCompiler.to_numpy", "BaseQueryCompiler.from_dataframe", "BaseQueryCompiler.copy", "BaseQueryCompiler.free", "BaseQueryCompiler.to_pandas", "BaseQueryCompiler:3", "BaseQueryCompiler.concat", "BaseQueryCompiler.to_dataframe", "BaseQueryCompiler.add_suffix", "BaseQueryCompiler.from_pandas", "BaseQueryCompiler.finalize"], "tokens": 2124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n def default_to_pandas(self, pandas_op, *args, **kwargs):\n \"\"\"\n Do fallback to pandas for the passed function.\n\n Parameters\n ----------\n pandas_op : callable(pandas.DataFrame) -> object\n Function to apply to the casted to pandas frame.\n *args : iterable\n Positional arguments to pass to `pandas_op`.\n **kwargs : dict\n Key-value arguments to pass to `pandas_op`.\n\n Returns\n -------\n BaseQueryCompiler\n The result of the `pandas_op`, converted back to ``BaseQueryCompiler``.\n \"\"\"\n op_name = getattr(pandas_op, \"__name__\", str(pandas_op))\n ErrorMessage.default_to_pandas(op_name)\n args = try_cast_to_pandas(args)\n kwargs = try_cast_to_pandas(kwargs)\n\n result = pandas_op(try_cast_to_pandas(self), *args, **kwargs)\n if isinstance(result, (tuple, list)):\n return [self.__wrap_in_qc(obj) for obj in result]\n return self.__wrap_in_qc(result)\n\n # Abstract Methods and Fields: Must implement in children classes\n # In some cases, there you may be able to use the same implementation for\n # some of these abstract methods, but for the sake of generality they are\n # treated differently.\n\n lazy_execution = False\n _shape_hint = None\n\n # Metadata modification abstract methods\n def add_prefix(self, prefix, axis=1):\n \"\"\"\n Add string prefix to the index labels along specified axis.\n\n Parameters\n ----------\n prefix : str\n The string to add before each label.\n axis : {0, 1}, default: 1\n Axis to add prefix along. 0 is for index and 1 is for columns.\n\n Returns\n -------\n BaseQueryCompiler\n New query compiler with updated labels.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.add_prefix)(\n self, prefix=prefix, axis=axis\n )\n\n def add_suffix(self, suffix, axis=1):\n \"\"\"\n Add string suffix to the index labels along specified axis.\n\n Parameters\n ----------\n suffix : str\n The string to add after each label.\n axis : {0, 1}, default: 1\n Axis to add suffix along. 0 is for index and 1 is for columns.\n\n Returns\n -------\n BaseQueryCompiler\n New query compiler with updated labels.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.add_suffix)(\n self, suffix=suffix, axis=axis\n )\n\n # END Metadata modification abstract methods\n\n # Abstract copy\n\n def copy(self):\n \"\"\"\n Make a copy of this object.\n\n Returns\n -------\n BaseQueryCompiler\n Copy of self.\n\n Notes\n -----\n For copy, we don't want a situation where we modify the metadata of the\n copies if we end up modifying something here. We copy all of the metadata\n to prevent that.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.copy)(self)\n\n # END Abstract copy\n\n # Abstract join and append helper functions\n\n def concat(self, axis, other, **kwargs): # noqa: PR02\n \"\"\"\n Concatenate `self` with passed query compilers along specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to concatenate along. 0 is for index and 1 is for columns.\n other : BaseQueryCompiler or list of such\n Objects to concatenate with `self`.\n join : {'outer', 'inner', 'right', 'left'}, default: 'outer'\n Type of join that will be used if indices on the other axis are different.\n (note: if specified, has to be passed as ``join=value``).\n ignore_index : bool, default: False\n If True, do not use the index values along the concatenation axis.\n The resulting axis will be labeled 0, \u2026, n - 1.\n (note: if specified, has to be passed as ``ignore_index=value``).\n sort : bool, default: False\n Whether or not to sort non-concatenation axis.\n (note: if specified, has to be passed as ``sort=value``).\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Concatenated objects.\n \"\"\"\n concat_join = [\"inner\", \"outer\"]\n\n def concat(df, axis, other, **kwargs):\n kwargs.pop(\"join_axes\", None)\n ignore_index = kwargs.get(\"ignore_index\", False)\n if kwargs.get(\"join\", \"outer\") in concat_join:\n if not isinstance(other, list):\n other = [other]\n other = [df] + other\n result = pandas.concat(other, axis=axis, **kwargs)\n else:\n if isinstance(other, (list, np.ndarray)) and len(other) == 1:\n other = other[0]\n ignore_index = kwargs.pop(\"ignore_index\", None)\n kwargs[\"how\"] = kwargs.pop(\"join\", None)\n if (\n isinstance(other, (pandas.DataFrame, pandas.Series))\n or len(other) <= 1\n ):\n kwargs[\"rsuffix\"] = \"r_\"\n result = df.join(other, **kwargs)\n if ignore_index:\n if axis == 0:\n result = result.reset_index(drop=True)\n else:\n result.columns = pandas.RangeIndex(len(result.columns))\n return result\n\n return DataFrameDefault.register(concat)(self, axis=axis, other=other, **kwargs)\n\n # END Abstract join and append helper functions\n\n # Data Management Methods\n @abc.abstractmethod\n def free(self):\n \"\"\"Trigger a cleanup of this object.\"\"\"\n pass\n\n @abc.abstractmethod\n def finalize(self):\n \"\"\"Finalize constructing the dataframe calling all deferred functions which were used to build it.\"\"\"\n pass\n\n # END Data Management Methods\n\n # To/From Pandas\n @abc.abstractmethod\n def to_pandas(self):\n \"\"\"\n Convert underlying query compilers data to ``pandas.DataFrame``.\n\n Returns\n -------\n pandas.DataFrame\n The QueryCompiler converted to pandas.\n \"\"\"\n pass\n\n @classmethod\n @abc.abstractmethod\n def from_pandas(cls, df, data_cls):\n \"\"\"\n Build QueryCompiler from pandas DataFrame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n The pandas DataFrame to convert from.\n data_cls : type\n :py:class:`~modin.core.dataframe.pandas.dataframe.dataframe.PandasDataframe` class\n (or its descendant) to convert to.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing data from the pandas DataFrame.\n \"\"\"\n pass\n\n # END To/From Pandas\n\n # From Arrow\n @classmethod\n @abc.abstractmethod\n def from_arrow(cls, at, data_cls):\n \"\"\"\n Build QueryCompiler from Arrow Table.\n\n Parameters\n ----------\n at : Arrow Table\n The Arrow Table to convert from.\n data_cls : type\n :py:class:`~modin.core.dataframe.pandas.dataframe.dataframe.PandasDataframe` class\n (or its descendant) to convert to.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing data from the pandas DataFrame.\n \"\"\"\n pass\n\n # END From Arrow\n\n # To NumPy\n\n def to_numpy(self, **kwargs): # noqa: PR02\n \"\"\"\n Convert underlying query compilers data to NumPy array.\n\n Parameters\n ----------\n dtype : dtype\n The dtype of the resulted array.\n copy : bool\n Whether to ensure that the returned value is not a view on another array.\n na_value : object\n The value to replace missing values with.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n np.ndarray\n The QueryCompiler converted to NumPy array.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.to_numpy)(self, **kwargs)\n\n # END To NumPy\n\n # Dataframe exchange protocol\n\n @abc.abstractmethod\n def to_dataframe(self, nan_as_null: bool = False, allow_copy: bool = True):\n \"\"\"\n Get a DataFrame exchange protocol object representing data of the Modin DataFrame.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n nan_as_null : bool, default: False\n A keyword intended for the consumer to tell the producer\n to overwrite null values in the data with ``NaN`` (or ``NaT``).\n This currently has no effect; once support for nullable extension\n dtypes is added, this value should be propagated to columns.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n\n Returns\n -------\n ProtocolDataframe\n A dataframe object following the DataFrame protocol specification.\n \"\"\"\n pass\n\n @classmethod\n @abc.abstractmethod\n def from_dataframe(cls, df, data_cls):\n \"\"\"\n Build QueryCompiler from a DataFrame object supporting the dataframe exchange protocol `__dataframe__()`.\n\n Parameters\n ----------\n df : DataFrame\n The DataFrame object supporting the dataframe exchange protocol.\n data_cls : type\n :py:class:`~modin.core.dataframe.pandas.dataframe.dataframe.PandasDataframe` class\n (or its descendant) to convert to.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing data from the DataFrame.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler._END_Dataframe_exchange__BaseQueryCompiler.dot.return.BinaryDefault_register_ap": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler._END_Dataframe_exchange__BaseQueryCompiler.dot.return.BinaryDefault_register_ap", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 455, "end_line": 726, "span_ids": ["BaseQueryCompiler.eq", "BaseQueryCompiler.dot", "BaseQueryCompiler.series_to_dict", "BaseQueryCompiler.combine_first", "BaseQueryCompiler.gt", "BaseQueryCompiler.mod", "BaseQueryCompiler.add", "BaseQueryCompiler.from_dataframe", "BaseQueryCompiler.mul", "BaseQueryCompiler.rmul", "BaseQueryCompiler.floordiv", "BaseQueryCompiler.corrwith", "BaseQueryCompiler.dataframe_to_dict", "BaseQueryCompiler.combine", "BaseQueryCompiler.cov", "BaseQueryCompiler.align", "BaseQueryCompiler.lt", "BaseQueryCompiler.ge", "BaseQueryCompiler.divmod", "BaseQueryCompiler.to_list", "BaseQueryCompiler.le", "BaseQueryCompiler.corr"], "tokens": 2092}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n # END Dataframe exchange protocol\n\n def to_list(self):\n \"\"\"\n Return a list of the values.\n\n These are each a scalar type, which is a Python scalar (for str, int, float) or a pandas scalar (for Timestamp/Timedelta/Interval/Period).\n\n Returns\n -------\n list\n \"\"\"\n return SeriesDefault.register(pandas.Series.to_list)(self)\n\n @doc_utils.add_refer_to(\"DataFrame.to_dict\")\n def dataframe_to_dict(self, orient=\"dict\", into=dict, index=True): # noqa: PR01\n \"\"\"\n Convert the DataFrame to a dictionary.\n\n Returns\n -------\n dict or `into` instance\n \"\"\"\n return self.to_pandas().to_dict(orient, into, index)\n\n @doc_utils.add_refer_to(\"Series.to_dict\")\n def series_to_dict(self, into=dict): # noqa: PR01\n \"\"\"\n Convert the Series to a dictionary.\n\n Returns\n -------\n dict or `into` instance\n \"\"\"\n return SeriesDefault.register(pandas.Series.to_dict)(self, into)\n\n # Abstract inter-data operations (e.g. add, sub)\n # These operations require two DataFrames and will change the shape of the\n # data if the index objects don't match. An outer join + op is performed,\n # such that columns/rows that don't have an index on the other DataFrame\n # result in NaN values.\n\n @doc_utils.add_refer_to(\"DataFrame.align\")\n def align(self, other, **kwargs):\n \"\"\"\n Align two objects on their axes with the specified join method.\n\n Join method is specified for each axis Index.\n\n Parameters\n ----------\n other : BaseQueryCompiler\n **kwargs : dict\n Other arguments for aligning.\n\n Returns\n -------\n BaseQueryCompiler\n Aligned `self`.\n BaseQueryCompiler\n Aligned `other`.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.align)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"addition\", sign=\"+\")\n def add(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.add)(self, other=other, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.combine\")\n def combine(self, other, **kwargs): # noqa: PR02\n \"\"\"\n Perform column-wise combine with another QueryCompiler with passed `func`.\n\n If axes are not equal, perform frames alignment first.\n\n Parameters\n ----------\n other : BaseQueryCompiler\n Left operand of the binary operation.\n func : callable(pandas.Series, pandas.Series) -> pandas.Series\n Function that takes two ``pandas.Series`` with aligned axes\n and returns one ``pandas.Series`` as resulting combination.\n fill_value : float or None\n Value to fill missing values with after frame alignment occurred.\n overwrite : bool\n If True, columns in `self` that do not exist in `other`\n will be overwritten with NaNs.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Result of combine.\n \"\"\"\n return BinaryDefault.register(pandas.DataFrame.combine)(\n self, other=other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.combine_first\")\n def combine_first(self, other, **kwargs): # noqa: PR02\n \"\"\"\n Fill null elements of `self` with value in the same location in `other`.\n\n If axes are not equal, perform frames alignment first.\n\n Parameters\n ----------\n other : BaseQueryCompiler\n Provided frame to use to fill null values from.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return BinaryDefault.register(pandas.DataFrame.combine_first)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"equality comparison\", sign=\"==\")\n def eq(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.eq)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(operation=\"integer division\", sign=\"//\")\n def floordiv(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.floordiv)(\n self, other=other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"Series.divmod\")\n def divmod(self, other, **kwargs):\n \"\"\"\n Return Integer division and modulo of `self` and `other`, element-wise (binary operator divmod).\n\n Equivalent to divmod(`self`, `other`), but with support to substitute a fill_value for missing data in either one of the inputs.\n\n Parameters\n ----------\n other : BaseQueryCompiler or scalar value\n **kwargs : dict\n Other arguments for division.\n\n Returns\n -------\n BaseQueryCompiler\n Compiler representing Series with divisor part of division.\n BaseQueryCompiler\n Compiler representing Series with modulo part of division.\n \"\"\"\n return SeriesDefault.register(pandas.Series.divmod)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(\n operation=\"greater than or equal comparison\", sign=\">=\", op_type=\"comparison\"\n )\n def ge(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.ge)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(\n operation=\"greater than comparison\", sign=\">\", op_type=\"comparison\"\n )\n def gt(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.gt)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(\n operation=\"less than or equal comparison\", sign=\"<=\", op_type=\"comparison\"\n )\n def le(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.le)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(\n operation=\"less than comparison\", sign=\"<\", op_type=\"comparison\"\n )\n def lt(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.lt)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(operation=\"modulo\", sign=\"%\")\n def mod(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.mod)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(operation=\"multiplication\", sign=\"*\")\n def mul(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.mul)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(\n operation=\"multiplication\", sign=\"*\", self_on_right=True\n )\n def rmul(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.rmul)(\n self, other=other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.corr\")\n def corr(self, **kwargs): # noqa: PR02\n \"\"\"\n Compute pairwise correlation of columns, excluding NA/null values.\n\n Parameters\n ----------\n method : {'pearson', 'kendall', 'spearman'} or callable(pandas.Series, pandas.Series) -> pandas.Series\n Correlation method.\n min_periods : int\n Minimum number of observations required per pair of columns\n to have a valid result. If fewer than `min_periods` non-NA values\n are present the result will be NA.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Correlation matrix.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.corr)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.corrwith\")\n def corrwith(self, **kwargs): # noqa: PR01\n \"\"\"\n Compute pairwise correlation.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.corrwith)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.cov\")\n def cov(self, **kwargs): # noqa: PR02\n \"\"\"\n Compute pairwise covariance of columns, excluding NA/null values.\n\n Parameters\n ----------\n min_periods : int\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Covariance matrix.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.cov)(self, **kwargs)\n\n def dot(self, other, **kwargs): # noqa: PR02\n \"\"\"\n Compute the matrix multiplication of `self` and `other`.\n\n Parameters\n ----------\n other : BaseQueryCompiler or NumPy array\n The other query compiler or NumPy array to matrix multiply with `self`.\n squeeze_self : boolean\n If `self` is a one-column query compiler, indicates whether it represents Series object.\n squeeze_other : boolean\n If `other` is a one-column query compiler, indicates whether it represents Series object.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n A new query compiler that contains result of the matrix multiply.\n \"\"\"\n if kwargs.get(\"squeeze_self\", False):\n applyier = pandas.Series.dot\n else:\n applyier = pandas.DataFrame.dot\n return BinaryDefault.register(applyier)(self, other=other, **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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.ne_BaseQueryCompiler.rdivmod.return.SeriesDefault_register_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.ne_BaseQueryCompiler.rdivmod.return.SeriesDefault_register_pa", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 728, "end_line": 766, "span_ids": ["BaseQueryCompiler.pow", "BaseQueryCompiler.radd", "BaseQueryCompiler.ne", "BaseQueryCompiler.rdivmod"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_binary_method(\n operation=\"not equal comparison\", sign=\"!=\", op_type=\"comparison\"\n )\n def ne(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.ne)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(operation=\"exponential power\", sign=\"**\")\n def pow(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.pow)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(operation=\"addition\", sign=\"+\", self_on_right=True)\n def radd(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.radd)(\n self, other=other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"Series.rdivmod\")\n def rdivmod(self, other, **kwargs):\n \"\"\"\n Return Integer division and modulo of `self` and `other`, element-wise (binary operator rdivmod).\n\n Equivalent to `other` divmod `self`, but with support to substitute a fill_value for missing data in either one of the inputs.\n\n Parameters\n ----------\n other : BaseQueryCompiler or scalar value\n **kwargs : dict\n Other arguments for division.\n\n Returns\n -------\n BaseQueryCompiler\n Compiler representing Series with divisor part of division.\n BaseQueryCompiler\n Compiler representing Series with modulo part of division.\n \"\"\"\n return SeriesDefault.register(pandas.Series.rdivmod)(\n self, other=other, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rfloordiv_BaseQueryCompiler.merge.return.DataFrameDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rfloordiv_BaseQueryCompiler.merge.return.DataFrameDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 768, "end_line": 1015, "span_ids": ["BaseQueryCompiler.__rxor__", "BaseQueryCompiler.rsub", "BaseQueryCompiler.series_update", "BaseQueryCompiler.rmod", "BaseQueryCompiler.rtruediv", "BaseQueryCompiler.__rand__", "BaseQueryCompiler.rfloordiv", "BaseQueryCompiler.truediv", "BaseQueryCompiler.df_update", "BaseQueryCompiler.rpow", "BaseQueryCompiler.asfreq", "BaseQueryCompiler.where", "BaseQueryCompiler.merge", "BaseQueryCompiler.__or__", "BaseQueryCompiler.sub", "BaseQueryCompiler.__xor__", "BaseQueryCompiler.__ror__", "BaseQueryCompiler.__and__", "BaseQueryCompiler.clip"], "tokens": 2083}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_binary_method(\n operation=\"integer division\", sign=\"//\", self_on_right=True\n )\n def rfloordiv(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.rfloordiv)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"modulo\", sign=\"%\", self_on_right=True)\n def rmod(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.rmod)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(\n operation=\"exponential power\", sign=\"**\", self_on_right=True\n )\n def rpow(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.rpow)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"subtraction\", sign=\"-\", self_on_right=True)\n def rsub(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.rsub)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"division\", sign=\"/\", self_on_right=True)\n def rtruediv(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.rtruediv)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"subtraction\", sign=\"-\")\n def sub(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.sub)(self, other=other, **kwargs)\n\n @doc_utils.doc_binary_method(operation=\"division\", sign=\"/\")\n def truediv(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.truediv)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"conjunction\", sign=\"&\", op_type=\"logical\")\n def __and__(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.__and__)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"disjunction\", sign=\"|\", op_type=\"logical\")\n def __or__(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.__or__)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(\n operation=\"conjunction\", sign=\"&\", op_type=\"logical\", self_on_right=True\n )\n def __rand__(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.__rand__)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(\n operation=\"disjunction\", sign=\"|\", op_type=\"logical\", self_on_right=True\n )\n def __ror__(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.__ror__)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(\n operation=\"exclusive or\", sign=\"^\", op_type=\"logical\", self_on_right=True\n )\n def __rxor__(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.__rxor__)(\n self, other=other, **kwargs\n )\n\n @doc_utils.doc_binary_method(operation=\"exclusive or\", sign=\"^\", op_type=\"logical\")\n def __xor__(self, other, **kwargs): # noqa: PR02\n return BinaryDefault.register(pandas.DataFrame.__xor__)(\n self, other=other, **kwargs\n )\n\n # FIXME: query compiler shoudln't care about differences between Frame and Series.\n # We should combine `df_update` and `series_update` into one method (Modin issue #3101).\n @doc_utils.add_refer_to(\"DataFrame.update\")\n def df_update(self, other, **kwargs): # noqa: PR02\n \"\"\"\n Update values of `self` using non-NA values of `other` at the corresponding positions.\n\n If axes are not equal, perform frames alignment first.\n\n Parameters\n ----------\n other : BaseQueryCompiler\n Frame to grab replacement values from.\n join : {\"left\"}\n Specify type of join to align frames if axes are not equal\n (note: currently only one type of join is implemented).\n overwrite : bool\n Whether to overwrite every corresponding value of self, or only if it's NAN.\n filter_func : callable(pandas.Series, pandas.Series) -> numpy.ndarray\n Function that takes column of the self and return bool mask for values, that\n should be overwritten in the self frame.\n errors : {\"raise\", \"ignore\"}\n If \"raise\", will raise a ``ValueError`` if `self` and `other` both contain\n non-NA data in the same place.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated values.\n \"\"\"\n return BinaryDefault.register(pandas.DataFrame.update, inplace=True)(\n self, other=other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"Series.update\")\n def series_update(self, other, **kwargs): # noqa: PR02\n \"\"\"\n Update values of `self` using values of `other` at the corresponding indices.\n\n Parameters\n ----------\n other : BaseQueryCompiler\n One-column query compiler with updated values.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated values.\n \"\"\"\n return BinaryDefault.register(pandas.Series.update, inplace=True)(\n self,\n other=other,\n squeeze_self=True,\n squeeze_other=True,\n **kwargs,\n )\n\n @doc_utils.add_refer_to(\"DataFrame.asfreq\")\n def asfreq(self, **kwargs): # noqa: PR01\n \"\"\"\n Convert time series to specified frequency.\n\n Returns the original data conformed to a new index with the specified frequency.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler reindexed to the specified frequency.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.asfreq)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.clip\")\n def clip(self, lower, upper, **kwargs): # noqa: PR02\n \"\"\"\n Trim values at input threshold.\n\n Parameters\n ----------\n lower : float or list-like\n upper : float or list-like\n axis : {0, 1}\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with values limited by the specified thresholds.\n \"\"\"\n if isinstance(lower, BaseQueryCompiler):\n lower = lower.to_pandas().squeeze(1)\n if isinstance(upper, BaseQueryCompiler):\n upper = upper.to_pandas().squeeze(1)\n return DataFrameDefault.register(pandas.DataFrame.clip)(\n self, lower=lower, upper=upper, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.where\")\n def where(self, cond, other, **kwargs): # noqa: PR02\n \"\"\"\n Update values of `self` using values from `other` at positions where `cond` is False.\n\n Parameters\n ----------\n cond : BaseQueryCompiler\n Boolean mask. True - keep the self value, False - replace by `other` value.\n other : BaseQueryCompiler or pandas.Series\n Object to grab replacement values from.\n axis : {0, 1}\n Axis to align frames along if axes of self, `cond` and `other` are not equal.\n 0 is for index, when 1 is for columns.\n level : int or label, optional\n Level of MultiIndex to align frames along if axes of self, `cond`\n and `other` are not equal. Currently `level` parameter is not implemented,\n so only None value is acceptable.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with updated data.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.where)(\n self, cond=cond, other=other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.merge\")\n def merge(self, right, **kwargs): # noqa: PR02\n \"\"\"\n Merge QueryCompiler objects using a database-style join.\n\n Parameters\n ----------\n right : BaseQueryCompiler\n QueryCompiler of the right frame to merge with.\n how : {\"left\", \"right\", \"outer\", \"inner\", \"cross\"}\n on : label or list of such\n left_on : label or list of such\n right_on : label or list of such\n left_index : bool\n right_index : bool\n sort : bool\n suffixes : list-like\n copy : bool\n indicator : bool or str\n validate : str\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler that contains result of the merge.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.merge)(\n self, right=right, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.merge_ordered_BaseQueryCompiler.merge_asof._Now_merged_right_label": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.merge_ordered_BaseQueryCompiler.merge_asof._Now_merged_right_label", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1017, "end_line": 1130, "span_ids": ["BaseQueryCompiler._get_column_as_pandas_series", "BaseQueryCompiler.merge_asof", "BaseQueryCompiler.merge_ordered"], "tokens": 956}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.add_refer_to(\"merge_ordered\")\n def merge_ordered(self, right, **kwargs): # noqa: PR01\n \"\"\"\n Perform a merge for ordered data with optional filling/interpolation.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.merge_ordered)(self, right, **kwargs)\n\n def _get_column_as_pandas_series(self, key):\n \"\"\"\n Get column data by label as pandas.Series.\n\n Parameters\n ----------\n key : Any\n Column label.\n\n Returns\n -------\n pandas.Series\n \"\"\"\n result = self.getitem_array([key]).to_pandas().squeeze(axis=1)\n if not isinstance(result, pandas.Series):\n raise RuntimeError(\n f\"Expected getting column {key} to give \"\n + f\"pandas.Series, but instead got {type(result)}\"\n )\n return result\n\n def merge_asof(\n self,\n right: \"BaseQueryCompiler\",\n left_on: Optional[IndexLabel] = None,\n right_on: Optional[IndexLabel] = None,\n left_index: bool = False,\n right_index: bool = False,\n left_by=None,\n right_by=None,\n suffixes: Suffixes = (\"_x\", \"_y\"),\n tolerance=None,\n allow_exact_matches: bool = True,\n direction: str = \"backward\",\n ):\n # Pandas fallbacks for tricky cases:\n if (\n # No idea how this works or why it does what it does; and in fact\n # there's a Pandas bug suggesting it's wrong:\n # https://github.com/pandas-dev/pandas/issues/33463\n (left_index and right_on is not None)\n # This is the case where by is a list of columns. If we're copying lots\n # of columns out of Pandas, maybe not worth trying our path, it's not\n # clear it's any better:\n or not (left_by is None or is_scalar(left_by))\n or not (right_by is None or is_scalar(right_by))\n # The implementation below assumes that the right index is unique\n # because it uses merge_asof to map each position in the merged\n # index to the label of the one right row that should be merged\n # at that row position.\n or not right.index.is_unique\n ):\n return self.default_to_pandas(\n pandas.merge_asof,\n right,\n left_on=left_on,\n right_on=right_on,\n left_index=left_index,\n right_index=right_index,\n left_by=left_by,\n right_by=right_by,\n suffixes=suffixes,\n tolerance=tolerance,\n allow_exact_matches=allow_exact_matches,\n direction=direction,\n )\n\n if left_on is None:\n left_column = self.index\n else:\n left_column = self._get_column_as_pandas_series(left_on)\n\n if right_on is None:\n right_column = right.index\n else:\n right_column = right._get_column_as_pandas_series(right_on)\n\n left_pandas_limited = {\"on\": left_column}\n right_pandas_limited = {\"on\": right_column, \"right_labels\": right.index}\n extra_kwargs = {} # extra arguments to Pandas merge_asof\n\n if left_by is not None or right_by is not None:\n extra_kwargs[\"by\"] = \"by\"\n left_pandas_limited[\"by\"] = self._get_column_as_pandas_series(left_by)\n right_pandas_limited[\"by\"] = right._get_column_as_pandas_series(right_by)\n\n # 1. Construct Pandas DataFrames with just the 'on' and optional 'by'\n # columns, and the index as another column.\n left_pandas_limited = pandas.DataFrame(left_pandas_limited, index=self.index)\n right_pandas_limited = pandas.DataFrame(right_pandas_limited)\n\n # 2. Use Pandas' merge_asof to figure out how to map labels on left to\n # labels on the right.\n merged = pandas.merge_asof(\n left_pandas_limited,\n right_pandas_limited,\n on=\"on\",\n direction=direction,\n allow_exact_matches=allow_exact_matches,\n tolerance=tolerance,\n **extra_kwargs,\n )\n # Now merged[\"right_labels\"] shows which labels from right map to left's index.\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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.merge_asof._3_Re_index_right_using_BaseQueryCompiler.pct_change.return.DataFrameDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.merge_asof._3_Re_index_right_using_BaseQueryCompiler.pct_change.return.DataFrameDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1132, "end_line": 1424, "span_ids": ["BaseQueryCompiler.transpose", "BaseQueryCompiler.columnarize", "BaseQueryCompiler.merge_asof", "BaseQueryCompiler.min", "BaseQueryCompiler.sum", "BaseQueryCompiler.set_index_from_columns", "BaseQueryCompiler.is_series_like", "BaseQueryCompiler.is_monotonic_increasing", "BaseQueryCompiler.pct_change", "BaseQueryCompiler.join", "BaseQueryCompiler.max", "BaseQueryCompiler.prod", "BaseQueryCompiler.reindex", "BaseQueryCompiler.mask", "BaseQueryCompiler.count", "BaseQueryCompiler.mean", "BaseQueryCompiler.is_monotonic_decreasing", "BaseQueryCompiler.reset_index"], "tokens": 2222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n def merge_asof(\n self,\n right: \"BaseQueryCompiler\",\n left_on: Optional[IndexLabel] = None,\n right_on: Optional[IndexLabel] = None,\n left_index: bool = False,\n right_index: bool = False,\n left_by=None,\n right_by=None,\n suffixes: Suffixes = (\"_x\", \"_y\"),\n tolerance=None,\n allow_exact_matches: bool = True,\n direction: str = \"backward\",\n ):\n\n # 3. Re-index right using the merged[\"right_labels\"]; at this point right\n # should be same length and (semantically) same order as left:\n right_subset = right.reindex(\n axis=0, labels=pandas.Index(merged[\"right_labels\"])\n )\n if not right_index:\n right_subset = right_subset.drop(columns=[right_on])\n if right_by is not None and left_by == right_by:\n right_subset = right_subset.drop(columns=[right_by])\n right_subset.index = self.index\n\n # 4. Merge left and the new shrunken right:\n result = self.merge(\n right_subset,\n left_index=True,\n right_index=True,\n suffixes=suffixes,\n how=\"left\",\n )\n\n # 5. Clean up to match Pandas output:\n if left_on is not None and right_index:\n result = result.insert(\n # In theory this could use get_indexer_for(), but that causes an error:\n list(result.columns).index(left_on + suffixes[0]),\n left_on,\n result.getitem_array([left_on + suffixes[0]]),\n )\n if not left_index and not right_index:\n result = result.reset_index(drop=True)\n\n return result\n\n @doc_utils.add_refer_to(\"DataFrame.join\")\n def join(self, right, **kwargs): # noqa: PR02\n \"\"\"\n Join columns of another QueryCompiler.\n\n Parameters\n ----------\n right : BaseQueryCompiler\n QueryCompiler of the right frame to join with.\n on : label or list of such\n how : {\"left\", \"right\", \"outer\", \"inner\"}\n lsuffix : str\n rsuffix : str\n sort : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler that contains result of the join.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.join)(self, right, **kwargs)\n\n # END Abstract inter-data operations\n\n # Abstract Transpose\n def transpose(self, *args, **kwargs): # noqa: PR02\n \"\"\"\n Transpose this QueryCompiler.\n\n Parameters\n ----------\n copy : bool\n Whether to copy the data after transposing.\n *args : iterable\n Serves the compatibility purpose. Does not affect the result.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Transposed new QueryCompiler.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.transpose)(\n self, *args, **kwargs\n )\n\n def columnarize(self):\n \"\"\"\n Transpose this QueryCompiler if it has a single row but multiple columns.\n\n This method should be called for QueryCompilers representing a Series object,\n i.e. ``self.is_series_like()`` should be True.\n\n Returns\n -------\n BaseQueryCompiler\n Transposed new QueryCompiler or self.\n \"\"\"\n if self._shape_hint == \"column\":\n return self\n\n if len(self.columns) != 1 or (\n len(self.index) == 1 and self.index[0] == MODIN_UNNAMED_SERIES_LABEL\n ):\n return self.transpose()\n return self\n\n def is_series_like(self):\n \"\"\"\n Check whether this QueryCompiler can represent ``modin.pandas.Series`` object.\n\n Returns\n -------\n bool\n Return True if QueryCompiler has a single column or row, False otherwise.\n \"\"\"\n return len(self.columns) == 1 or len(self.index) == 1\n\n # END Abstract Transpose\n\n # Abstract reindex/reset_index (may shuffle data)\n @doc_utils.add_refer_to(\"DataFrame.reindex\")\n def reindex(self, axis, labels, **kwargs): # noqa: PR02\n \"\"\"\n Align QueryCompiler data with a new index along specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to align labels along. 0 is for index, 1 is for columns.\n labels : list-like\n Index-labels to align with.\n method : {None, \"backfill\"/\"bfill\", \"pad\"/\"ffill\", \"nearest\"}\n Method to use for filling holes in reindexed frame.\n fill_value : scalar\n Value to use for missing values in the resulted frame.\n limit : int\n tolerance : int\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with aligned axis.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.reindex)(\n self, axis=axis, labels=labels, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.reset_index\")\n def reset_index(self, **kwargs): # noqa: PR02\n \"\"\"\n Reset the index, or a level of it.\n\n Parameters\n ----------\n drop : bool\n Whether to drop the reset index or insert it at the beginning of the frame.\n level : int or label, optional\n Level to remove from index. Removes all levels by default.\n col_level : int or label\n If the columns have multiple levels, determines which level the labels\n are inserted into.\n col_fill : label\n If the columns have multiple levels, determines how the other levels\n are named.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with reset index.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.reset_index)(self, **kwargs)\n\n def set_index_from_columns(\n self, keys: List[Hashable], drop: bool = True, append: bool = False\n ):\n \"\"\"\n Create new row labels from a list of columns.\n\n Parameters\n ----------\n keys : list of hashable\n The list of column names that will become the new index.\n drop : bool, default: True\n Whether or not to drop the columns provided in the `keys` argument.\n append : bool, default: True\n Whether or not to add the columns in `keys` as new levels appended to the\n existing index.\n\n Returns\n -------\n BaseQueryCompiler\n A new QueryCompiler with updated index.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.set_index)(\n self, keys=keys, drop=drop, append=append\n )\n\n # END Abstract reindex/reset_index\n\n # Full Reduce operations\n #\n # These operations result in a reduced dimensionality of data.\n # Currently, this means a Pandas Series will be returned, but in the future\n # we will implement a Distributed Series, and this will be returned\n # instead.\n\n def is_monotonic_increasing(self):\n \"\"\"\n Return boolean if values in the object are monotonically increasing.\n\n Returns\n -------\n bool\n \"\"\"\n return SeriesDefault.register(pandas.Series.is_monotonic_increasing)(self)\n\n def is_monotonic_decreasing(self):\n \"\"\"\n Return boolean if values in the object are monotonically decreasing.\n\n Returns\n -------\n bool\n \"\"\"\n return SeriesDefault.register(pandas.Series.is_monotonic_decreasing)(self)\n\n @doc_utils.doc_reduce_agg(\n method=\"number of non-NaN values\", refer_to=\"count\", extra_params=[\"**kwargs\"]\n )\n def count(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.count)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"maximum value\", refer_to=\"max\", extra_params=[\"skipna\", \"**kwargs\"]\n )\n def max(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.max)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"mean value\", refer_to=\"mean\", extra_params=[\"skipna\", \"**kwargs\"]\n )\n def mean(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.mean)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"minimum value\", refer_to=\"min\", extra_params=[\"skipna\", \"**kwargs\"]\n )\n def min(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.min)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"production\",\n refer_to=\"prod\",\n extra_params=[\"**kwargs\"],\n params=\"axis : {0, 1}\",\n )\n def prod(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.prod)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"sum\",\n refer_to=\"sum\",\n extra_params=[\"**kwargs\"],\n params=\"axis : {0, 1}\",\n )\n def sum(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.sum)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.mask\")\n def mask(self, cond, other, **kwargs): # noqa: PR01\n \"\"\"\n Replace values where the condition `cond` is True.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with elements replaced with ones from `other` where `cond` is True.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.mask)(\n self, cond, other, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.pct_change\")\n def pct_change(self, **kwargs): # noqa: PR01\n \"\"\"\n Percentage change between the current and a prior element.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.pct_change)(self, **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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.to_datetime_BaseQueryCompiler.to_numeric.return.SeriesDefault_register_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.to_datetime_BaseQueryCompiler.to_numeric.return.SeriesDefault_register_pa", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1426, "end_line": 1719, "span_ids": ["BaseQueryCompiler.to_datetime", "BaseQueryCompiler.isna", "BaseQueryCompiler.notna", "BaseQueryCompiler.series_view", "BaseQueryCompiler.to_numeric", "BaseQueryCompiler.interpolate", "BaseQueryCompiler.isin", "BaseQueryCompiler.abs", "BaseQueryCompiler.conj", "BaseQueryCompiler.argsort", "BaseQueryCompiler.replace", "BaseQueryCompiler.round", "BaseQueryCompiler.applymap", "BaseQueryCompiler.negative"], "tokens": 2093}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.add_refer_to(\"to_datetime\")\n def to_datetime(self, *args, **kwargs):\n \"\"\"\n Convert columns of the QueryCompiler to the datetime dtype.\n\n Parameters\n ----------\n *args : iterable\n **kwargs : dict\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with all columns converted to datetime dtype.\n \"\"\"\n return SeriesDefault.register(pandas.to_datetime)(self, *args, **kwargs)\n\n # END Abstract full Reduce operations\n\n # Abstract map partitions operations\n # These operations are operations that apply a function to every partition.\n def abs(self):\n \"\"\"\n Get absolute numeric value of each element.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with absolute numeric value of each element.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.abs)(self)\n\n def applymap(self, func, *args, **kwargs):\n \"\"\"\n Apply passed function elementwise.\n\n Parameters\n ----------\n func : callable(scalar) -> scalar\n Function to apply to each element of the QueryCompiler.\n *args : iterable\n **kwargs : dict\n\n Returns\n -------\n BaseQueryCompiler\n Transformed QueryCompiler.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.applymap)(\n self, func, *args, **kwargs\n )\n\n # FIXME: `**kwargs` which follows `numpy.conj` signature was inherited\n # from ``PandasQueryCompiler``, we should get rid of this dependency.\n # (Modin issue #3108)\n def conj(self, **kwargs):\n \"\"\"\n Get the complex conjugate for every element of self.\n\n Parameters\n ----------\n **kwargs : dict\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with conjugate applied element-wise.\n\n Notes\n -----\n Please refer to ``numpy.conj`` for parameters description.\n \"\"\"\n\n def conj(df, *args, **kwargs):\n return pandas.DataFrame(np.conj(df))\n\n return DataFrameDefault.register(conj)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.interpolate\")\n def interpolate(self, **kwargs): # noqa: PR01\n \"\"\"\n Fill NaN values using an interpolation method.\n\n Returns\n -------\n BaseQueryCompiler\n Returns the same object type as the caller, interpolated at some or all NaN values.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.interpolate)(self, **kwargs)\n\n # FIXME:\n # 1. This function takes Modin Series and DataFrames via `values` parameter,\n # we should avoid leaking of the high-level objects to the query compiler level.\n # (Modin issue #3106)\n # 2. Spread **kwargs into actual arguments (Modin issue #3108).\n def isin(self, values, ignore_indices=False, **kwargs): # noqa: PR02\n \"\"\"\n Check for each element of `self` whether it's contained in passed `values`.\n\n Parameters\n ----------\n values : list-like, modin.pandas.Series, modin.pandas.DataFrame or dict\n Values to check elements of self in.\n ignore_indices : bool, default: False\n Whether to execute ``isin()`` only on an intersection of indices.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n Boolean mask for self of whether an element at the corresponding\n position is contained in `values`.\n \"\"\"\n shape_hint = kwargs.pop(\"shape_hint\", None)\n if isinstance(values, type(self)) and ignore_indices:\n # Pandas logic is that it ignores indexing if 'values' is a 1D object\n values = values.to_pandas().squeeze(axis=1)\n if shape_hint == \"column\":\n return SeriesDefault.register(pandas.Series.isin)(self, values, **kwargs)\n else:\n return DataFrameDefault.register(pandas.DataFrame.isin)(\n self, values, **kwargs\n )\n\n def isna(self):\n \"\"\"\n Check for each element of self whether it's NaN.\n\n Returns\n -------\n BaseQueryCompiler\n Boolean mask for self of whether an element at the corresponding\n position is NaN.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.isna)(self)\n\n # FIXME: this method is not supposed to take any parameters (Modin issue #3108).\n def negative(self, **kwargs):\n \"\"\"\n Change the sign for every value of self.\n\n Parameters\n ----------\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n\n Notes\n -----\n Be aware, that all QueryCompiler values have to be numeric.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.__neg__)(self, **kwargs)\n\n def notna(self):\n \"\"\"\n Check for each element of `self` whether it's existing (non-missing) value.\n\n Returns\n -------\n BaseQueryCompiler\n Boolean mask for `self` of whether an element at the corresponding\n position is not NaN.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.notna)(self)\n\n @doc_utils.add_refer_to(\"DataFrame.round\")\n def round(self, **kwargs): # noqa: PR02\n \"\"\"\n Round every numeric value up to specified number of decimals.\n\n Parameters\n ----------\n decimals : int or list-like\n Number of decimals to round each column to.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with rounded values.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.round)(self, **kwargs)\n\n # FIXME:\n # 1. high-level objects leaks to the query compiler (Modin issue #3106).\n # 2. remove `inplace` parameter.\n @doc_utils.add_refer_to(\"DataFrame.replace\")\n def replace(self, **kwargs): # noqa: PR02\n \"\"\"\n Replace values given in `to_replace` by `value`.\n\n Parameters\n ----------\n to_replace : scalar, list-like, regex, modin.pandas.Series, or None\n value : scalar, list-like, regex or dict\n inplace : {False}\n This parameter serves the compatibility purpose. Always has to be False.\n limit : int or None\n regex : bool or same types as `to_replace`\n method : {\"pad\", \"ffill\", \"bfill\", None}\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with all `to_replace` values replaced by `value`.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.replace)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"Series.argsort\")\n def argsort(self, **kwargs): # noqa: PR02\n \"\"\"\n Return the integer indices that would sort the Series values.\n\n Override ndarray.argsort. Argsorts the value, omitting NA/null values,\n and places the result in the same locations as the non-NA values.\n\n Parameters\n ----------\n axis : {0 or 'index'}\n Unused. Parameter needed for compatibility with DataFrame.\n kind : {'mergesort', 'quicksort', 'heapsort', 'stable'}, default 'quicksort'\n Choice of sorting algorithm. See :func:`numpy.sort` for more\n information. 'mergesort' and 'stable' are the only stable algorithms.\n order : None\n Has no effect but is accepted for compatibility with NumPy.\n **kwargs : dict\n Serves compatibility purposes.\n\n Returns\n -------\n BaseQueryCompiler\n One-column QueryCompiler with positions of values within the\n sort order with -1 indicating nan values.\n \"\"\"\n return SeriesDefault.register(pandas.Series.argsort)(self, **kwargs)\n\n @doc_utils.add_one_column_warning\n # FIXME: adding refer-to note will create two instances of the \"Notes\" section,\n # this breaks numpydoc style rules and also crashes the doc-style checker script.\n # For now manually added the refer-to message.\n # @doc_utils.add_refer_to(\"Series.view\")\n def series_view(self, **kwargs): # noqa: PR02\n \"\"\"\n Reinterpret underlying data with new dtype.\n\n Parameters\n ----------\n dtype : dtype\n Data type to reinterpret underlying data with.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler of the same data in memory, with reinterpreted values.\n\n Notes\n -----\n - Be aware, that if this method do fallback to pandas, then newly created\n QueryCompiler will be the copy of the original data.\n - Please refer to ``modin.pandas.Series.view`` for more information\n about parameters and output format.\n \"\"\"\n return SeriesDefault.register(pandas.Series.view)(self, **kwargs)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"to_numeric\")\n def to_numeric(self, *args, **kwargs): # noqa: PR02\n \"\"\"\n Convert underlying data to numeric dtype.\n\n Parameters\n ----------\n errors : {\"ignore\", \"raise\", \"coerce\"}\n downcast : {\"integer\", \"signed\", \"unsigned\", \"float\", None}\n *args : iterable\n Serves the compatibility purpose. Does not affect the result.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with converted to numeric values.\n \"\"\"\n return SeriesDefault.register(pandas.to_numeric)(self, *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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.to_timedelta_BaseQueryCompiler.idxmin.return.DataFrameDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.to_timedelta_BaseQueryCompiler.idxmin.return.DataFrameDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1721, "end_line": 2012, "span_ids": ["BaseQueryCompiler.first_valid_index", "BaseQueryCompiler.infer_objects", "BaseQueryCompiler.dtypes", "BaseQueryCompiler.stack", "BaseQueryCompiler.astype", "BaseQueryCompiler.convert_dtypes", "BaseQueryCompiler.unique", "BaseQueryCompiler.searchsorted", "BaseQueryCompiler.all", "BaseQueryCompiler.idxmin", "BaseQueryCompiler.idxmax", "BaseQueryCompiler.to_timedelta", "BaseQueryCompiler.any"], "tokens": 2045}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"to_timedelta\")\n def to_timedelta(self, unit=\"ns\", errors=\"raise\"): # noqa: PR02\n \"\"\"\n Convert argument to timedelta.\n\n Parameters\n ----------\n unit : str, default: \"ns\"\n Denotes the unit of the arg for numeric arg. Defaults to \"ns\".\n errors : {\"ignore\", \"raise\", \"coerce\"}, default: \"raise\"\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with converted to timedelta values.\n \"\"\"\n return SeriesDefault.register(pandas.to_timedelta)(\n self, unit=unit, errors=errors\n )\n\n # FIXME: get rid of `**kwargs` parameter (Modin issue #3108).\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.unique\")\n def unique(self, **kwargs):\n \"\"\"\n Get unique values of `self`.\n\n Parameters\n ----------\n **kwargs : dict\n Serves compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with unique values.\n \"\"\"\n return SeriesDefault.register(pandas.Series.unique)(self, **kwargs)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.searchsorted\")\n def searchsorted(self, **kwargs): # noqa: PR02\n \"\"\"\n Find positions in a sorted `self` where `value` should be inserted to maintain order.\n\n Parameters\n ----------\n value : list-like\n side : {\"left\", \"right\"}\n sorter : list-like, optional\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n One-column QueryCompiler which contains indices to insert.\n \"\"\"\n return SeriesDefault.register(pandas.Series.searchsorted)(self, **kwargs)\n\n # END Abstract map partitions operations\n\n @doc_utils.add_refer_to(\"DataFrame.stack\")\n def stack(self, level, dropna):\n \"\"\"\n Stack the prescribed level(s) from columns to index.\n\n Parameters\n ----------\n level : int or label\n dropna : bool\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.stack)(\n self, level=level, dropna=dropna\n )\n\n # Abstract map partitions across select indices\n def astype(self, col_dtypes, errors: str = \"raise\"): # noqa: PR02\n \"\"\"\n Convert columns dtypes to given dtypes.\n\n Parameters\n ----------\n col_dtypes : dict\n Map for column names and new dtypes.\n errors : {'raise', 'ignore'}, default: 'raise'\n Control raising of exceptions on invalid data for provided dtype.\n - raise : allow exceptions to be raised\n - ignore : suppress exceptions. On error return original object.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated dtypes.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.astype)(\n self, dtype=col_dtypes, errors=errors\n )\n\n def infer_objects(self):\n \"\"\"\n Attempt to infer better dtypes for object columns.\n\n Attempts soft conversion of object-dtyped columns, leaving non-object\n and unconvertible columns unchanged. The inference rules are the same\n as during normal Series/DataFrame construction.\n\n Returns\n -------\n BaseQueryCompiler\n New query compiler with udpated dtypes.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.infer_objects)(self)\n\n def convert_dtypes(\n self,\n infer_objects: bool = True,\n convert_string: bool = True,\n convert_integer: bool = True,\n convert_boolean: bool = True,\n convert_floating: bool = True,\n dtype_backend: DtypeBackend = \"numpy_nullable\",\n ):\n \"\"\"\n Convert columns to best possible dtypes using dtypes supporting ``pd.NA``.\n\n Parameters\n ----------\n infer_objects : bool, default: True\n Whether object dtypes should be converted to the best possible types.\n convert_string : bool, default: True\n Whether object dtypes should be converted to ``pd.StringDtype()``.\n convert_integer : bool, default: True\n Whether, if possbile, conversion should be done to integer extension types.\n convert_boolean : bool, default: True\n Whether object dtypes should be converted to ``pd.BooleanDtype()``.\n convert_floating : bool, default: True\n Whether, if possible, conversion can be done to floating extension types.\n If `convert_integer` is also True, preference will be give to integer dtypes\n if the floats can be faithfully casted to integers.\n dtype_backend : {\"numpy_nullable\", \"pyarrow\"}, default: \"numpy_nullable\"\n Which dtype_backend to use, e.g. whether a DataFrame should use nullable\n dtypes for all dtypes that have a nullable\n implementation when \"numpy_nullable\" is set, PyArrow is used for all\n dtypes if \"pyarrow\" is set.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated dtypes.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.convert_dtypes)(\n self,\n infer_objects=infer_objects,\n convert_string=convert_string,\n convert_integer=convert_integer,\n convert_boolean=convert_boolean,\n convert_floating=convert_floating,\n dtype_backend=dtype_backend,\n )\n\n @property\n def dtypes(self):\n \"\"\"\n Get columns dtypes.\n\n Returns\n -------\n pandas.Series\n Series with dtypes of each column.\n \"\"\"\n return self.to_pandas().dtypes\n\n # END Abstract map partitions across select indices\n\n # Abstract column/row partitions reduce operations\n #\n # These operations result in a reduced dimensionality of data.\n # Currently, this means a Pandas Series will be returned, but in the future\n # we will implement a Distributed Series, and this will be returned\n # instead.\n\n # FIXME: we're handling level parameter at front-end, it shouldn't\n # propagate to the query compiler (Modin issue #3102)\n @doc_utils.add_refer_to(\"DataFrame.all\")\n def all(self, **kwargs): # noqa: PR02\n \"\"\"\n Return whether all the elements are true, potentially over an axis.\n\n Parameters\n ----------\n axis : {0, 1}, optional\n bool_only : bool, optional\n skipna : bool\n level : int or label\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n If axis was specified return one-column QueryCompiler with index labels\n of the specified axis, where each row contains boolean of whether all elements\n at the corresponding row or column are True. Otherwise return QueryCompiler\n with a single bool of whether all elements are True.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.all)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.any\")\n def any(self, **kwargs): # noqa: PR02\n \"\"\"\n Return whether any element is true, potentially over an axis.\n\n Parameters\n ----------\n axis : {0, 1}, optional\n bool_only : bool, optional\n skipna : bool\n level : int or label\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n If axis was specified return one-column QueryCompiler with index labels\n of the specified axis, where each row contains boolean of whether any element\n at the corresponding row or column is True. Otherwise return QueryCompiler\n with a single bool of whether any element is True.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.any)(self, **kwargs)\n\n def first_valid_index(self):\n \"\"\"\n Return index label of first non-NaN/NULL value.\n\n Returns\n -------\n scalar\n \"\"\"\n return (\n DataFrameDefault.register(pandas.DataFrame.first_valid_index)(self)\n .to_pandas()\n .squeeze()\n )\n\n @doc_utils.add_refer_to(\"DataFrame.idxmax\")\n def idxmax(self, **kwargs): # noqa: PR02\n \"\"\"\n Get position of the first occurrence of the maximum for each row or column.\n\n Parameters\n ----------\n axis : {0, 1}\n skipna : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n One-column QueryCompiler with index labels of the specified axis,\n where each row contains position of the maximum element for the\n corresponding row or column.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.idxmax)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.idxmin\")\n def idxmin(self, **kwargs): # noqa: PR02\n \"\"\"\n Get position of the first occurrence of the minimum for each row or column.\n\n Parameters\n ----------\n axis : {0, 1}\n skipna : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n One-column QueryCompiler with index labels of the specified axis,\n where each row contains position of the minimum element for the\n corresponding row or column.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.idxmin)(self, **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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.last_valid_index_BaseQueryCompiler.quantile_for_single_value.return.DataFrameDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.last_valid_index_BaseQueryCompiler.quantile_for_single_value.return.DataFrameDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2014, "end_line": 2088, "span_ids": ["BaseQueryCompiler.median", "BaseQueryCompiler.last_valid_index", "BaseQueryCompiler.sizeof", "BaseQueryCompiler.memory_usage", "BaseQueryCompiler.quantile_for_single_value", "BaseQueryCompiler.nunique"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n def last_valid_index(self):\n \"\"\"\n Return index label of last non-NaN/NULL value.\n\n Returns\n -------\n scalar\n \"\"\"\n return (\n DataFrameDefault.register(pandas.DataFrame.last_valid_index)(self)\n .to_pandas()\n .squeeze()\n )\n\n @doc_utils.doc_reduce_agg(\n method=\"median value\", refer_to=\"median\", extra_params=[\"skipna\", \"**kwargs\"]\n )\n def median(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.median)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.memory_usage\")\n def memory_usage(self, **kwargs): # noqa: PR02\n \"\"\"\n Return the memory usage of each column in bytes.\n\n Parameters\n ----------\n index : bool\n deep : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n One-column QueryCompiler with index labels of `self`, where each row\n contains the memory usage for the corresponding column.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.memory_usage)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.sizeof\")\n def sizeof(self):\n \"\"\"\n Compute the total memory usage for `self`.\n\n Returns\n -------\n BaseQueryCompiler\n Result that holds either a value or Series of values.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.__sizeof__)(self)\n\n @doc_utils.doc_reduce_agg(\n method=\"number of unique values\",\n refer_to=\"nunique\",\n params=\"\"\"\n axis : {0, 1}\n dropna : bool\"\"\",\n extra_params=[\"**kwargs\"],\n )\n def nunique(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.nunique)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"value at the given quantile\",\n refer_to=\"quantile\",\n params=\"\"\"\n q : float\n axis : {0, 1}\n numeric_only : bool\n interpolation : {\"linear\", \"lower\", \"higher\", \"midpoint\", \"nearest\"}\"\"\",\n extra_params=[\"**kwargs\"],\n )\n def quantile_for_single_value(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.quantile)(self, **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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.skew_BaseQueryCompiler.query.return.DataFrameDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.skew_BaseQueryCompiler.query.return.DataFrameDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2090, "end_line": 2359, "span_ids": ["BaseQueryCompiler.nsmallest", "BaseQueryCompiler.fillna", "BaseQueryCompiler.cummin", "BaseQueryCompiler.skew", "BaseQueryCompiler.cumprod", "BaseQueryCompiler.query", "BaseQueryCompiler.var", "BaseQueryCompiler.std", "BaseQueryCompiler.cummax", "BaseQueryCompiler.cumsum", "BaseQueryCompiler.diff", "BaseQueryCompiler.eval", "BaseQueryCompiler.nlargest", "BaseQueryCompiler.duplicated", "BaseQueryCompiler.describe", "BaseQueryCompiler.sem", "BaseQueryCompiler.dropna", "BaseQueryCompiler.mode"], "tokens": 1939}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_reduce_agg(\n method=\"unbiased skew\", refer_to=\"skew\", extra_params=[\"skipna\", \"**kwargs\"]\n )\n def skew(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.skew)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"standard deviation of the mean\",\n refer_to=\"sem\",\n extra_params=[\"skipna\", \"ddof\", \"**kwargs\"],\n )\n def sem(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.sem)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"standard deviation\",\n refer_to=\"std\",\n extra_params=[\"skipna\", \"ddof\", \"**kwargs\"],\n )\n def std(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.std)(self, **kwargs)\n\n @doc_utils.doc_reduce_agg(\n method=\"variance\", refer_to=\"var\", extra_params=[\"skipna\", \"ddof\", \"**kwargs\"]\n )\n def var(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.var)(self, **kwargs)\n\n # END Abstract column/row partitions reduce operations\n\n @doc_utils.add_refer_to(\"DataFrame.describe\")\n def describe(self, percentiles: np.ndarray):\n \"\"\"\n Generate descriptive statistics.\n\n Parameters\n ----------\n percentiles : list-like\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler object containing the descriptive statistics\n of the underlying data.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.describe)(\n self,\n percentiles=percentiles,\n include=\"all\",\n )\n\n # Map across rows/columns\n # These operations require some global knowledge of the full column/row\n # that is being operated on. This means that we have to put all of that\n # data in the same place.\n\n @doc_utils.doc_cum_agg(method=\"sum\", refer_to=\"cumsum\")\n def cumsum(self, fold_axis, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.cumsum)(self, **kwargs)\n\n @doc_utils.doc_cum_agg(method=\"maximum\", refer_to=\"cummax\")\n def cummax(self, fold_axis, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.cummax)(self, **kwargs)\n\n @doc_utils.doc_cum_agg(method=\"minimum\", refer_to=\"cummin\")\n def cummin(self, fold_axis, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.cummin)(self, **kwargs)\n\n @doc_utils.doc_cum_agg(method=\"product\", refer_to=\"cumprod\")\n def cumprod(self, fold_axis, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.cumprod)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.diff\")\n def diff(self, **kwargs): # noqa: PR02\n \"\"\"\n First discrete difference of element.\n\n Parameters\n ----------\n periods : int\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler of the same shape as `self`, where each element is the difference\n between the corresponding value and the previous value in this row or column.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.diff)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.dropna\")\n def dropna(self, **kwargs): # noqa: PR02\n \"\"\"\n Remove missing values.\n\n Parameters\n ----------\n axis : {0, 1}\n how : {\"any\", \"all\"}\n thresh : int, optional\n subset : list of labels\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with null values dropped along given axis.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.dropna)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.duplicated\")\n def duplicated(self, **kwargs):\n \"\"\"\n Return boolean Series denoting duplicate rows.\n\n Parameters\n ----------\n **kwargs : dict\n Additional keyword arguments to be passed in to `pandas.DataFrame.duplicated`.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing boolean Series denoting duplicate rows.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.duplicated)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.nlargest\")\n def nlargest(self, n=5, columns=None, keep=\"first\"):\n \"\"\"\n Return the first `n` rows ordered by `columns` in descending order.\n\n Parameters\n ----------\n n : int, default: 5\n columns : list of labels, optional\n Column labels to order by.\n (note: this parameter can be omitted only for a single-column query compilers\n representing Series object, otherwise `columns` has to be specified).\n keep : {\"first\", \"last\", \"all\"}, default: \"first\"\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n if columns is None:\n return SeriesDefault.register(pandas.Series.nlargest)(self, n=n, keep=keep)\n else:\n return DataFrameDefault.register(pandas.DataFrame.nlargest)(\n self, n=n, columns=columns, keep=keep\n )\n\n @doc_utils.add_refer_to(\"DataFrame.nsmallest\")\n def nsmallest(self, n=5, columns=None, keep=\"first\"):\n \"\"\"\n Return the first `n` rows ordered by `columns` in ascending order.\n\n Parameters\n ----------\n n : int, default: 5\n columns : list of labels, optional\n Column labels to order by.\n (note: this parameter can be omitted only for a single-column query compilers\n representing Series object, otherwise `columns` has to be specified).\n keep : {\"first\", \"last\", \"all\"}, default: \"first\"\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n if columns is None:\n return SeriesDefault.register(pandas.Series.nsmallest)(self, n=n, keep=keep)\n else:\n return DataFrameDefault.register(pandas.DataFrame.nsmallest)(\n self, n=n, columns=columns, keep=keep\n )\n\n @doc_utils.add_refer_to(\"DataFrame.eval\")\n def eval(self, expr, **kwargs):\n \"\"\"\n Evaluate string expression on QueryCompiler columns.\n\n Parameters\n ----------\n expr : str\n **kwargs : dict\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing the result of evaluation.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.eval)(\n self, expr=expr, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.mode\")\n def mode(self, **kwargs): # noqa: PR02\n \"\"\"\n Get the modes for every column or row.\n\n Parameters\n ----------\n axis : {0, 1}\n numeric_only : bool\n dropna : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with modes calculated along given axis.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.mode)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.fillna\")\n def fillna(self, **kwargs): # noqa: PR02\n \"\"\"\n Replace NaN values using provided method.\n\n Parameters\n ----------\n value : scalar or dict\n method : {\"backfill\", \"bfill\", \"pad\", \"ffill\", None}\n axis : {0, 1}\n inplace : {False}\n This parameter serves the compatibility purpose. Always has to be False.\n limit : int, optional\n downcast : dict, optional\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with all null values filled.\n \"\"\"\n squeeze_self = kwargs.pop(\"squeeze_self\", False)\n squeeze_value = kwargs.pop(\"squeeze_value\", False)\n\n def fillna(df, value, **kwargs):\n if squeeze_self:\n df = df.squeeze(axis=1)\n if squeeze_value:\n value = value.squeeze(axis=1)\n return df.fillna(value, **kwargs)\n\n return DataFrameDefault.register(fillna)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.query\")\n def query(self, expr, **kwargs):\n \"\"\"\n Query columns of the QueryCompiler with a boolean expression.\n\n Parameters\n ----------\n expr : str\n **kwargs : dict\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the rows where the boolean expression is satisfied.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.query)(\n self, expr=expr, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rank_BaseQueryCompiler._Abstract_drop": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rank_BaseQueryCompiler._Abstract_drop", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2361, "end_line": 2666, "span_ids": ["BaseQueryCompiler.sort_index", "BaseQueryCompiler.sort_columns_by_row_values", "BaseQueryCompiler.getitem_column_array", "BaseQueryCompiler.insert", "BaseQueryCompiler.getitem_array", "BaseQueryCompiler.rank", "BaseQueryCompiler.lookup", "BaseQueryCompiler.setitem_bool", "BaseQueryCompiler.quantile_for_list_of_values", "BaseQueryCompiler.getitem_row_array", "BaseQueryCompiler.sort_rows_by_column_values", "BaseQueryCompiler.melt"], "tokens": 2108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.add_refer_to(\"DataFrame.rank\")\n def rank(self, **kwargs): # noqa: PR02\n \"\"\"\n Compute numerical rank along the specified axis.\n\n By default, equal values are assigned a rank that is the average of the ranks\n of those values, this behavior can be changed via `method` parameter.\n\n Parameters\n ----------\n axis : {0, 1}\n method : {\"average\", \"min\", \"max\", \"first\", \"dense\"}\n numeric_only : bool\n na_option : {\"keep\", \"top\", \"bottom\"}\n ascending : bool\n pct : bool\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler of the same shape as `self`, where each element is the\n numerical rank of the corresponding value along row or column.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.rank)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.sort_index\")\n def sort_index(self, **kwargs): # noqa: PR02\n \"\"\"\n Sort data by index or column labels.\n\n Parameters\n ----------\n axis : {0, 1}\n level : int, label or list of such\n ascending : bool\n inplace : bool\n kind : {\"quicksort\", \"mergesort\", \"heapsort\"}\n na_position : {\"first\", \"last\"}\n sort_remaining : bool\n ignore_index : bool\n key : callable(pandas.Index) -> pandas.Index, optional\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the data sorted by columns or indices.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.sort_index)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.melt\")\n def melt(self, *args, **kwargs): # noqa: PR02\n \"\"\"\n Unpivot QueryCompiler data from wide to long format.\n\n Parameters\n ----------\n id_vars : list of labels, optional\n value_vars : list of labels, optional\n var_name : label\n value_name : label\n col_level : int or label\n ignore_index : bool\n *args : iterable\n Serves the compatibility purpose. Does not affect the result.\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with unpivoted data.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.melt)(self, *args, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.sort_values\")\n def sort_columns_by_row_values(self, rows, ascending=True, **kwargs): # noqa: PR02\n \"\"\"\n Reorder the columns based on the lexicographic order of the given rows.\n\n Parameters\n ----------\n rows : label or list of labels\n The row or rows to sort by.\n ascending : bool, default: True\n Sort in ascending order (True) or descending order (False).\n kind : {\"quicksort\", \"mergesort\", \"heapsort\"}\n na_position : {\"first\", \"last\"}\n ignore_index : bool\n key : callable(pandas.Index) -> pandas.Index, optional\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler that contains result of the sort.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.sort_values)(\n self, by=rows, axis=1, ascending=ascending, **kwargs\n )\n\n @doc_utils.add_refer_to(\"DataFrame.sort_values\")\n def sort_rows_by_column_values(\n self, columns, ascending=True, **kwargs\n ): # noqa: PR02\n \"\"\"\n Reorder the rows based on the lexicographic order of the given columns.\n\n Parameters\n ----------\n columns : label or list of labels\n The column or columns to sort by.\n ascending : bool, default: True\n Sort in ascending order (True) or descending order (False).\n kind : {\"quicksort\", \"mergesort\", \"heapsort\"}\n na_position : {\"first\", \"last\"}\n ignore_index : bool\n key : callable(pandas.Index) -> pandas.Index, optional\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler that contains result of the sort.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.sort_values)(\n self, by=columns, axis=0, ascending=ascending, **kwargs\n )\n\n # END Abstract map across rows/columns\n\n # Map across rows/columns\n # These operations require some global knowledge of the full column/row\n # that is being operated on. This means that we have to put all of that\n # data in the same place.\n @doc_utils.doc_reduce_agg(\n method=\"value at the given quantile\",\n refer_to=\"quantile\",\n params=\"\"\"\n q : list-like\n axis : {0, 1}\n numeric_only : bool\n interpolation : {\"linear\", \"lower\", \"higher\", \"midpoint\", \"nearest\"}\"\"\",\n extra_params=[\"**kwargs\"],\n )\n def quantile_for_list_of_values(self, **kwargs): # noqa: PR02\n return DataFrameDefault.register(pandas.DataFrame.quantile)(self, **kwargs)\n\n # END Abstract map across rows/columns\n\n # Abstract __getitem__ methods\n def getitem_array(self, key):\n \"\"\"\n Mask QueryCompiler with `key`.\n\n Parameters\n ----------\n key : BaseQueryCompiler, np.ndarray or list of column labels\n Boolean mask represented by QueryCompiler or ``np.ndarray`` of the same\n shape as `self`, or enumerable of columns to pick.\n\n Returns\n -------\n BaseQueryCompiler\n New masked QueryCompiler.\n \"\"\"\n if isinstance(key, type(self)):\n key = key.to_pandas().squeeze(axis=1)\n\n def getitem_array(df, key):\n return df[key]\n\n return DataFrameDefault.register(getitem_array)(self, key)\n\n def getitem_column_array(self, key, numeric=False, ignore_order=False):\n \"\"\"\n Get column data for target labels.\n\n Parameters\n ----------\n key : list-like\n Target labels by which to retrieve data.\n numeric : bool, default: False\n Whether or not the key passed in represents the numeric index\n or the named index.\n ignore_order : bool, default: False\n Allow returning columns in an arbitrary order for the sake of performance.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler that contains specified columns.\n \"\"\"\n\n def get_column(df, key):\n if numeric:\n return df.iloc[:, key]\n else:\n return df[key]\n\n return DataFrameDefault.register(get_column)(self, key=key)\n\n def getitem_row_array(self, key):\n \"\"\"\n Get row data for target indices.\n\n Parameters\n ----------\n key : list-like\n Numeric indices of the rows to pick.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler that contains specified rows.\n \"\"\"\n\n def get_row(df, key):\n return df.iloc[key]\n\n return DataFrameDefault.register(get_row)(self, key=key)\n\n def lookup(self, row_labels, col_labels): # noqa: PR01, RT01, D200\n \"\"\"\n Label-based \"fancy indexing\" function for ``DataFrame``.\n \"\"\"\n return self.default_to_pandas(pandas.DataFrame.lookup, row_labels, col_labels)\n\n # END Abstract __getitem__ methods\n\n # Abstract insert\n # This method changes the shape of the resulting data. In Pandas, this\n # operation is always inplace, but this object is immutable, so we just\n # return a new one from here and let the front end handle the inplace\n # update.\n def insert(self, loc, column, value):\n \"\"\"\n Insert new column.\n\n Parameters\n ----------\n loc : int\n Insertion position.\n column : label\n Label of the new column.\n value : One-column BaseQueryCompiler, 1D array or scalar\n Data to fill new column with.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler with new column inserted.\n \"\"\"\n\n def inserter(df, loc, column, value):\n if isinstance(value, pandas.DataFrame):\n value = value.squeeze(axis=1)\n df.insert(loc, column, value)\n return df\n\n return DataFrameDefault.register(inserter, inplace=True)(\n self, loc=loc, column=column, value=value\n )\n\n # END Abstract insert\n\n # __setitem__ methods\n def setitem_bool(self, row_loc, col_loc, item):\n \"\"\"\n Set an item to the given location based on `row_loc` and `col_loc`.\n\n Parameters\n ----------\n row_loc : BaseQueryCompiler\n Query Compiler holding a Series of booleans.\n col_loc : label\n Column label in `self`.\n item : scalar\n An item to be set.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with the inserted item.\n\n Notes\n -----\n Currently, this method is only used to set a scalar to the given location.\n \"\"\"\n\n def _set_item(df, row_loc, col_loc, item):\n df.loc[row_loc.squeeze(axis=1), col_loc] = item\n return df\n\n return DataFrameDefault.register(_set_item)(\n self, row_loc=row_loc, col_loc=col_loc, item=item\n )\n\n # END __setitem__ methods\n\n # Abstract drop", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.drop_BaseQueryCompiler._logic_can_get_a_bit_con": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.drop_BaseQueryCompiler._logic_can_get_a_bit_con", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2665, "end_line": 2694, "span_ids": ["BaseQueryCompiler.drop"], "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 BaseQueryCompiler(ClassLogger, abc.ABC):\n def drop(self, index=None, columns=None, errors: str = \"raise\"):\n \"\"\"\n Drop specified rows or columns.\n\n Parameters\n ----------\n index : list of labels, optional\n Labels of rows to drop.\n columns : list of labels, optional\n Labels of columns to drop.\n errors : str, default: \"raise\"\n If 'ignore', suppress error and only existing labels are dropped.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with removed data.\n \"\"\"\n if index is None and columns is None:\n return self\n else:\n return DataFrameDefault.register(pandas.DataFrame.drop)(\n self, index=index, columns=columns, errors=errors\n )\n\n # END drop\n\n # UDF (apply and agg) methods\n # There is a wide range of behaviors that are supported, so a lot of the\n # logic can get a bit convoluted.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.apply_BaseQueryCompiler.groupby_sum.return.GroupByDefault_register_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.apply_BaseQueryCompiler.groupby_sum.return.GroupByDefault_register_p", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2695, "end_line": 2991, "span_ids": ["BaseQueryCompiler.groupby_idxmin", "BaseQueryCompiler.groupby_sum", "BaseQueryCompiler.explode", "BaseQueryCompiler.groupby_max", "BaseQueryCompiler.groupby_all", "BaseQueryCompiler.apply", "BaseQueryCompiler.groupby_count", "BaseQueryCompiler.groupby_any", "BaseQueryCompiler.groupby_prod", "BaseQueryCompiler.groupby_idxmax", "BaseQueryCompiler.apply_on_series", "BaseQueryCompiler.groupby_min"], "tokens": 1947}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n def apply(self, func, axis, raw=False, result_type=None, *args, **kwargs):\n \"\"\"\n Apply passed function across given axis.\n\n Parameters\n ----------\n func : callable(pandas.Series) -> scalar, str, list or dict of such\n The function to apply to each column or row.\n axis : {0, 1}\n Target axis to apply the function along.\n 0 is for index, 1 is for columns.\n raw : bool, default: False\n Whether to pass a high-level Series object (False) or a raw representation\n of the data (True).\n result_type : {\"expand\", \"reduce\", \"broadcast\", None}, default: None\n Determines how to treat list-like return type of the `func` (works only if\n a single function was passed):\n\n - \"expand\": expand list-like result into columns.\n - \"reduce\": keep result into a single cell (opposite of \"expand\").\n - \"broadcast\": broadcast result to original data shape (overwrite the existing column/row with the function result).\n - None: use \"expand\" strategy if Series is returned, \"reduce\" otherwise.\n *args : iterable\n Positional arguments to pass to `func`.\n **kwargs : dict\n Keyword arguments to pass to `func`.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler that contains the results of execution and is built by\n the following rules:\n\n - Index of the specified axis contains: the names of the passed functions if multiple\n functions are passed, otherwise: indices of the `func` result if \"expand\" strategy\n is used, indices of the original frame if \"broadcast\" strategy is used, a single\n label `MODIN_UNNAMED_SERIES_LABEL` if \"reduce\" strategy is used.\n - Labels of the opposite axis are preserved.\n - Each element is the result of execution of `func` against\n corresponding row/column.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.apply)(\n self,\n func=func,\n axis=axis,\n raw=raw,\n result_type=result_type,\n *args,\n **kwargs,\n )\n\n def apply_on_series(self, func, *args, **kwargs):\n \"\"\"\n Apply passed function on underlying Series.\n\n Parameters\n ----------\n func : callable(pandas.Series) -> scalar, str, list or dict of such\n The function to apply to each row.\n *args : iterable\n Positional arguments to pass to `func`.\n **kwargs : dict\n Keyword arguments to pass to `func`.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n assert self.is_series_like()\n\n return SeriesDefault.register(pandas.Series.apply)(\n self,\n func=func,\n *args,\n **kwargs,\n )\n\n def explode(self, column):\n \"\"\"\n Explode the given columns.\n\n Parameters\n ----------\n column : Union[Hashable, Sequence[Hashable]]\n The columns to explode.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler that contains the results of execution. For each row\n in the input QueryCompiler, if the selected columns each contain M\n items, there will be M rows created by exploding the columns.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.explode)(self, column)\n\n # END UDF\n\n # Manual Partitioning methods (e.g. merge, groupby)\n # These methods require some sort of manual partitioning due to their\n # nature. They require certain data to exist on the same partition, and\n # after the shuffle, there should be only a local map required.\n\n # FIXME: `map_args` and `reduce_args` leaked there from `PandasQueryCompiler.groupby_*`,\n # pandas storage format implements groupby via TreeReduce approach, but for other storage formats these\n # parameters make no sense, they shouldn't be present in a base class.\n\n @doc_utils.doc_groupby_method(\n action=\"count non-null values\",\n result=\"number of non-null values\",\n refer_to=\"count\",\n )\n def groupby_count(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.count)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"check whether any element is True\",\n result=\"boolean of whether there is any element which is True\",\n refer_to=\"any\",\n )\n def groupby_any(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.any)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get the index of the minimum value\",\n result=\"index of minimum value\",\n refer_to=\"idxmin\",\n )\n def groupby_idxmin(\n self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.idxmin)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get the index of the maximum value\",\n result=\"index of maximum value\",\n refer_to=\"idxmax\",\n )\n def groupby_idxmax(\n self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.idxmax)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get the minimum value\", result=\"minimum value\", refer_to=\"min\"\n )\n def groupby_min(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.min)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(result=\"product\", refer_to=\"prod\")\n def groupby_prod(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.prod)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get the maximum value\", result=\"maximum value\", refer_to=\"max\"\n )\n def groupby_max(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.max)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"check whether all elements are True\",\n result=\"boolean of whether all elements are True\",\n refer_to=\"all\",\n )\n def groupby_all(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.all)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(result=\"sum\", refer_to=\"sum\")\n def groupby_sum(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.sum)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_size_BaseQueryCompiler.groupby_sem.return.self_groupby_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_size_BaseQueryCompiler.groupby_sem.return.self_groupby_agg_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2993, "end_line": 3307, "span_ids": ["BaseQueryCompiler.groupby_mean", "BaseQueryCompiler.groupby_skew", "BaseQueryCompiler.groupby_cumprod", "BaseQueryCompiler.groupby_sem", "BaseQueryCompiler.groupby_cummin", "BaseQueryCompiler.groupby_std", "BaseQueryCompiler.groupby_cumsum", "BaseQueryCompiler.groupby_cummax", "BaseQueryCompiler.groupby_cumcount", "BaseQueryCompiler.groupby_size", "BaseQueryCompiler.groupby_agg"], "tokens": 1958}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_groupby_method(\n action=\"get the number of elements\",\n result=\"number of elements\",\n refer_to=\"size\",\n )\n def groupby_size(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n result = GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.size)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n method=\"size\",\n )\n if not groupby_kwargs.get(\"as_index\", False):\n # Renaming 'MODIN_UNNAMED_SERIES_LABEL' to a proper name\n result.columns = result.columns[:-1].append(pandas.Index([\"size\"]))\n return result\n\n @doc_utils.add_refer_to(\"GroupBy.aggregate\")\n def groupby_agg(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n how=\"axis_wise\",\n drop=False,\n series_groupby=False,\n ):\n \"\"\"\n Group QueryCompiler data and apply passed aggregation function.\n\n Parameters\n ----------\n by : BaseQueryCompiler, column or index label, Grouper or list of such\n Object that determine groups.\n agg_func : str, dict or callable(Series | DataFrame) -> scalar | Series | DataFrame\n Function to apply to the GroupBy object.\n axis : {0, 1}\n Axis to group and apply aggregation function along.\n 0 is for index, when 1 is for columns.\n groupby_kwargs : dict\n GroupBy parameters as expected by ``modin.pandas.DataFrame.groupby`` signature.\n agg_args : list-like\n Positional arguments to pass to the `agg_func`.\n agg_kwargs : dict\n Key arguments to pass to the `agg_func`.\n how : {'axis_wise', 'group_wise', 'transform'}, default: 'axis_wise'\n How to apply passed `agg_func`:\n - 'axis_wise': apply the function against each row/column.\n - 'group_wise': apply the function against every group.\n - 'transform': apply the function against every group and broadcast\n the result to the original Query Compiler shape.\n drop : bool, default: False\n If `by` is a QueryCompiler indicates whether or not by-data came\n from the `self`.\n series_groupby : bool, default: False\n Whether we should treat `self` as Series when performing groupby.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing the result of groupby aggregation.\n \"\"\"\n if isinstance(by, type(self)) and len(by.columns) == 1:\n by = by.columns[0] if drop else by.to_pandas().squeeze()\n # converting QC 'by' to a list of column labels only if this 'by' comes from the self (if drop is True)\n elif drop and isinstance(by, type(self)):\n by = list(by.columns)\n\n defaulter = SeriesGroupByDefault if series_groupby else GroupByDefault\n return defaulter.register(defaulter.get_aggregation_method(how))(\n self,\n by=by,\n agg_func=agg_func,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute the mean value\", result=\"mean value\", refer_to=\"mean\"\n )\n def groupby_mean(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"mean\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute unbiased skew\", result=\"unbiased skew\", refer_to=\"skew\"\n )\n def groupby_skew(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n if axis == 1:\n # To avoid `ValueError: Operation skew does not support axis=1` due to the\n # difference in the behavior of `groupby(...).skew(axis=1)` and\n # `groupby(...).agg(\"skew\", axis=1)`.\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.skew)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n return self.groupby_agg(\n by=by,\n agg_func=\"skew\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute cumulative count\",\n result=\"count of all the previous values\",\n refer_to=\"cumcount\",\n )\n def groupby_cumcount(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"cumcount\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute cumulative sum\",\n result=\"sum of all the previous values\",\n refer_to=\"cumsum\",\n )\n def groupby_cumsum(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"cumsum\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get cumulative maximum\",\n result=\"maximum of all the previous values\",\n refer_to=\"cummax\",\n )\n def groupby_cummax(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"cummax\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get cumulative minimum\",\n result=\"minimum of all the previous values\",\n refer_to=\"cummin\",\n )\n def groupby_cummin(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"cummin\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get cumulative production\",\n result=\"production of all the previous values\",\n refer_to=\"cumprod\",\n )\n def groupby_cumprod(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"cumprod\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute standard deviation\", result=\"standard deviation\", refer_to=\"std\"\n )\n def groupby_std(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"std\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute standard error\", result=\"standard error\", refer_to=\"sem\"\n )\n def groupby_sem(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"sem\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_rank_BaseQueryCompiler.groupby_tail.return.self_groupby_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_rank_BaseQueryCompiler.groupby_tail.return.self_groupby_agg_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3309, "end_line": 3679, "span_ids": ["BaseQueryCompiler.groupby_nunique", "BaseQueryCompiler.groupby_last", "BaseQueryCompiler.groupby_dtypes", "BaseQueryCompiler.groupby_head", "BaseQueryCompiler.groupby_tail", "BaseQueryCompiler.groupby_get_group", "BaseQueryCompiler.groupby_var", "BaseQueryCompiler.groupby_cov", "BaseQueryCompiler.groupby_quantile", "BaseQueryCompiler.groupby_diff", "BaseQueryCompiler.groupby_shift", "BaseQueryCompiler.groupby_first", "BaseQueryCompiler.groupby_fillna", "BaseQueryCompiler.groupby_rank", "BaseQueryCompiler.groupby_pct_change", "BaseQueryCompiler.groupby_median", "BaseQueryCompiler.groupby_corr"], "tokens": 1953}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_groupby_method(\n action=\"compute numerical rank\", result=\"numerical rank\", refer_to=\"rank\"\n )\n def groupby_rank(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"rank\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute variance\", result=\"variance\", refer_to=\"var\"\n )\n def groupby_var(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"var\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute correlation\", result=\"correlation\", refer_to=\"corr\"\n )\n def groupby_corr(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"corr\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute covariance\", result=\"covariance\", refer_to=\"cov\"\n )\n def groupby_cov(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"cov\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get the number of unique values\",\n result=\"number of unique values\",\n refer_to=\"nunique\",\n )\n def groupby_nunique(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"nunique\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get the median value\", result=\"median value\", refer_to=\"median\"\n )\n def groupby_median(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"median\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"compute specified quantile\",\n result=\"quantile value\",\n refer_to=\"quantile\",\n )\n def groupby_quantile(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"quantile\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"fill NaN values\",\n result=\"`fill_value` if it was NaN, original value otherwise\",\n refer_to=\"fillna\",\n )\n def groupby_fillna(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"fillna\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n def groupby_diff(self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False):\n return self.groupby_agg(\n by=by,\n agg_func=\"diff\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n def groupby_pct_change(\n self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"pct_change\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get data types\", result=\"data type\", refer_to=\"dtypes\"\n )\n def groupby_dtypes(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"dtypes\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"construct DataFrame from group with provided name\",\n result=\"DataFrame for given group\",\n refer_to=\"get_group\",\n )\n def groupby_get_group(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"get_group\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"shift data with the specified settings\",\n result=\"shifted value\",\n refer_to=\"shift\",\n )\n def groupby_shift(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"shift\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get first value in group\",\n result=\"first value\",\n refer_to=\"first\",\n )\n def groupby_first(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"first\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get last value in group\",\n result=\"last value\",\n refer_to=\"last\",\n )\n def groupby_last(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"last\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get first n values of a group\",\n result=\"first n values of a group\",\n refer_to=\"head\",\n )\n def groupby_head(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"head\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get last n values in group\",\n result=\"last n values\",\n refer_to=\"tail\",\n )\n def groupby_tail(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"tail\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_nth_BaseQueryCompiler.groupby_ngroup.return.self_groupby_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_nth_BaseQueryCompiler.groupby_ngroup.return.self_groupby_agg_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3681, "end_line": 3727, "span_ids": ["BaseQueryCompiler.groupby_ngroup", "BaseQueryCompiler.groupby_nth"], "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 BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_groupby_method(\n action=\"get nth value in group\",\n result=\"nth value\",\n refer_to=\"nth\",\n )\n def groupby_nth(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"nth\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get group number of each value\",\n result=\"group number of each value\",\n refer_to=\"ngroup\",\n )\n def groupby_ngroup(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"ngroup\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_nlargest_BaseQueryCompiler.take_2d_labels.return.self_take_2d_positional_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.groupby_nlargest_BaseQueryCompiler.take_2d_labels.return.self_take_2d_positional_r", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3729, "end_line": 4066, "span_ids": ["BaseQueryCompiler.unstack", "BaseQueryCompiler.groupby_nlargest", "BaseQueryCompiler.groupby_ohlc", "BaseQueryCompiler.cut", "BaseQueryCompiler:7", "BaseQueryCompiler.pivot_table", "BaseQueryCompiler.get_dummies", "BaseQueryCompiler.get_axis", "BaseQueryCompiler.take_2d_labels", "BaseQueryCompiler.groupby_unique", "BaseQueryCompiler.pivot", "BaseQueryCompiler.groupby_nsmallest", "BaseQueryCompiler.repeat", "BaseQueryCompiler.wide_to_long"], "tokens": 1973}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_groupby_method(\n action=\"get n largest values in group\",\n result=\"n largest values\",\n refer_to=\"nlargest\",\n )\n def groupby_nlargest(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"nlargest\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n series_groupby=True,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get n nsmallest values in group\",\n result=\"n nsmallest values\",\n refer_to=\"nsmallest\",\n )\n def groupby_nsmallest(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"nsmallest\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n series_groupby=True,\n )\n\n @doc_utils.doc_groupby_method(\n action=\"get unique values in group\",\n result=\"unique values\",\n refer_to=\"unique\",\n )\n def groupby_unique(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n agg_func=\"unique\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n series_groupby=True,\n )\n\n def groupby_ohlc(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n is_df,\n ):\n if not is_df:\n return self.groupby_agg(\n by=by,\n agg_func=\"ohlc\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n series_groupby=True,\n )\n return GroupByDefault.register(pandas.core.groupby.DataFrameGroupBy.ohlc)(\n self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=True,\n )\n\n # END Manual Partitioning methods\n\n @doc_utils.add_refer_to(\"DataFrame.unstack\")\n def unstack(self, level, fill_value):\n \"\"\"\n Pivot a level of the (necessarily hierarchical) index labels.\n\n Parameters\n ----------\n level : int or label\n fill_value : scalar or dict\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.unstack)(\n self, level=level, fill_value=fill_value\n )\n\n @doc_utils.add_refer_to(\"wide_to_long\")\n def wide_to_long(self, **kwargs): # noqa: PR01\n \"\"\"\n Unpivot a DataFrame from wide to long format.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.wide_to_long)(self, **kwargs)\n\n @doc_utils.add_refer_to(\"DataFrame.pivot\")\n def pivot(self, index, columns, values):\n \"\"\"\n Produce pivot table based on column values.\n\n Parameters\n ----------\n index : label or list of such, pandas.Index, optional\n columns : label or list of such\n values : label or list of such, optional\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing pivot table.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.pivot)(\n self, index=index, columns=columns, values=values\n )\n\n @doc_utils.add_refer_to(\"DataFrame.pivot_table\")\n def pivot_table(\n self,\n index,\n values,\n columns,\n aggfunc,\n fill_value,\n margins,\n dropna,\n margins_name,\n observed,\n sort,\n ):\n \"\"\"\n Create a spreadsheet-style pivot table from underlying data.\n\n Parameters\n ----------\n index : label, pandas.Grouper, array or list of such\n values : label, optional\n columns : column, pandas.Grouper, array or list of such\n aggfunc : callable(pandas.Series) -> scalar, dict of list of such\n fill_value : scalar, optional\n margins : bool\n dropna : bool\n margins_name : str\n observed : bool\n sort : bool\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.pivot_table)(\n self,\n index=index,\n values=values,\n columns=columns,\n aggfunc=aggfunc,\n fill_value=fill_value,\n margins=margins,\n dropna=dropna,\n margins_name=margins_name,\n observed=observed,\n sort=sort,\n )\n\n @doc_utils.add_refer_to(\"get_dummies\")\n def get_dummies(self, columns, **kwargs): # noqa: PR02\n \"\"\"\n Convert categorical variables to dummy variables for certain columns.\n\n Parameters\n ----------\n columns : label or list of such\n Columns to convert.\n prefix : str or list of such\n prefix_sep : str\n dummy_na : bool\n drop_first : bool\n dtype : dtype\n **kwargs : dict\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with categorical variables converted to dummy.\n \"\"\"\n\n def get_dummies(df, columns, **kwargs):\n return pandas.get_dummies(df, columns=columns, **kwargs)\n\n return DataFrameDefault.register(get_dummies)(self, columns=columns, **kwargs)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.repeat\")\n def repeat(self, repeats):\n \"\"\"\n Repeat each element of one-column QueryCompiler given number of times.\n\n Parameters\n ----------\n repeats : int or array of ints\n The number of repetitions for each element. This should be a\n non-negative integer. Repeating 0 times will return an empty\n QueryCompiler.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with repeated elements.\n \"\"\"\n return SeriesDefault.register(pandas.Series.repeat)(self, repeats=repeats)\n\n @doc_utils.add_refer_to(\"cut\")\n def cut(\n self,\n bins,\n **kwargs,\n ):\n \"\"\"\n Bin values into discrete intervals.\n\n Parameters\n ----------\n bins : int, array of ints, or IntervalIndex\n The criteria to bin by.\n **kwargs : dict\n The keyword arguments to pass through.\n\n Returns\n -------\n BaseQueryCompiler or np.ndarray or list[np.ndarray]\n Returns the result of pd.cut.\n \"\"\"\n\n def squeeze_and_cut(df, *args, **kwargs):\n # We need this function to ensure we squeeze our internal\n # representation (a dataframe) to a Series.\n series = df.squeeze(axis=1)\n return pandas.cut(series, *args, **kwargs)\n\n # We use `default_to_pandas` here since the type and number of\n # results can change depending on the input arguments.\n return self.default_to_pandas(squeeze_and_cut, bins, **kwargs)\n\n # Indexing\n\n index = property(_get_axis(0), _set_axis(0))\n columns = property(_get_axis(1), _set_axis(1))\n\n def get_axis(self, axis):\n \"\"\"\n Return index labels of the specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to return labels on.\n 0 is for index, when 1 is for columns.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n return self.index if axis == 0 else self.columns\n\n def take_2d_labels(\n self,\n index,\n columns,\n ):\n \"\"\"\n Take the given labels.\n\n Parameters\n ----------\n index : slice, scalar, list-like, or BaseQueryCompiler\n Labels of rows to grab.\n columns : slice, scalar, list-like, or BaseQueryCompiler\n Labels of columns to grab.\n\n Returns\n -------\n BaseQueryCompiler\n Subset of this QueryCompiler.\n \"\"\"\n row_lookup, col_lookup = self.get_positions_from_labels(index, columns)\n if isinstance(row_lookup, slice):\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=row_lookup != slice(None),\n extra_log=f\"Only None-slices are acceptable as a slice argument in masking, got: {row_lookup}\",\n )\n row_lookup = None\n if isinstance(col_lookup, slice):\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=col_lookup != slice(None),\n extra_log=f\"Only None-slices are acceptable as a slice argument in masking, got: {col_lookup}\",\n )\n col_lookup = None\n return self.take_2d_positional(row_lookup, col_lookup)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.get_positions_from_labels_BaseQueryCompiler._END___delitem__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.get_positions_from_labels_BaseQueryCompiler._END___delitem__", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4068, "end_line": 4349, "span_ids": ["BaseQueryCompiler.setitem", "BaseQueryCompiler.insert_item", "BaseQueryCompiler.take_2d_positional", "BaseQueryCompiler.__constructor__", "BaseQueryCompiler.write_items", "BaseQueryCompiler.get_positions_from_labels", "BaseQueryCompiler.delitem"], "tokens": 2102}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n def get_positions_from_labels(self, row_loc, col_loc):\n \"\"\"\n Compute index and column positions from their respective locators.\n\n Inputs to this method are arguments the the pandas user could pass to loc.\n This function will compute the corresponding index and column positions\n that the user could equivalently pass to iloc.\n\n Parameters\n ----------\n row_loc : scalar, slice, list, array or tuple\n Row locator.\n col_loc : scalar, slice, list, array or tuple\n Columns locator.\n\n Returns\n -------\n row_lookup : slice(None) if full axis grab, pandas.RangeIndex if repetition is detected, numpy.ndarray otherwise\n List of index labels.\n col_lookup : slice(None) if full axis grab, pandas.RangeIndex if repetition is detected, numpy.ndarray otherwise\n List of columns labels.\n\n Notes\n -----\n Usage of `slice(None)` as a resulting lookup is a hack to pass information about\n full-axis grab without computing actual indices that triggers lazy computations.\n Ideally, this API should get rid of using slices as indexers and either use a\n common ``Indexer`` object or range and ``np.ndarray`` only.\n \"\"\"\n from modin.pandas.indexing import (\n is_boolean_array,\n is_list_like,\n is_range_like,\n boolean_mask_to_numeric,\n )\n\n lookups = []\n for axis, axis_loc in enumerate((row_loc, col_loc)):\n if is_scalar(axis_loc):\n axis_loc = np.array([axis_loc])\n if isinstance(axis_loc, pandas.RangeIndex):\n axis_lookup = axis_loc\n elif isinstance(axis_loc, slice) or is_range_like(axis_loc):\n if isinstance(axis_loc, slice) and axis_loc == slice(None):\n axis_lookup = axis_loc\n else:\n axis_labels = self.get_axis(axis)\n # `slice_indexer` returns a fully-defined numeric slice for a non-fully-defined labels-based slice\n # RangeIndex and range use a semi-open interval, while\n # slice_indexer uses a closed interval. Subtract 1 step from the\n # end of the interval to get the equivalent closed interval.\n if axis_loc.stop is None or not is_number(axis_loc.stop):\n slice_stop = axis_loc.stop\n else:\n slice_stop = axis_loc.stop - (\n 0 if axis_loc.step is None else axis_loc.step\n )\n axis_lookup = axis_labels.slice_indexer(\n axis_loc.start,\n slice_stop,\n axis_loc.step,\n )\n # Converting negative indices to their actual positions:\n axis_lookup = pandas.RangeIndex(\n start=(\n axis_lookup.start\n if axis_lookup.start >= 0\n else axis_lookup.start + len(axis_labels)\n ),\n stop=(\n axis_lookup.stop\n if axis_lookup.stop >= 0\n else axis_lookup.stop + len(axis_labels)\n ),\n step=axis_lookup.step,\n )\n elif self.has_multiindex(axis):\n # `Index.get_locs` raises an IndexError by itself if missing labels were provided,\n # we don't have to do missing-check for the received `axis_lookup`.\n if isinstance(axis_loc, pandas.MultiIndex):\n axis_lookup = self.get_axis(axis).get_indexer_for(axis_loc)\n else:\n axis_lookup = self.get_axis(axis).get_locs(axis_loc)\n elif is_boolean_array(axis_loc):\n axis_lookup = boolean_mask_to_numeric(axis_loc)\n else:\n axis_labels = self.get_axis(axis)\n if is_list_like(axis_loc) and not isinstance(\n axis_loc, (np.ndarray, pandas.Index)\n ):\n # `Index.get_indexer_for` works much faster with numpy arrays than with python lists,\n # so although we lose some time here on converting to numpy, `Index.get_indexer_for`\n # speedup covers the loss that we gain here.\n axis_loc = np.array(axis_loc, dtype=axis_labels.dtype)\n axis_lookup = axis_labels.get_indexer_for(axis_loc)\n # `Index.get_indexer_for` sets -1 value for missing labels, we have to verify whether\n # there are any -1 in the received indexer to raise a KeyError here.\n missing_mask = axis_lookup == -1\n if missing_mask.any():\n missing_labels = (\n axis_loc[missing_mask]\n if is_list_like(axis_loc)\n # If `axis_loc` is not a list-like then we can't select certain\n # labels that are missing and so printing the whole indexer\n else axis_loc\n )\n raise KeyError(missing_labels)\n\n if isinstance(axis_lookup, pandas.Index) and not is_range_like(axis_lookup):\n axis_lookup = axis_lookup.values\n\n lookups.append(axis_lookup)\n return lookups\n\n def take_2d_positional(self, index=None, columns=None):\n \"\"\"\n Index QueryCompiler with passed keys.\n\n Parameters\n ----------\n index : list-like of ints, optional\n Positional indices of rows to grab.\n columns : list-like of ints, optional\n Positional indices of columns to grab.\n\n Returns\n -------\n BaseQueryCompiler\n New masked QueryCompiler.\n \"\"\"\n index = slice(None) if index is None else index\n columns = slice(None) if columns is None else columns\n\n def applyer(df):\n return df.iloc[index, columns]\n\n return DataFrameDefault.register(applyer)(self)\n\n def insert_item(self, axis, loc, value, how=\"inner\", replace=False):\n \"\"\"\n Insert rows/columns defined by `value` at the specified position.\n\n If frames are not aligned along specified axis, perform frames alignment first.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to insert along. 0 means insert rows, when 1 means insert columns.\n loc : int\n Position to insert `value`.\n value : BaseQueryCompiler\n Rows/columns to insert.\n how : {\"inner\", \"outer\", \"left\", \"right\"}, default: \"inner\"\n Type of join that will be used if frames are not aligned.\n replace : bool, default: False\n Whether to insert item after column/row at `loc-th` position or to replace\n it by `value`.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with inserted values.\n \"\"\"\n assert isinstance(value, type(self))\n\n def mask(idx):\n if len(idx) == len(self.get_axis(axis)):\n return self\n return (\n self.getitem_column_array(idx, numeric=True)\n if axis\n else self.getitem_row_array(idx)\n )\n\n if 0 <= loc < len(self.get_axis(axis)):\n first_mask = mask(list(range(loc)))\n second_mask_loc = loc + 1 if replace else loc\n second_mask = mask(list(range(second_mask_loc, len(self.get_axis(axis)))))\n return first_mask.concat(axis, [value, second_mask], join=how, sort=False)\n else:\n return self.concat(axis, [value], join=how, sort=False)\n\n def setitem(self, axis, key, value):\n \"\"\"\n Set the row/column defined by `key` to the `value` provided.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to set `value` along. 0 means set row, 1 means set column.\n key : label\n Row/column label to set `value` in.\n value : BaseQueryCompiler, list-like or scalar\n Define new row/column value.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated `key` value.\n \"\"\"\n\n def setitem(df, axis, key, value):\n if is_scalar(key) and isinstance(value, pandas.DataFrame):\n value = value.squeeze()\n if not axis:\n df[key] = value\n else:\n df.loc[key] = value\n return df\n\n return DataFrameDefault.register(setitem)(self, axis=axis, key=key, value=value)\n\n def write_items(self, row_numeric_index, col_numeric_index, broadcasted_items):\n \"\"\"\n Update QueryCompiler elements at the specified positions by passed values.\n\n In contrast to ``setitem`` this method allows to do 2D assignments.\n\n Parameters\n ----------\n row_numeric_index : list of ints\n Row positions to write value.\n col_numeric_index : list of ints\n Column positions to write value.\n broadcasted_items : 2D-array\n Values to write. Have to be same size as defined by `row_numeric_index`\n and `col_numeric_index`.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated values.\n \"\"\"\n if not isinstance(row_numeric_index, slice):\n row_numeric_index = list(row_numeric_index)\n if not isinstance(col_numeric_index, slice):\n col_numeric_index = list(col_numeric_index)\n\n def write_items(df, broadcasted_items):\n if isinstance(df.iloc[row_numeric_index, col_numeric_index], pandas.Series):\n broadcasted_items = broadcasted_items.squeeze()\n df.iloc[row_numeric_index, col_numeric_index] = broadcasted_items\n return df\n\n return DataFrameDefault.register(write_items)(\n self, broadcasted_items=broadcasted_items\n )\n\n # END Abstract methods for QueryCompiler\n\n @pandas.util.cache_readonly\n def __constructor__(self):\n \"\"\"\n Get query compiler constructor.\n\n By default, constructor method will invoke an init.\n\n Returns\n -------\n callable\n \"\"\"\n return type(self)\n\n # __delitem__\n # This will change the shape of the resulting data.\n def delitem(self, key):\n \"\"\"\n Drop `key` column.\n\n Parameters\n ----------\n key : label\n Column name to drop.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler without `key` column.\n \"\"\"\n return self.drop(columns=[key])\n\n # END __delitem__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.has_multiindex_BaseQueryCompiler.dt_unit.return.DateTimeDefault_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.has_multiindex_BaseQueryCompiler.dt_unit.return.DateTimeDefault_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4351, "end_line": 4625, "span_ids": ["BaseQueryCompiler.tz_localize", "BaseQueryCompiler.dt_floor", "BaseQueryCompiler.dt_freq", "BaseQueryCompiler.set_index_names", "BaseQueryCompiler.dt_ceil", "BaseQueryCompiler.dt_day", "BaseQueryCompiler.dt_dayofyear", "BaseQueryCompiler.shift", "BaseQueryCompiler.get_index_names", "BaseQueryCompiler.set_index_name", "BaseQueryCompiler.tz_convert", "BaseQueryCompiler.dt_days", "BaseQueryCompiler.dt_dayofweek", "BaseQueryCompiler.dt_days_in_month", "BaseQueryCompiler.dt_unit", "BaseQueryCompiler.between_time", "BaseQueryCompiler.dt_daysinmonth", "BaseQueryCompiler.dt_components", "BaseQueryCompiler.dt_date", "BaseQueryCompiler.dt_day_name", "BaseQueryCompiler.get_index_name", "BaseQueryCompiler.has_multiindex", "BaseQueryCompiler.dt_end_time"], "tokens": 1886}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n def has_multiindex(self, axis=0):\n \"\"\"\n Check if specified axis is indexed by MultiIndex.\n\n Parameters\n ----------\n axis : {0, 1}, default: 0\n The axis to check (0 - index, 1 - columns).\n\n Returns\n -------\n bool\n True if index at specified axis is MultiIndex and False otherwise.\n \"\"\"\n if axis == 0:\n return isinstance(self.index, pandas.MultiIndex)\n assert axis == 1\n return isinstance(self.columns, pandas.MultiIndex)\n\n def get_index_name(self, axis=0):\n \"\"\"\n Get index name of specified axis.\n\n Parameters\n ----------\n axis : {0, 1}, default: 0\n Axis to get index name on.\n\n Returns\n -------\n hashable\n Index name, None for MultiIndex.\n \"\"\"\n return self.get_axis(axis).name\n\n def set_index_name(self, name, axis=0):\n \"\"\"\n Set index name for the specified axis.\n\n Parameters\n ----------\n name : hashable\n New index name.\n axis : {0, 1}, default: 0\n Axis to set name along.\n \"\"\"\n self.get_axis(axis).name = name\n\n def get_index_names(self, axis=0):\n \"\"\"\n Get index names of specified axis.\n\n Parameters\n ----------\n axis : {0, 1}, default: 0\n Axis to get index names on.\n\n Returns\n -------\n list\n Index names.\n \"\"\"\n return self.get_axis(axis).names\n\n def set_index_names(self, names, axis=0):\n \"\"\"\n Set index names for the specified axis.\n\n Parameters\n ----------\n names : list\n New index names.\n axis : {0, 1}, default: 0\n Axis to set names along.\n \"\"\"\n self.get_axis(axis).names = names\n\n # DateTime methods\n def between_time(self, **kwargs): # noqa: PR01\n \"\"\"\n Select values between particular times of the day (e.g., 9:00-9:30 AM).\n\n By setting start_time to be later than end_time, you can get the times that are not between the two times.\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.between_time)(self, **kwargs)\n\n def shift(\n self,\n periods,\n freq,\n axis,\n fill_value,\n ):\n return DataFrameDefault.register(pandas.DataFrame.shift)(\n self, periods, freq, axis, fill_value\n )\n\n def tz_convert(\n self,\n tz,\n axis=0,\n level=None,\n copy=True,\n ):\n \"\"\"\n Convert tz-aware axis to target time zone.\n\n Parameters\n ----------\n tz : str or tzinfo object or None\n Target time zone. Passing None will convert to UTC\n and remove the timezone information.\n axis : int, default: 0\n The axis to localize.\n level : int, str, default: None\n If axis is a MultiIndex, convert a specific level. Otherwise must be None.\n copy : bool, default: True\n Also make a copy of the underlying data.\n\n Returns\n -------\n BaseQueryCompiler\n A new query compiler with the converted axis.\n \"\"\"\n if level is not None:\n new_labels = (\n pandas.Series(index=self.get_axis(axis))\n .tz_convert(tz, level=level)\n .index\n )\n else:\n new_labels = self.get_axis(axis).tz_convert(tz)\n obj = self.copy() if copy else self\n if axis == 0:\n obj.index = new_labels\n else:\n obj.columns = new_labels\n return obj\n\n def tz_localize(\n self, tz, axis=0, level=None, copy=True, ambiguous=\"raise\", nonexistent=\"raise\"\n ):\n \"\"\"\n Localize tz-naive index of a Series or DataFrame to target time zone.\n\n Parameters\n ----------\n tz : tzstr or tzinfo or None\n Time zone to localize. Passing None will remove the time zone\n information and preserve local time.\n axis : int, default: 0\n The axis to localize.\n level : int, str, default: None\n If axis is a MultiIndex, localize a specific level. Otherwise must be None.\n copy : bool, default: True\n Also make a copy of the underlying data.\n ambiguous : str, bool-ndarray, NaT, default: \"raise\"\n Behaviour on ambiguous times.\n nonexistent : str, default: \"raise\"\n What to do with nonexistent times.\n\n Returns\n -------\n BaseQueryCompiler\n A new query compiler with the localized axis.\n \"\"\"\n new_labels = (\n pandas.Series(index=self.get_axis(axis))\n .tz_localize(\n tz,\n axis=axis,\n level=level,\n copy=False,\n ambiguous=ambiguous,\n nonexistent=nonexistent,\n )\n .index\n )\n obj = self.copy() if copy else self\n if axis == 0:\n obj.index = new_labels\n else:\n obj.columns = new_labels\n return obj\n\n @doc_utils.doc_dt_round(refer_to=\"ceil\")\n def dt_ceil(self, freq, ambiguous=\"raise\", nonexistent=\"raise\"):\n return DateTimeDefault.register(pandas.Series.dt.ceil)(\n self, freq, ambiguous, nonexistent\n )\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.components\")\n def dt_components(self):\n \"\"\"\n Spread each date-time value into its components (days, hours, minutes...).\n\n Returns\n -------\n BaseQueryCompiler\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.components)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the date without timezone information\", refer_to=\"date\"\n )\n def dt_date(self):\n return DateTimeDefault.register(pandas.Series.dt.date)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"day component\", refer_to=\"day\")\n def dt_day(self):\n return DateTimeDefault.register(pandas.Series.dt.day)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"day name\", refer_to=\"day_name\", params=\"locale : str, optional\"\n )\n def dt_day_name(self, locale=None):\n return DateTimeDefault.register(pandas.Series.dt.day_name)(self, locale)\n\n @doc_utils.doc_dt_timestamp(prop=\"integer day of week\", refer_to=\"dayofweek\")\n # FIXME: `dt_dayofweek` is an alias for `dt_weekday`, one of them should\n # be removed (Modin issue #3107).\n def dt_dayofweek(self):\n return DateTimeDefault.register(pandas.Series.dt.dayofweek)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"day of year\", refer_to=\"dayofyear\")\n def dt_dayofyear(self):\n return DateTimeDefault.register(pandas.Series.dt.dayofyear)(self)\n\n @doc_utils.doc_dt_interval(prop=\"days\", refer_to=\"days\")\n def dt_days(self):\n return DateTimeDefault.register(pandas.Series.dt.days)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"number of days in month\", refer_to=\"days_in_month\"\n )\n # FIXME: `dt_days_in_month` is an alias for `dt_daysinmonth`, one of them should\n # be removed (Modin issue #3107).\n def dt_days_in_month(self):\n return DateTimeDefault.register(pandas.Series.dt.days_in_month)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"number of days in month\", refer_to=\"daysinmonth\")\n def dt_daysinmonth(self):\n return DateTimeDefault.register(pandas.Series.dt.daysinmonth)(self)\n\n @doc_utils.doc_dt_period(prop=\"the timestamp of end time\", refer_to=\"end_time\")\n def dt_end_time(self):\n return DateTimeDefault.register(pandas.Series.dt.end_time)(self)\n\n @doc_utils.doc_dt_round(refer_to=\"floor\")\n def dt_floor(self, freq, ambiguous=\"raise\", nonexistent=\"raise\"):\n return DateTimeDefault.register(pandas.Series.dt.floor)(\n self, freq, ambiguous, nonexistent\n )\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.freq\")\n def dt_freq(self):\n \"\"\"\n Get the time frequency of the underlying time-series data.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing a single value, the frequency of the data.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.freq)(self)\n\n @doc_utils.add_refer_to(\"Series.dt.unit\")\n def dt_unit(self): # noqa: RT01\n return DateTimeDefault.register(pandas.Series.dt.unit)(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_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.dt_as_unit_BaseQueryCompiler.dt_asfreq.return.DateTimeDefault_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.dt_as_unit_BaseQueryCompiler.dt_asfreq.return.DateTimeDefault_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4627, "end_line": 4808, "span_ids": ["BaseQueryCompiler.dt_normalize", "BaseQueryCompiler.dt_seconds", "BaseQueryCompiler.dt_is_year_start", "BaseQueryCompiler.dt_quarter", "BaseQueryCompiler.dt_as_unit", "BaseQueryCompiler.dt_microseconds", "BaseQueryCompiler.dt_nanosecond", "BaseQueryCompiler.dt_qyear", "BaseQueryCompiler.dt_time", "BaseQueryCompiler.dt_microsecond", "BaseQueryCompiler.dt_round", "BaseQueryCompiler.dt_month", "BaseQueryCompiler.dt_is_leap_year", "BaseQueryCompiler.dt_start_time", "BaseQueryCompiler.dt_is_month_start", "BaseQueryCompiler.dt_nanoseconds", "BaseQueryCompiler.dt_minute", "BaseQueryCompiler.dt_is_quarter_end", "BaseQueryCompiler.dt_strftime", "BaseQueryCompiler.dt_is_year_end", "BaseQueryCompiler.dt_timetz", "BaseQueryCompiler.dt_is_month_end", "BaseQueryCompiler.dt_isocalendar", "BaseQueryCompiler.dt_hour", "BaseQueryCompiler.dt_second", "BaseQueryCompiler.dt_asfreq", "BaseQueryCompiler.dt_is_quarter_start", "BaseQueryCompiler.dt_month_name"], "tokens": 1553}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.add_refer_to(\"Series.dt.as_unit\")\n def dt_as_unit(self, *args, **kwargs): # noqa: PR01, RT01\n return DateTimeDefault.register(pandas.Series.dt.as_unit)(self, *args, **kwargs)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"Calculate year, week, and day according to the ISO 8601 standard.\",\n refer_to=\"isocalendar\",\n )\n def dt_isocalendar(self):\n return DateTimeDefault.register(pandas.Series.dt.isocalendar)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"hour\", refer_to=\"hour\")\n def dt_hour(self):\n return DateTimeDefault.register(pandas.Series.dt.hour)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether corresponding year is leap\",\n refer_to=\"is_leap_year\",\n )\n def dt_is_leap_year(self):\n return DateTimeDefault.register(pandas.Series.dt.is_leap_year)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether the date is the last day of the month\",\n refer_to=\"is_month_end\",\n )\n def dt_is_month_end(self):\n return DateTimeDefault.register(pandas.Series.dt.is_month_end)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether the date is the first day of the month\",\n refer_to=\"is_month_start\",\n )\n def dt_is_month_start(self):\n return DateTimeDefault.register(pandas.Series.dt.is_month_start)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether the date is the last day of the quarter\",\n refer_to=\"is_quarter_end\",\n )\n def dt_is_quarter_end(self):\n return DateTimeDefault.register(pandas.Series.dt.is_quarter_end)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether the date is the first day of the quarter\",\n refer_to=\"is_quarter_start\",\n )\n def dt_is_quarter_start(self):\n return DateTimeDefault.register(pandas.Series.dt.is_quarter_start)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether the date is the last day of the year\",\n refer_to=\"is_year_end\",\n )\n def dt_is_year_end(self):\n return DateTimeDefault.register(pandas.Series.dt.is_year_end)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the boolean of whether the date is the first day of the year\",\n refer_to=\"is_year_start\",\n )\n def dt_is_year_start(self):\n return DateTimeDefault.register(pandas.Series.dt.is_year_start)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"microseconds component\", refer_to=\"microsecond\")\n def dt_microsecond(self):\n return DateTimeDefault.register(pandas.Series.dt.microsecond)(self)\n\n @doc_utils.doc_dt_interval(prop=\"microseconds component\", refer_to=\"microseconds\")\n def dt_microseconds(self):\n return DateTimeDefault.register(pandas.Series.dt.microseconds)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"minute component\", refer_to=\"minute\")\n def dt_minute(self):\n return DateTimeDefault.register(pandas.Series.dt.minute)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"month component\", refer_to=\"month\")\n def dt_month(self):\n return DateTimeDefault.register(pandas.Series.dt.month)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"the month name\", refer_to=\"month name\", params=\"locale : str, optional\"\n )\n def dt_month_name(self, locale=None):\n return DateTimeDefault.register(pandas.Series.dt.month_name)(self, locale)\n\n @doc_utils.doc_dt_timestamp(prop=\"nanoseconds component\", refer_to=\"nanosecond\")\n def dt_nanosecond(self):\n return DateTimeDefault.register(pandas.Series.dt.nanosecond)(self)\n\n @doc_utils.doc_dt_interval(prop=\"nanoseconds component\", refer_to=\"nanoseconds\")\n def dt_nanoseconds(self):\n return DateTimeDefault.register(pandas.Series.dt.nanoseconds)(self)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.normalize\")\n def dt_normalize(self):\n \"\"\"\n Set the time component of each date-time value to midnight.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing date-time values with midnight time.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.normalize)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"quarter component\", refer_to=\"quarter\")\n def dt_quarter(self):\n return DateTimeDefault.register(pandas.Series.dt.quarter)(self)\n\n @doc_utils.doc_dt_period(prop=\"the fiscal year\", refer_to=\"qyear\")\n def dt_qyear(self):\n return DateTimeDefault.register(pandas.Series.dt.qyear)(self)\n\n @doc_utils.doc_dt_round(refer_to=\"round\")\n def dt_round(self, freq, ambiguous=\"raise\", nonexistent=\"raise\"):\n return DateTimeDefault.register(pandas.Series.dt.round)(\n self, freq, ambiguous, nonexistent\n )\n\n @doc_utils.doc_dt_timestamp(prop=\"seconds component\", refer_to=\"second\")\n def dt_second(self):\n return DateTimeDefault.register(pandas.Series.dt.second)(self)\n\n @doc_utils.doc_dt_interval(prop=\"seconds component\", refer_to=\"seconds\")\n def dt_seconds(self):\n return DateTimeDefault.register(pandas.Series.dt.seconds)(self)\n\n @doc_utils.doc_dt_period(prop=\"the timestamp of start time\", refer_to=\"start_time\")\n def dt_start_time(self):\n return DateTimeDefault.register(pandas.Series.dt.start_time)(self)\n\n @doc_utils.add_refer_to(\"Series.dt.strftime\")\n def dt_strftime(self, date_format):\n \"\"\"\n Format underlying date-time data using specified format.\n\n Parameters\n ----------\n date_format : str\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing formatted date-time values.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.strftime)(self, date_format)\n\n @doc_utils.doc_dt_timestamp(prop=\"time component\", refer_to=\"time\")\n def dt_time(self):\n return DateTimeDefault.register(pandas.Series.dt.time)(self)\n\n @doc_utils.doc_dt_timestamp(\n prop=\"time component with timezone information\", refer_to=\"timetz\"\n )\n def dt_timetz(self):\n return DateTimeDefault.register(pandas.Series.dt.timetz)(self)\n\n @doc_utils.add_refer_to(\"Series.dt.asfreq\")\n def dt_asfreq(self, freq=None, how: str = \"E\"):\n \"\"\"\n Convert the PeriodArray to the specified frequency `freq`.\n\n Equivalent to applying pandas.Period.asfreq() with the given arguments to each Period in this PeriodArray.\n\n Parameters\n ----------\n freq : str, optional\n A frequency.\n how : str {'E', 'S'}, default: 'E'\n Whether the elements should be aligned to the end or start within pa period.\n * 'E', \"END\", or \"FINISH\" for end,\n * 'S', \"START\", or \"BEGIN\" for start.\n January 31st (\"END\") vs. January 1st (\"START\") for example.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing period data.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.asfreq)(self, freq, how)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.dt_to_period_BaseQueryCompiler.resample_asfreq.return.ResampleDefault_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.dt_to_period_BaseQueryCompiler.resample_asfreq.return.ResampleDefault_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4810, "end_line": 5038, "span_ids": ["BaseQueryCompiler.dt_to_pydatetime", "BaseQueryCompiler.last", "BaseQueryCompiler.dt_to_timestamp", "BaseQueryCompiler.resample_asfreq", "BaseQueryCompiler.resample_app_df", "BaseQueryCompiler.dt_total_seconds", "BaseQueryCompiler.dt_to_pytimedelta", "BaseQueryCompiler.first", "BaseQueryCompiler.dt_weekday", "BaseQueryCompiler.dt_tz_localize", "BaseQueryCompiler.dt_tz", "BaseQueryCompiler.dt_tz_convert", "BaseQueryCompiler.resample_agg_df", "BaseQueryCompiler.dt_to_period", "BaseQueryCompiler.resample_agg_ser", "BaseQueryCompiler.resample_app_ser", "BaseQueryCompiler.dt_year"], "tokens": 1808}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.to_period\")\n def dt_to_period(self, freq=None):\n \"\"\"\n Convert underlying data to the period at a particular frequency.\n\n Parameters\n ----------\n freq : str, optional\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing period data.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.to_period)(self, freq)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.to_pydatetime\")\n def dt_to_pydatetime(self):\n \"\"\"\n Convert underlying data to array of python native ``datetime``.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing 1D array of ``datetime`` objects.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.to_pydatetime)(self)\n\n # FIXME: there are no references to this method, we should either remove it\n # or add a call reference at the DataFrame level (Modin issue #3103).\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.to_pytimedelta\")\n def dt_to_pytimedelta(self):\n \"\"\"\n Convert underlying data to array of python native ``datetime.timedelta``.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing 1D array of ``datetime.timedelta``.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.to_pytimedelta)(self)\n\n @doc_utils.doc_dt_period(\n prop=\"the timestamp representation\", refer_to=\"to_timestamp\"\n )\n def dt_to_timestamp(self):\n return DateTimeDefault.register(pandas.Series.dt.to_timestamp)(self)\n\n @doc_utils.doc_dt_interval(prop=\"duration in seconds\", refer_to=\"total_seconds\")\n def dt_total_seconds(self):\n return DateTimeDefault.register(pandas.Series.dt.total_seconds)(self)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.tz\")\n def dt_tz(self):\n \"\"\"\n Get the time-zone of the underlying time-series data.\n\n Returns\n -------\n BaseQueryCompiler\n QueryCompiler containing a single value, time-zone of the data.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.tz)(self)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.tz_convert\")\n def dt_tz_convert(self, tz):\n \"\"\"\n Convert time-series data to the specified time zone.\n\n Parameters\n ----------\n tz : str, pytz.timezone\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing values with converted time zone.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.tz_convert)(self, tz)\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.dt.tz_localize\")\n def dt_tz_localize(self, tz, ambiguous=\"raise\", nonexistent=\"raise\"):\n \"\"\"\n Localize tz-naive to tz-aware.\n\n Parameters\n ----------\n tz : str, pytz.timezone, optional\n ambiguous : {\"raise\", \"inner\", \"NaT\"} or bool mask, default: \"raise\"\n nonexistent : {\"raise\", \"shift_forward\", \"shift_backward, \"NaT\"} or pandas.timedelta, default: \"raise\"\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing values with localized time zone.\n \"\"\"\n return DateTimeDefault.register(pandas.Series.dt.tz_localize)(\n self, tz, ambiguous, nonexistent\n )\n\n @doc_utils.doc_dt_timestamp(prop=\"integer day of week\", refer_to=\"weekday\")\n def dt_weekday(self):\n return DateTimeDefault.register(pandas.Series.dt.weekday)(self)\n\n @doc_utils.doc_dt_timestamp(prop=\"year component\", refer_to=\"year\")\n def dt_year(self):\n return DateTimeDefault.register(pandas.Series.dt.year)(self)\n\n # End of DateTime methods\n\n def first(self, offset: pandas.DateOffset):\n \"\"\"\n Select initial periods of time series data based on a date offset.\n\n When having a query compiler with dates as index, this function can\n select the first few rows based on a date offset.\n\n Parameters\n ----------\n offset : pandas.DateOffset\n The offset length of the data to select.\n\n Returns\n -------\n BaseQueryCompiler\n New compiler containing the selected data.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.first)(self, offset)\n\n def last(self, offset: pandas.DateOffset):\n \"\"\"\n Select final periods of time series data based on a date offset.\n\n For a query compiler with a sorted DatetimeIndex, this function\n selects the last few rows based on a date offset.\n\n Parameters\n ----------\n offset : pandas.DateOffset\n The offset length of the data to select.\n\n Returns\n -------\n BaseQueryCompiler\n New compiler containing the selected data.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.last)(self, offset)\n\n # Resample methods\n\n # FIXME:\n # 1. Query Compiler shouldn't care about differences between Series and DataFrame\n # so `resample_agg_df` and `resample_agg_ser` should be combined (Modin issue #3104).\n # 2. In DataFrame API `Resampler.aggregate` is an alias for `Resampler.apply`\n # we should remove one of these methods: `resample_agg_*` or `resample_app_*` (Modin issue #3107).\n @doc_utils.doc_resample_agg(\n action=\"apply passed aggregation function\",\n params=\"func : str, dict, callable(pandas.Series) -> scalar, or list of such\",\n output=\"function names\",\n refer_to=\"agg\",\n )\n def resample_agg_df(self, resample_kwargs, func, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.aggregate)(\n self, resample_kwargs, func, *args, **kwargs\n )\n\n @doc_utils.add_deprecation_warning(replacement_method=\"resample_agg_df\")\n @doc_utils.doc_resample_agg(\n action=\"apply passed aggregation function in a one-column query compiler\",\n params=\"func : str, dict, callable(pandas.Series) -> scalar, or list of such\",\n output=\"function names\",\n refer_to=\"agg\",\n )\n def resample_agg_ser(self, resample_kwargs, func, *args, **kwargs):\n return ResampleDefault.register(\n pandas.core.resample.Resampler.aggregate, squeeze_self=True\n )(self, resample_kwargs, func, *args, **kwargs)\n\n @doc_utils.add_deprecation_warning(replacement_method=\"resample_agg_df\")\n @doc_utils.doc_resample_agg(\n action=\"apply passed aggregation function\",\n params=\"func : str, dict, callable(pandas.Series) -> scalar, or list of such\",\n output=\"function names\",\n refer_to=\"apply\",\n )\n def resample_app_df(self, resample_kwargs, func, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.apply)(\n self, resample_kwargs, func, *args, **kwargs\n )\n\n @doc_utils.add_deprecation_warning(replacement_method=\"resample_agg_df\")\n @doc_utils.doc_resample_agg(\n action=\"apply passed aggregation function in a one-column query compiler\",\n params=\"func : str, dict, callable(pandas.Series) -> scalar, or list of such\",\n output=\"function names\",\n refer_to=\"apply\",\n )\n def resample_app_ser(self, resample_kwargs, func, *args, **kwargs):\n return ResampleDefault.register(\n pandas.core.resample.Resampler.apply, squeeze_self=True\n )(self, resample_kwargs, func, *args, **kwargs)\n\n def resample_asfreq(self, resample_kwargs, fill_value):\n \"\"\"\n Resample time-series data and get the values at the new frequency.\n\n Group data into intervals by time-series row/column with\n a specified frequency and get values at the new frequency.\n\n Parameters\n ----------\n resample_kwargs : dict\n Resample parameters as expected by ``modin.pandas.DataFrame.resample`` signature.\n fill_value : scalar\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing values at the specified frequency.\n \"\"\"\n return ResampleDefault.register(pandas.core.resample.Resampler.asfreq)(\n self, resample_kwargs, fill_value\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.resample_bfill_BaseQueryCompiler.resample_interpolate.return.ResampleDefault_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.resample_bfill_BaseQueryCompiler.resample_interpolate.return.ResampleDefault_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5040, "end_line": 5141, "span_ids": ["BaseQueryCompiler.resample_get_group", "BaseQueryCompiler.resample_ffill", "BaseQueryCompiler.resample_count", "BaseQueryCompiler.resample_fillna", "BaseQueryCompiler.resample_interpolate", "BaseQueryCompiler.resample_bfill", "BaseQueryCompiler.resample_first"], "tokens": 793}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_resample_fillna(method=\"back-fill\", refer_to=\"bfill\")\n def resample_bfill(self, resample_kwargs, limit):\n return ResampleDefault.register(pandas.core.resample.Resampler.bfill)(\n self, resample_kwargs, limit\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"number of non-NA values\", refer_to=\"count\", compatibility_params=False\n )\n def resample_count(self, resample_kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.count)(\n self, resample_kwargs\n )\n\n @doc_utils.doc_resample_fillna(method=\"forward-fill\", refer_to=\"ffill\")\n def resample_ffill(self, resample_kwargs, limit):\n return ResampleDefault.register(pandas.core.resample.Resampler.ffill)(\n self, resample_kwargs, limit\n )\n\n # FIXME: we should combine all resample fillna methods into `resample_fillna`\n # (Modin issue #3107)\n @doc_utils.doc_resample_fillna(\n method=\"specified\", refer_to=\"fillna\", params=\"method : str\"\n )\n def resample_fillna(self, resample_kwargs, method, limit):\n return ResampleDefault.register(pandas.core.resample.Resampler.fillna)(\n self, resample_kwargs, method, limit\n )\n\n @doc_utils.doc_resample_reduce(result=\"first element\", refer_to=\"first\")\n def resample_first(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.first)(\n self, resample_kwargs, *args, **kwargs\n )\n\n # FIXME: This function takes Modin DataFrame via `obj` parameter,\n # we should avoid leaking of the high-level objects to the query compiler level.\n # (Modin issue #3106)\n def resample_get_group(self, resample_kwargs, name, obj):\n \"\"\"\n Resample time-series data and get the specified group.\n\n Group data into intervals by time-series row/column with\n a specified frequency and get the values of the specified group.\n\n Parameters\n ----------\n resample_kwargs : dict\n Resample parameters as expected by ``modin.pandas.DataFrame.resample`` signature.\n name : object\n obj : modin.pandas.DataFrame, optional\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the values from the specified group.\n \"\"\"\n return ResampleDefault.register(pandas.core.resample.Resampler.get_group)(\n self, resample_kwargs, name, obj\n )\n\n @doc_utils.doc_resample_fillna(\n method=\"specified interpolation\",\n refer_to=\"interpolate\",\n params=\"\"\"\n method : str\n axis : {0, 1}\n limit : int\n inplace : {False}\n This parameter serves the compatibility purpose. Always has to be False.\n limit_direction : {\"forward\", \"backward\", \"both\"}\n limit_area : {None, \"inside\", \"outside\"}\n downcast : str, optional\n **kwargs : dict\n \"\"\",\n overwrite_template_params=True,\n )\n def resample_interpolate(\n self,\n resample_kwargs,\n method,\n axis,\n limit,\n inplace,\n limit_direction,\n limit_area,\n downcast,\n **kwargs,\n ):\n return ResampleDefault.register(pandas.core.resample.Resampler.interpolate)(\n self,\n resample_kwargs,\n method,\n axis=axis,\n limit=limit,\n inplace=inplace,\n limit_direction=limit_direction,\n limit_area=limit_area,\n downcast=downcast,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.resample_last_BaseQueryCompiler.str_contains.return.StrDefault_register_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.resample_last_BaseQueryCompiler.str_contains.return.StrDefault_register_panda", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5143, "end_line": 5356, "span_ids": ["BaseQueryCompiler.str_center", "BaseQueryCompiler.str_contains", "BaseQueryCompiler.resample_size", "BaseQueryCompiler.resample_quantile", "BaseQueryCompiler.resample_std", "BaseQueryCompiler.resample_nearest", "BaseQueryCompiler.resample_transform", "BaseQueryCompiler.resample_ohlc_df", "BaseQueryCompiler.resample_mean", "BaseQueryCompiler.resample_min", "BaseQueryCompiler.resample_sem", "BaseQueryCompiler.resample_last", "BaseQueryCompiler.resample_nunique", "BaseQueryCompiler.resample_var", "BaseQueryCompiler.resample_ohlc_ser", "BaseQueryCompiler.resample_sum", "BaseQueryCompiler.resample_max", "BaseQueryCompiler.resample_median", "BaseQueryCompiler.resample_pipe", "BaseQueryCompiler.str_capitalize", "BaseQueryCompiler.resample_prod"], "tokens": 1950}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_resample_reduce(result=\"last element\", refer_to=\"last\")\n def resample_last(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.last)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(result=\"maximum value\", refer_to=\"max\")\n def resample_max(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.max)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(result=\"mean value\", refer_to=\"mean\")\n def resample_mean(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.mean)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(result=\"median value\", refer_to=\"median\")\n def resample_median(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.median)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(result=\"minimum value\", refer_to=\"min\")\n def resample_min(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.min)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_fillna(method=\"'nearest'\", refer_to=\"nearest\")\n def resample_nearest(self, resample_kwargs, limit):\n return ResampleDefault.register(pandas.core.resample.Resampler.nearest)(\n self, resample_kwargs, limit\n )\n\n @doc_utils.doc_resample_reduce(result=\"number of unique values\", refer_to=\"nunique\")\n def resample_nunique(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.nunique)(\n self, resample_kwargs, *args, **kwargs\n )\n\n # FIXME: Query Compiler shouldn't care about differences between Series and DataFrame\n # so `resample_ohlc_df` and `resample_ohlc_ser` should be combined (Modin issue #3104).\n @doc_utils.doc_resample_agg(\n action=\"compute open, high, low and close values\",\n output=\"labels of columns containing computed values\",\n refer_to=\"ohlc\",\n )\n def resample_ohlc_df(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.ohlc)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_agg(\n action=\"compute open, high, low and close values\",\n output=\"labels of columns containing computed values\",\n refer_to=\"ohlc\",\n )\n def resample_ohlc_ser(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(\n pandas.core.resample.Resampler.ohlc, squeeze_self=True\n )(self, resample_kwargs, *args, **kwargs)\n\n # FIXME: This method require us to build high-level resampler object\n # which we shouldn't do at the query compiler. We need to move this at the front.\n # (Modin issue #3105)\n @doc_utils.add_refer_to(\"Resampler.pipe\")\n def resample_pipe(self, resample_kwargs, func, *args, **kwargs):\n \"\"\"\n Resample time-series data and apply aggregation on it.\n\n Group data into intervals by time-series row/column with\n a specified frequency, build equivalent ``pandas.Resampler`` object\n and apply passed function to it.\n\n Parameters\n ----------\n resample_kwargs : dict\n Resample parameters as expected by ``modin.pandas.DataFrame.resample`` signature.\n func : callable(pandas.Resampler) -> object or tuple(callable, str)\n *args : iterable\n Positional arguments to pass to function.\n **kwargs : dict\n Keyword arguments to pass to function.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the result of passed function.\n \"\"\"\n return ResampleDefault.register(pandas.core.resample.Resampler.pipe)(\n self, resample_kwargs, func, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"product\",\n params=\"min_count : int\",\n refer_to=\"prod\",\n )\n def resample_prod(self, resample_kwargs, min_count, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.prod)(\n self, resample_kwargs, min_count, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"quantile\", params=\"q : float\", refer_to=\"quantile\"\n )\n def resample_quantile(self, resample_kwargs, q, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.quantile)(\n self, resample_kwargs, q, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"standard error of the mean\",\n refer_to=\"sem\",\n )\n def resample_sem(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.sem)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"number of elements in a group\", refer_to=\"size\"\n )\n def resample_size(self, resample_kwargs, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.size)(\n self, resample_kwargs, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"standard deviation\", params=\"ddof : int\", refer_to=\"std\"\n )\n def resample_std(self, resample_kwargs, ddof, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.std)(\n self, resample_kwargs, ddof, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"sum\",\n params=\"min_count : int\",\n refer_to=\"sum\",\n )\n def resample_sum(self, resample_kwargs, min_count, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.sum)(\n self, resample_kwargs, min_count, *args, **kwargs\n )\n\n def resample_transform(self, resample_kwargs, arg, *args, **kwargs):\n \"\"\"\n Resample time-series data and apply aggregation on it.\n\n Group data into intervals by time-series row/column with\n a specified frequency and call passed function on each group.\n In contrast to ``resample_app_df`` apply function to the whole group,\n instead of a single axis.\n\n Parameters\n ----------\n resample_kwargs : dict\n Resample parameters as expected by ``modin.pandas.DataFrame.resample`` signature.\n arg : callable(pandas.DataFrame) -> pandas.Series\n *args : iterable\n Positional arguments to pass to function.\n **kwargs : dict\n Keyword arguments to pass to function.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the result of passed function.\n \"\"\"\n return ResampleDefault.register(pandas.core.resample.Resampler.transform)(\n self, resample_kwargs, arg, *args, **kwargs\n )\n\n @doc_utils.doc_resample_reduce(\n result=\"variance\", params=\"ddof : int\", refer_to=\"var\"\n )\n def resample_var(self, resample_kwargs, ddof, *args, **kwargs):\n return ResampleDefault.register(pandas.core.resample.Resampler.var)(\n self, resample_kwargs, ddof, *args, **kwargs\n )\n\n # End of Resample methods\n\n # Str methods\n\n @doc_utils.doc_str_method(refer_to=\"capitalize\", params=\"\")\n def str_capitalize(self):\n return StrDefault.register(pandas.Series.str.capitalize)(self)\n\n @doc_utils.doc_str_method(\n refer_to=\"center\",\n params=\"\"\"\n width : int\n fillchar : str, default: ' '\"\"\",\n )\n def str_center(self, width, fillchar=\" \"):\n return StrDefault.register(pandas.Series.str.center)(self, width, fillchar)\n\n @doc_utils.doc_str_method(\n refer_to=\"contains\",\n params=\"\"\"\n pat : str\n case : bool, default: True\n flags : int, default: 0\n na : object, default: None\n regex : bool, default: True\"\"\",\n )\n def str_contains(self, pat, case=True, flags=0, na=None, regex=True):\n return StrDefault.register(pandas.Series.str.contains)(\n self, pat, case, flags, na, regex\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.str_count_BaseQueryCompiler.str_replace.return.StrDefault_register_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.str_count_BaseQueryCompiler.str_replace.return.StrDefault_register_panda", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5358, "end_line": 5567, "span_ids": ["BaseQueryCompiler.str_extract", "BaseQueryCompiler.str_removesuffix", "BaseQueryCompiler.str_removeprefix", "BaseQueryCompiler.str_isupper", "BaseQueryCompiler.str_partition", "BaseQueryCompiler.str_index", "BaseQueryCompiler.str_repeat", "BaseQueryCompiler.str_replace", "BaseQueryCompiler.str_isdecimal", "BaseQueryCompiler.str_find", "BaseQueryCompiler.str_fullmatch", "BaseQueryCompiler.str_isalpha", "BaseQueryCompiler.str_join", "BaseQueryCompiler.str_isspace", "BaseQueryCompiler.str_endswith", "BaseQueryCompiler.str_count", "BaseQueryCompiler.str_islower", "BaseQueryCompiler.str_isdigit", "BaseQueryCompiler.str_len", "BaseQueryCompiler.str_lower", "BaseQueryCompiler.str_lstrip", "BaseQueryCompiler.str_isalnum", "BaseQueryCompiler.str_match", "BaseQueryCompiler.str_normalize", "BaseQueryCompiler.str_pad", "BaseQueryCompiler.str_findall", "BaseQueryCompiler.str_get", "BaseQueryCompiler.str_isnumeric", "BaseQueryCompiler.str_extractall", "BaseQueryCompiler.str_ljust", "BaseQueryCompiler.str_get_dummies", "BaseQueryCompiler.str_istitle"], "tokens": 1820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_str_method(\n refer_to=\"count\",\n params=\"\"\"\n pat : str\n flags : int, default: 0\"\"\",\n )\n def str_count(self, pat, flags=0):\n return StrDefault.register(pandas.Series.str.count)(self, pat, flags)\n\n @doc_utils.doc_str_method(\n refer_to=\"endswith\",\n params=\"\"\"\n pat : str\n na : object, default: None\"\"\",\n )\n def str_endswith(self, pat, na=None):\n return StrDefault.register(pandas.Series.str.endswith)(self, pat, na)\n\n @doc_utils.doc_str_method(\n refer_to=\"find\",\n params=\"\"\"\n sub : str\n start : int, default: 0\n end : int, optional\"\"\",\n )\n def str_find(self, sub, start=0, end=None):\n return StrDefault.register(pandas.Series.str.find)(self, sub, start, end)\n\n @doc_utils.doc_str_method(\n refer_to=\"findall\",\n params=\"\"\"\n pat : str\n flags : int, default: 0\"\"\",\n )\n def str_findall(self, pat, flags=0):\n return StrDefault.register(pandas.Series.str.findall)(self, pat, flags)\n\n @doc_utils.doc_str_method(\n refer_to=\"fullmatch\",\n params=\"\"\"\n pat : str\n case : bool, default: True\n flags : int, default: 0\n na : object, default: None\"\"\",\n )\n def str_fullmatch(self, pat, case=True, flags=0, na=None):\n return StrDefault.register(pandas.Series.str.fullmatch)(\n self, pat, case, flags, na\n )\n\n @doc_utils.doc_str_method(refer_to=\"get\", params=\"i : int\")\n def str_get(self, i):\n return StrDefault.register(pandas.Series.str.get)(self, i)\n\n @doc_utils.doc_str_method(refer_to=\"get_dummies\", params=\"sep : str\")\n def str_get_dummies(self, sep):\n return StrDefault.register(pandas.Series.str.get_dummies)(self, sep)\n\n @doc_utils.doc_str_method(\n refer_to=\"index\",\n params=\"\"\"\n sub : str\n start : int, default: 0\n end : int, optional\"\"\",\n )\n def str_index(self, sub, start=0, end=None):\n return StrDefault.register(pandas.Series.str.index)(self, sub, start, end)\n\n @doc_utils.doc_str_method(refer_to=\"isalnum\", params=\"\")\n def str_isalnum(self):\n return StrDefault.register(pandas.Series.str.isalnum)(self)\n\n @doc_utils.doc_str_method(refer_to=\"isalpha\", params=\"\")\n def str_isalpha(self):\n return StrDefault.register(pandas.Series.str.isalpha)(self)\n\n @doc_utils.doc_str_method(refer_to=\"isdecimal\", params=\"\")\n def str_isdecimal(self):\n return StrDefault.register(pandas.Series.str.isdecimal)(self)\n\n @doc_utils.doc_str_method(refer_to=\"isdigit\", params=\"\")\n def str_isdigit(self):\n return StrDefault.register(pandas.Series.str.isdigit)(self)\n\n @doc_utils.doc_str_method(refer_to=\"islower\", params=\"\")\n def str_islower(self):\n return StrDefault.register(pandas.Series.str.islower)(self)\n\n @doc_utils.doc_str_method(refer_to=\"isnumeric\", params=\"\")\n def str_isnumeric(self):\n return StrDefault.register(pandas.Series.str.isnumeric)(self)\n\n @doc_utils.doc_str_method(refer_to=\"isspace\", params=\"\")\n def str_isspace(self):\n return StrDefault.register(pandas.Series.str.isspace)(self)\n\n @doc_utils.doc_str_method(refer_to=\"istitle\", params=\"\")\n def str_istitle(self):\n return StrDefault.register(pandas.Series.str.istitle)(self)\n\n @doc_utils.doc_str_method(refer_to=\"isupper\", params=\"\")\n def str_isupper(self):\n return StrDefault.register(pandas.Series.str.isupper)(self)\n\n @doc_utils.doc_str_method(refer_to=\"join\", params=\"sep : str\")\n def str_join(self, sep):\n return StrDefault.register(pandas.Series.str.join)(self, sep)\n\n @doc_utils.doc_str_method(refer_to=\"len\", params=\"\")\n def str_len(self):\n return StrDefault.register(pandas.Series.str.len)(self)\n\n @doc_utils.doc_str_method(\n refer_to=\"ljust\",\n params=\"\"\"\n width : int\n fillchar : str, default: ' '\"\"\",\n )\n def str_ljust(self, width, fillchar=\" \"):\n return StrDefault.register(pandas.Series.str.ljust)(self, width, fillchar)\n\n @doc_utils.doc_str_method(refer_to=\"lower\", params=\"\")\n def str_lower(self):\n return StrDefault.register(pandas.Series.str.lower)(self)\n\n @doc_utils.doc_str_method(refer_to=\"lstrip\", params=\"to_strip : str, optional\")\n def str_lstrip(self, to_strip=None):\n return StrDefault.register(pandas.Series.str.lstrip)(self, to_strip)\n\n @doc_utils.doc_str_method(\n refer_to=\"match\",\n params=\"\"\"\n pat : str\n case : bool, default: True\n flags : int, default: 0\n na : object, default: None\"\"\",\n )\n def str_match(self, pat, case=True, flags=0, na=None):\n return StrDefault.register(pandas.Series.str.match)(self, pat, case, flags, na)\n\n @doc_utils.doc_str_method(\n refer_to=\"extract\",\n params=\"\"\"\n pat : str\n flags : int, default: 0\n expand : bool, default: True\"\"\",\n )\n def str_extract(self, pat, flags=0, expand=True):\n return StrDefault.register(pandas.Series.str.extract)(self, pat, flags, expand)\n\n @doc_utils.doc_str_method(\n refer_to=\"extractall\",\n params=\"\"\"\n pat : str\n flags : int, default: 0\"\"\",\n )\n def str_extractall(self, pat, flags=0):\n return StrDefault.register(pandas.Series.str.extractall)(self, pat, flags)\n\n @doc_utils.doc_str_method(\n refer_to=\"normalize\", params=\"form : {'NFC', 'NFKC', 'NFD', 'NFKD'}\"\n )\n def str_normalize(self, form):\n return StrDefault.register(pandas.Series.str.normalize)(self, form)\n\n @doc_utils.doc_str_method(\n refer_to=\"pad\",\n params=\"\"\"\n width : int\n side : {'left', 'right', 'both'}, default: 'left'\n fillchar : str, default: ' '\"\"\",\n )\n def str_pad(self, width, side=\"left\", fillchar=\" \"):\n return StrDefault.register(pandas.Series.str.pad)(self, width, side, fillchar)\n\n @doc_utils.doc_str_method(\n refer_to=\"partition\",\n params=\"\"\"\n sep : str, default: ' '\n expand : bool, default: True\"\"\",\n )\n def str_partition(self, sep=\" \", expand=True):\n return StrDefault.register(pandas.Series.str.partition)(self, sep, expand)\n\n @doc_utils.doc_str_method(refer_to=\"removeprefix\", params=\"prefix : str\")\n def str_removeprefix(self, prefix):\n return StrDefault.register(pandas.Series.str.removeprefix)(self, prefix)\n\n @doc_utils.doc_str_method(refer_to=\"removesuffix\", params=\"suffix : str\")\n def str_removesuffix(self, suffix):\n return StrDefault.register(pandas.Series.str.removesuffix)(self, suffix)\n\n @doc_utils.doc_str_method(refer_to=\"repeat\", params=\"repeats : int\")\n def str_repeat(self, repeats):\n return StrDefault.register(pandas.Series.str.repeat)(self, repeats)\n\n @doc_utils.doc_str_method(\n refer_to=\"replace\",\n params=\"\"\"\n pat : str\n repl : str or callable\n n : int, default: -1\n case : bool, optional\n flags : int, default: 0\n regex : bool, default: None\"\"\",\n )\n def str_replace(self, pat, repl, n=-1, case=None, flags=0, regex=None):\n return StrDefault.register(pandas.Series.str.replace)(\n self, pat, repl, n, case, flags, regex\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.str_rfind_BaseQueryCompiler.rolling_corr.return.RollingDefault_register_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.str_rfind_BaseQueryCompiler.rolling_corr.return.RollingDefault_register_p", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5569, "end_line": 5815, "span_ids": ["BaseQueryCompiler.rolling_apply", "BaseQueryCompiler.str_split", "BaseQueryCompiler.str_cat", "BaseQueryCompiler.str_wrap", "BaseQueryCompiler.str_swapcase", "BaseQueryCompiler.str_rstrip", "BaseQueryCompiler.str_strip", "BaseQueryCompiler.str_casefold", "BaseQueryCompiler.str_rpartition", "BaseQueryCompiler.str_slice_replace", "BaseQueryCompiler.str___getitem__", "BaseQueryCompiler.str_rjust", "BaseQueryCompiler.str_rfind", "BaseQueryCompiler.str_upper", "BaseQueryCompiler.str_rsplit", "BaseQueryCompiler.str_startswith", "BaseQueryCompiler.str_translate", "BaseQueryCompiler.str_zfill", "BaseQueryCompiler.rolling_corr", "BaseQueryCompiler.rolling_aggregate", "BaseQueryCompiler.str_slice", "BaseQueryCompiler.str_title", "BaseQueryCompiler.str_encode", "BaseQueryCompiler.str_decode", "BaseQueryCompiler.str_rindex"], "tokens": 2015}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_str_method(\n refer_to=\"rfind\",\n params=\"\"\"\n sub : str\n start : int, default: 0\n end : int, optional\"\"\",\n )\n def str_rfind(self, sub, start=0, end=None):\n return StrDefault.register(pandas.Series.str.rfind)(self, sub, start, end)\n\n @doc_utils.doc_str_method(\n refer_to=\"rindex\",\n params=\"\"\"\n sub : str\n start : int, default: 0\n end : int, optional\"\"\",\n )\n def str_rindex(self, sub, start=0, end=None):\n return StrDefault.register(pandas.Series.str.rindex)(self, sub, start, end)\n\n @doc_utils.doc_str_method(\n refer_to=\"rjust\",\n params=\"\"\"\n width : int\n fillchar : str, default: ' '\"\"\",\n )\n def str_rjust(self, width, fillchar=\" \"):\n return StrDefault.register(pandas.Series.str.rjust)(self, width, fillchar)\n\n @doc_utils.doc_str_method(\n refer_to=\"rpartition\",\n params=\"\"\"\n sep : str, default: ' '\n expand : bool, default: True\"\"\",\n )\n def str_rpartition(self, sep=\" \", expand=True):\n return StrDefault.register(pandas.Series.str.rpartition)(self, sep, expand)\n\n @doc_utils.doc_str_method(\n refer_to=\"rsplit\",\n params=\"\"\"\n pat : str, optional\n n : int, default: -1\n expand : bool, default: False\"\"\",\n )\n def str_rsplit(self, pat=None, *, n=-1, expand=False):\n return StrDefault.register(pandas.Series.str.rsplit)(\n self, pat, n=n, expand=expand\n )\n\n @doc_utils.doc_str_method(refer_to=\"rstrip\", params=\"to_strip : str, optional\")\n def str_rstrip(self, to_strip=None):\n return StrDefault.register(pandas.Series.str.rstrip)(self, to_strip)\n\n @doc_utils.doc_str_method(\n refer_to=\"slice\",\n params=\"\"\"\n start : int, optional\n stop : int, optional\n step : int, optional\"\"\",\n )\n def str_slice(self, start=None, stop=None, step=None):\n return StrDefault.register(pandas.Series.str.slice)(self, start, stop, step)\n\n @doc_utils.doc_str_method(\n refer_to=\"slice_replace\",\n params=\"\"\"\n start : int, optional\n stop : int, optional\n repl : str or callable, optional\"\"\",\n )\n def str_slice_replace(self, start=None, stop=None, repl=None):\n return StrDefault.register(pandas.Series.str.slice_replace)(\n self, start, stop, repl\n )\n\n @doc_utils.doc_str_method(\n refer_to=\"split\",\n params=\"\"\"\n pat : str, optional\n n : int, default: -1\n expand : bool, default: False\n regex : bool, default: None\"\"\",\n )\n def str_split(self, pat=None, *, n=-1, expand=False, regex=None):\n return StrDefault.register(pandas.Series.str.split)(\n self, pat, n=n, expand=expand, regex=regex\n )\n\n @doc_utils.doc_str_method(\n refer_to=\"startswith\",\n params=\"\"\"\n pat : str\n na : object, default: None\"\"\",\n )\n def str_startswith(self, pat, na=None):\n return StrDefault.register(pandas.Series.str.startswith)(self, pat, na)\n\n @doc_utils.doc_str_method(refer_to=\"strip\", params=\"to_strip : str, optional\")\n def str_strip(self, to_strip=None):\n return StrDefault.register(pandas.Series.str.strip)(self, to_strip)\n\n @doc_utils.doc_str_method(refer_to=\"swapcase\", params=\"\")\n def str_swapcase(self):\n return StrDefault.register(pandas.Series.str.swapcase)(self)\n\n @doc_utils.doc_str_method(refer_to=\"title\", params=\"\")\n def str_title(self):\n return StrDefault.register(pandas.Series.str.title)(self)\n\n @doc_utils.doc_str_method(refer_to=\"translate\", params=\"table : dict\")\n def str_translate(self, table):\n return StrDefault.register(pandas.Series.str.translate)(self, table)\n\n @doc_utils.doc_str_method(refer_to=\"upper\", params=\"\")\n def str_upper(self):\n return StrDefault.register(pandas.Series.str.upper)(self)\n\n @doc_utils.doc_str_method(\n refer_to=\"wrap\",\n params=\"\"\"\n width : int\n **kwargs : dict\"\"\",\n )\n def str_wrap(self, width, **kwargs):\n return StrDefault.register(pandas.Series.str.wrap)(self, width, **kwargs)\n\n @doc_utils.doc_str_method(refer_to=\"zfill\", params=\"width : int\")\n def str_zfill(self, width):\n return StrDefault.register(pandas.Series.str.zfill)(self, width)\n\n @doc_utils.doc_str_method(refer_to=\"__getitem__\", params=\"key : object\")\n def str___getitem__(self, key):\n return StrDefault.register(pandas.Series.str.__getitem__)(self, key)\n\n @doc_utils.doc_str_method(\n refer_to=\"encode\",\n params=\"\"\"\n encoding : str,\n errors : str, default = 'strict'\"\"\",\n )\n def str_encode(self, encoding, errors):\n return StrDefault.register(pandas.Series.str.encode)(self, encoding, errors)\n\n @doc_utils.doc_str_method(\n refer_to=\"decode\",\n params=\"\"\"\n encoding : str,\n errors : str, default = 'strict'\"\"\",\n )\n def str_decode(self, encoding, errors):\n return StrDefault.register(pandas.Series.str.decode)(self, encoding, errors)\n\n @doc_utils.doc_str_method(\n refer_to=\"cat\",\n params=\"\"\"\n others : Series, Index, DataFrame, np.ndarray or list-like,\n sep : str, default: '',\n na_rep : str or None, default: None,\n join : {'left', 'right', 'outer', 'inner'}, default: 'left'\"\"\",\n )\n def str_cat(self, others, sep=None, na_rep=None, join=\"left\"):\n return StrDefault.register(pandas.Series.str.cat)(\n self, others, sep, na_rep, join\n )\n\n @doc_utils.doc_str_method(\n refer_to=\"casefold\",\n params=\"\",\n )\n def str_casefold(self):\n return StrDefault.register(pandas.Series.str.casefold)(self)\n\n # End of Str methods\n\n # Rolling methods\n\n # FIXME: most of the rolling/window methods take *args and **kwargs parameters\n # which are only needed for the compatibility with numpy, this behavior is inherited\n # from the API level, we should get rid of it (Modin issue #3108).\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"the result of passed functions\",\n action=\"apply specified functions\",\n refer_to=\"aggregate\",\n params=\"\"\"\n func : str, dict, callable(pandas.Series) -> scalar, or list of such\n *args : iterable\n **kwargs : dict\"\"\",\n build_rules=\"udf_aggregation\",\n )\n def rolling_aggregate(self, fold_axis, rolling_args, func, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.aggregate)(\n self, rolling_args, func, *args, **kwargs\n )\n\n # FIXME: at the query compiler method `rolling_apply` is an alias for `rolling_aggregate`,\n # one of these should be removed (Modin issue #3107).\n @doc_utils.add_deprecation_warning(replacement_method=\"rolling_aggregate\")\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"the result of passed function\",\n action=\"apply specified function\",\n refer_to=\"apply\",\n params=\"\"\"\n func : callable(pandas.Series) -> scalar\n raw : bool, default: False\n engine : None, default: None\n This parameters serves the compatibility purpose. Always has to be None.\n engine_kwargs : None, default: None\n This parameters serves the compatibility purpose. Always has to be None.\n args : tuple, optional\n kwargs : dict, optional\"\"\",\n build_rules=\"udf_aggregation\",\n )\n def rolling_apply(\n self,\n fold_axis,\n rolling_args,\n func,\n raw=False,\n engine=None,\n engine_kwargs=None,\n args=None,\n kwargs=None,\n ):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.apply)(\n self, rolling_args, func, raw, engine, engine_kwargs, args, kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"correlation\",\n refer_to=\"corr\",\n params=\"\"\"\n other : modin.pandas.Series, modin.pandas.DataFrame, list-like, optional\n pairwise : bool, optional\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_corr(\n self, fold_axis, rolling_args, other=None, pairwise=None, *args, **kwargs\n ):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.corr)(\n self, rolling_args, other, pairwise, *args, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rolling_count_BaseQueryCompiler.rolling_cov.return.RollingDefault_register_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rolling_count_BaseQueryCompiler.rolling_cov.return.RollingDefault_register_p", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5817, "end_line": 5840, "span_ids": ["BaseQueryCompiler.rolling_cov", "BaseQueryCompiler.rolling_count"], "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 BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\", result=\"number of non-NA values\", refer_to=\"count\"\n )\n def rolling_count(self, fold_axis, rolling_args):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.count)(\n self, rolling_args\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"covariance\",\n refer_to=\"cov\",\n params=\"\"\"\n other : modin.pandas.Series, modin.pandas.DataFrame, list-like, optional\n pairwise : bool, optional\n ddof : int, default: 1\n **kwargs : dict\"\"\",\n )\n def rolling_cov(\n self, fold_axis, rolling_args, other=None, pairwise=None, ddof=1, **kwargs\n ):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.cov)(\n self, rolling_args, other, pairwise, ddof, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rolling_kurt_BaseQueryCompiler.expanding_median.return.ExpandingDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.rolling_kurt_BaseQueryCompiler.expanding_median.return.ExpandingDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5842, "end_line": 6122, "span_ids": ["BaseQueryCompiler.rolling_mean", "BaseQueryCompiler.expanding_min", "BaseQueryCompiler.rolling_median", "BaseQueryCompiler.rolling_max", "BaseQueryCompiler.expanding_aggregate", "BaseQueryCompiler.rolling_sem", "BaseQueryCompiler.expanding_max", "BaseQueryCompiler.expanding_sum", "BaseQueryCompiler.rolling_skew", "BaseQueryCompiler.rolling_rank", "BaseQueryCompiler.rolling_var", "BaseQueryCompiler.rolling_sum", "BaseQueryCompiler.rolling_min", "BaseQueryCompiler.rolling_kurt", "BaseQueryCompiler.rolling_std", "BaseQueryCompiler.expanding_median", "BaseQueryCompiler.expanding_mean", "BaseQueryCompiler.rolling_quantile"], "tokens": 1994}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"unbiased kurtosis\",\n refer_to=\"kurt\",\n params=\"**kwargs : dict\",\n )\n def rolling_kurt(self, fold_axis, rolling_args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.kurt)(\n self, rolling_args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"maximum value\",\n refer_to=\"max\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_max(self, fold_axis, rolling_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.max)(\n self, rolling_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"mean value\",\n refer_to=\"mean\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_mean(self, fold_axis, rolling_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.mean)(\n self, rolling_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"median value\",\n refer_to=\"median\",\n params=\"**kwargs : dict\",\n )\n def rolling_median(self, fold_axis, rolling_args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.median)(\n self, rolling_args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"minimum value\",\n refer_to=\"min\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_min(self, fold_axis, rolling_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.min)(\n self, rolling_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"quantile\",\n refer_to=\"quantile\",\n params=\"\"\"\n quantile : float\n interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}, default: 'linear'\n **kwargs : dict\"\"\",\n )\n def rolling_quantile(\n self, fold_axis, rolling_args, quantile, interpolation=\"linear\", **kwargs\n ):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.quantile)(\n self, rolling_args, quantile, interpolation, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"unbiased skewness\",\n refer_to=\"skew\",\n params=\"**kwargs : dict\",\n )\n def rolling_skew(self, fold_axis, rolling_args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.skew)(\n self, rolling_args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"standard deviation\",\n refer_to=\"std\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_std(self, fold_axis, rolling_args, ddof=1, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.std)(\n self, rolling_args, ddof, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"sum\",\n refer_to=\"sum\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_sum(self, fold_axis, rolling_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.sum)(\n self, rolling_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"sem\",\n refer_to=\"sem\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_sem(self, fold_axis, rolling_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.sem)(\n self, rolling_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"variance\",\n refer_to=\"var\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_var(self, fold_axis, rolling_args, ddof=1, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.var)(\n self, rolling_args, ddof, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n result=\"rank\",\n refer_to=\"rank\",\n params=\"\"\"\n method : {'average', 'min', 'max'}, default: 'average'\n ascending : bool, default: True\n pct : bool, default: False\n numeric_only : bool, default: False\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def rolling_rank(\n self,\n fold_axis,\n rolling_args,\n method=\"average\",\n ascending=True,\n pct=False,\n numeric_only=False,\n *args,\n **kwargs,\n ):\n return RollingDefault.register(pandas.core.window.rolling.Rolling.rank)(\n self,\n rolling_args,\n method=method,\n ascending=ascending,\n pct=pct,\n numeric_only=numeric_only,\n *args,\n **kwargs,\n )\n\n # End of Rolling methods\n\n # Begin Expanding methods\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"the result of passed functions\",\n action=\"apply specified functions\",\n refer_to=\"aggregate\",\n win_type=\"expanding window\",\n params=\"\"\"\n func : str, dict, callable(pandas.Series) -> scalar, or list of such\n *args : iterable\n **kwargs : dict\"\"\",\n build_rules=\"udf_aggregation\",\n )\n def expanding_aggregate(self, fold_axis, expanding_args, func, *args, **kwargs):\n return ExpandingDefault.register(\n pandas.core.window.expanding.Expanding.aggregate\n )(self, expanding_args, func, *args, **kwargs)\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"sum\",\n refer_to=\"sum\",\n win_type=\"expanding window\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_sum(self, fold_axis, expanding_args, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.sum)(\n self, expanding_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"minimum value\",\n refer_to=\"min\",\n win_type=\"expanding window\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_min(self, fold_axis, expanding_args, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.min)(\n self, expanding_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"maximum value\",\n refer_to=\"max\",\n win_type=\"expanding window\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_max(self, fold_axis, expanding_args, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.max)(\n self, expanding_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"mean value\",\n refer_to=\"mean\",\n win_type=\"expanding window\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_mean(self, fold_axis, expanding_args, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.mean)(\n self, expanding_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"median\",\n refer_to=\"median\",\n win_type=\"expanding window\",\n params=\"\"\"\n numeric_only : bool, default: False\n engine : Optional[str], default: None\n engine_kwargs : Optional[dict], default: None\n **kwargs : dict\"\"\",\n )\n def expanding_median(\n self,\n fold_axis,\n expanding_args,\n numeric_only=False,\n engine=None,\n engine_kwargs=None,\n **kwargs,\n ):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.median)(\n self,\n expanding_args,\n numeric_only=numeric_only,\n engine=engine,\n engine_kwargs=engine_kwargs,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.expanding_var_BaseQueryCompiler.expanding_corr.return.ExpandingDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.expanding_var_BaseQueryCompiler.expanding_corr.return.ExpandingDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 6124, "end_line": 6198, "span_ids": ["BaseQueryCompiler.expanding_corr", "BaseQueryCompiler.expanding_var", "BaseQueryCompiler.expanding_std"], "tokens": 522}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"variance\",\n refer_to=\"var\",\n win_type=\"expanding window\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_var(self, fold_axis, expanding_args, ddof=1, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.var)(\n self, expanding_args, ddof=ddof, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"standard deviation\",\n refer_to=\"std\",\n win_type=\"expanding window\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_std(self, fold_axis, expanding_args, ddof=1, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.std)(\n self, expanding_args, ddof=ddof, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"correlation\",\n refer_to=\"corr\",\n win_type=\"expanding window\",\n params=\"\"\"\n squeeze_self : bool\n squeeze_other : bool\n other : pandas.Series or pandas.DataFrame, default: None\n pairwise : bool | None, default: None\n ddof : int, default: 1\n numeric_only : bool, default: False\n **kwargs : dict\"\"\",\n )\n def expanding_corr(\n self,\n fold_axis,\n expanding_args,\n squeeze_self,\n squeeze_other,\n other=None,\n pairwise=None,\n ddof=1,\n numeric_only=False,\n **kwargs,\n ):\n other_for_default = (\n other\n if other is None\n else other.to_pandas().squeeze(axis=1)\n if squeeze_other\n else other.to_pandas()\n )\n return ExpandingDefault.register(\n pandas.core.window.expanding.Expanding.corr,\n squeeze_self=squeeze_self,\n )(\n self,\n expanding_args,\n other=other_for_default,\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.expanding_cov_BaseQueryCompiler.compare.return.DataFrameDefault_register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.expanding_cov_BaseQueryCompiler.compare.return.DataFrameDefault_register", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 6200, "end_line": 6493, "span_ids": ["BaseQueryCompiler.expanding_count", "BaseQueryCompiler.window_mean", "BaseQueryCompiler.expanding_kurt", "BaseQueryCompiler.window_var", "BaseQueryCompiler.expanding_sem", "BaseQueryCompiler.expanding_skew", "BaseQueryCompiler.cat_codes", "BaseQueryCompiler:11", "BaseQueryCompiler.expanding_cov", "BaseQueryCompiler.compare", "BaseQueryCompiler.expanding_rank", "BaseQueryCompiler.expanding_quantile", "BaseQueryCompiler.kurt", "BaseQueryCompiler.invert", "BaseQueryCompiler.window_sum", "BaseQueryCompiler.window_std"], "tokens": 2007}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"sample covariance\",\n refer_to=\"cov\",\n win_type=\"expanding window\",\n params=\"\"\"\n squeeze_self : bool\n squeeze_other : bool\n other : pandas.Series or pandas.DataFrame, default: None\n pairwise : bool | None, default: None\n ddof : int, default: 1\n numeric_only : bool, default: False\n **kwargs : dict\"\"\",\n )\n def expanding_cov(\n self,\n fold_axis,\n expanding_args,\n squeeze_self,\n squeeze_other,\n other=None,\n pairwise=None,\n ddof=1,\n numeric_only=False,\n **kwargs,\n ):\n other_for_default = (\n other\n if other is None\n else other.to_pandas().squeeze(axis=1)\n if squeeze_other\n else other.to_pandas()\n )\n return ExpandingDefault.register(\n pandas.core.window.expanding.Expanding.cov,\n squeeze_self=squeeze_self,\n )(\n self,\n expanding_args,\n other=other_for_default,\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"standard deviation\",\n refer_to=\"std\",\n win_type=\"expanding window\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_count(self, fold_axis, expanding_args, ddof=1, *args, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.count)(\n self, expanding_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"quantile\",\n refer_to=\"quantile\",\n win_type=\"expanding window\",\n params=\"\"\"\n quantile : float\n interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}, default: 'linear'\n **kwargs : dict\"\"\",\n )\n def expanding_quantile(\n self, fold_axis, expanding_args, quantile, interpolation, **kwargs\n ):\n return ExpandingDefault.register(pandas.core.window.rolling.Expanding.quantile)(\n self, expanding_args, quantile, interpolation, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"unbiased standard error mean\",\n refer_to=\"std\",\n win_type=\"expanding window\",\n params=\"\"\"\n ddof : int, default: 1\n numeric_only : bool, default: False\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_sem(\n self, fold_axis, expanding_args, ddof=1, numeric_only=False, *args, **kwargs\n ):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.sem)(\n self, expanding_args, ddof=ddof, numeric_only=numeric_only, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"unbiased skewness\",\n refer_to=\"skew\",\n win_type=\"expanding window\",\n params=\"\"\"\n numeric_only : bool, default: False\n **kwargs : dict\"\"\",\n )\n def expanding_skew(self, fold_axis, expanding_args, numeric_only=False, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.skew)(\n self, expanding_args, numeric_only=numeric_only, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"Fisher\u2019s definition of kurtosis without bias\",\n refer_to=\"kurt\",\n win_type=\"expanding window\",\n params=\"\"\"\n numeric_only : bool, default: False\n **kwargs : dict\"\"\",\n )\n def expanding_kurt(self, fold_axis, expanding_args, numeric_only=False, **kwargs):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.kurt)(\n self, expanding_args, numeric_only=numeric_only, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Expanding\",\n result=\"rank\",\n refer_to=\"rank\",\n win_type=\"expanding window\",\n params=\"\"\"\n method : {'average', 'min', 'max'}, default: 'average'\n ascending : bool, default: True\n pct : bool, default: False\n numeric_only : bool, default: False\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def expanding_rank(\n self,\n fold_axis,\n expanding_args,\n method=\"average\",\n ascending=True,\n pct=False,\n numeric_only=False,\n *args,\n **kwargs,\n ):\n return ExpandingDefault.register(pandas.core.window.expanding.Expanding.rank)(\n self,\n expanding_args,\n method=method,\n ascending=ascending,\n pct=pct,\n numeric_only=numeric_only,\n *args,\n **kwargs,\n )\n\n # End of Expanding methods\n\n # Window methods\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n win_type=\"window of the specified type\",\n result=\"mean\",\n refer_to=\"mean\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def window_mean(self, fold_axis, window_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.Window.mean)(\n self, window_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n win_type=\"window of the specified type\",\n result=\"standard deviation\",\n refer_to=\"std\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def window_std(self, fold_axis, window_args, ddof=1, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.Window.std)(\n self, window_args, ddof, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n win_type=\"window of the specified type\",\n result=\"sum\",\n refer_to=\"sum\",\n params=\"\"\"\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def window_sum(self, fold_axis, window_args, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.Window.sum)(\n self, window_args, *args, **kwargs\n )\n\n @doc_utils.doc_window_method(\n window_cls_name=\"Rolling\",\n win_type=\"window of the specified type\",\n result=\"variance\",\n refer_to=\"var\",\n params=\"\"\"\n ddof : int, default: 1\n *args : iterable\n **kwargs : dict\"\"\",\n )\n def window_var(self, fold_axis, window_args, ddof=1, *args, **kwargs):\n return RollingDefault.register(pandas.core.window.Window.var)(\n self, window_args, ddof, *args, **kwargs\n )\n\n # End of Window methods\n\n # Categories methods\n\n @doc_utils.add_one_column_warning\n @doc_utils.add_refer_to(\"Series.cat.codes\")\n def cat_codes(self):\n \"\"\"\n Convert underlying categories data into its codes.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the integer codes of the underlying\n categories.\n \"\"\"\n return CatDefault.register(pandas.Series.cat.codes)(self)\n\n # End of Categories methods\n\n # DataFrame methods\n\n def invert(self):\n \"\"\"\n Apply bitwise inversion for each element of the QueryCompiler.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing bitwise inversion for each value.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.__invert__)(self)\n\n @doc_utils.doc_reduce_agg(\n method=\"unbiased kurtosis\", refer_to=\"kurt\", extra_params=[\"skipna\", \"**kwargs\"]\n )\n def kurt(self, axis, numeric_only=False, skipna=True, **kwargs):\n return DataFrameDefault.register(pandas.DataFrame.kurt)(\n self, axis=axis, skipna=skipna, numeric_only=numeric_only, **kwargs\n )\n\n sum_min_count = sum\n prod_min_count = prod\n\n @doc_utils.add_refer_to(\"DataFrame.compare\")\n def compare(self, other, align_axis, keep_shape, keep_equal, result_names):\n \"\"\"\n Compare data of two QueryCompilers and highlight the difference.\n\n Parameters\n ----------\n other : BaseQueryCompiler\n Query compiler to compare with. Have to be the same shape and the same\n labeling as `self`.\n align_axis : {0, 1}\n keep_shape : bool\n keep_equal : bool\n result_names : tuple\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler containing the differences between `self` and passed\n query compiler.\n \"\"\"\n return DataFrameDefault.register(pandas.DataFrame.compare)(\n self,\n other=other,\n align_axis=align_axis,\n keep_shape=keep_shape,\n keep_equal=keep_equal,\n result_names=result_names,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.repartition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/base/query_compiler.py_BaseQueryCompiler.repartition_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/base/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 6495, "end_line": 6535, "span_ids": ["BaseQueryCompiler.repartition"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseQueryCompiler(ClassLogger, abc.ABC):\n\n def repartition(self, axis=None):\n \"\"\"\n Repartitioning QueryCompiler objects to get ideal partitions inside.\n\n Allows to improve performance where the query compiler can't improve\n yet by doing implicit repartitioning.\n\n Parameters\n ----------\n axis : {0, 1, None}, optional\n The axis along which the repartitioning occurs.\n `None` is used for repartitioning along both axes.\n\n Returns\n -------\n BaseQueryCompiler\n The repartitioned BaseQueryCompiler.\n \"\"\"\n if StorageFormat.get() == \"Hdk\":\n # Hdk uses only one partition, it makes\n # no sense for it to repartition the dataframe.\n return self\n\n axes = [0, 1] if axis is None else [axis]\n\n new_query_compiler = self\n for _ax in axes:\n new_query_compiler = new_query_compiler.__constructor__(\n new_query_compiler._modin_frame.apply_full_axis(\n _ax,\n lambda df: df,\n new_index=self._modin_frame.copy_index_cache(),\n new_columns=self._modin_frame.copy_columns_cache(),\n keep_partitioning=False,\n sync_labels=False,\n )\n )\n return new_query_compiler\n\n # End of DataFrame methods", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/__init__.py_cuDFQueryCompiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/__init__.py_cuDFQueryCompiler_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 20}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .query_compiler import cuDFQueryCompiler\n\n__all__ = [\"cuDFQueryCompiler\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_from_collections_import_O_from_modin_error_message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_from_collections_import_O_from_modin_error_message_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/parser.py", "file_name": "parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 28, "span_ids": ["docstring"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import OrderedDict\nfrom io import BytesIO\nimport numpy as np\nimport pandas\nfrom pandas.core.dtypes.cast import find_common_type\nfrom pandas.core.dtypes.concat import union_categoricals\nfrom pandas.io.common import infer_compression\nimport warnings\n\nfrom modin.core.io.file_dispatcher import OpenFile\nfrom modin.core.execution.ray.implementations.cudf_on_ray.partitioning.partition_manager import (\n GPU_MANAGERS,\n)\nfrom modin.core.storage_formats.pandas.utils import split_result_of_axis_func_pandas\nfrom modin.error_message import ErrorMessage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py__split_result_for_readers__split_result_for_readers.return.splits": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py__split_result_for_readers__split_result_for_readers.return.splits", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/parser.py", "file_name": "parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 45, "span_ids": ["_split_result_for_readers"], "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 _split_result_for_readers(axis, num_splits, df): # pragma: no cover\n \"\"\"Splits the DataFrame read into smaller DataFrames and handles all edge cases.\n\n Args:\n axis: Which axis to split over.\n num_splits: The number of splits to create.\n df: The DataFrame after it has been read.\n\n Returns:\n A list of pandas DataFrames.\n \"\"\"\n splits = split_result_of_axis_func_pandas(axis, num_splits, df)\n if not isinstance(splits, list):\n splits = [splits]\n return splits", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_find_common_type_cat_find_common_type_cat.if_all_isinstance_t_pand.else_.return.find_common_type_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_find_common_type_cat_find_common_type_cat.if_all_isinstance_t_pand.else_.return.find_common_type_types_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/parser.py", "file_name": "parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 60, "span_ids": ["find_common_type_cat"], "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 find_common_type_cat(types):\n if all(isinstance(t, pandas.CategoricalDtype) for t in types):\n if all(t.ordered for t in types):\n return pandas.CategoricalDtype(\n np.sort(np.unique([c for t in types for c in t.categories])[0]),\n ordered=True,\n )\n return union_categoricals(\n [pandas.Categorical([], dtype=t) for t in types],\n sort_categories=all(t.ordered for t in types),\n ).dtype\n else:\n return find_common_type(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_modin-project__modin/modin/core/storage_formats/cudf/parser.py_cuDFParser_cuDFParser.infer_compression.infer_compression": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_cuDFParser_cuDFParser.infer_compression.infer_compression", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/parser.py", "file_name": "parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 92, "span_ids": ["cuDFParser", "cuDFParser.get_dtypes", "cuDFParser:2", "cuDFParser.single_worker_read"], "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 cuDFParser(object):\n @classmethod\n def get_dtypes(cls, dtypes_ids):\n return (\n pandas.concat(cls.materialize(dtypes_ids), axis=1)\n .apply(lambda row: find_common_type_cat(row.values), axis=1)\n .squeeze(axis=0)\n )\n\n @classmethod\n def single_worker_read(cls, fname, *, reason, **kwargs):\n ErrorMessage.default_to_pandas(reason=reason)\n # Use default args for everything\n pandas_frame = cls.parse(fname, **kwargs)\n if isinstance(pandas_frame, pandas.io.parsers.TextFileReader):\n pd_read = pandas_frame.read\n pandas_frame.read = (\n lambda *args, **kwargs: cls.query_compiler_cls.from_pandas(\n pd_read(*args, **kwargs), cls.frame_cls\n )\n )\n return pandas_frame\n elif isinstance(pandas_frame, (OrderedDict, dict)):\n return {\n i: cls.query_compiler_cls.from_pandas(frame, cls.frame_cls)\n for i, frame in pandas_frame.items()\n }\n return cls.query_compiler_cls.from_pandas(pandas_frame, cls.frame_cls)\n\n infer_compression = infer_compression", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_cuDFCSVParser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/parser.py_cuDFCSVParser_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/parser.py", "file_name": "parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 133, "span_ids": ["cuDFCSVParser", "cuDFCSVParser.parse"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class cuDFCSVParser(cuDFParser):\n @classmethod\n def parse(cls, fname, **kwargs):\n warnings.filterwarnings(\"ignore\")\n num_splits = kwargs.pop(\"num_splits\", None)\n start = kwargs.pop(\"start\", None)\n end = kwargs.pop(\"end\", None)\n index_col = kwargs.get(\"index_col\", None)\n gpu_selected = kwargs.pop(\"gpu\", 0)\n\n if start is not None and end is not None:\n put_func = cls.frame_partition_cls.put\n\n # pop \"compression\" from kwargs because bio is uncompressed\n with OpenFile(fname, \"rb\", kwargs.pop(\"compression\", \"infer\")) as bio:\n if kwargs.get(\"encoding\", None) is not None:\n header = b\"\" + bio.readline()\n else:\n header = b\"\"\n bio.seek(start)\n to_read = header + bio.read(end - start)\n pandas_df = pandas.read_csv(BytesIO(to_read), **kwargs)\n else:\n # This only happens when we are reading with only one worker (Default)\n pandas_df = pandas.read_csv(fname, **kwargs)\n num_splits = (\n 1 # force num_splits to be 1 here because we don't want it partitioning\n )\n if index_col is not None:\n index = pandas_df.index\n else:\n index = len(pandas_df)\n partition_dfs = _split_result_for_readers(1, num_splits, pandas_df)\n key = [\n put_func(GPU_MANAGERS[gpu_selected], partition_df)\n for partition_df in partition_dfs\n ]\n return key + [index, pandas_df.dtypes]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/query_compiler.py_np_cuDFQueryCompiler.transpose.return.self___constructor___self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/query_compiler.py_np_cuDFQueryCompiler.transpose.return.self___constructor___self", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 32, "span_ids": ["cuDFQueryCompiler.transpose", "cuDFQueryCompiler", "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": "import numpy as np\nimport pandas\n\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\n\n\nclass cuDFQueryCompiler(PandasQueryCompiler):\n # Transpose\n # For transpose, we need to check that all the columns are the same type due to cudf limitations.\n def transpose(self, *args, **kwargs):\n \"\"\"Transposes this QueryCompiler.\n\n Returns:\n Transposed new QueryCompiler.\n \"\"\"\n if len(np.unique(self._modin_frame.dtypes.values)) != 1:\n return self.default_to_pandas(pandas.DataFrame.transpose)\n # Switch the index and columns and transpose the data within the blocks.\n return self.__constructor__(self._modin_frame.transpose())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/query_compiler.py_cuDFQueryCompiler.write_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/cudf/query_compiler.py_cuDFQueryCompiler.write_items_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/cudf/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 68, "span_ids": ["cuDFQueryCompiler.write_items"], "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 cuDFQueryCompiler(PandasQueryCompiler):\n # Transpose\n\n def write_items(self, row_numeric_index, col_numeric_index, broadcasted_items):\n def iloc_mut(partition, row_internal_indices, col_internal_indices, item):\n partition = partition.copy()\n unique_items = np.unique(item)\n # Basically, cudf do not support a nice multi-element assignment when the elements are not equal.\n # This is a nice workaround to use native-cudf element assignment per partition. In the case where\n # the elements and/or the indices are different we need to iterate over all the index combination\n # to assign each element individually.\n if (row_internal_indices == col_internal_indices).all() and len(\n unique_items\n ) == 1:\n partition.iloc[row_internal_indices] = unique_items[0]\n else:\n permutations_col = np.vstack(\n [col_internal_indices] * len(col_internal_indices)\n ).T.flatten()\n permutations_row = np.hstack(\n row_internal_indices * len(row_internal_indices)\n )\n for i, j, it in zip(permutations_row, permutations_col, item.flatten()):\n partition.iloc[i, j] = it\n return partition\n\n new_modin_frame = self._modin_frame.apply_select_indices(\n axis=None,\n func=iloc_mut,\n row_labels=row_numeric_index,\n col_labels=col_numeric_index,\n new_index=self.index,\n new_columns=self.columns,\n keep_remaining=True,\n item_to_distribute=broadcasted_items,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/__init__.py_PandasQueryCompiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/__init__.py_PandasQueryCompiler_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 20}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .query_compiler import PandasQueryCompiler\n\n__all__ = [\"PandasQueryCompiler\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_pandas_CorrCovBuilder.build_corr_method.return.corr_method": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_pandas_CorrCovBuilder.build_corr_method.return.corr_method", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 96, "span_ids": ["CorrCovBuilder.Method", "CorrCovBuilder.build_corr_method", "CorrCovBuilder", "docstring"], "tokens": 659}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nfrom pandas.core.dtypes.common import is_numeric_dtype\nimport numpy as np\nfrom typing import TYPE_CHECKING, Tuple, Callable\nfrom enum import Enum\n\nif TYPE_CHECKING:\n from .query_compiler import PandasQueryCompiler\n\nfrom modin.utils import MODIN_UNNAMED_SERIES_LABEL\n\n\nclass CorrCovBuilder:\n \"\"\"Responsible for building pandas query compiler's methods computing correlation and covariance matrices.\"\"\"\n\n class Method(Enum):\n \"\"\"Enum specifying what method to use (either CORR for correlation or COV for covariance).\"\"\"\n\n CORR = 1\n COV = 2\n\n @classmethod\n def build_corr_method(\n cls,\n ) -> Callable[[\"PandasQueryCompiler\", str, int, bool], \"PandasQueryCompiler\"]:\n \"\"\"\n Build a query compiler method computing the correlation matrix.\n\n Returns\n -------\n callable(qc: PandasQueryCompiler, method: str, min_periods: int, numeric_only: bool) -> PandasQueryCompiler\n A callable matching the ``BaseQueryCompiler.corr`` signature and computing the correlation matrix.\n \"\"\"\n\n def corr_method(\n qc: \"PandasQueryCompiler\",\n method: str,\n min_periods: int = 1,\n numeric_only: bool = True,\n ) -> \"PandasQueryCompiler\":\n if method != \"pearson\":\n return super(type(qc), qc).corr(\n method=method, min_periods=min_periods, numeric_only=numeric_only\n )\n\n if not numeric_only and qc._modin_frame.has_materialized_columns:\n new_index, new_columns = (\n qc._modin_frame.copy_columns_cache(),\n qc._modin_frame.copy_columns_cache(),\n )\n new_dtypes = pandas.Series(\n np.repeat(np.dtype(\"float\"), len(new_columns)), index=new_columns\n )\n elif numeric_only and qc._modin_frame.has_materialized_dtypes:\n old_dtypes = qc._modin_frame.dtypes\n\n new_columns = old_dtypes[old_dtypes.map(is_numeric_dtype)].index\n new_index = new_columns.copy()\n new_dtypes = pandas.Series(\n np.repeat(np.dtype(\"float\"), len(new_columns)), index=new_columns\n )\n else:\n new_index, new_columns, new_dtypes = None, None, None\n\n map, reduce = cls._build_map_reduce_methods(\n min_periods, method=cls.Method.CORR, numeric_only=numeric_only\n )\n\n reduced = qc._modin_frame.apply_full_axis(axis=1, func=map)\n # The 'reduced' dataset has the shape either (num_cols, num_cols + 3) for a non-NaN case\n # or (num_cols, num_cols * 4) for a NaN case, so it's acceptable to call `.combine_and_apply()`\n # here as the number of cols is usually quite small\n result = reduced.combine_and_apply(\n func=reduce,\n new_index=new_index,\n new_columns=new_columns,\n new_dtypes=new_dtypes,\n )\n return qc.__constructor__(result)\n\n return corr_method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_CorrCovBuilder.build_cov_method_CorrCovBuilder.build_cov_method.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_CorrCovBuilder.build_cov_method_CorrCovBuilder.build_cov_method.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 110, "span_ids": ["CorrCovBuilder.build_cov_method"], "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 CorrCovBuilder:\n\n @classmethod\n def build_cov_method(\n cls,\n ) -> Callable[[\"PandasQueryCompiler\", int, int], \"PandasQueryCompiler\"]:\n \"\"\"\n Build a query compiler method computing the covariance matrix.\n\n Returns\n -------\n callable(qc: PandasQueryCompiler, min_periods: int, ddof: int) -> PandasQueryCompiler\n A callable matching the ``BaseQueryCompiler.cov`` signature and computing the covariance matrix.\n \"\"\"\n raise NotImplementedError(\"Computing covariance is not yet implemented.\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_CorrCovBuilder._build_map_reduce_methods_CorrCovBuilder._build_map_reduce_methods.return.lambda_df__CorrCovKernel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py_CorrCovBuilder._build_map_reduce_methods_CorrCovBuilder._build_map_reduce_methods.return.lambda_df__CorrCovKernel", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 142, "span_ids": ["CorrCovBuilder._build_map_reduce_methods"], "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 CorrCovBuilder:\n\n @classmethod\n def _build_map_reduce_methods(\n cls, min_periods: int, method: Method, numeric_only: bool\n ) -> Tuple[\n Callable[[pandas.DataFrame], pandas.DataFrame],\n Callable[[pandas.DataFrame], pandas.DataFrame],\n ]:\n \"\"\"\n Build MapReduce kernels for the specified corr/cov method.\n\n Parameters\n ----------\n min_periods : int\n The parameter to pass to the reduce method.\n method : CorrCovBuilder.Method\n Whether the kernels compute correlation or covariance.\n numeric_only : bool\n Whether to only include numeric types.\n\n Returns\n -------\n Tuple[Callable(pandas.DataFrame) -> pandas.DataFrame, Callable(pandas.DataFrame) -> pandas.DataFrame]\n A tuple holding the Map (at the first position) and the Reduce (at the second position) kernels\n computing correlation/covariance matrix.\n \"\"\"\n if method == cls.Method.COV:\n raise NotImplementedError(\"Computing covariance is not yet implemented.\")\n\n return lambda df: _CorrCovKernels.map(\n df, numeric_only\n ), lambda df: _CorrCovKernels.reduce(df, min_periods, method)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels__CorrCovKernels.map.return.aggregations": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels__CorrCovKernels.map.return.aggregations", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 218, "span_ids": ["_CorrCovKernels.map", "_CorrCovKernels"], "tokens": 713}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _CorrCovKernels:\n \"\"\"Holds kernel functions computing correlation/covariance matrices in a MapReduce manner.\"\"\"\n\n @classmethod\n def map(cls, df: pandas.DataFrame, numeric_only: bool) -> pandas.DataFrame:\n \"\"\"\n Perform the Map phase to compute the corr/cov matrix.\n\n In this kernel we compute all the required components to compute\n the correlation matrix at the reduce phase, the required components are:\n 1. Matrix holding sums of pairwise multiplications between all columns\n defined as ``M[col1, col2] = sum(col1[i] * col2[i] for i in range(col_len))``\n 2. Sum for each column (special case if there are NaN values)\n 3. Sum of squares for each column (special case if there are NaN values)\n 4. Number of values in each column (special case if there are NaN values)\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition to compute the aggregations for.\n numeric_only : bool\n Whether to only include numeric types.\n\n Returns\n -------\n pandas.DataFrame\n A MultiIndex columned DataFrame holding the described aggregation results for this\n specifix partition under the following keys: ``[\"mul\", \"sum\", \"pow2_sum\", \"count\"]``\n \"\"\"\n if numeric_only:\n df = df.select_dtypes(include=\"number\")\n # It's more convenient to use a NumPy array here as it appears to perform\n # much faster in for-loops which this kernel function has plenty of\n raw_df = df.values.T\n try:\n nan_mask = np.isnan(raw_df)\n except TypeError as e:\n # Pandas raises ValueError on unsupported types, so casting\n # the exception to a proper type\n raise ValueError(\"Unsupported types with 'numeric_only=False'\") from e\n\n has_nans = nan_mask.sum() != 0\n\n if has_nans:\n if not raw_df.flags.writeable:\n # making a copy if the buffer is read-only\n raw_df = raw_df.copy()\n # Replacing all NaNs with zeros so we can use much\n # faster `np.sum()` instead of slow `np.nansum()`\n np.putmask(raw_df, nan_mask, values=0)\n\n cols = df.columns\n # Here we compute a sum of pairwise multiplications between all columns\n # result:\n # col1: [sum(col1 * col2), sum(col1 * col3), ... sum(col1 * colN)]\n # col2: [sum(col2 * col3), sum(col2 * col4), ... sum(col2 * colN)]\n # ...\n sum_of_pairwise_mul = pandas.DataFrame(\n np.dot(raw_df, raw_df.T), index=cols, columns=cols, copy=False\n )\n\n if has_nans:\n sums, sums_of_squares, count = cls._compute_nan_aggs(raw_df, cols, nan_mask)\n else:\n sums, sums_of_squares, count = cls._compute_non_nan_aggs(df)\n\n aggregations = pandas.concat(\n [sum_of_pairwise_mul, sums, sums_of_squares, count],\n copy=False,\n axis=1,\n keys=[\"mul\", \"sum\", \"pow2_sum\", \"count\"],\n )\n\n return aggregations", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_non_nan_aggs__CorrCovKernels._compute_non_nan_aggs.return.sums_sums_of_squares_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_non_nan_aggs__CorrCovKernels._compute_non_nan_aggs.return.sums_sums_of_squares_co", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 220, "end_line": 243, "span_ids": ["_CorrCovKernels._compute_non_nan_aggs"], "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 _CorrCovKernels:\n\n @staticmethod\n def _compute_non_nan_aggs(\n df: pandas.DataFrame,\n ) -> Tuple[pandas.Series, pandas.Series, pandas.Series]:\n \"\"\"\n Compute sums, sums of square and the number of observations for a partition assuming there are no NaN values in it.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition to compute the aggregations for.\n\n Returns\n -------\n Tuple[sums: pandas.Series, sums_of_squares: pandas.Series, count: pandas.Series]\n A tuple storing Series where each of them holds the result for\n one of the described aggregations.\n \"\"\"\n sums = df.sum().rename(MODIN_UNNAMED_SERIES_LABEL)\n sums_of_squares = (df**2).sum().rename(MODIN_UNNAMED_SERIES_LABEL)\n count = pandas.Series(\n np.repeat(len(df), len(df.columns)), index=df.columns, copy=False\n ).rename(MODIN_UNNAMED_SERIES_LABEL)\n return sums, sums_of_squares, 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_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_nan_aggs__CorrCovKernels._compute_nan_aggs._TODO_is_it_possible_to": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_nan_aggs__CorrCovKernels._compute_nan_aggs._TODO_is_it_possible_to", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 245, "end_line": 287, "span_ids": ["_CorrCovKernels._compute_nan_aggs"], "tokens": 529}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _CorrCovKernels:\n\n @staticmethod\n def _compute_nan_aggs(\n raw_df: np.ndarray, cols: pandas.Index, nan_mask: np.ndarray\n ) -> Tuple[pandas.DataFrame, pandas.DataFrame, pandas.DataFrame]:\n \"\"\"\n Compute sums, sums of square and the number of observations for a partition assuming there are NaN values in it.\n\n Parameters\n ----------\n raw_df : np.ndarray\n Raw values of the partition to compute the aggregations for.\n cols : pandas.Index\n Columns of the partition.\n nan_mask : np.ndarray[bool]\n Boolean mask showing positions of NaN values in the `raw_df`.\n\n Returns\n -------\n Tuple[sums: pandas.DataFrame, sums_of_squares: pandas.DataFrame, count: pandas.DataFrame]\n A tuple storing DataFrames where each of them holds the result for\n one of the described aggregations.\n \"\"\"\n # Unfortunately, in case of NaN values we forced to compute multiple sums/square sums/counts\n # for each column because we have to exclude values at positions of NaN values in each other\n # column individually.\n # Imagine we have a dataframe like this:\n # col1: 1, 2 , 3 , 4\n # col2: 2, NaN, 3 , 4\n # col3: 4, 5 , NaN, 7\n # In this case we would need to compute 2 different sums/square sums/count for 'col1':\n # - The first one excluding the values at the NaN possitions of 'col2' (1 + 3 + 4)\n # - And the second one excluding the values at the NaN positions of 'col3' (1 + 2 + 4)\n # and then also do the same for the rest columns. At the end this should form a matrix\n # of pairwise sums/square sums/counts:\n # sums[col1, col2] = sum(col1[i] for i in non_NA_indices_of_col2)\n # sums[col2, col1] = sum(col2[i] for i in non_NA_indices_of_col1)\n # ...\n # Note that sums[col1, col2] != sums[col2, col1]\n sums = {}\n sums_of_squares = {}\n count = {}\n\n # TODO: is it possible to get rid of this for-loop somehow?\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_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_nan_aggs.for_i_col_in_enumerate_c__CorrCovKernels._compute_nan_aggs.return.sums_sums_of_squares_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._compute_nan_aggs.for_i_col_in_enumerate_c__CorrCovKernels._compute_nan_aggs.return.sums_sums_of_squares_co", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 314, "span_ids": ["_CorrCovKernels._compute_nan_aggs"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _CorrCovKernels:\n\n @staticmethod\n def _compute_nan_aggs(\n raw_df: np.ndarray, cols: pandas.Index, nan_mask: np.ndarray\n ) -> Tuple[pandas.DataFrame, pandas.DataFrame, pandas.DataFrame]:\n # ... other code\n for i, col in enumerate(cols):\n # Here we're taking each column, resizing it to the original frame's shape to compute\n # aggregations for each other column and then excluding values at those positions where\n # other columns had NaN values by setting zeros using the validity mask:\n # col1: 1, 2 , 3 , 4 df[i].resize() col1: 1, 2, 3, 4 putmask() col1: 1, 2, 3, 4\n # col2: 2, NaN, 3 , 4 -------------> col1: 1, 2, 3, 4 --------> col1: 1, 0, 3, 4\n # col3: 4, 5 , NaN, 7 col1: 1, 2, 3, 4 col1: 1, 2, 0, 4\n # Note that 'NaN' values in this diagram are just for the sake of visibility, in reality\n # they were already replaced by zeroes at the beginning of the 'map' phase.\n col_vals = np.resize(raw_df[i], raw_df.shape)\n np.putmask(col_vals, nan_mask, values=0)\n\n sums[col] = pandas.Series(np.sum(col_vals, axis=1), index=cols, copy=False)\n sums_of_squares[col] = pandas.Series(\n np.sum(col_vals**2, axis=1), index=cols, copy=False\n )\n count[col] = pandas.Series(\n nan_mask.shape[1] - np.count_nonzero(nan_mask | nan_mask[i], axis=1),\n index=cols,\n copy=False,\n )\n\n sums = pandas.concat(sums, axis=1, copy=False)\n sums_of_squares = pandas.concat(sums_of_squares, axis=1, copy=False)\n count = pandas.concat(count, axis=1, copy=False)\n\n return sums, sums_of_squares, 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_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels.reduce__CorrCovKernels.reduce.if_has_nans_.else_.return.cls__build_corr_table_non": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels.reduce__CorrCovKernels.reduce.if_has_nans_.else_.return.cls__build_corr_table_non", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 392, "span_ids": ["_CorrCovKernels.reduce"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _CorrCovKernels:\n\n @classmethod\n def reduce(\n cls, df: pandas.DataFrame, min_periods: int, method: CorrCovBuilder.Method\n ) -> pandas.DataFrame:\n \"\"\"\n Perform the Reduce phase to compute the corr/cov matrix.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A dataframe holding aggregations computed for each partition\n concatenated along the rows axis.\n min_periods : int\n Minimum number of observations required per pair of columns to have a valid result.\n method : CorrCovBuilder.Method\n Whether to build a correlation or a covariance matrix.\n\n Returns\n -------\n pandas.DataFrame\n Either correlation or covariance matrix.\n \"\"\"\n if method == CorrCovBuilder.Method.COV:\n raise NotImplementedError(\"Computing covariance is not yet implemented.\")\n # The `df` here accumulates the aggregation results retrieved from each row partition\n # and combined together along the rows axis, so the `df` looks something like this:\n # mul sums pow2_sums\n # a . . .\n # b . . . <--- part1 result\n # c . . .\n # ---------------------------\n # a . . .\n # b . . . <--- part2 result\n # c . . .\n # ---------------------------\n # ...\n # So to get the total result we have to group on the index and sum the values\n total_agg = df.groupby(level=0).sum()\n total_agg = cls._maybe_combine_nan_and_non_nan_aggs(total_agg)\n\n sum_of_pairwise_mul = total_agg[\"mul\"]\n sums = total_agg[\"sum\"]\n sums_of_squares = total_agg[\"pow2_sum\"]\n count = total_agg[\"count\"]\n\n cols = sum_of_pairwise_mul.columns\n # If there are NaNs in the original dataframe, then we have computed a matrix\n # of sums/square sums/counts at the Map phase, meaning that we now have multiple\n # columns in `sums`.\n has_nans = len(sums.columns) > 1\n if not has_nans:\n # 'count' is the same for all columns in a non-NaN case, so converting\n # it to scalar for faster binary operations\n count = count.iloc[0, 0]\n if count < min_periods:\n # Fast-path for too small data\n return pandas.DataFrame(index=cols, columns=cols, dtype=\"float\")\n\n # Converting frame to a Series for more convenient handling\n sums = sums.squeeze(axis=1)\n sums_of_squares = sums_of_squares.squeeze(axis=1)\n\n means = sums / count\n std = np.sqrt(sums_of_squares - 2 * means * sums + count * (means**2))\n\n # The 'is_nans' condition was moved out of the loop, so the loops themselves\n # work faster as not being slowed by extra conditions in them\n if has_nans:\n return cls._build_corr_table_nan(\n sum_of_pairwise_mul, means, sums, count, std, cols, min_periods\n )\n else:\n # We've already processed the 'min_periods' parameter for a non-na case above,\n # so don't need to pass it here\n return cls._build_corr_table_non_nan(\n sum_of_pairwise_mul, means, sums, count, std, cols\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.parts_with_nans.total_agg_values_na_ag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.parts_with_nans.total_agg_values_na_ag", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 461, "span_ids": ["_CorrCovKernels._maybe_combine_nan_and_non_nan_aggs"], "tokens": 731}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _CorrCovKernels:\n\n @staticmethod\n def _maybe_combine_nan_and_non_nan_aggs(\n total_agg: pandas.DataFrame,\n ) -> pandas.DataFrame:\n \"\"\"\n Pair the aggregation results of partitions having and not having NaN values if needed.\n\n Parameters\n ----------\n total_agg : pandas.DataFrame\n A dataframe holding aggregations computed for each partition\n concatenated along the rows axis.\n\n Returns\n -------\n pandas.DataFrame\n DataFrame with aligned results.\n \"\"\"\n # Here we try to align the results between partitions that had and didn't have NaNs.\n # At the result of the Map phase, partitions with and without NaNs would produce\n # different results:\n # - Partitions with NaNs produce a matrix of pairwise sums/square sums/counts\n # - And parts without NaNs produce regular one-column sums/square sums/counts\n #\n # As the result, `total_agg` will be something like this:\n # mul | sum pow2_sum count | sum pow2_sum count\n # a b | a b a b a b | __reduced__ __reduced__ __reduced__\n # a . . | . . . . . . | . . .\n # b . . | . . . . . . | . . .\n # --------|-----------------------|----------------------------------------\n # ^-- these are results ^-- and these are results for\n # for partitions that partitions that didn't have NaNs\n # had NaNs\n # So, to get an actual total result of these aggregations, we have to additionally\n # sum the results from non-NaN and NaN partitions.\n #\n # Here we sample the 'sum' columns to check whether we had mixed NaNs and\n # non-NaNs partitions, if it's not the case we can skip the described step:\n nsums = total_agg.columns.get_locs([\"sum\"])\n if not (\n len(nsums) > 1 and (\"sum\", MODIN_UNNAMED_SERIES_LABEL) in total_agg.columns\n ):\n return total_agg\n\n cols = total_agg.columns\n\n # Finding column positions for aggregational columns\n all_agg_idxs = np.where(\n cols.get_loc(\"sum\") | cols.get_loc(\"pow2_sum\") | cols.get_loc(\"count\")\n )[0]\n # Finding column positions for aggregational columns that store\n # results of non-NaN partitions\n non_na_agg_idxs = cols.get_indexer_for(\n pandas.Index(\n [\n (\"sum\", MODIN_UNNAMED_SERIES_LABEL),\n (\"pow2_sum\", MODIN_UNNAMED_SERIES_LABEL),\n (\"count\", MODIN_UNNAMED_SERIES_LABEL),\n ]\n )\n )\n # Finding column positions for aggregational columns that store\n # results of NaN partitions by deducting non-NaN indices from all indices\n na_agg_idxs = np.setdiff1d(all_agg_idxs, non_na_agg_idxs, assume_unique=True)\n\n # Using `.values` here so we can ignore the indices (it's really hard\n # to arrange them for pandas to properly perform the summation)\n parts_with_nans = total_agg.values[:, na_agg_idxs]\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_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.parts_without_nans__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.return.total_agg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.parts_without_nans__CorrCovKernels._maybe_combine_nan_and_non_nan_aggs.return.total_agg", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 462, "end_line": 504, "span_ids": ["_CorrCovKernels._maybe_combine_nan_and_non_nan_aggs"], "tokens": 566}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _CorrCovKernels:\n\n @staticmethod\n def _maybe_combine_nan_and_non_nan_aggs(\n total_agg: pandas.DataFrame,\n ) -> pandas.DataFrame:\n # ... other code\n parts_without_nans = (\n total_agg.values[:, non_na_agg_idxs]\n # Before doing the summation we have to align the shapes\n # Imagine that we have 'parts_with_nans' like:\n # sum pow2_sum count\n # a b a b a b\n # a 1 2 3 4 5 6\n # b 1 2 3 4 5 6\n #\n # And the 'parts_without_nans' like:\n # sum pow2_sum count\n # a 1 3 5\n # b 2 4 6\n #\n # Here we want to sum them in an order so the digit matches (1 + 1), (2 + 2), ...\n # For that we first have to repeat the values in 'parts_without_nans':\n # parts_without_nans.repeat(parts_with_nans.shape[0]):\n # sum pow2_sum count\n # a 1 3 5\n # b 1 3 5\n # a 2 4 6\n # b 2 4 6\n #\n # And then reshape it using the \"Fortran\" order:\n # parts_without_nans.reshape(parts_with_nans.shape, order=\"F\"):\n # sum pow2_sum count\n # a b a b a b\n # a 1 2 3 4 5 6\n # b 1 2 3 4 5 6\n # After that the shapes & orders are aligned and we can perform the summation\n .repeat(repeats=len(parts_with_nans), axis=0).reshape(\n parts_with_nans.shape, order=\"F\"\n )\n )\n replace_values = parts_with_nans + parts_without_nans\n\n if not total_agg.values.flags.writeable:\n # making a copy if the buffer is read-only as\n # we will need to modify `total_agg` inplace\n total_agg = total_agg.copy()\n total_agg.values[:, na_agg_idxs] = replace_values\n\n return total_agg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._build_corr_table_nan__CorrCovKernels._build_corr_table_nan.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._build_corr_table_nan__CorrCovKernels._build_corr_table_nan.return.res", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 506, "end_line": 549, "span_ids": ["_CorrCovKernels._build_corr_table_nan"], "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 _CorrCovKernels:\n\n @staticmethod\n def _build_corr_table_nan(\n sum_of_pairwise_mul: pandas.DataFrame,\n means: pandas.DataFrame,\n sums: pandas.DataFrame,\n count: pandas.DataFrame,\n std: pandas.DataFrame,\n cols: pandas.Index,\n min_periods: int,\n ) -> pandas.DataFrame:\n \"\"\"\n Build correlation matrix for a DataFrame that had NaN values in it.\n\n Parameters\n ----------\n sum_of_pairwise_mul : pandas.DataFrame\n means : pandas.DataFrame\n sums : pandas.DataFrame\n count : pandas.DataFrame\n std : pandas.DataFrame\n cols : pandas.Index\n min_periods : int\n\n Returns\n -------\n pandas.DataFrame\n Correlation matrix.\n \"\"\"\n res = pandas.DataFrame(index=cols, columns=cols, dtype=\"float\")\n nan_mask = count < min_periods\n\n for col in cols:\n top = (\n sum_of_pairwise_mul.loc[col]\n - sums.loc[col] * means[col]\n - means.loc[col] * sums[col]\n + count.loc[col] * means.loc[col] * means[col]\n )\n down = std.loc[col] * std[col]\n res.loc[col, :] = top / down\n\n res[nan_mask] = np.nan\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_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._build_corr_table_non_nan_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/aggregations.py__CorrCovKernels._build_corr_table_non_nan_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/aggregations.py", "file_name": "aggregations.py", "file_type": "text/x-python", "category": "implementation", "start_line": 551, "end_line": 590, "span_ids": ["_CorrCovKernels._build_corr_table_non_nan"], "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 _CorrCovKernels:\n\n @staticmethod\n def _build_corr_table_non_nan(\n sum_of_pairwise_mul: pandas.DataFrame,\n means: pandas.Series,\n sums: pandas.Series,\n count: int,\n std: pandas.Series,\n cols: pandas.Index,\n ) -> pandas.DataFrame:\n \"\"\"\n Build correlation matrix for a DataFrame that didn't have NaN values in it.\n\n Parameters\n ----------\n sum_of_pairwise_mul : pandas.DataFrame\n means : pandas.Series\n sums : pandas.Series\n count : int\n std : pandas.Series\n cols : pandas.Index\n\n Returns\n -------\n pandas.DataFrame\n Correlation matrix.\n \"\"\"\n res = pandas.DataFrame(index=cols, columns=cols, dtype=\"float\")\n\n for col in cols:\n top = (\n sum_of_pairwise_mul.loc[col]\n - sums.loc[col] * means\n - means.loc[col] * sums\n + count * means.loc[col] * means\n )\n down = std.loc[col] * std\n res.loc[col, :] = top / down\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_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_pandas_GroupbyReduceImpl.get_impl.try_.except_KeyError_.raise_KeyError_f_Have_no_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_pandas_GroupbyReduceImpl.get_impl.try_.except_KeyError_.raise_KeyError_f_Have_no_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 44, "span_ids": ["GroupbyReduceImpl", "GroupbyReduceImpl.get_impl", "docstring"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport numpy as np\n\nfrom modin.utils import hashable\nfrom modin.core.dataframe.algebra import GroupByReduce\nfrom modin.config import ExperimentalGroupbyImpl\nfrom modin.error_message import ErrorMessage\n\n\nclass GroupbyReduceImpl:\n \"\"\"Provide TreeReduce implementations for certain groupby aggregations.\"\"\"\n\n @classmethod\n def get_impl(cls, agg_name):\n \"\"\"\n Get TreeReduce implementations for the specified `agg_name`.\n\n Parameters\n ----------\n agg_name : hashable\n\n Returns\n -------\n (map_fn: Union[callable, str], reduce_fn: Union[callable, str], default2pandas_fn: callable)\n \"\"\"\n try:\n return cls._groupby_reduce_impls[agg_name]\n except KeyError:\n raise KeyError(f\"Have no implementation for {agg_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_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.has_impl_for_GroupbyReduceImpl.has_impl_for.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.has_impl_for_GroupbyReduceImpl.has_impl_for.return.True", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 71, "span_ids": ["GroupbyReduceImpl.has_impl_for"], "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 GroupbyReduceImpl:\n\n @classmethod\n def has_impl_for(cls, agg_func):\n \"\"\"\n Check whether the class has TreeReduce implementation for the specified `agg_func`.\n\n Parameters\n ----------\n agg_func : hashable or dict\n\n Returns\n -------\n bool\n \"\"\"\n if hashable(agg_func):\n return agg_func in cls._groupby_reduce_impls\n if not isinstance(agg_func, dict):\n return False\n\n # We have to keep this import away from the module level to avoid circular import\n from modin.pandas.utils import walk_aggregation_dict\n\n for _, func, _, _ in walk_aggregation_dict(agg_func):\n if func not in cls._groupby_reduce_impls:\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_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_skew_impl_GroupbyReduceImpl._build_skew_impl.skew_map.return.pandas_concat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_skew_impl_GroupbyReduceImpl._build_skew_impl.skew_map.return.pandas_concat_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 139, "span_ids": ["GroupbyReduceImpl._build_skew_impl"], "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 GroupbyReduceImpl:\n\n @staticmethod\n def _build_skew_impl():\n \"\"\"\n Build TreeReduce implementation for 'skew' groupby aggregation.\n\n Returns\n -------\n (map_fn: callable, reduce_fn: callable, default2pandas_fn: callable)\n \"\"\"\n\n def skew_map(dfgb, *args, **kwargs):\n if dfgb._selection is not None:\n data_to_agg = dfgb._selected_obj\n else:\n cols_to_agg = dfgb.obj.columns.difference(dfgb.exclusions)\n data_to_agg = dfgb.obj[cols_to_agg]\n\n df_pow2 = data_to_agg**2\n df_pow3 = data_to_agg**3\n\n return pandas.concat(\n [\n dfgb.count(*args, **kwargs),\n dfgb.sum(*args, **kwargs),\n df_pow2.groupby(dfgb.grouper).sum(*args, **kwargs),\n df_pow3.groupby(dfgb.grouper).sum(*args, **kwargs),\n ],\n copy=False,\n axis=1,\n keys=[\"count\", \"sum\", \"pow2_sum\", \"pow3_sum\"],\n names=[GroupByReduce.ID_LEVEL_NAME],\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_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_skew_impl.skew_reduce_GroupbyReduceImpl._build_skew_impl.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_skew_impl.skew_reduce_GroupbyReduceImpl._build_skew_impl.return._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 175, "span_ids": ["GroupbyReduceImpl._build_skew_impl"], "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 GroupbyReduceImpl:\n\n @staticmethod\n def _build_skew_impl():\n # ... other code\n\n def skew_reduce(dfgb, *args, **kwargs):\n df = dfgb.sum(*args, **kwargs)\n if df.empty:\n return df.droplevel(GroupByReduce.ID_LEVEL_NAME, axis=1)\n\n count = df[\"count\"]\n s = df[\"sum\"]\n s2 = df[\"pow2_sum\"]\n s3 = df[\"pow3_sum\"]\n\n # mean = sum(x) / count\n m = s / count\n\n # m2 = sum( (x - m)^ 2) = sum(x^2 - 2*x*m + m^2)\n m2 = s2 - 2 * m * s + count * (m**2)\n\n # m3 = sum( (x - m)^ 3) = sum(x^3 - 3*x^2*m + 3*x*m^2 - m^3)\n m3 = s3 - 3 * m * s2 + 3 * s * (m**2) - count * (m**3)\n\n # The equation for the 'skew' was taken directly from pandas:\n # https://github.com/pandas-dev/pandas/blob/8dab54d6573f7186ff0c3b6364d5e4dd635ff3e7/pandas/core/nanops.py#L1226\n with np.errstate(invalid=\"ignore\", divide=\"ignore\"):\n skew_res = (count * (count - 1) ** 0.5 / (count - 2)) * (m3 / m2**1.5)\n\n # Setting dummy values for invalid results in accordance with pandas\n skew_res[m2 == 0] = 0\n skew_res[count < 3] = np.nan\n return skew_res\n\n GroupByReduce.register_implementation(skew_map, skew_reduce)\n return (\n skew_map,\n skew_reduce,\n lambda grp, *args, **kwargs: grp.skew(*args, **kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_mean_impl_GroupbyReduceImpl._build_mean_impl.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._build_mean_impl_GroupbyReduceImpl._build_mean_impl.return._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 227, "span_ids": ["GroupbyReduceImpl._build_mean_impl"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupbyReduceImpl:\n\n @staticmethod\n def _build_mean_impl():\n \"\"\"\n Build TreeReduce implementation for 'mean' groupby aggregation.\n\n Returns\n -------\n (map_fn: callable, reduce_fn: callable, default2pandas_fn: callable)\n \"\"\"\n\n def mean_map(dfgb, **kwargs):\n return pandas.concat(\n [dfgb.sum(**kwargs), dfgb.count()],\n axis=1,\n copy=False,\n keys=[\"sum\", \"count\"],\n names=[GroupByReduce.ID_LEVEL_NAME],\n )\n\n def mean_reduce(dfgb, **kwargs):\n \"\"\"\n Compute mean value in each group using sums/counts values within reduce phase.\n\n Parameters\n ----------\n dfgb : pandas.DataFrameGroupBy\n GroupBy object for column-partition.\n **kwargs : dict\n Additional keyword parameters to be passed in ``pandas.DataFrameGroupBy.sum``.\n\n Returns\n -------\n pandas.DataFrame\n A pandas Dataframe with mean values in each column of each group.\n \"\"\"\n sums_counts_df = dfgb.sum(**kwargs)\n if sums_counts_df.empty:\n return sums_counts_df.droplevel(GroupByReduce.ID_LEVEL_NAME, axis=1)\n\n sum_df = sums_counts_df[\"sum\"]\n count_df = sums_counts_df[\"count\"]\n\n return sum_df / count_df\n\n GroupByReduce.register_implementation(mean_map, mean_reduce)\n\n return (\n mean_map,\n mean_reduce,\n lambda grp, *args, **kwargs: grp.mean(*args, **kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._groupby_reduce_impls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl._groupby_reduce_impls_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 242, "span_ids": ["impl"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "GroupbyReduceImpl._groupby_reduce_impls = {\n \"all\": (\"all\", \"all\", lambda grp, *args, **kwargs: grp.all(*args, **kwargs)),\n \"any\": (\"any\", \"any\", lambda grp, *args, **kwargs: grp.any(*args, **kwargs)),\n \"count\": (\"count\", \"sum\", lambda grp, *args, **kwargs: grp.count(*args, **kwargs)),\n \"max\": (\"max\", \"max\", lambda grp, *args, **kwargs: grp.max(*args, **kwargs)),\n \"mean\": GroupbyReduceImpl._build_mean_impl(),\n \"min\": (\"min\", \"min\", lambda grp, *args, **kwargs: grp.min(*args, **kwargs)),\n \"prod\": (\"prod\", \"prod\", lambda grp, *args, **kwargs: grp.prod(*args, **kwargs)),\n \"size\": (\"size\", \"sum\", lambda grp, *args, **kwargs: grp.size(*args, **kwargs)),\n \"skew\": GroupbyReduceImpl._build_skew_impl(),\n \"sum\": (\"sum\", \"sum\", lambda grp, *args, **kwargs: grp.sum(*args, **kwargs)),\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_os__doc_parse_parameters_common2._n_join_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_os__doc_parse_parameters_common2._n_join_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 96, "span_ids": ["imports:8", "docstring"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#\n\nimport os\nfrom collections import OrderedDict\nfrom io import BytesIO, TextIOWrapper, IOBase\nimport fsspec\nimport numpy as np\nimport pandas\nfrom pandas.core.dtypes.cast import find_common_type\nfrom pandas.core.dtypes.concat import union_categoricals\nfrom pandas.io.common import infer_compression\nfrom pandas.util._decorators import doc\nfrom typing import Any, NamedTuple\nimport warnings\n\nfrom modin.core.io.file_dispatcher import OpenFile\nfrom modin.db_conn import ModinDatabaseConnection\nfrom modin.core.storage_formats.pandas.utils import (\n split_result_of_axis_func_pandas,\n _nullcontext,\n)\nfrom modin.error_message import ErrorMessage\nfrom modin.logging import ClassLogger\nfrom modin.utils import ModinAssumptionError\n\n_doc_pandas_parser_class = \"\"\"\nClass for handling {data_type} on the workers using pandas storage format.\n\nInherits common functions from `PandasParser` class.\n\"\"\"\n\n_doc_parse_func = \"\"\"\nParse data on the workers.\n\nParameters\n----------\n{parameters}\n**kwargs : dict\n Keywords arguments to be used by `parse` function or\n passed into `read_*` function.\n\nReturns\n-------\nlist\n List with split parse results and it's metadata\n (index, dtypes, etc.).\n\"\"\"\n\n_doc_parse_parameters_common = \"\"\"fname : str or path object\n Name of the file or path to read.\"\"\"\n\n_doc_common_read_kwargs = \"\"\"common_read_kwargs : dict\n Common keyword parameters for read functions.\n\"\"\"\n_doc_parse_parameters_common2 = \"\\n\".join(\n (_doc_parse_parameters_common, _doc_common_read_kwargs)\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py__split_result_for_readers__split_result_for_readers.return.splits": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py__split_result_for_readers__split_result_for_readers.return.splits", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 120, "span_ids": ["_split_result_for_readers"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _split_result_for_readers(axis, num_splits, df): # pragma: no cover\n \"\"\"\n Split the read DataFrame into smaller DataFrames and handle all edge cases.\n\n Parameters\n ----------\n axis : int\n The axis to split across (0 - index, 1 - columns).\n num_splits : int\n The number of splits to create.\n df : pandas.DataFrame\n `pandas.DataFrame` to split.\n\n Returns\n -------\n list\n A list of pandas DataFrames.\n \"\"\"\n splits = split_result_of_axis_func_pandas(axis, num_splits, df)\n if not isinstance(splits, list):\n splits = [splits]\n return splits", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_find_common_type_cat_find_common_type_cat.if_all_isinstance_t_pand.else_.return.find_common_type_list_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_find_common_type_cat_find_common_type_cat.if_all_isinstance_t_pand.else_.return.find_common_type_list_typ", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 151, "span_ids": ["find_common_type_cat"], "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 find_common_type_cat(types):\n \"\"\"\n Find a common data type among the given dtypes.\n\n Parameters\n ----------\n types : array-like\n Array of dtypes.\n\n Returns\n -------\n pandas.core.dtypes.dtypes.ExtensionDtype or\n np.dtype or\n None\n `dtype` that is common for all passed `types`.\n \"\"\"\n if all(isinstance(t, pandas.CategoricalDtype) for t in types):\n if all(t.ordered for t in types):\n categories = np.sort(np.unique([c for t in types for c in t.categories]))\n return pandas.CategoricalDtype(\n categories,\n ordered=True,\n )\n return union_categoricals(\n [pandas.Categorical([], dtype=t) for t in types],\n sort_categories=all(t.ordered for t in types),\n ).dtype\n else:\n return find_common_type(list(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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser_PandasParser.generic_parse.return._split_result_for_readers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser_PandasParser.generic_parse.return._split_result_for_readers", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 220, "span_ids": ["PandasParser.generic_parse", "PandasParser"], "tokens": 574}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasParser(ClassLogger):\n \"\"\"Base class for parser classes with pandas storage format.\"\"\"\n\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def generic_parse(fname, **kwargs):\n warnings.filterwarnings(\"ignore\")\n num_splits = kwargs.pop(\"num_splits\", None)\n start = kwargs.pop(\"start\", None)\n end = kwargs.pop(\"end\", None)\n header_size = kwargs.pop(\"header_size\", 0)\n encoding = kwargs.get(\"encoding\", None)\n callback = kwargs.pop(\"callback\")\n if start is None or end is None:\n # This only happens when we are reading with only one worker (Default)\n return callback(fname, **kwargs)\n\n # pop \"compression\" from kwargs because bio is uncompressed\n with OpenFile(\n fname,\n \"rb\",\n kwargs.pop(\"compression\", \"infer\"),\n **(kwargs.pop(\"storage_options\", None) or {}),\n ) as bio:\n header = b\"\"\n # In this case we beware that first line can contain BOM, so\n # adding this line to the `header` for reading and then skip it\n if encoding and (\n \"utf\" in encoding\n and \"8\" not in encoding\n or encoding == \"unicode_escape\"\n or encoding.replace(\"-\", \"_\") == \"utf_8_sig\"\n ):\n # do not 'close' the wrapper - underlying buffer is managed by `bio` handle\n fio = TextIOWrapper(bio, encoding=encoding, newline=\"\")\n if header_size == 0:\n header = fio.readline().encode(encoding)\n kwargs[\"skiprows\"] = 1\n for _ in range(header_size):\n header += fio.readline().encode(encoding)\n elif encoding is not None:\n if header_size == 0:\n header = bio.readline()\n # `skiprows` can be only None here, so don't check it's type\n # and just set to 1\n kwargs[\"skiprows\"] = 1\n for _ in range(header_size):\n header += bio.readline()\n else:\n for _ in range(header_size):\n header += bio.readline()\n\n bio.seek(start)\n to_read = header + bio.read(end - start)\n if \"memory_map\" in kwargs:\n kwargs = kwargs.copy()\n del kwargs[\"memory_map\"]\n pandas_df = callback(BytesIO(to_read), **kwargs)\n index = (\n pandas_df.index\n if not isinstance(pandas_df.index, pandas.RangeIndex)\n else len(pandas_df)\n )\n return _split_result_for_readers(1, num_splits, pandas_df) + [\n index,\n pandas_df.dtypes,\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.get_dtypes_PandasParser.get_dtypes.return.frame_dtypes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.get_dtypes_PandasParser.get_dtypes.return.frame_dtypes", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 275, "span_ids": ["PandasParser.get_dtypes"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasParser(ClassLogger):\n\n @classmethod\n def get_dtypes(cls, dtypes_ids, columns):\n \"\"\"\n Get common for all partitions dtype for each of the columns.\n\n Parameters\n ----------\n dtypes_ids : list\n Array with references to the partitions dtypes objects.\n columns : array-like or Index (1d)\n The names of the columns in this variable will be used\n for dtypes creation.\n\n Returns\n -------\n frame_dtypes : pandas.Series, dtype or None\n Resulting dtype or pandas.Series where column names are used as\n index and types of columns are used as values for full resulting\n frame.\n \"\"\"\n if len(dtypes_ids) == 0:\n return None\n # each element in `partitions_dtypes` is a Series, where column names are\n # used as index and types of columns for different partitions are used as values\n partitions_dtypes = cls.materialize(dtypes_ids)\n if all([len(dtype) == 0 for dtype in partitions_dtypes]):\n return None\n\n combined_part_dtypes = pandas.concat(partitions_dtypes, axis=1)\n frame_dtypes = combined_part_dtypes.iloc[:, 0]\n frame_dtypes.name = None\n\n if not combined_part_dtypes.eq(frame_dtypes, axis=0).all(axis=None):\n ErrorMessage.missmatch_with_pandas(\n operation=\"read_*\",\n message=\"Data types of partitions are different! \"\n + \"Please refer to the troubleshooting section of the Modin documentation \"\n + \"to fix this issue\",\n )\n\n # concat all elements of `partitions_dtypes` and find common dtype\n # for each of the column among all partitions\n frame_dtypes = combined_part_dtypes.apply(\n lambda row: find_common_type_cat(row.values),\n axis=1,\n ).squeeze(axis=0)\n\n # Set the index for the dtypes to the column names\n if isinstance(frame_dtypes, pandas.Series):\n frame_dtypes.index = columns\n else:\n frame_dtypes = pandas.Series(frame_dtypes, index=columns)\n\n return frame_dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.single_worker_read_PandasParser.single_worker_read.return.cls_query_compiler_cls_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.single_worker_read_PandasParser.single_worker_read.return.cls_query_compiler_cls_fr", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 318, "span_ids": ["PandasParser.single_worker_read"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasParser(ClassLogger):\n\n @classmethod\n def single_worker_read(cls, fname, *args, reason: str, **kwargs):\n \"\"\"\n Perform reading by single worker (default-to-pandas implementation).\n\n Parameters\n ----------\n fname : str, path object or file-like object\n Name of the file or file-like object to read.\n *args : tuple\n Positional arguments to be passed into `read_*` function.\n reason : str\n Message describing the reason for falling back to pandas.\n **kwargs : dict\n Keywords arguments to be passed into `read_*` function.\n\n Returns\n -------\n BaseQueryCompiler or\n dict or\n pandas.io.parsers.TextFileReader\n Object with imported data (or with reference to data) for further\n processing, object type depends on the child class `parse` function\n result type.\n \"\"\"\n ErrorMessage.default_to_pandas(reason=reason)\n # Use default args for everything\n pandas_frame = cls.parse(fname, *args, **kwargs)\n if isinstance(pandas_frame, pandas.io.parsers.TextFileReader):\n pd_read = pandas_frame.read\n pandas_frame.read = (\n lambda *args, **kwargs: cls.query_compiler_cls.from_pandas(\n pd_read(*args, **kwargs), cls.frame_cls\n )\n )\n return pandas_frame\n elif isinstance(pandas_frame, (OrderedDict, dict)):\n return {\n i: cls.query_compiler_cls.from_pandas(frame, cls.frame_cls)\n for i, frame in pandas_frame.items()\n }\n return cls.query_compiler_cls.from_pandas(pandas_frame, cls.frame_cls)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.get_types_mapper_PandasParser.infer_compression.infer_compression": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParser.get_types_mapper_PandasParser.infer_compression.infer_compression", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 343, "span_ids": ["PandasParser.get_types_mapper", "PandasParser:3"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasParser(ClassLogger):\n\n @staticmethod\n def get_types_mapper(dtype_backend):\n \"\"\"\n Get types mapper that would be used in read_parquet/read_feather.\n\n Parameters\n ----------\n dtype_backend : {\"numpy_nullable\", \"pyarrow\", lib.no_default}\n\n Returns\n -------\n dict\n \"\"\"\n to_pandas_kwargs = {}\n if dtype_backend == \"numpy_nullable\":\n from pandas.io._util import _arrow_dtype_mapping\n\n mapping = _arrow_dtype_mapping()\n to_pandas_kwargs[\"types_mapper\"] = mapping.get\n elif dtype_backend == \"pyarrow\":\n to_pandas_kwargs[\"types_mapper\"] = pandas.ArrowDtype\n return to_pandas_kwargs\n\n infer_compression = infer_compression", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasCSVParser_PandasCSVParser.read_callback.return.pandas_read_csv_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasCSVParser_PandasCSVParser.read_callback.return.pandas_read_csv_args_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 346, "end_line": 375, "span_ids": ["PandasCSVParser", "PandasCSVParser.read_callback", "PandasCSVParser.parse"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_pandas_parser_class, data_type=\"CSV files\")\nclass PandasCSVParser(PandasParser):\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common2)\n def parse(fname, common_read_kwargs, **kwargs):\n return PandasParser.generic_parse(\n fname,\n callback=PandasCSVParser.read_callback,\n **common_read_kwargs,\n **kwargs,\n )\n\n @staticmethod\n def read_callback(*args, **kwargs):\n \"\"\"\n Parse data on each partition.\n\n Parameters\n ----------\n *args : list\n Positional arguments to be passed to the callback function.\n **kwargs : dict\n Keyword arguments to be passed to the callback function.\n\n Returns\n -------\n pandas.DataFrame or pandas.io.parsers.TextParser\n Function call result.\n \"\"\"\n return pandas.read_csv(*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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasCSVGlobParser_PandasCSVGlobParser.parse.return._split_result_for_readers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasCSVGlobParser_PandasCSVGlobParser.parse.return._split_result_for_readers", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 437, "span_ids": ["PandasCSVGlobParser", "PandasCSVGlobParser.parse"], "tokens": 505}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_pandas_parser_class, data_type=\"multiple CSV files simultaneously\")\nclass PandasCSVGlobParser(PandasCSVParser):\n @staticmethod\n @doc(\n _doc_parse_func,\n parameters=\"\"\"chunks : list\n List, where each element of the list is a list of tuples. The inner lists\n of tuples contains the data file name of the chunk, chunk start offset, and\n chunk end offsets for its corresponding file.\"\"\",\n )\n def parse(chunks, **kwargs):\n warnings.filterwarnings(\"ignore\")\n num_splits = kwargs.pop(\"num_splits\", None)\n index_col = kwargs.get(\"index_col\", None)\n\n # `single_worker_read` just pass filename via chunks; need check\n if isinstance(chunks, str):\n return pandas.read_csv(chunks, **kwargs)\n\n # pop `compression` from kwargs because `bio` below is uncompressed\n compression = kwargs.pop(\"compression\", \"infer\")\n storage_options = kwargs.pop(\"storage_options\", None) or {}\n pandas_dfs = []\n for fname, start, end in chunks:\n if start is not None and end is not None:\n with OpenFile(fname, \"rb\", compression, **storage_options) as bio:\n if kwargs.get(\"encoding\", None) is not None:\n header = b\"\" + bio.readline()\n else:\n header = b\"\"\n bio.seek(start)\n to_read = header + bio.read(end - start)\n pandas_dfs.append(pandas.read_csv(BytesIO(to_read), **kwargs))\n else:\n # This only happens when we are reading with only one worker (Default)\n return pandas.read_csv(\n fname,\n compression=compression,\n storage_options=storage_options,\n **kwargs,\n )\n\n # Combine read in data.\n if len(pandas_dfs) > 1:\n pandas_df = pandas.concat(pandas_dfs)\n elif len(pandas_dfs) > 0:\n pandas_df = pandas_dfs[0]\n else:\n pandas_df = pandas.DataFrame()\n\n # Set internal index.\n if index_col is not None:\n index = pandas_df.index\n else:\n # The lengths will become the RangeIndex\n index = len(pandas_df)\n return _split_result_for_readers(1, num_splits, pandas_df) + [\n index,\n pandas_df.dtypes,\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_ExperimentalPandasPickleParser_ExperimentalCustomTextParser.parse.return.PandasParser_generic_pars": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_ExperimentalPandasPickleParser_ExperimentalCustomTextParser.parse.return.PandasParser_generic_pars", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 440, "end_line": 466, "span_ids": ["ExperimentalPandasPickleParser.parse", "ExperimentalCustomTextParser", "ExperimentalCustomTextParser.parse", "ExperimentalPandasPickleParser"], "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": "@doc(_doc_pandas_parser_class, data_type=\"pickled pandas objects\")\nclass ExperimentalPandasPickleParser(PandasParser):\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def parse(fname, **kwargs):\n warnings.filterwarnings(\"ignore\")\n num_splits = 1\n single_worker_read = kwargs.pop(\"single_worker_read\", None)\n df = pandas.read_pickle(fname, **kwargs)\n if single_worker_read:\n return df\n assert isinstance(\n df, pandas.DataFrame\n ), f\"Pickled obj type: [{type(df)}] in [{fname}]; works only with pandas.DataFrame\"\n\n length = len(df)\n width = len(df.columns)\n\n return _split_result_for_readers(1, num_splits, df) + [length, width]\n\n\n@doc(_doc_pandas_parser_class, data_type=\"custom text\")\nclass ExperimentalCustomTextParser(PandasParser):\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def parse(fname, **kwargs):\n return PandasParser.generic_parse(fname, **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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasFWFParser_PandasFWFParser.read_callback.return.pandas_read_fwf_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasFWFParser_PandasFWFParser.read_callback.return.pandas_read_fwf_args_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 469, "end_line": 498, "span_ids": ["PandasFWFParser.read_callback", "PandasFWFParser.parse", "PandasFWFParser"], "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": "@doc(_doc_pandas_parser_class, data_type=\"tables with fixed-width formatted lines\")\nclass PandasFWFParser(PandasParser):\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common2)\n def parse(fname, common_read_kwargs, **kwargs):\n return PandasParser.generic_parse(\n fname,\n callback=PandasFWFParser.read_callback,\n **common_read_kwargs,\n **kwargs,\n )\n\n @staticmethod\n def read_callback(*args, **kwargs):\n \"\"\"\n Parse data on each partition.\n\n Parameters\n ----------\n *args : list\n Positional arguments to be passed to the callback function.\n **kwargs : dict\n Keyword arguments to be passed to the callback function.\n\n Returns\n -------\n pandas.DataFrame or pandas.io.parsers.TextFileReader\n Function call result.\n \"\"\"\n return pandas.read_fwf(*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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser_PandasExcelParser.get_sheet_data.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser_PandasExcelParser.get_sheet_data.return._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 501, "end_line": 523, "span_ids": ["PandasExcelParser", "PandasExcelParser.get_sheet_data"], "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": "@doc(_doc_pandas_parser_class, data_type=\"excel files\")\nclass PandasExcelParser(PandasParser):\n @classmethod\n def get_sheet_data(cls, sheet, convert_float):\n \"\"\"\n Get raw data from the excel sheet.\n\n Parameters\n ----------\n sheet : openpyxl.worksheet.worksheet.Worksheet\n Sheet to get data from.\n convert_float : bool\n Whether to convert floats to ints or not.\n\n Returns\n -------\n list\n List with sheet data.\n \"\"\"\n return [\n [cls._convert_cell(cell, convert_float) for cell in row]\n for row in sheet.rows\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser._convert_cell_PandasExcelParser.need_rich_text_param.return.version_parse_openpyxl___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser._convert_cell_PandasExcelParser.need_rich_text_param.return.version_parse_openpyxl___", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 525, "end_line": 572, "span_ids": ["PandasExcelParser._convert_cell", "PandasExcelParser.need_rich_text_param"], "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": "@doc(_doc_pandas_parser_class, data_type=\"excel files\")\nclass PandasExcelParser(PandasParser):\n\n @classmethod\n def _convert_cell(cls, cell, convert_float):\n \"\"\"\n Convert excel cell to value.\n\n Parameters\n ----------\n cell : openpyxl.cell.cell.Cell\n Excel cell to convert.\n convert_float : bool\n Whether to convert floats to ints or not.\n\n Returns\n -------\n list\n Value that was converted from the excel cell.\n \"\"\"\n if cell.is_date:\n return cell.value\n elif cell.data_type == \"e\":\n return np.nan\n elif cell.data_type == \"b\":\n return bool(cell.value)\n elif cell.value is None:\n return \"\"\n elif cell.data_type == \"n\":\n if convert_float:\n val = int(cell.value)\n if val == cell.value:\n return val\n else:\n return float(cell.value)\n\n return cell.value\n\n @property\n def need_rich_text_param(self):\n \"\"\"\n Determine whether a required `rich_text` parameter should be specified for the ``WorksheetReader`` constructor.\n\n Returns\n -------\n bool\n \"\"\"\n import openpyxl\n from packaging import version\n\n return version.parse(openpyxl.__version__) >= version.parse(\"3.1.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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse_PandasExcelParser.parse.with_ZipFile_fname_as_z_.with_z_open_xl_worksheet.bytes_data.file_read_end_start_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse_PandasExcelParser.parse.with_ZipFile_fname_as_z_.with_z_open_xl_worksheet.bytes_data.file_read_end_start_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 574, "end_line": 616, "span_ids": ["PandasExcelParser.parse"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_pandas_parser_class, data_type=\"excel files\")\nclass PandasExcelParser(PandasParser):\n\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def parse(fname, **kwargs):\n num_splits = kwargs.pop(\"num_splits\", None)\n start = kwargs.pop(\"start\", None)\n end = kwargs.pop(\"end\", None)\n _skiprows = kwargs.pop(\"skiprows\")\n excel_header = kwargs.get(\"_header\")\n sheet_name = kwargs.get(\"sheet_name\", 0)\n footer = b\"\"\n\n # Default to pandas case, where we are not splitting or partitioning\n if start is None or end is None:\n return pandas.read_excel(fname, **kwargs)\n\n from zipfile import ZipFile\n import openpyxl\n from openpyxl.worksheet._reader import WorksheetReader\n from openpyxl.reader.excel import ExcelReader\n from openpyxl.worksheet.worksheet import Worksheet\n from pandas.core.dtypes.common import is_list_like\n from pandas.io.excel._util import (\n fill_mi_header,\n maybe_convert_usecols,\n )\n from pandas.io.parsers import TextParser\n import re\n\n wb = openpyxl.load_workbook(filename=fname, read_only=True)\n # Get shared strings\n ex = ExcelReader(fname, read_only=True)\n ex.read_manifest()\n ex.read_strings()\n # Convert string name 0 to string\n if sheet_name == 0:\n sheet_name = wb.sheetnames[sheet_name]\n # get the worksheet to use with the worksheet reader\n ws = Worksheet(wb)\n # Read the raw data\n with ZipFile(fname) as z:\n with z.open(\"xl/worksheets/{}.xml\".format(sheet_name)) as file:\n file.seek(start)\n bytes_data = file.read(end - start)\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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse.update_row_nums_PandasExcelParser.parse.update_row_nums.return.re_sub_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse.update_row_nums_PandasExcelParser.parse.update_row_nums.return.re_sub_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 618, "end_line": 645, "span_ids": ["PandasExcelParser.parse"], "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": "@doc(_doc_pandas_parser_class, data_type=\"excel files\")\nclass PandasExcelParser(PandasParser):\n\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def parse(fname, **kwargs):\n # ... other code\n\n def update_row_nums(match):\n \"\"\"\n Update the row numbers to start at 1.\n\n Parameters\n ----------\n match : re.Match object\n The match from the origin `re.sub` looking for row number tags.\n\n Returns\n -------\n str\n The updated string with new row numbers.\n\n Notes\n -----\n This is needed because the parser we are using does not scale well if\n the row numbers remain because empty rows are inserted for all \"missing\"\n rows.\n \"\"\"\n b = match.group(0)\n return re.sub(\n rb\"\\d+\",\n lambda c: str(int(c.group(0).decode(\"utf-8\")) - _skiprows).encode(\n \"utf-8\"\n ),\n b,\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_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse.bytes_data_PandasExcelParser.parse.return._split_result_for_readers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasExcelParser.parse.bytes_data_PandasExcelParser.parse.return._split_result_for_readers", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 647, "end_line": 725, "span_ids": ["PandasExcelParser.parse"], "tokens": 783}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@doc(_doc_pandas_parser_class, data_type=\"excel files\")\nclass PandasExcelParser(PandasParser):\n\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def parse(fname, **kwargs):\n # ... other code\n\n bytes_data = re.sub(rb'r=\"[A-Z]*\\d+\"', update_row_nums, bytes_data)\n bytesio = BytesIO(excel_header + bytes_data + footer)\n # Use openpyxl to read/parse sheet data\n common_args = (ws, bytesio, ex.shared_strings, False)\n if PandasExcelParser.need_rich_text_param:\n reader = WorksheetReader(*common_args, rich_text=False)\n else:\n reader = WorksheetReader(*common_args)\n # Attach cells to worksheet object\n reader.bind_cells()\n data = PandasExcelParser.get_sheet_data(ws, kwargs.pop(\"convert_float\", True))\n usecols = maybe_convert_usecols(kwargs.pop(\"usecols\", None))\n header = kwargs.pop(\"header\", 0)\n index_col = kwargs.pop(\"index_col\", None)\n # skiprows is handled externally\n skiprows = None\n\n # Handle header and create MultiIndex for columns if necessary\n if is_list_like(header) and len(header) == 1:\n header = header[0]\n if header is not None and is_list_like(header):\n control_row = [True] * len(data[0])\n\n for row in header:\n data[row], control_row = fill_mi_header(data[row], control_row)\n # Handle MultiIndex for row Index if necessary\n if is_list_like(index_col):\n # Forward fill values for MultiIndex index.\n if not is_list_like(header):\n offset = 1 + header\n else:\n offset = 1 + max(header)\n\n # Check if dataset is empty\n if offset < len(data):\n for col in index_col:\n last = data[offset][col]\n for row in range(offset + 1, len(data)):\n if data[row][col] == \"\" or data[row][col] is None:\n data[row][col] = last\n else:\n last = data[row][col]\n parser = TextParser(\n data,\n header=header,\n index_col=index_col,\n has_index_names=is_list_like(header) and len(header) > 1,\n skiprows=skiprows,\n usecols=usecols,\n skip_blank_lines=False,\n **kwargs,\n )\n pandas_df = parser.read()\n if (\n len(pandas_df) > 1\n and len(pandas_df.columns) != 0\n and pandas_df.isnull().all().all()\n ):\n # Drop NaN rows at the end of the DataFrame\n pandas_df = pandas.DataFrame(columns=pandas_df.columns)\n\n # Since we know the number of rows that occur before this partition, we can\n # correctly assign the index in cases of RangeIndex. If it is not a RangeIndex,\n # the index is already correct because it came from the data.\n if isinstance(pandas_df.index, pandas.RangeIndex):\n pandas_df.index = pandas.RangeIndex(\n start=_skiprows, stop=len(pandas_df.index) + _skiprows\n )\n # We return the length if it is a RangeIndex (common case) to reduce\n # serialization cost.\n if index_col is not None:\n index = pandas_df.index\n else:\n # The lengths will become the RangeIndex\n index = len(pandas_df)\n return _split_result_for_readers(1, num_splits, pandas_df) + [\n index,\n pandas_df.dtypes,\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasJSONParser_PandasJSONParser.parse.return._split_result_for_readers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasJSONParser_PandasJSONParser.parse.return._split_result_for_readers", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 728, "end_line": 758, "span_ids": ["PandasJSONParser.parse", "PandasJSONParser"], "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": "@doc(_doc_pandas_parser_class, data_type=\"JSON files\")\nclass PandasJSONParser(PandasParser):\n @staticmethod\n @doc(_doc_parse_func, parameters=_doc_parse_parameters_common)\n def parse(fname, **kwargs):\n num_splits = kwargs.pop(\"num_splits\", None)\n start = kwargs.pop(\"start\", None)\n end = kwargs.pop(\"end\", None)\n if start is not None and end is not None:\n # pop \"compression\" from kwargs because bio is uncompressed\n with OpenFile(\n fname,\n \"rb\",\n kwargs.pop(\"compression\", \"infer\"),\n **(kwargs.pop(\"storage_options\", None) or {}),\n ) as bio:\n bio.seek(start)\n to_read = b\"\" + bio.read(end - start)\n columns = kwargs.pop(\"columns\")\n pandas_df = pandas.read_json(BytesIO(to_read), **kwargs)\n else:\n # This only happens when we are reading with only one worker (Default)\n return pandas.read_json(fname, **kwargs)\n if not pandas_df.columns.equals(columns):\n raise ModinAssumptionError(\"Columns must be the same across all rows.\")\n partition_columns = pandas_df.columns\n return _split_result_for_readers(1, num_splits, pandas_df) + [\n len(pandas_df),\n pandas_df.dtypes,\n partition_columns,\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_ParquetFileToRead_PandasParquetParser._read_row_group_chunk.if_engine_pyarrow_.else_.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_ParquetFileToRead_PandasParquetParser._read_row_group_chunk.if_engine_pyarrow_.else_.raise_ValueError_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 761, "end_line": 811, "span_ids": ["ParquetFileToRead", "PandasParquetParser._read_row_group_chunk", "PandasParquetParser"], "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 ParquetFileToRead(NamedTuple):\n \"\"\"\n Class to store path and row group information for parquet reads.\n\n Parameters\n ----------\n path : str, path object or file-like object\n Name of the file to read.\n row_group_start : int\n Row group to start read from.\n row_group_end : int\n Row group to stop read.\n \"\"\"\n\n path: Any\n row_group_start: int\n row_group_end: int\n\n\n@doc(_doc_pandas_parser_class, data_type=\"PARQUET data\")\nclass PandasParquetParser(PandasParser):\n @staticmethod\n def _read_row_group_chunk(\n f, row_group_start, row_group_end, columns, engine, to_pandas_kwargs\n ): # noqa: GL08\n if engine == \"pyarrow\":\n from pyarrow.parquet import ParquetFile\n\n return (\n ParquetFile(f)\n .read_row_groups(\n range(\n row_group_start,\n row_group_end,\n ),\n columns=columns,\n use_pandas_metadata=True,\n )\n .to_pandas(**to_pandas_kwargs)\n )\n elif engine == \"fastparquet\":\n from fastparquet import ParquetFile\n\n return ParquetFile(f)[row_group_start:row_group_end].to_pandas(\n columns=columns\n )\n else:\n # We shouldn't ever come to this case, so something went wrong\n raise ValueError(\n f\"engine must be one of 'pyarrow', 'fastparquet', got: {engine}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParquetParser.parse_PandasParquetParser.parse.return.df_df_index_len_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasParquetParser.parse_PandasParquetParser.parse.return.df_df_index_len_df_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 813, "end_line": 848, "span_ids": ["PandasParquetParser.parse"], "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": "@doc(_doc_pandas_parser_class, data_type=\"PARQUET data\")\nclass PandasParquetParser(PandasParser):\n\n @staticmethod\n @doc(\n _doc_parse_func,\n parameters=\"\"\"files_for_parser : list\n List of files to be read.\nengine : str\n Parquet library to use (either PyArrow or fastparquet).\n\"\"\",\n )\n def parse(files_for_parser, engine, **kwargs):\n columns = kwargs.get(\"columns\", None)\n storage_options = kwargs.get(\"storage_options\", {})\n chunks = []\n # `single_worker_read` just passes in a string path or path-like object\n if isinstance(files_for_parser, (str, os.PathLike)):\n return pandas.read_parquet(files_for_parser, engine=engine, **kwargs)\n\n to_pandas_kwargs = PandasParser.get_types_mapper(kwargs[\"dtype_backend\"])\n\n for file_for_parser in files_for_parser:\n if isinstance(file_for_parser.path, IOBase):\n context = _nullcontext(file_for_parser.path)\n else:\n context = fsspec.open(file_for_parser.path, **storage_options)\n with context as f:\n chunk = PandasParquetParser._read_row_group_chunk(\n f,\n file_for_parser.row_group_start,\n file_for_parser.row_group_end,\n columns,\n engine,\n to_pandas_kwargs,\n )\n chunks.append(chunk)\n df = pandas.concat(chunks)\n return df, df.index, len(df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasHDFParser_PandasHDFParser.parse.return._split_result_for_readers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasHDFParser_PandasHDFParser.parse.return._split_result_for_readers", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 851, "end_line": 866, "span_ids": ["PandasHDFParser", "PandasHDFParser.parse"], "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": "@doc(_doc_pandas_parser_class, data_type=\"HDF data\")\nclass PandasHDFParser(PandasParser): # pragma: no cover\n @staticmethod\n @doc(\n _doc_parse_func,\n parameters=\"\"\"fname : str, path object, pandas.HDFStore or file-like object\n Name of the file, path pandas.HDFStore or file-like object to read.\"\"\",\n )\n def parse(fname, **kwargs):\n kwargs[\"key\"] = kwargs.pop(\"_key\", None)\n num_splits = kwargs.pop(\"num_splits\", None)\n if num_splits is None:\n return pandas.read_hdf(fname, **kwargs)\n df = pandas.read_hdf(fname, **kwargs)\n # Append the length of the index here to build it externally\n return _split_result_for_readers(0, num_splits, df) + [len(df.index), df.dtypes]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasFeatherParser_PandasFeatherParser.parse.return._split_result_for_readers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasFeatherParser_PandasFeatherParser.parse.return._split_result_for_readers", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 869, "end_line": 893, "span_ids": ["PandasFeatherParser", "PandasFeatherParser.parse"], "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": "@doc(_doc_pandas_parser_class, data_type=\"FEATHER files\")\nclass PandasFeatherParser(PandasParser):\n @staticmethod\n @doc(\n _doc_parse_func,\n parameters=\"\"\"fname : str, path object or file-like object\n Name of the file, path or file-like object to read.\"\"\",\n )\n def parse(fname, **kwargs):\n from pyarrow import feather\n\n num_splits = kwargs.pop(\"num_splits\", None)\n if num_splits is None:\n return pandas.read_feather(fname, **kwargs)\n\n to_pandas_kwargs = PandasParser.get_types_mapper(kwargs[\"dtype_backend\"])\n del kwargs[\"dtype_backend\"]\n\n with OpenFile(\n fname,\n **(kwargs.pop(\"storage_options\", None) or {}),\n ) as file:\n df = feather.read_feather(file, **kwargs, **to_pandas_kwargs)\n # Append the length of the index here to build it externally\n return _split_result_for_readers(0, num_splits, df) + [len(df.index), df.dtypes]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasSQLParser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/parsers.py_PandasSQLParser_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 896, "end_line": 940, "span_ids": ["PandasSQLParser", "PandasSQLParser.parse"], "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": "@doc(_doc_pandas_parser_class, data_type=\"SQL queries or tables\")\nclass PandasSQLParser(PandasParser):\n @staticmethod\n @doc(\n _doc_parse_func,\n parameters=\"\"\"sql : str or SQLAlchemy Selectable (select or text object)\n SQL query to be executed or a table name.\ncon : SQLAlchemy connectable, str, or sqlite3 connection\n Connection object to database.\nindex_col : str or list of str\n Column(s) to set as index(MultiIndex).\nread_sql_engine : str\n Underlying engine ('pandas' or 'connectorx') used for fetching query result.\"\"\",\n )\n def parse(sql, con, index_col, read_sql_engine, **kwargs):\n enable_cx = False\n if read_sql_engine == \"Connectorx\":\n try:\n import connectorx as cx\n\n enable_cx = True\n except ImportError:\n warnings.warn(\n \"Switch to 'pandas.read_sql' since 'connectorx' is not installed, please run 'pip install connectorx'.\"\n )\n\n num_splits = kwargs.pop(\"num_splits\", None)\n if isinstance(con, ModinDatabaseConnection):\n con = con.get_string() if enable_cx else con.get_connection()\n\n if num_splits is None:\n if enable_cx:\n return cx.read_sql(con, sql, index_col=index_col)\n return pandas.read_sql(sql, con, index_col=index_col, **kwargs)\n\n if enable_cx:\n df = cx.read_sql(con, sql, index_col=index_col)\n else:\n df = pandas.read_sql(sql, con, index_col=index_col, **kwargs)\n if index_col is None:\n index = len(df)\n else:\n index = df.index\n return _split_result_for_readers(1, num_splits, df) + [index, df.dtypes]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_re__get_axis.if_axis_0_.else_.return.lambda_self_self__modin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_re__get_axis.if_axis_0_.else_.return.lambda_self_self__modin_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 90, "span_ids": ["imports:27", "_get_axis", "docstring"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nimport numpy as np\nimport pandas\nimport functools\nfrom pandas.api.types import is_scalar\nfrom pandas.core.common import is_bool_indexer\nfrom pandas.core.indexing import check_bool_indexer\nfrom pandas.core.indexes.api import ensure_index_from_sequences\nfrom pandas.core.dtypes.common import (\n is_list_like,\n is_numeric_dtype,\n is_datetime_or_timedelta_dtype,\n is_datetime64_any_dtype,\n is_bool_dtype,\n)\nfrom pandas.core.dtypes.cast import find_common_type\nfrom pandas.errors import DataError, MergeError\nfrom pandas._libs.lib import no_default\nfrom collections.abc import Iterable\nfrom typing import List, Hashable\nimport warnings\nimport hashlib\nfrom pandas.core.groupby.base import transformation_kernels\n\nfrom modin.core.storage_formats.base.query_compiler import BaseQueryCompiler\nfrom modin.config import ExperimentalGroupbyImpl\nfrom modin.error_message import ErrorMessage\nfrom modin.utils import (\n try_cast_to_pandas,\n wrap_udf_function,\n hashable,\n _inherit_docstrings,\n MODIN_UNNAMED_SERIES_LABEL,\n)\nfrom modin.core.dataframe.base.dataframe.utils import join_columns\nfrom modin.core.dataframe.algebra import (\n Fold,\n Map,\n TreeReduce,\n Reduce,\n Binary,\n GroupByReduce,\n)\nfrom modin.core.dataframe.algebra.default2pandas.groupby import (\n GroupBy,\n GroupByDefault,\n SeriesGroupByDefault,\n)\nfrom .utils import get_group_names, merge_partitioning\nfrom .groupby import GroupbyReduceImpl\nfrom .aggregations import CorrCovBuilder\n\n\ndef _get_axis(axis):\n \"\"\"\n Build index labels getter of the specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to get labels from. 0 is for index and 1 is for column.\n\n Returns\n -------\n callable(PandasQueryCompiler) -> pandas.Index\n \"\"\"\n if axis == 0:\n return lambda self: self._modin_frame.index\n else:\n return lambda self: self._modin_frame.columns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__set_axis__set_axis.return.set_axis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__set_axis__set_axis.return.set_axis", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 116, "span_ids": ["_set_axis"], "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 _set_axis(axis):\n \"\"\"\n Build index labels setter of the specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to set labels on. 0 is for index and 1 is for column.\n\n Returns\n -------\n callable(PandasQueryCompiler)\n \"\"\"\n if axis == 0:\n\n def set_axis(self, idx):\n self._modin_frame.index = idx\n\n else:\n\n def set_axis(self, cols):\n self._modin_frame.columns = cols\n\n return set_axis", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__str_map__str_map.return.str_op_builder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__str_map__str_map.return.str_op_builder", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 141, "span_ids": ["_str_map"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _str_map(func_name):\n \"\"\"\n Build function that calls specified string function on frames ``str`` accessor.\n\n Parameters\n ----------\n func_name : str\n String function name to execute on ``str`` accessor.\n\n Returns\n -------\n callable(pandas.DataFrame, *args, **kwargs) -> pandas.DataFrame\n \"\"\"\n\n def str_op_builder(df, *args, **kwargs):\n \"\"\"Apply specified function against `str` accessor of the passed frame.\"\"\"\n str_s = df.squeeze(axis=1).str\n res = getattr(pandas.Series.str, func_name)(str_s, *args, **kwargs)\n if hasattr(res, \"to_frame\"):\n res = res.to_frame()\n return res\n\n return str_op_builder", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__dt_prop_map__dt_prop_map.return.dt_op_builder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__dt_prop_map__dt_prop_map.return.dt_op_builder", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 177, "span_ids": ["_dt_prop_map"], "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 _dt_prop_map(property_name):\n \"\"\"\n Build function that access specified property of the ``dt`` property of the passed frame.\n\n Parameters\n ----------\n property_name : str\n Date-time property name to access.\n\n Returns\n -------\n callable(pandas.DataFrame, *args, **kwargs) -> pandas.DataFrame\n Function to be applied in the partitions.\n\n Notes\n -----\n This applies non-callable properties of ``Series.dt``.\n \"\"\"\n\n def dt_op_builder(df, *args, **kwargs):\n \"\"\"Access specified date-time property of the passed frame.\"\"\"\n squeezed_df = df.squeeze(axis=1)\n if isinstance(squeezed_df, pandas.DataFrame) and len(squeezed_df.columns) == 0:\n return squeezed_df\n assert isinstance(squeezed_df, pandas.Series)\n prop_val = getattr(squeezed_df.dt, property_name)\n if isinstance(prop_val, pandas.Series):\n return prop_val.to_frame()\n elif isinstance(prop_val, pandas.DataFrame):\n return prop_val\n else:\n return pandas.DataFrame([prop_val])\n\n return dt_op_builder", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__dt_func_map__dt_func_map.return.dt_op_builder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py__dt_func_map__dt_func_map.return.dt_op_builder", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 207, "span_ids": ["_dt_func_map"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _dt_func_map(func_name):\n \"\"\"\n Build function that apply specified method against ``dt`` property of the passed frame.\n\n Parameters\n ----------\n func_name : str\n Date-time function name to apply.\n\n Returns\n -------\n callable(pandas.DataFrame, *args, **kwargs) -> pandas.DataFrame\n Function to be applied in the partitions.\n\n Notes\n -----\n This applies callable methods of ``Series.dt``.\n \"\"\"\n\n def dt_op_builder(df, *args, **kwargs):\n \"\"\"Apply specified function against ``dt`` accessor of the passed frame.\"\"\"\n dt_s = df.squeeze(axis=1).dt\n dt_func_result = getattr(pandas.Series.dt, func_name)(dt_s, *args, **kwargs)\n # If we don't specify the dtype for the frame, the frame might get the\n # wrong dtype, e.g. for to_pydatetime in https://github.com/modin-project/modin/issues/4436\n return pandas.DataFrame(dt_func_result, dtype=dt_func_result.dtype)\n\n return dt_op_builder", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_copy_df_for_func_copy_df_for_func.return.caller": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_copy_df_for_func_copy_df_for_func.return.caller", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 238, "span_ids": ["copy_df_for_func"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def copy_df_for_func(func, display_name: str = None):\n \"\"\"\n Build function that execute specified `func` against passed frame inplace.\n\n Built function copies passed frame, applies `func` to the copy and returns\n the modified frame.\n\n Parameters\n ----------\n func : callable(pandas.DataFrame)\n The function, usually updates a dataframe inplace.\n display_name : str, optional\n The function's name, which is displayed by progress bar.\n\n Returns\n -------\n callable(pandas.DataFrame)\n A callable function to be applied in the partitions.\n \"\"\"\n\n def caller(df, *args, **kwargs):\n \"\"\"Apply specified function the passed frame inplace.\"\"\"\n df = df.copy()\n func(df, *args, **kwargs)\n return df\n\n if display_name is not None:\n caller.__name__ = display_name\n return caller", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler_PandasQueryCompiler._future_TODO_devin_pet": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler_PandasQueryCompiler._future_TODO_devin_pet", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 241, "end_line": 340, "span_ids": ["PandasQueryCompiler:3", "PandasQueryCompiler.from_dataframe", "PandasQueryCompiler.add_suffix", "PandasQueryCompiler.copy", "PandasQueryCompiler.lazy_execution", "PandasQueryCompiler.__init__", "PandasQueryCompiler.from_arrow", "PandasQueryCompiler.finalize", "PandasQueryCompiler.from_pandas", "PandasQueryCompiler", "PandasQueryCompiler.dtypes", "PandasQueryCompiler.add_prefix", "PandasQueryCompiler.to_pandas", "PandasQueryCompiler.to_dataframe"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n \"\"\"\n Query compiler for the pandas storage format.\n\n This class translates common query compiler API into the DataFrame Algebra\n queries, that is supposed to be executed by :py:class:`~modin.core.dataframe.pandas.dataframe.dataframe.PandasDataframe`.\n\n Parameters\n ----------\n modin_frame : PandasDataframe\n Modin Frame to query with the compiled queries.\n shape_hint : {\"row\", \"column\", None}, default: None\n Shape hint for frames known to be a column or a row, otherwise None.\n \"\"\"\n\n def __init__(self, modin_frame, shape_hint=None):\n self._modin_frame = modin_frame\n self._shape_hint = shape_hint\n\n @property\n def lazy_execution(self):\n \"\"\"\n Whether underlying Modin frame should be executed in a lazy mode.\n\n If True, such QueryCompiler will be handled differently at the front-end in order\n to reduce triggering the computation as much as possible.\n\n Returns\n -------\n bool\n \"\"\"\n frame = self._modin_frame\n return not frame.has_materialized_index or not frame.has_materialized_columns\n\n def finalize(self):\n self._modin_frame.finalize()\n\n def to_pandas(self):\n return self._modin_frame.to_pandas()\n\n @classmethod\n def from_pandas(cls, df, data_cls):\n return cls(data_cls.from_pandas(df))\n\n @classmethod\n def from_arrow(cls, at, data_cls):\n return cls(data_cls.from_arrow(at))\n\n # Dataframe exchange protocol\n\n def to_dataframe(self, nan_as_null: bool = False, allow_copy: bool = True):\n return self._modin_frame.__dataframe__(\n nan_as_null=nan_as_null, allow_copy=allow_copy\n )\n\n @classmethod\n def from_dataframe(cls, df, data_cls):\n return cls(data_cls.from_dataframe(df))\n\n # END Dataframe exchange protocol\n\n index = property(_get_axis(0), _set_axis(0))\n columns = property(_get_axis(1), _set_axis(1))\n\n @property\n def dtypes(self):\n return self._modin_frame.dtypes\n\n # END Index, columns, and dtypes objects\n\n # Metadata modification methods\n def add_prefix(self, prefix, axis=1):\n return self.__constructor__(self._modin_frame.add_prefix(prefix, axis))\n\n def add_suffix(self, suffix, axis=1):\n return self.__constructor__(self._modin_frame.add_suffix(suffix, axis))\n\n # END Metadata modification methods\n\n # Copy\n # For copy, we don't want a situation where we modify the metadata of the\n # copies if we end up modifying something here. We copy all of the metadata\n # to prevent that.\n def copy(self):\n return self.__constructor__(self._modin_frame.copy())\n\n # END Copy\n\n # Append/Concat/Join (Not Merge)\n # The append/concat/join operations should ideally never trigger remote\n # compute. These operations should only ever be manipulations of the\n # metadata of the resulting object. It should just be a simple matter of\n # appending the other object's blocks and adding np.nan columns for the new\n # columns, if needed. If new columns are added, some compute may be\n # required, though it can be delayed.\n #\n # Currently this computation is not delayed, and it may make a copy of the\n # DataFrame in memory. This can be problematic and should be fixed in the\n # future. TODO (devin-petersohn): Delay reindexing", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.concat_PandasQueryCompiler.concat.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.concat_PandasQueryCompiler.concat.return.result", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 342, "end_line": 362, "span_ids": ["PandasQueryCompiler.concat"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def concat(self, axis, other, **kwargs):\n if not isinstance(other, list):\n other = [other]\n assert all(\n isinstance(o, type(self)) for o in other\n ), \"Different Manager objects are being used. This is not allowed\"\n sort = kwargs.get(\"sort\", None)\n if sort is None:\n sort = False\n join = kwargs.get(\"join\", \"outer\")\n ignore_index = kwargs.get(\"ignore_index\", False)\n other_modin_frame = [o._modin_frame for o in other]\n new_modin_frame = self._modin_frame.concat(axis, other_modin_frame, join, sort)\n result = self.__constructor__(new_modin_frame)\n if ignore_index:\n if axis == 0:\n return result.reset_index(drop=True)\n else:\n result.columns = pandas.RangeIndex(len(result.columns))\n return 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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Append_Concat_Join_PandasQueryCompiler._Needed_for_numpy_API": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Append_Concat_Join_PandasQueryCompiler._Needed_for_numpy_API", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 364, "end_line": 429, "span_ids": ["PandasQueryCompiler:7", "PandasQueryCompiler.concat", "PandasQueryCompiler.free", "PandasQueryCompiler.to_numpy"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END Append/Concat/Join\n\n # Data Management Methods\n def free(self):\n # TODO create a way to clean up this object.\n return\n\n # END Data Management Methods\n\n # To NumPy\n def to_numpy(self, **kwargs):\n arr = self._modin_frame.to_numpy(**kwargs)\n ErrorMessage.catch_bugs_and_request_email(\n len(arr) != len(self.index) or len(arr[0]) != len(self.columns)\n )\n return arr\n\n # END To NumPy\n\n # Binary operations (e.g. add, sub)\n # These operations require two DataFrames and will change the shape of the\n # data if the index objects don't match. An outer join + op is performed,\n # such that columns/rows that don't have an index on the other DataFrame\n # result in NaN values.\n\n add = Binary.register(pandas.DataFrame.add, infer_dtypes=\"common_cast\")\n combine = Binary.register(pandas.DataFrame.combine, infer_dtypes=\"common_cast\")\n combine_first = Binary.register(pandas.DataFrame.combine_first, infer_dtypes=\"bool\")\n eq = Binary.register(pandas.DataFrame.eq, infer_dtypes=\"bool\")\n floordiv = Binary.register(pandas.DataFrame.floordiv, infer_dtypes=\"common_cast\")\n ge = Binary.register(pandas.DataFrame.ge, infer_dtypes=\"bool\")\n gt = Binary.register(pandas.DataFrame.gt, infer_dtypes=\"bool\")\n le = Binary.register(pandas.DataFrame.le, infer_dtypes=\"bool\")\n lt = Binary.register(pandas.DataFrame.lt, infer_dtypes=\"bool\")\n mod = Binary.register(pandas.DataFrame.mod, infer_dtypes=\"common_cast\")\n mul = Binary.register(pandas.DataFrame.mul, infer_dtypes=\"common_cast\")\n rmul = Binary.register(pandas.DataFrame.rmul, infer_dtypes=\"common_cast\")\n ne = Binary.register(pandas.DataFrame.ne, infer_dtypes=\"bool\")\n pow = Binary.register(pandas.DataFrame.pow, infer_dtypes=\"common_cast\")\n radd = Binary.register(pandas.DataFrame.radd, infer_dtypes=\"common_cast\")\n rfloordiv = Binary.register(pandas.DataFrame.rfloordiv, infer_dtypes=\"common_cast\")\n rmod = Binary.register(pandas.DataFrame.rmod, infer_dtypes=\"common_cast\")\n rpow = Binary.register(pandas.DataFrame.rpow, infer_dtypes=\"common_cast\")\n rsub = Binary.register(pandas.DataFrame.rsub, infer_dtypes=\"common_cast\")\n rtruediv = Binary.register(pandas.DataFrame.rtruediv, infer_dtypes=\"float\")\n sub = Binary.register(pandas.DataFrame.sub, infer_dtypes=\"common_cast\")\n truediv = Binary.register(pandas.DataFrame.truediv, infer_dtypes=\"float\")\n __and__ = Binary.register(pandas.DataFrame.__and__, infer_dtypes=\"bool\")\n __or__ = Binary.register(pandas.DataFrame.__or__, infer_dtypes=\"bool\")\n __rand__ = Binary.register(pandas.DataFrame.__rand__, infer_dtypes=\"bool\")\n __ror__ = Binary.register(pandas.DataFrame.__ror__, infer_dtypes=\"bool\")\n __rxor__ = Binary.register(pandas.DataFrame.__rxor__, infer_dtypes=\"bool\")\n __xor__ = Binary.register(pandas.DataFrame.__xor__, infer_dtypes=\"bool\")\n df_update = Binary.register(\n copy_df_for_func(pandas.DataFrame.update, display_name=\"update\"),\n join_type=\"left\",\n )\n series_update = Binary.register(\n copy_df_for_func(\n lambda x, y: pandas.Series.update(x.squeeze(axis=1), y.squeeze(axis=1)),\n display_name=\"update\",\n ),\n join_type=\"left\",\n )\n\n # Needed for numpy API", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._logical_and_PandasQueryCompiler._logical_xor.Binary_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._logical_and_PandasQueryCompiler._logical_xor.Binary_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 430, "end_line": 447, "span_ids": ["PandasQueryCompiler:7"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n _logical_and = Binary.register(\n lambda df, other, *args, **kwargs: pandas.DataFrame(\n np.logical_and(df, other, *args, **kwargs)\n ),\n infer_dtypes=\"bool\",\n )\n _logical_or = Binary.register(\n lambda df, other, *args, **kwargs: pandas.DataFrame(\n np.logical_or(df, other, *args, **kwargs)\n ),\n infer_dtypes=\"bool\",\n )\n _logical_xor = Binary.register(\n lambda df, other, *args, **kwargs: pandas.DataFrame(\n np.logical_xor(df, other, *args, **kwargs)\n ),\n infer_dtypes=\"bool\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.where_PandasQueryCompiler.where.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.where_PandasQueryCompiler.where.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 478, "span_ids": ["PandasQueryCompiler.where"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def where(self, cond, other, **kwargs):\n assert isinstance(\n cond, type(self)\n ), \"Must have the same QueryCompiler subclass to perform this operation\"\n # it's doesn't work if `other` is Series._query_compiler because\n # `n_ary_op` performs columns copartition both for `cond` and `other`.\n if isinstance(other, type(self)) and other._shape_hint is not None:\n other = other.to_pandas()\n if isinstance(other, type(self)):\n # Make sure to set join_type=None so the `where` result always has\n # the same row and column labels as `self`.\n new_modin_frame = self._modin_frame.n_ary_op(\n lambda df, cond, other: df.where(cond, other, **kwargs),\n [\n cond._modin_frame,\n other._modin_frame,\n ],\n join_type=None,\n )\n # This will be a Series of scalars to be applied based on the condition\n # dataframe.\n else:\n\n def where_builder_series(df, cond):\n return df.where(cond, other, **kwargs)\n\n new_modin_frame = self._modin_frame.n_ary_op(\n where_builder_series, [cond._modin_frame], join_type=\"left\"\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.merge_PandasQueryCompiler.merge.if_how_in_left_inner.else_.return.self_default_to_pandas_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.merge_PandasQueryCompiler.merge.if_how_in_left_inner.else_.return.self_default_to_pandas_pa", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 604, "span_ids": ["PandasQueryCompiler.merge"], "tokens": 1135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def merge(self, right, **kwargs):\n how = kwargs.get(\"how\", \"inner\")\n on = kwargs.get(\"on\", None)\n left_on = kwargs.get(\"left_on\", None)\n right_on = kwargs.get(\"right_on\", None)\n left_index = kwargs.get(\"left_index\", False)\n right_index = kwargs.get(\"right_index\", False)\n sort = kwargs.get(\"sort\", False)\n\n if how in [\"left\", \"inner\"] and left_index is False and right_index is False:\n right_pandas = right.to_pandas()\n\n kwargs[\"sort\"] = False\n\n def map_func(left, right=right_pandas, kwargs=kwargs): # pragma: no cover\n return pandas.merge(left, right_pandas, **kwargs)\n\n # Want to ensure that these are python lists\n if left_on is not None and right_on is not None:\n left_on = list(left_on) if is_list_like(left_on) else [left_on]\n right_on = list(right_on) if is_list_like(right_on) else [right_on]\n elif on is not None:\n on = list(on) if is_list_like(on) else [on]\n\n new_columns = None\n new_dtypes = None\n if self._modin_frame.has_materialized_columns:\n if left_on is None and right_on is None:\n if on is None:\n on = [c for c in self.columns if c in right_pandas.columns]\n _left_on, _right_on = on, on\n else:\n if left_on is None or right_on is None:\n raise MergeError(\n \"Must either pass only 'on' or 'left_on' and 'right_on', not combination of them.\"\n )\n _left_on, _right_on = left_on, right_on\n\n try:\n new_columns, left_renamer, right_renamer = join_columns(\n self.columns,\n right_pandas.columns,\n _left_on,\n _right_on,\n kwargs.get(\"suffixes\", (\"_x\", \"_y\")),\n )\n except NotImplementedError:\n # This happens when one of the keys to join is an index level. Pandas behaviour\n # is really complicated in this case, so we're not computing resulted columns for now.\n pass\n else:\n if self._modin_frame.has_materialized_dtypes:\n new_dtypes = []\n for old_col in left_renamer.keys():\n new_dtypes.append(self.dtypes[old_col])\n for old_col in right_renamer.keys():\n new_dtypes.append(right_pandas.dtypes[old_col])\n new_dtypes = pandas.Series(new_dtypes, index=new_columns)\n\n new_self = self.__constructor__(\n self._modin_frame.apply_full_axis(\n axis=1,\n func=map_func,\n # We're going to explicitly change the shape across the 1-axis,\n # so we want for partitioning to adapt as well\n keep_partitioning=False,\n num_splits=merge_partitioning(\n self._modin_frame, right._modin_frame, axis=1\n ),\n new_columns=new_columns,\n dtypes=new_dtypes,\n sync_labels=False,\n )\n )\n\n # Here we want to understand whether we're joining on a column or on an index level.\n # It's cool if indexes are already materialized so we can easily check that, if not\n # it's fine too, we can also decide that by columns, which tend to be already\n # materialized quite often compared to the indexes.\n keep_index = False\n if self._modin_frame.has_materialized_index:\n if left_on is not None and right_on is not None:\n keep_index = any(\n o in self.index.names\n and o in right_on\n and o in right_pandas.index.names\n for o in left_on\n )\n elif on is not None:\n keep_index = any(\n o in self.index.names and o in right_pandas.index.names\n for o in on\n )\n else:\n # Have to trigger columns materialization. Hope they're already available at this point.\n if left_on is not None and right_on is not None:\n keep_index = any(\n o not in right_pandas.columns\n and o in left_on\n and o not in self.columns\n for o in right_on\n )\n elif on is not None:\n keep_index = any(\n o not in right_pandas.columns and o not in self.columns\n for o in on\n )\n\n if sort:\n if left_on is not None and right_on is not None:\n new_self = (\n new_self.sort_index(axis=0, level=left_on + right_on)\n if keep_index\n else new_self.sort_rows_by_column_values(left_on + right_on)\n )\n elif on is not None:\n new_self = (\n new_self.sort_index(axis=0, level=on)\n if keep_index\n else new_self.sort_rows_by_column_values(on)\n )\n\n return new_self if keep_index else new_self.reset_index(drop=True)\n else:\n return self.default_to_pandas(pandas.DataFrame.merge, right, **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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.join_PandasQueryCompiler.join.if_how_in_left_inner.else_.return.self_default_to_pandas_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.join_PandasQueryCompiler.join.if_how_in_left_inner.else_.return.self_default_to_pandas_pa", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 606, "end_line": 631, "span_ids": ["PandasQueryCompiler.join"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def join(self, right, **kwargs):\n on = kwargs.get(\"on\", None)\n how = kwargs.get(\"how\", \"left\")\n sort = kwargs.get(\"sort\", False)\n\n if how in [\"left\", \"inner\"]:\n right_pandas = right.to_pandas()\n\n def map_func(left, right=right_pandas, kwargs=kwargs): # pragma: no cover\n return pandas.DataFrame.join(left, right, **kwargs)\n\n new_self = self.__constructor__(\n self._modin_frame.apply_full_axis(\n axis=1,\n func=map_func,\n # We're going to explicitly change the shape across the 1-axis,\n # so we want for partitioning to adapt as well\n keep_partitioning=False,\n num_splits=merge_partitioning(\n self._modin_frame, right._modin_frame, axis=1\n ),\n )\n )\n return new_self.sort_rows_by_column_values(on) if sort else new_self\n else:\n return self.default_to_pandas(pandas.DataFrame.join, right, **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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Inter_Data_operatio_PandasQueryCompiler.reindex.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Inter_Data_operatio_PandasQueryCompiler.reindex.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 633, "end_line": 645, "span_ids": ["PandasQueryCompiler.join", "PandasQueryCompiler.reindex"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END Inter-Data operations\n\n # Reindex/reset_index (may shuffle data)\n def reindex(self, axis, labels, **kwargs):\n new_index, _ = (self.index, None) if axis else self.index.reindex(labels)\n new_columns, _ = self.columns.reindex(labels) if axis else (self.columns, None)\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis,\n lambda df: df.reindex(labels=labels, axis=axis, **kwargs),\n new_index=new_index,\n new_columns=new_columns,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.reset_index_PandasQueryCompiler.reset_index.if_level_is_not_None_.elif_not_drop_.uniq_sorted_level.list_range_self_index_nle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.reset_index_PandasQueryCompiler.reset_index.if_level_is_not_None_.elif_not_drop_.uniq_sorted_level.list_range_self_index_nle", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 647, "end_line": 710, "span_ids": ["PandasQueryCompiler.reset_index"], "tokens": 535}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def reset_index(self, **kwargs):\n if self.lazy_execution:\n\n def _reset(df, *axis_lengths, partition_idx): # pragma: no cover\n df = df.reset_index(**kwargs)\n\n if isinstance(df.index, pandas.RangeIndex):\n # If the resulting index is a pure RangeIndex that means that\n # `.reset_index` actually dropped all of the levels of the\n # original index and so we have to recompute it manually for each partition\n start = sum(axis_lengths[:partition_idx])\n stop = sum(axis_lengths[: partition_idx + 1])\n\n df.index = pandas.RangeIndex(start, stop)\n return df\n\n if self._modin_frame.has_columns_cache and kwargs[\"drop\"]:\n new_columns = self._modin_frame.copy_columns_cache()\n else:\n new_columns = None\n\n return self.__constructor__(\n self._modin_frame.apply_full_axis(\n axis=1,\n func=_reset,\n enumerate_partitions=True,\n new_columns=new_columns,\n dtypes=(\n self._modin_frame._dtypes if kwargs.get(\"drop\", False) else None\n ),\n sync_labels=False,\n pass_axis_lengths_to_partitions=True,\n )\n )\n\n allow_duplicates = kwargs.pop(\"allow_duplicates\", no_default)\n names = kwargs.pop(\"names\", None)\n if allow_duplicates not in (no_default, False) or names is not None:\n return self.default_to_pandas(\n pandas.DataFrame.reset_index,\n allow_duplicates=allow_duplicates,\n names=names,\n **kwargs,\n )\n\n drop = kwargs.get(\"drop\", False)\n level = kwargs.get(\"level\", None)\n new_index = None\n if level is not None:\n if not isinstance(level, (tuple, list)):\n level = [level]\n level = [self.index._get_level_number(lev) for lev in level]\n uniq_sorted_level = sorted(set(level))\n if len(uniq_sorted_level) < self.index.nlevels:\n # We handle this by separately computing the index. We could just\n # put the labels into the data and pull them back out, but that is\n # expensive.\n new_index = (\n self.index.droplevel(uniq_sorted_level)\n if len(level) < self.index.nlevels\n else pandas.RangeIndex(len(self.index))\n )\n elif not drop:\n uniq_sorted_level = list(range(self.index.nlevels))\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.reset_index.if_not_drop__PandasQueryCompiler.reset_index.return.new_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.reset_index.if_not_drop__PandasQueryCompiler.reset_index.return.new_self", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 712, "end_line": 791, "span_ids": ["PandasQueryCompiler.reset_index"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def reset_index(self, **kwargs):\n # ... other code\n\n if not drop:\n if len(uniq_sorted_level) < self.index.nlevels:\n # These are the index levels that will remain after the reset_index\n keep_levels = [\n i for i in range(self.index.nlevels) if i not in uniq_sorted_level\n ]\n new_copy = self.copy()\n # Change the index to have only the levels that will be inserted\n # into the data. We will replace the old levels later.\n new_copy.index = self.index.droplevel(keep_levels)\n new_copy.index.names = [\n \"level_{}\".format(level_value)\n if new_copy.index.names[level_index] is None\n else new_copy.index.names[level_index]\n for level_index, level_value in enumerate(uniq_sorted_level)\n ]\n new_modin_frame = new_copy._modin_frame.from_labels()\n # Replace the levels that will remain as a part of the index.\n new_modin_frame.index = new_index\n else:\n new_modin_frame = self._modin_frame.from_labels()\n if isinstance(new_modin_frame.columns, pandas.MultiIndex):\n # Fix col_level and col_fill in generated column names because from_labels works with assumption\n # that col_level and col_fill are not specified but it expands tuples in level names.\n col_level = kwargs.get(\"col_level\", 0)\n col_fill = kwargs.get(\"col_fill\", \"\")\n if col_level != 0 or col_fill != \"\":\n # Modify generated column names if col_level and col_fil have values different from default.\n levels_names_list = [\n f\"level_{level_index}\" if level_name is None else level_name\n for level_index, level_name in enumerate(self.index.names)\n ]\n if col_fill is None:\n # Initialize col_fill if it is None.\n # This is some weird undocumented Pandas behavior to take first\n # element of the last column name.\n last_col_name = levels_names_list[uniq_sorted_level[-1]]\n last_col_name = (\n list(last_col_name)\n if isinstance(last_col_name, tuple)\n else [last_col_name]\n )\n if len(last_col_name) not in (1, self.columns.nlevels):\n raise ValueError(\n \"col_fill=None is incompatible \"\n + f\"with incomplete column name {last_col_name}\"\n )\n col_fill = last_col_name[0]\n columns_list = new_modin_frame.columns.tolist()\n for level_index, level_value in enumerate(uniq_sorted_level):\n level_name = levels_names_list[level_value]\n # Expand tuples into separate items and fill the rest with col_fill\n top_level = [col_fill] * col_level\n middle_level = (\n list(level_name)\n if isinstance(level_name, tuple)\n else [level_name]\n )\n bottom_level = [col_fill] * (\n self.columns.nlevels - (col_level + len(middle_level))\n )\n item = tuple(top_level + middle_level + bottom_level)\n if len(item) > self.columns.nlevels:\n raise ValueError(\n \"Item must have length equal to number of levels.\"\n )\n columns_list[level_index] = item\n new_modin_frame.columns = pandas.MultiIndex.from_tuples(\n columns_list, names=self.columns.names\n )\n new_self = self.__constructor__(new_modin_frame)\n else:\n new_self = self.copy()\n new_self.index = (\n # Cheaper to compute row lengths than index\n pandas.RangeIndex(sum(new_self._modin_frame.row_lengths))\n if new_index is None\n else new_index\n )\n return new_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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.set_index_from_columns_PandasQueryCompiler.set_index_from_columns.return.self___constructor___resu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.set_index_from_columns_PandasQueryCompiler.set_index_from_columns.return.self___constructor___resu", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 793, "end_line": 824, "span_ids": ["PandasQueryCompiler.set_index_from_columns"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def set_index_from_columns(\n self, keys: List[Hashable], drop: bool = True, append: bool = False\n ):\n new_modin_frame = self._modin_frame.to_labels(keys)\n if append:\n arrays = []\n # Appending keeps the original order of the index levels, then appends the\n # new index objects.\n names = list(self.index.names)\n if isinstance(self.index, pandas.MultiIndex):\n for i in range(self.index.nlevels):\n arrays.append(self.index._get_level_values(i))\n else:\n arrays.append(self.index)\n\n # Add the names in the correct order.\n names.extend(new_modin_frame.index.names)\n if isinstance(new_modin_frame.index, pandas.MultiIndex):\n for i in range(new_modin_frame.index.nlevels):\n arrays.append(new_modin_frame.index._get_level_values(i))\n else:\n arrays.append(new_modin_frame.index)\n new_modin_frame.index = ensure_index_from_sequences(arrays, names)\n if not drop:\n # The algebraic operator for this operation always drops the column, but we\n # can copy the data in this object and just use the index from the result of\n # the query compiler call.\n result = self._modin_frame.copy()\n result.index = new_modin_frame.index\n else:\n result = new_modin_frame\n return self.__constructor__(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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Reindex_reset_index_PandasQueryCompiler._memory_usage_without_index.TreeReduce_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Reindex_reset_index_PandasQueryCompiler._memory_usage_without_index.TreeReduce_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 826, "end_line": 859, "span_ids": ["PandasQueryCompiler.is_series_like", "PandasQueryCompiler.set_index_from_columns", "PandasQueryCompiler:73", "PandasQueryCompiler.transpose"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END Reindex/reset_index\n\n # Transpose\n # For transpose, we aren't going to immediately copy everything. Since the\n # actual transpose operation is very fast, we will just do it before any\n # operation that gets called on the transposed data. See _prepare_method\n # for how the transpose is applied.\n #\n # Our invariants assume that the blocks are transposed, but not the\n # data inside. Sometimes we have to reverse this transposition of blocks\n # for simplicity of implementation.\n\n def transpose(self, *args, **kwargs):\n # Switch the index and columns and transpose the data within the blocks.\n return self.__constructor__(self._modin_frame.transpose())\n\n def is_series_like(self):\n return len(self.columns) == 1 or len(self.index) == 1\n\n # END Transpose\n\n # TreeReduce operations\n count = TreeReduce.register(pandas.DataFrame.count, pandas.DataFrame.sum)\n sum = TreeReduce.register(pandas.DataFrame.sum)\n prod = TreeReduce.register(pandas.DataFrame.prod)\n any = TreeReduce.register(pandas.DataFrame.any, pandas.DataFrame.any)\n all = TreeReduce.register(pandas.DataFrame.all, pandas.DataFrame.all)\n # memory_usage adds an extra column for index usage, but we don't want to distribute\n # the index memory usage calculation.\n _memory_usage_without_index = TreeReduce.register(\n pandas.DataFrame.memory_usage,\n lambda x, *args, **kwargs: pandas.DataFrame.sum(x),\n axis=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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.memory_usage_PandasQueryCompiler.memory_usage.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.memory_usage_PandasQueryCompiler.memory_usage.return._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 861, "end_line": 876, "span_ids": ["PandasQueryCompiler.memory_usage"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def memory_usage(self, **kwargs):\n index = kwargs.get(\"index\", True)\n deep = kwargs.get(\"deep\", False)\n usage_without_index = self._memory_usage_without_index(index=False, deep=deep)\n return (\n self.from_pandas(\n pandas.DataFrame(\n [self.index.memory_usage()],\n columns=[\"Index\"],\n index=[MODIN_UNNAMED_SERIES_LABEL],\n ),\n data_cls=type(self._modin_frame),\n ).concat(axis=1, other=[usage_without_index])\n if index\n else usage_without_index\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.max_PandasQueryCompiler.min.return.TreeReduce_register_map_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.max_PandasQueryCompiler.min.return.TreeReduce_register_map_f", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 878, "end_line": 900, "span_ids": ["PandasQueryCompiler.min", "PandasQueryCompiler.max"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def max(self, axis, **kwargs):\n def map_func(df, **kwargs):\n return pandas.DataFrame.max(df, **kwargs)\n\n def reduce_func(df, **kwargs):\n if kwargs.get(\"numeric_only\", False):\n kwargs = kwargs.copy()\n kwargs[\"numeric_only\"] = False\n return pandas.DataFrame.max(df, **kwargs)\n\n return TreeReduce.register(map_func, reduce_func)(self, axis=axis, **kwargs)\n\n def min(self, axis, **kwargs):\n def map_func(df, **kwargs):\n return pandas.DataFrame.min(df, **kwargs)\n\n def reduce_func(df, **kwargs):\n if kwargs.get(\"numeric_only\", False):\n kwargs = kwargs.copy()\n kwargs[\"numeric_only\"] = False\n return pandas.DataFrame.min(df, **kwargs)\n\n return TreeReduce.register(map_func, reduce_func)(self, axis=axis, **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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mean_PandasQueryCompiler.mean.map_fn.return.result_if_axis_else_resul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mean_PandasQueryCompiler.mean.map_fn.return.result_if_axis_else_resul", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 902, "end_line": 923, "span_ids": ["PandasQueryCompiler.mean"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def mean(self, axis, **kwargs):\n if kwargs.get(\"level\") is not None or axis is None:\n return self.default_to_pandas(pandas.DataFrame.mean, axis=axis, **kwargs)\n\n skipna = kwargs.get(\"skipna\", True)\n\n # TODO-FIX: this function may work incorrectly with user-defined \"numeric\" values.\n # Since `count(numeric_only=True)` discards all unknown \"numeric\" types, we can get incorrect\n # divisor inside the reduce function.\n def map_fn(df, numeric_only=False, **kwargs):\n \"\"\"\n Perform Map phase of the `mean`.\n\n Compute sum and number of elements in a given partition.\n \"\"\"\n result = pandas.DataFrame(\n {\n \"sum\": df.sum(axis=axis, skipna=skipna, numeric_only=numeric_only),\n \"count\": df.count(axis=axis, numeric_only=numeric_only),\n }\n )\n return result if axis else result.T\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mean.reduce_fn_PandasQueryCompiler.mean.return.TreeReduce_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mean.reduce_fn_PandasQueryCompiler.mean.return.TreeReduce_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 925, "end_line": 945, "span_ids": ["PandasQueryCompiler.mean"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def mean(self, axis, **kwargs):\n # ... other code\n\n def reduce_fn(df, **kwargs):\n \"\"\"\n Perform Reduce phase of the `mean`.\n\n Compute sum for all the the partitions and divide it to\n the total number of elements.\n \"\"\"\n sum_cols = df[\"sum\"] if axis else df.loc[\"sum\"]\n count_cols = df[\"count\"] if axis else df.loc[\"count\"]\n\n if not isinstance(sum_cols, pandas.Series):\n # If we got `NaN` as the result of the sum in any axis partition,\n # then we must consider the whole sum as `NaN`, so setting `skipna=False`\n sum_cols = sum_cols.sum(axis=axis, skipna=False)\n count_cols = count_cols.sum(axis=axis, skipna=False)\n return sum_cols / count_cols\n\n return TreeReduce.register(\n map_fn,\n reduce_fn,\n )(self, axis=axis, **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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_TreeReduce_operatio_PandasQueryCompiler.quantile_for_single_value.Reduce_register_pandas_Da": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_TreeReduce_operatio_PandasQueryCompiler.quantile_for_single_value.Reduce_register_pandas_Da", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 947, "end_line": 975, "span_ids": ["PandasQueryCompiler:91", "PandasQueryCompiler:89", "PandasQueryCompiler.kurt", "PandasQueryCompiler.mean", "PandasQueryCompiler.median", "PandasQueryCompiler:85", "PandasQueryCompiler.skew"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END TreeReduce operations\n\n # Reduce operations\n idxmax = Reduce.register(pandas.DataFrame.idxmax)\n idxmin = Reduce.register(pandas.DataFrame.idxmin)\n\n def median(self, axis, **kwargs):\n if axis is None:\n return self.default_to_pandas(pandas.DataFrame.median, axis=axis, **kwargs)\n return Reduce.register(pandas.DataFrame.median)(self, axis=axis, **kwargs)\n\n nunique = Reduce.register(pandas.DataFrame.nunique)\n\n def skew(self, axis, **kwargs):\n if axis is None:\n return self.default_to_pandas(pandas.DataFrame.skew, axis=axis, **kwargs)\n return Reduce.register(pandas.DataFrame.skew)(self, axis=axis, **kwargs)\n\n def kurt(self, axis, **kwargs):\n if axis is None:\n return self.default_to_pandas(pandas.DataFrame.kurt, axis=axis, **kwargs)\n return Reduce.register(pandas.DataFrame.kurt)(self, axis=axis, **kwargs)\n\n sem = Reduce.register(pandas.DataFrame.sem)\n std = Reduce.register(pandas.DataFrame.std)\n var = Reduce.register(pandas.DataFrame.var)\n sum_min_count = Reduce.register(pandas.DataFrame.sum)\n prod_min_count = Reduce.register(pandas.DataFrame.prod)\n quantile_for_single_value = Reduce.register(pandas.DataFrame.quantile)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.to_datetime_PandasQueryCompiler._END_Reduce_operations": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.to_datetime_PandasQueryCompiler._END_Reduce_operations", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 977, "end_line": 988, "span_ids": ["PandasQueryCompiler.to_datetime"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def to_datetime(self, *args, **kwargs):\n if len(self.columns) == 1:\n return Map.register(\n # to_datetime has inplace side effects, see GH#3063\n lambda df, *args, **kwargs: pandas.to_datetime(\n df.squeeze(axis=1), *args, **kwargs\n ).to_frame()\n )(self, *args, **kwargs)\n else:\n return Reduce.register(pandas.to_datetime, axis=1)(self, *args, **kwargs)\n\n # END Reduce operations", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._resample_func_PandasQueryCompiler._resample_func._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._resample_func_PandasQueryCompiler._resample_func._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 990, "end_line": 1016, "span_ids": ["PandasQueryCompiler._resample_func"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _resample_func(\n self, resample_kwargs, func_name, new_columns=None, df_op=None, *args, **kwargs\n ):\n \"\"\"\n Resample underlying time-series data and apply aggregation on it.\n\n Parameters\n ----------\n resample_kwargs : dict\n Resample parameters in the format of ``modin.pandas.DataFrame.resample`` signature.\n func_name : str\n Aggregation function name to apply on resampler object.\n new_columns : list of labels, optional\n Actual column labels of the resulted frame, supposed to be a hint for the\n Modin frame. If not specified will be computed automaticly.\n df_op : callable(pandas.DataFrame) -> [pandas.DataFrame, pandas.Series], optional\n Preprocessor function to apply to the passed frame before resampling.\n *args : args\n Arguments to pass to the aggregation function.\n **kwargs : kwargs\n Arguments to pass to the aggregation function.\n\n Returns\n -------\n PandasQueryCompiler\n New QueryCompiler containing the result of resample aggregation.\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._resample_func.map_func_PandasQueryCompiler._resample_func.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._resample_func.map_func_PandasQueryCompiler._resample_func.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1018, "end_line": 1043, "span_ids": ["PandasQueryCompiler._resample_func"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _resample_func(\n self, resample_kwargs, func_name, new_columns=None, df_op=None, *args, **kwargs\n ):\n\n def map_func(df, resample_kwargs=resample_kwargs): # pragma: no cover\n \"\"\"Resample time-series data of the passed frame and apply aggregation function on it.\"\"\"\n if df_op is not None:\n df = df_op(df)\n resampled_val = df.resample(**resample_kwargs)\n op = getattr(pandas.core.resample.Resampler, func_name)\n if callable(op):\n try:\n # This will happen with Arrow buffer read-only errors. We don't want to copy\n # all the time, so this will try to fast-path the code first.\n val = op(resampled_val, *args, **kwargs)\n except ValueError:\n resampled_val = df.copy().resample(**resample_kwargs)\n val = op(resampled_val, *args, **kwargs)\n else:\n val = getattr(resampled_val, func_name)\n\n if isinstance(val, pandas.Series):\n return val.to_frame()\n else:\n return val\n\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis=0, func=map_func, new_columns=new_columns\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_get_group_PandasQueryCompiler.resample_asfreq.return.self__resample_func_resam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_get_group_PandasQueryCompiler.resample_asfreq.return.self__resample_func_resam", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1045, "end_line": 1099, "span_ids": ["PandasQueryCompiler.resample_ffill", "PandasQueryCompiler.resample_app_df", "PandasQueryCompiler.resample_pipe", "PandasQueryCompiler.resample_get_group", "PandasQueryCompiler.resample_nearest", "PandasQueryCompiler.resample_fillna", "PandasQueryCompiler.resample_agg_df", "PandasQueryCompiler.resample_agg_ser", "PandasQueryCompiler.resample_transform", "PandasQueryCompiler.resample_app_ser", "PandasQueryCompiler.resample_asfreq", "PandasQueryCompiler.resample_bfill"], "tokens": 541}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def resample_get_group(self, resample_kwargs, name, obj):\n return self._resample_func(resample_kwargs, \"get_group\", name=name, obj=obj)\n\n def resample_app_ser(self, resample_kwargs, func, *args, **kwargs):\n return self._resample_func(\n resample_kwargs,\n \"apply\",\n df_op=lambda df: df.squeeze(axis=1),\n func=func,\n *args,\n **kwargs,\n )\n\n def resample_app_df(self, resample_kwargs, func, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"apply\", func=func, *args, **kwargs)\n\n def resample_agg_ser(self, resample_kwargs, func, *args, **kwargs):\n return self._resample_func(\n resample_kwargs,\n \"aggregate\",\n df_op=lambda df: df.squeeze(axis=1),\n func=func,\n *args,\n **kwargs,\n )\n\n def resample_agg_df(self, resample_kwargs, func, *args, **kwargs):\n return self._resample_func(\n resample_kwargs, \"aggregate\", func=func, *args, **kwargs\n )\n\n def resample_transform(self, resample_kwargs, arg, *args, **kwargs):\n return self._resample_func(\n resample_kwargs, \"transform\", arg=arg, *args, **kwargs\n )\n\n def resample_pipe(self, resample_kwargs, func, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"pipe\", func=func, *args, **kwargs)\n\n def resample_ffill(self, resample_kwargs, limit):\n return self._resample_func(resample_kwargs, \"ffill\", limit=limit)\n\n def resample_bfill(self, resample_kwargs, limit):\n return self._resample_func(resample_kwargs, \"bfill\", limit=limit)\n\n def resample_nearest(self, resample_kwargs, limit):\n return self._resample_func(resample_kwargs, \"nearest\", limit=limit)\n\n def resample_fillna(self, resample_kwargs, method, limit):\n return self._resample_func(\n resample_kwargs, \"fillna\", method=method, limit=limit\n )\n\n def resample_asfreq(self, resample_kwargs, fill_value):\n return self._resample_func(resample_kwargs, \"asfreq\", fill_value=fill_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_interpolate_PandasQueryCompiler.resample_interpolate.return.self__resample_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_interpolate_PandasQueryCompiler.resample_interpolate.return.self__resample_func_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1101, "end_line": 1123, "span_ids": ["PandasQueryCompiler.resample_interpolate"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def resample_interpolate(\n self,\n resample_kwargs,\n method,\n axis,\n limit,\n inplace,\n limit_direction,\n limit_area,\n downcast,\n **kwargs,\n ):\n return self._resample_func(\n resample_kwargs,\n \"interpolate\",\n axis=axis,\n limit=limit,\n inplace=inplace,\n limit_direction=limit_direction,\n limit_area=limit_area,\n downcast=downcast,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_count_PandasQueryCompiler.resample_quantile.return.self__resample_func_resam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.resample_count_PandasQueryCompiler.resample_quantile.return.self__resample_func_resam", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1125, "end_line": 1194, "span_ids": ["PandasQueryCompiler.resample_sum", "PandasQueryCompiler.resample_median", "PandasQueryCompiler.resample_ohlc_df", "PandasQueryCompiler.resample_count", "PandasQueryCompiler.resample_prod", "PandasQueryCompiler.resample_ohlc_ser", "PandasQueryCompiler.resample_last", "PandasQueryCompiler.resample_std", "PandasQueryCompiler.resample_mean", "PandasQueryCompiler.resample_min", "PandasQueryCompiler.resample_size", "PandasQueryCompiler.resample_var", "PandasQueryCompiler.resample_first", "PandasQueryCompiler.resample_nunique", "PandasQueryCompiler.resample_sem", "PandasQueryCompiler.resample_max", "PandasQueryCompiler.resample_quantile"], "tokens": 719}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def resample_count(self, resample_kwargs):\n return self._resample_func(resample_kwargs, \"count\")\n\n def resample_nunique(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"nunique\", *args, **kwargs)\n\n def resample_first(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"first\", *args, **kwargs)\n\n def resample_last(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"last\", *args, **kwargs)\n\n def resample_max(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"max\", *args, **kwargs)\n\n def resample_mean(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"median\", *args, **kwargs)\n\n def resample_median(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"median\", *args, **kwargs)\n\n def resample_min(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"min\", *args, **kwargs)\n\n def resample_ohlc_ser(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(\n resample_kwargs,\n \"ohlc\",\n df_op=lambda df: df.squeeze(axis=1),\n *args,\n **kwargs,\n )\n\n def resample_ohlc_df(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"ohlc\", *args, **kwargs)\n\n def resample_prod(self, resample_kwargs, min_count, *args, **kwargs):\n return self._resample_func(\n resample_kwargs,\n \"prod\",\n min_count=min_count,\n *args,\n **kwargs,\n )\n\n def resample_size(self, resample_kwargs):\n return self._resample_func(\n resample_kwargs, \"size\", new_columns=[MODIN_UNNAMED_SERIES_LABEL]\n )\n\n def resample_sem(self, resample_kwargs, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"sem\", *args, **kwargs)\n\n def resample_std(self, resample_kwargs, ddof, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"std\", ddof=ddof, *args, **kwargs)\n\n def resample_sum(self, resample_kwargs, min_count, *args, **kwargs):\n return self._resample_func(\n resample_kwargs,\n \"sum\",\n min_count=min_count,\n *args,\n **kwargs,\n )\n\n def resample_var(self, resample_kwargs, ddof, *args, **kwargs):\n return self._resample_func(resample_kwargs, \"var\", ddof=ddof, *args, **kwargs)\n\n def resample_quantile(self, resample_kwargs, q, **kwargs):\n return self._resample_func(resample_kwargs, \"quantile\", q=q, **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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_aggregate_PandasQueryCompiler.expanding_count.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_aggregate_PandasQueryCompiler.expanding_count.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1196, "end_line": 1252, "span_ids": ["PandasQueryCompiler:103", "PandasQueryCompiler.expanding_aggregate"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def expanding_aggregate(self, axis, expanding_args, func, *args, **kwargs):\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis,\n lambda df: pandas.DataFrame(\n df.expanding(*expanding_args).aggregate(func=func, *args, **kwargs)\n ),\n new_index=self.index,\n )\n return self.__constructor__(new_modin_frame)\n\n expanding_sum = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).sum(*args, **kwargs)\n )\n )\n\n expanding_min = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).min(*args, **kwargs)\n )\n )\n\n expanding_max = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).max(*args, **kwargs)\n )\n )\n\n expanding_mean = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).mean(*args, **kwargs)\n )\n )\n\n expanding_median = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).median(*args, **kwargs)\n )\n )\n\n expanding_var = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).var(*args, **kwargs)\n )\n )\n\n expanding_std = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).std(*args, **kwargs)\n )\n )\n\n expanding_count = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).count(*args, **kwargs)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_cov_PandasQueryCompiler.expanding_cov.return.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_cov_PandasQueryCompiler.expanding_cov.return.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1254, "end_line": 1300, "span_ids": ["PandasQueryCompiler.expanding_cov"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def expanding_cov(\n self,\n fold_axis,\n expanding_args,\n squeeze_self,\n squeeze_other,\n other=None,\n pairwise=None,\n ddof=1,\n numeric_only=False,\n **kwargs,\n ):\n other_for_pandas = (\n other\n if other is None\n else other.to_pandas().squeeze(axis=1)\n if squeeze_other\n else other.to_pandas()\n )\n if len(self.columns) > 1:\n # computing covariance for each column requires having the other columns,\n # so we can't parallelize this as a full-column operation\n return self.default_to_pandas(\n lambda df: pandas.DataFrame.expanding(df, *expanding_args).cov(\n other=other_for_pandas,\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\n )\n )\n return Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n (df.squeeze(axis=1) if squeeze_self else df)\n .expanding(*expanding_args)\n .cov(*args, **kwargs)\n )\n )(\n self,\n fold_axis,\n expanding_args,\n other=other_for_pandas,\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_corr_PandasQueryCompiler.expanding_corr.return.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_corr_PandasQueryCompiler.expanding_corr.return.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1302, "end_line": 1348, "span_ids": ["PandasQueryCompiler.expanding_corr"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def expanding_corr(\n self,\n fold_axis,\n expanding_args,\n squeeze_self,\n squeeze_other,\n other=None,\n pairwise=None,\n ddof=1,\n numeric_only=False,\n **kwargs,\n ):\n other_for_pandas = (\n other\n if other is None\n else other.to_pandas().squeeze(axis=1)\n if squeeze_other\n else other.to_pandas()\n )\n if len(self.columns) > 1:\n # computing correlation for each column requires having the other columns,\n # so we can't parallelize this as a full-column operation\n return self.default_to_pandas(\n lambda df: pandas.DataFrame.expanding(df, *expanding_args).corr(\n other=other_for_pandas,\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\n )\n )\n return Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n (df.squeeze(axis=1) if squeeze_self else df)\n .expanding(*expanding_args)\n .corr(*args, **kwargs)\n )\n )(\n self,\n fold_axis,\n expanding_args,\n other=other_for_pandas,\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_quantile_PandasQueryCompiler.rolling_min.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.expanding_quantile_PandasQueryCompiler.rolling_min.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1350, "end_line": 1437, "span_ids": ["PandasQueryCompiler:119"], "tokens": 758}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n expanding_quantile = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).quantile(*args, **kwargs)\n )\n )\n\n expanding_sem = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).sem(*args, **kwargs)\n )\n )\n\n expanding_kurt = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).kurt(*args, **kwargs)\n )\n )\n\n expanding_skew = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).skew(*args, **kwargs)\n )\n )\n\n expanding_rank = Fold.register(\n lambda df, expanding_args, *args, **kwargs: pandas.DataFrame(\n df.expanding(*expanding_args).rank(*args, **kwargs)\n )\n )\n\n window_mean = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).mean(*args, **kwargs)\n )\n )\n window_sum = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).sum(*args, **kwargs)\n )\n )\n window_var = Fold.register(\n lambda df, rolling_args, ddof, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).var(ddof=ddof, *args, **kwargs)\n )\n )\n window_std = Fold.register(\n lambda df, rolling_args, ddof, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).std(ddof=ddof, *args, **kwargs)\n )\n )\n rolling_count = Fold.register(\n lambda df, rolling_args: pandas.DataFrame(df.rolling(*rolling_args).count())\n )\n rolling_sum = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).sum(*args, **kwargs)\n )\n )\n rolling_sem = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).sem(*args, **kwargs)\n )\n )\n rolling_mean = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).mean(*args, **kwargs)\n )\n )\n rolling_median = Fold.register(\n lambda df, rolling_args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).median(**kwargs)\n )\n )\n rolling_var = Fold.register(\n lambda df, rolling_args, ddof, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).var(ddof=ddof, *args, **kwargs)\n )\n )\n rolling_std = Fold.register(\n lambda df, rolling_args, ddof, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).std(ddof=ddof, *args, **kwargs)\n )\n )\n rolling_min = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).min(*args, **kwargs)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_max_PandasQueryCompiler.rolling_rank.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_max_PandasQueryCompiler.rolling_rank.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1438, "end_line": 1482, "span_ids": ["PandasQueryCompiler:119"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n rolling_max = Fold.register(\n lambda df, rolling_args, *args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).max(*args, **kwargs)\n )\n )\n rolling_skew = Fold.register(\n lambda df, rolling_args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).skew(**kwargs)\n )\n )\n rolling_kurt = Fold.register(\n lambda df, rolling_args, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).kurt(**kwargs)\n )\n )\n rolling_apply = Fold.register(\n lambda df, rolling_args, func, raw, engine, engine_kwargs, args, kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).apply(\n func=func,\n raw=raw,\n engine=engine,\n engine_kwargs=engine_kwargs,\n args=args,\n kwargs=kwargs,\n )\n )\n )\n rolling_quantile = Fold.register(\n lambda df, rolling_args, quantile, interpolation, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).quantile(\n quantile=quantile, interpolation=interpolation, **kwargs\n )\n )\n )\n rolling_rank = Fold.register(\n lambda df, rolling_args, method, ascending, pct, numeric_only, **kwargs: pandas.DataFrame(\n df.rolling(*rolling_args).rank(\n method=method,\n ascending=ascending,\n pct=pct,\n numeric_only=numeric_only,\n **kwargs,\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_corr_PandasQueryCompiler.rolling_corr.if_len_self_columns_1_.else_.return.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_corr_PandasQueryCompiler.rolling_corr.if_len_self_columns_1_.else_.return.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1484, "end_line": 1498, "span_ids": ["PandasQueryCompiler.rolling_corr"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def rolling_corr(self, axis, rolling_args, other, pairwise, *args, **kwargs):\n if len(self.columns) > 1:\n return self.default_to_pandas(\n lambda df: pandas.DataFrame.rolling(df, *rolling_args).corr(\n other=other, pairwise=pairwise, *args, **kwargs\n )\n )\n else:\n return Fold.register(\n lambda df: pandas.DataFrame(\n df.rolling(*rolling_args).corr(\n other=other, pairwise=pairwise, *args, **kwargs\n )\n )\n )(self, axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_cov_PandasQueryCompiler.rolling_cov.if_len_self_columns_1_.else_.return.Fold_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_cov_PandasQueryCompiler.rolling_cov.if_len_self_columns_1_.else_.return.Fold_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1500, "end_line": 1514, "span_ids": ["PandasQueryCompiler.rolling_cov"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def rolling_cov(self, axis, rolling_args, other, pairwise, ddof, **kwargs):\n if len(self.columns) > 1:\n return self.default_to_pandas(\n lambda df: pandas.DataFrame.rolling(df, *rolling_args).cov(\n other=other, pairwise=pairwise, ddof=ddof, **kwargs\n )\n )\n else:\n return Fold.register(\n lambda df: pandas.DataFrame(\n df.rolling(*rolling_args).cov(\n other=other, pairwise=pairwise, ddof=ddof, **kwargs\n )\n )\n )(self, axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_aggregate_PandasQueryCompiler.unstack.map_func.return.pandas_DataFrame_df_unsta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.rolling_aggregate_PandasQueryCompiler.unstack.map_func.return.pandas_DataFrame_df_unsta", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1516, "end_line": 1541, "span_ids": ["PandasQueryCompiler.unstack", "PandasQueryCompiler.rolling_aggregate"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def rolling_aggregate(self, axis, rolling_args, func, *args, **kwargs):\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis,\n lambda df: pandas.DataFrame(\n df.rolling(*rolling_args).aggregate(func=func, *args, **kwargs)\n ),\n new_index=self.index,\n )\n return self.__constructor__(new_modin_frame)\n\n def unstack(self, level, fill_value):\n if not isinstance(self.index, pandas.MultiIndex) or (\n isinstance(self.index, pandas.MultiIndex)\n and is_list_like(level)\n and len(level) == self.index.nlevels\n ):\n axis = 1\n new_columns = [MODIN_UNNAMED_SERIES_LABEL]\n need_reindex = True\n else:\n axis = 0\n new_columns = None\n need_reindex = False\n\n def map_func(df): # pragma: no cover\n return pandas.DataFrame(df.unstack(level=level, fill_value=fill_value))\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.is_tree_like_or_1d_PandasQueryCompiler.unstack.is_tree_like_or_1d.return.len_self_index_len_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.is_tree_like_or_1d_PandasQueryCompiler.unstack.is_tree_like_or_1d.return.len_self_index_len_sel", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1543, "end_line": 1565, "span_ids": ["PandasQueryCompiler.unstack"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def unstack(self, level, fill_value):\n # ... other code\n\n def is_tree_like_or_1d(calc_index, valid_index):\n \"\"\"\n Check whether specified index is a single dimensional or built in a tree manner.\n\n Parameters\n ----------\n calc_index : pandas.Index\n Frame index to check.\n valid_index : pandas.Index\n Frame index on the opposite from `calc_index` axis.\n\n Returns\n -------\n bool\n True if `calc_index` is not MultiIndex or MultiIndex and built in a tree manner.\n False otherwise.\n \"\"\"\n if not isinstance(calc_index, pandas.MultiIndex):\n return True\n actual_len = 1\n for lvl in calc_index.levels:\n actual_len *= len(lvl)\n return len(self.index) * len(self.columns) == actual_len * len(valid_index)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.is_tree_like_or_1d_index_PandasQueryCompiler.unstack.result.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.is_tree_like_or_1d_index_PandasQueryCompiler.unstack.result.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1567, "end_line": 1589, "span_ids": ["PandasQueryCompiler.unstack"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def unstack(self, level, fill_value):\n # ... other code\n\n is_tree_like_or_1d_index = is_tree_like_or_1d(self.index, self.columns)\n is_tree_like_or_1d_cols = is_tree_like_or_1d(self.columns, self.index)\n\n is_all_multi_list = False\n if (\n isinstance(self.index, pandas.MultiIndex)\n and isinstance(self.columns, pandas.MultiIndex)\n and is_list_like(level)\n and len(level) == self.index.nlevels\n and is_tree_like_or_1d_index\n and is_tree_like_or_1d_cols\n ):\n is_all_multi_list = True\n real_cols_bkp = self.columns\n obj = self.copy()\n obj.columns = np.arange(len(obj.columns))\n else:\n obj = self\n\n new_modin_frame = obj._modin_frame.apply_full_axis(\n axis, map_func, new_columns=new_columns\n )\n result = self.__constructor__(new_modin_frame)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.compute_index_PandasQueryCompiler.unstack.compute_index.return.pandas_MultiIndex_from_pr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.compute_index_PandasQueryCompiler.unstack.compute_index.return.pandas_MultiIndex_from_pr", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1591, "end_line": 1631, "span_ids": ["PandasQueryCompiler.unstack"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def unstack(self, level, fill_value):\n # ... other code\n\n def compute_index(index, columns, consider_index=True, consider_columns=True):\n \"\"\"\n Compute new index for the unstacked frame.\n\n Parameters\n ----------\n index : pandas.Index\n Index of the original frame.\n columns : pandas.Index\n Columns of the original frame.\n consider_index : bool, default: True\n Whether original index contains duplicated values.\n If True all duplicates will be droped.\n consider_columns : bool, default: True\n Whether original columns contains duplicated values.\n If True all duplicates will be droped.\n\n Returns\n -------\n pandas.Index\n New index to use in the unstacked frame.\n \"\"\"\n\n def get_unique_level_values(index):\n return [\n index.get_level_values(lvl).unique()\n for lvl in np.arange(index.nlevels)\n ]\n\n new_index = (\n get_unique_level_values(index)\n if consider_index\n else index\n if isinstance(index, list)\n else [index]\n )\n\n new_columns = (\n get_unique_level_values(columns) if consider_columns else [columns]\n )\n return pandas.MultiIndex.from_product([*new_columns, *new_index])\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.if_is_all_multi_list_and__PandasQueryCompiler.unstack.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.unstack.if_is_all_multi_list_and__PandasQueryCompiler.unstack.return.result", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1633, "end_line": 1678, "span_ids": ["PandasQueryCompiler.unstack"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def unstack(self, level, fill_value):\n # ... other code\n\n if is_all_multi_list and is_tree_like_or_1d_index and is_tree_like_or_1d_cols:\n result = result.sort_index()\n index_level_values = [lvl for lvl in obj.index.levels]\n\n result.index = compute_index(\n index_level_values, real_cols_bkp, consider_index=False\n )\n return result\n\n if need_reindex:\n if is_tree_like_or_1d_index and is_tree_like_or_1d_cols:\n is_recompute_index = isinstance(self.index, pandas.MultiIndex)\n is_recompute_columns = not is_recompute_index and isinstance(\n self.columns, pandas.MultiIndex\n )\n new_index = compute_index(\n self.index, self.columns, is_recompute_index, is_recompute_columns\n )\n elif is_tree_like_or_1d_index != is_tree_like_or_1d_cols:\n if isinstance(self.columns, pandas.MultiIndex) or not isinstance(\n self.index, pandas.MultiIndex\n ):\n return result\n else:\n index = (\n self.index.sortlevel()[0]\n if is_tree_like_or_1d_index\n and not is_tree_like_or_1d_cols\n and isinstance(self.index, pandas.MultiIndex)\n else self.index\n )\n index = pandas.MultiIndex.from_tuples(\n list(index) * len(self.columns)\n )\n columns = self.columns.repeat(len(self.index))\n index_levels = [\n index.get_level_values(i) for i in range(index.nlevels)\n ]\n new_index = pandas.MultiIndex.from_arrays(\n [columns] + index_levels,\n names=self.columns.names + self.index.names,\n )\n else:\n return result\n result = result.reindex(0, new_index)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.stack_PandasQueryCompiler._These_operations_are_op": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.stack_PandasQueryCompiler._These_operations_are_op", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1680, "end_line": 1698, "span_ids": ["PandasQueryCompiler.stack"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def stack(self, level, dropna):\n if not isinstance(self.columns, pandas.MultiIndex) or (\n isinstance(self.columns, pandas.MultiIndex)\n and is_list_like(level)\n and len(level) == self.columns.nlevels\n ):\n new_columns = [MODIN_UNNAMED_SERIES_LABEL]\n else:\n new_columns = None\n\n new_modin_frame = self._modin_frame.apply_full_axis(\n 1,\n lambda df: pandas.DataFrame(df.stack(level=level, dropna=dropna)),\n new_columns=new_columns,\n )\n return self.__constructor__(new_modin_frame)\n\n # Map partitions operations\n # These operations are operations that apply a function to every partition.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.isin_PandasQueryCompiler.isin.return.Map_register_isin_func_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.isin_PandasQueryCompiler.isin.return.Map_register_isin_func_s", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1699, "end_line": 1723, "span_ids": ["PandasQueryCompiler.isin"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n def isin(self, values, ignore_indices=False, shape_hint=None):\n if isinstance(values, type(self)):\n # HACK: if we don't cast to pandas, then the execution engine will try to\n # propagate the distributed Series to workers and most likely would have\n # some performance problems.\n # TODO: A better way of doing so could be passing this `values` as a query compiler\n # and broadcast accordingly.\n values = values.to_pandas()\n if ignore_indices:\n # Pandas logic is that it ignores indexing if 'values' is a 1D object\n values = values.squeeze(axis=1)\n\n def isin_func(df, values):\n if shape_hint == \"column\":\n df = df.squeeze(axis=1)\n res = df.isin(values)\n if isinstance(res, pandas.Series):\n res = res.to_frame(\n MODIN_UNNAMED_SERIES_LABEL if res.name is None else res.name\n )\n return res\n\n return Map.register(isin_func, shape_hint=shape_hint, dtypes=np.bool_)(\n self, values\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.abs_PandasQueryCompiler.str_capitalize.Map_register__str_map_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.abs_PandasQueryCompiler.str_capitalize.Map_register__str_map_ca", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1725, "end_line": 1794, "span_ids": ["PandasQueryCompiler:165"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n abs = Map.register(pandas.DataFrame.abs, dtypes=\"copy\")\n applymap = Map.register(pandas.DataFrame.applymap)\n conj = Map.register(lambda df, *args, **kwargs: pandas.DataFrame(np.conj(df)))\n convert_dtypes = Fold.register(pandas.DataFrame.convert_dtypes)\n invert = Map.register(pandas.DataFrame.__invert__, dtypes=\"copy\")\n isna = Map.register(pandas.DataFrame.isna, dtypes=np.bool_)\n _isfinite = Map.register(\n lambda df, *args, **kwargs: pandas.DataFrame(np.isfinite(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _isinf = Map.register( # Needed for numpy API\n lambda df, *args, **kwargs: pandas.DataFrame(np.isinf(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _isnat = Map.register( # Needed for numpy API\n lambda df, *args, **kwargs: pandas.DataFrame(np.isnat(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _isneginf = Map.register( # Needed for numpy API\n lambda df, *args, **kwargs: pandas.DataFrame(np.isneginf(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _isposinf = Map.register( # Needed for numpy API\n lambda df, *args, **kwargs: pandas.DataFrame(np.isposinf(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _iscomplex = Map.register( # Needed for numpy API\n lambda df, *args, **kwargs: pandas.DataFrame(np.iscomplex(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _isreal = Map.register( # Needed for numpy API\n lambda df, *args, **kwargs: pandas.DataFrame(np.isreal(df, *args, **kwargs)),\n dtypes=np.bool_,\n )\n _logical_not = Map.register(np.logical_not, dtypes=np.bool_) # Needed for numpy API\n _tanh = Map.register(\n lambda df, *args, **kwargs: pandas.DataFrame(np.tanh(df, *args, **kwargs))\n ) # Needed for numpy API\n _sqrt = Map.register(\n lambda df, *args, **kwargs: pandas.DataFrame(np.sqrt(df, *args, **kwargs))\n ) # Needed for numpy API\n _exp = Map.register(\n lambda df, *args, **kwargs: pandas.DataFrame(np.exp(df, *args, **kwargs))\n ) # Needed for numpy API\n negative = Map.register(pandas.DataFrame.__neg__)\n notna = Map.register(pandas.DataFrame.notna, dtypes=np.bool_)\n round = Map.register(pandas.DataFrame.round)\n replace = Map.register(pandas.DataFrame.replace)\n series_view = Map.register(\n lambda df, *args, **kwargs: pandas.DataFrame(\n df.squeeze(axis=1).view(*args, **kwargs)\n )\n )\n to_numeric = Map.register(\n lambda df, *args, **kwargs: pandas.DataFrame(\n pandas.to_numeric(df.squeeze(axis=1), *args, **kwargs)\n )\n )\n to_timedelta = Map.register(\n lambda s, *args, **kwargs: pandas.to_timedelta(\n s.squeeze(axis=1), *args, **kwargs\n ).to_frame(),\n dtypes=\"timedelta64[ns]\",\n )\n\n # END Map partitions operations\n\n # String map partitions operations\n\n str_capitalize = Map.register(_str_map(\"capitalize\"), dtypes=\"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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.str_center_PandasQueryCompiler._str_rpartition.Map_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.str_center_PandasQueryCompiler._str_rpartition.Map_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1795, "end_line": 1847, "span_ids": ["PandasQueryCompiler:165", "PandasQueryCompiler.str_extract", "PandasQueryCompiler.str_partition", "PandasQueryCompiler:267", "PandasQueryCompiler:271"], "tokens": 800}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n str_center = Map.register(_str_map(\"center\"), dtypes=\"copy\")\n str_contains = Map.register(_str_map(\"contains\"), dtypes=np.bool_)\n str_count = Map.register(_str_map(\"count\"), dtypes=int)\n str_endswith = Map.register(_str_map(\"endswith\"), dtypes=np.bool_)\n str_find = Map.register(_str_map(\"find\"), dtypes=\"copy\")\n str_findall = Map.register(_str_map(\"findall\"), dtypes=\"copy\")\n str_get = Map.register(_str_map(\"get\"), dtypes=\"copy\")\n str_index = Map.register(_str_map(\"index\"), dtypes=\"copy\")\n str_isalnum = Map.register(_str_map(\"isalnum\"), dtypes=np.bool_)\n str_isalpha = Map.register(_str_map(\"isalpha\"), dtypes=np.bool_)\n str_isdecimal = Map.register(_str_map(\"isdecimal\"), dtypes=np.bool_)\n str_isdigit = Map.register(_str_map(\"isdigit\"), dtypes=np.bool_)\n str_islower = Map.register(_str_map(\"islower\"), dtypes=np.bool_)\n str_isnumeric = Map.register(_str_map(\"isnumeric\"), dtypes=np.bool_)\n str_isspace = Map.register(_str_map(\"isspace\"), dtypes=np.bool_)\n str_istitle = Map.register(_str_map(\"istitle\"), dtypes=np.bool_)\n str_isupper = Map.register(_str_map(\"isupper\"), dtypes=np.bool_)\n str_join = Map.register(_str_map(\"join\"), dtypes=\"copy\")\n str_len = Map.register(_str_map(\"len\"), dtypes=int)\n str_ljust = Map.register(_str_map(\"ljust\"), dtypes=\"copy\")\n str_lower = Map.register(_str_map(\"lower\"), dtypes=\"copy\")\n str_lstrip = Map.register(_str_map(\"lstrip\"), dtypes=\"copy\")\n str_match = Map.register(_str_map(\"match\"), dtypes=\"copy\")\n str_normalize = Map.register(_str_map(\"normalize\"), dtypes=\"copy\")\n str_pad = Map.register(_str_map(\"pad\"), dtypes=\"copy\")\n _str_partition = Map.register(_str_map(\"partition\"), dtypes=\"copy\")\n\n def str_partition(self, sep=\" \", expand=True):\n # For `expand`, need an operator that can create more columns than before\n if expand:\n return super().str_partition(sep=sep, expand=expand)\n return self._str_partition(sep=sep, expand=False)\n\n str_repeat = Map.register(_str_map(\"repeat\"), dtypes=\"copy\")\n _str_extract = Map.register(_str_map(\"extract\"), dtypes=\"copy\")\n\n def str_extract(self, pat, flags, expand):\n regex = re.compile(pat, flags=flags)\n # need an operator that can create more columns than before\n if expand and regex.groups == 1:\n qc = self._str_extract(pat, flags=flags, expand=expand)\n qc.columns = get_group_names(regex)\n else:\n qc = super().str_extract(pat, flags=flags, expand=expand)\n return qc\n\n str_replace = Map.register(_str_map(\"replace\"), dtypes=\"copy\", shape_hint=\"column\")\n str_rfind = Map.register(_str_map(\"rfind\"), dtypes=\"copy\", shape_hint=\"column\")\n str_rindex = Map.register(_str_map(\"rindex\"), dtypes=\"copy\", shape_hint=\"column\")\n str_rjust = Map.register(_str_map(\"rjust\"), dtypes=\"copy\", shape_hint=\"column\")\n _str_rpartition = Map.register(\n _str_map(\"rpartition\"), dtypes=\"copy\", shape_hint=\"column\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.str_rpartition_PandasQueryCompiler.dt_year.Map_register__dt_prop_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.str_rpartition_PandasQueryCompiler.dt_year.Map_register__dt_prop_map", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1849, "end_line": 1919, "span_ids": ["PandasQueryCompiler.searchsorted", "PandasQueryCompiler:281", "PandasQueryCompiler:291", "PandasQueryCompiler.unique", "PandasQueryCompiler.str_rpartition", "PandasQueryCompiler:309", "PandasQueryCompiler.str_rsplit", "PandasQueryCompiler:283", "PandasQueryCompiler.str_split"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def str_rpartition(self, sep=\" \", expand=True):\n if expand:\n # For `expand`, need an operator that can create more columns than before\n return super().str_rpartition(sep=sep, expand=expand)\n return self._str_rpartition(sep=sep, expand=False)\n\n _str_rsplit = Map.register(_str_map(\"rsplit\"), dtypes=\"copy\", shape_hint=\"column\")\n\n def str_rsplit(self, pat=None, n=-1, expand=False):\n if expand:\n # For `expand`, need an operator that can create more columns than before\n return super().str_rsplit(pat=pat, n=n, expand=expand)\n return self._str_rsplit(pat=pat, n=n, expand=False)\n\n str_rstrip = Map.register(_str_map(\"rstrip\"), dtypes=\"copy\", shape_hint=\"column\")\n str_slice = Map.register(_str_map(\"slice\"), dtypes=\"copy\", shape_hint=\"column\")\n str_slice_replace = Map.register(\n _str_map(\"slice_replace\"), dtypes=\"copy\", shape_hint=\"column\"\n )\n _str_split = Map.register(_str_map(\"split\"), dtypes=\"copy\", shape_hint=\"column\")\n\n def str_split(self, pat=None, n=-1, expand=False, regex=None):\n if expand:\n # For `expand`, need an operator that can create more columns than before\n return super().str_split(pat=pat, n=n, expand=expand, regex=regex)\n return self._str_split(pat=pat, n=n, expand=False, regex=regex)\n\n str_startswith = Map.register(\n _str_map(\"startswith\"), dtypes=np.bool_, shape_hint=\"column\"\n )\n str_strip = Map.register(_str_map(\"strip\"), dtypes=\"copy\", shape_hint=\"column\")\n str_swapcase = Map.register(\n _str_map(\"swapcase\"), dtypes=\"copy\", shape_hint=\"column\"\n )\n str_title = Map.register(_str_map(\"title\"), dtypes=\"copy\", shape_hint=\"column\")\n str_translate = Map.register(\n _str_map(\"translate\"), dtypes=\"copy\", shape_hint=\"column\"\n )\n str_upper = Map.register(_str_map(\"upper\"), dtypes=\"copy\", shape_hint=\"column\")\n str_wrap = Map.register(_str_map(\"wrap\"), dtypes=\"copy\", shape_hint=\"column\")\n str_zfill = Map.register(_str_map(\"zfill\"), dtypes=\"copy\", shape_hint=\"column\")\n str___getitem__ = Map.register(\n _str_map(\"__getitem__\"), dtypes=\"copy\", shape_hint=\"column\"\n )\n\n # END String map partitions operations\n\n def unique(self):\n new_modin_frame = self._modin_frame.apply_full_axis(\n 0,\n lambda x: x.squeeze(axis=1).unique(),\n new_columns=self.columns,\n )\n return self.__constructor__(new_modin_frame)\n\n def searchsorted(self, **kwargs):\n def searchsorted(df):\n \"\"\"Apply `searchsorted` function to a single partition.\"\"\"\n result = df.squeeze(axis=1).searchsorted(**kwargs)\n if not is_list_like(result):\n result = [result]\n return pandas.DataFrame(result)\n\n return self.default_to_pandas(searchsorted)\n\n # Dt map partitions operations\n\n dt_date = Map.register(_dt_prop_map(\"date\"), dtypes=np.object_)\n dt_time = Map.register(_dt_prop_map(\"time\"), dtypes=np.object_)\n dt_timetz = Map.register(_dt_prop_map(\"timetz\"), dtypes=np.object_)\n dt_year = Map.register(_dt_prop_map(\"year\"), dtypes=np.int32)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dt_month_PandasQueryCompiler.dt_nanoseconds.Map_register__dt_prop_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dt_month_PandasQueryCompiler.dt_nanoseconds.Map_register__dt_prop_map", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1920, "end_line": 1959, "span_ids": ["PandasQueryCompiler:309"], "tokens": 778}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n dt_month = Map.register(_dt_prop_map(\"month\"), dtypes=np.int32)\n dt_day = Map.register(_dt_prop_map(\"day\"), dtypes=np.int32)\n dt_hour = Map.register(_dt_prop_map(\"hour\"), dtypes=np.int64)\n dt_minute = Map.register(_dt_prop_map(\"minute\"), dtypes=np.int64)\n dt_second = Map.register(_dt_prop_map(\"second\"), dtypes=np.int64)\n dt_microsecond = Map.register(_dt_prop_map(\"microsecond\"), dtypes=np.int64)\n dt_nanosecond = Map.register(_dt_prop_map(\"nanosecond\"), dtypes=np.int64)\n dt_dayofweek = Map.register(_dt_prop_map(\"dayofweek\"), dtypes=np.int64)\n dt_weekday = Map.register(_dt_prop_map(\"weekday\"), dtypes=np.int64)\n dt_dayofyear = Map.register(_dt_prop_map(\"dayofyear\"), dtypes=np.int64)\n dt_quarter = Map.register(_dt_prop_map(\"quarter\"), dtypes=np.int64)\n dt_is_month_start = Map.register(_dt_prop_map(\"is_month_start\"), dtypes=np.bool_)\n dt_is_month_end = Map.register(_dt_prop_map(\"is_month_end\"), dtypes=np.bool_)\n dt_is_quarter_start = Map.register(\n _dt_prop_map(\"is_quarter_start\"), dtypes=np.bool_\n )\n dt_is_quarter_end = Map.register(_dt_prop_map(\"is_quarter_end\"), dtypes=np.bool_)\n dt_is_year_start = Map.register(_dt_prop_map(\"is_year_start\"), dtypes=np.bool_)\n dt_is_year_end = Map.register(_dt_prop_map(\"is_year_end\"), dtypes=np.bool_)\n dt_is_leap_year = Map.register(_dt_prop_map(\"is_leap_year\"), dtypes=np.bool_)\n dt_daysinmonth = Map.register(_dt_prop_map(\"daysinmonth\"), dtypes=np.int64)\n dt_days_in_month = Map.register(_dt_prop_map(\"days_in_month\"), dtypes=np.int64)\n dt_asfreq = Map.register(_dt_func_map(\"asfreq\"))\n dt_to_period = Map.register(_dt_func_map(\"to_period\"))\n dt_to_pydatetime = Map.register(_dt_func_map(\"to_pydatetime\"), dtypes=np.object_)\n dt_tz_localize = Map.register(_dt_func_map(\"tz_localize\"))\n dt_tz_convert = Map.register(_dt_func_map(\"tz_convert\"))\n dt_normalize = Map.register(_dt_func_map(\"normalize\"))\n dt_strftime = Map.register(_dt_func_map(\"strftime\"), dtypes=np.object_)\n dt_round = Map.register(_dt_func_map(\"round\"))\n dt_floor = Map.register(_dt_func_map(\"floor\"))\n dt_ceil = Map.register(_dt_func_map(\"ceil\"))\n dt_month_name = Map.register(_dt_func_map(\"month_name\"), dtypes=np.object_)\n dt_day_name = Map.register(_dt_func_map(\"day_name\"), dtypes=np.object_)\n dt_to_pytimedelta = Map.register(_dt_func_map(\"to_pytimedelta\"), dtypes=np.object_)\n dt_total_seconds = Map.register(_dt_func_map(\"total_seconds\"), dtypes=np.float64)\n dt_seconds = Map.register(_dt_prop_map(\"seconds\"), dtypes=np.int64)\n dt_days = Map.register(_dt_prop_map(\"days\"), dtypes=np.int64)\n dt_microseconds = Map.register(_dt_prop_map(\"microseconds\"), dtypes=np.int64)\n dt_nanoseconds = Map.register(_dt_prop_map(\"nanoseconds\"), dtypes=np.int64)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dt_qyear_PandasQueryCompiler._Column_Row_partitions_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dt_qyear_PandasQueryCompiler._Column_Row_partitions_r", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1960, "end_line": 1977, "span_ids": ["PandasQueryCompiler.infer_objects", "PandasQueryCompiler:309", "PandasQueryCompiler.astype"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n dt_qyear = Map.register(_dt_prop_map(\"qyear\"), dtypes=np.int64)\n dt_start_time = Map.register(_dt_prop_map(\"start_time\"))\n dt_end_time = Map.register(_dt_prop_map(\"end_time\"))\n dt_to_timestamp = Map.register(_dt_func_map(\"to_timestamp\"))\n\n # END Dt map partitions operations\n\n def astype(self, col_dtypes, errors: str = \"raise\"):\n # `errors` parameter needs to be part of the function signature because\n # other query compilers may not take care of error handling at the API\n # layer. This query compiler assumes there won't be any errors due to\n # invalid type keys.\n return self.__constructor__(self._modin_frame.astype(col_dtypes, errors=errors))\n\n def infer_objects(self):\n return self.__constructor__(self._modin_frame.infer_objects())\n\n # Column/Row partitions reduce operations", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.first_valid_index_PandasQueryCompiler.first_valid_index.return.self_index_first_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.first_valid_index_PandasQueryCompiler.first_valid_index.return.self_index_first_result_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1979, "end_line": 1995, "span_ids": ["PandasQueryCompiler.first_valid_index"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def first_valid_index(self):\n def first_valid_index_builder(df):\n \"\"\"Get the position of the first valid index in a single partition.\"\"\"\n return df.set_axis(pandas.RangeIndex(len(df.index)), axis=\"index\").apply(\n lambda df: df.first_valid_index()\n )\n\n # We get the minimum from each column, then take the min of that to get\n # first_valid_index. The `to_pandas()` here is just for a single value and\n # `squeeze` will convert it to a scalar.\n first_result = (\n self.__constructor__(self._modin_frame.reduce(0, first_valid_index_builder))\n .min(axis=1)\n .to_pandas()\n .squeeze()\n )\n return self.index[first_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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.last_valid_index_PandasQueryCompiler._END_Column_Row_partitio": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.last_valid_index_PandasQueryCompiler._END_Column_Row_partitio", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1997, "end_line": 2015, "span_ids": ["PandasQueryCompiler.last_valid_index"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def last_valid_index(self):\n def last_valid_index_builder(df):\n \"\"\"Get the position of the last valid index in a single partition.\"\"\"\n return df.set_axis(pandas.RangeIndex(len(df.index)), axis=\"index\").apply(\n lambda df: df.last_valid_index()\n )\n\n # We get the maximum from each column, then take the max of that to get\n # last_valid_index. The `to_pandas()` here is just for a single value and\n # `squeeze` will convert it to a scalar.\n first_result = (\n self.__constructor__(self._modin_frame.reduce(0, last_valid_index_builder))\n .max(axis=1)\n .to_pandas()\n .squeeze()\n )\n return self.index[first_result]\n\n # END Column/Row partitions reduce operations", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.describe_PandasQueryCompiler.describe.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.describe_PandasQueryCompiler.describe.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2017, "end_line": 2049, "span_ids": ["PandasQueryCompiler.describe"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def describe(self, percentiles: np.ndarray):\n # Use pandas to calculate the correct columns\n empty_df = (\n pandas.DataFrame(columns=self.columns)\n .astype(self.dtypes)\n .describe(percentiles, include=\"all\")\n )\n new_index = empty_df.index\n\n def describe_builder(df, internal_indices=[]): # pragma: no cover\n \"\"\"Apply `describe` function to the subset of columns in a single partition.\"\"\"\n # The index of the resulting dataframe is the same amongst all partitions\n # when dealing with the same data type. However, if we work with columns\n # that contain strings, we can get extra values in our result index such as\n # 'unique', 'top', and 'freq'. Since we call describe() on each partition,\n # we can have cases where certain partitions do not contain any of the\n # object string data leading to an index mismatch between partitions.\n # Thus, we must reindex each partition with the global new_index.\n return (\n df.iloc[:, internal_indices]\n .describe(percentiles=percentiles, include=\"all\")\n .reindex(new_index)\n )\n\n return self.__constructor__(\n self._modin_frame.apply_full_axis_select_indices(\n 0,\n describe_builder,\n empty_df.columns,\n new_index=new_index,\n new_columns=empty_df.columns,\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.None_65_PandasQueryCompiler.diff.return.self__diff_fold_axis_axis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.None_65_PandasQueryCompiler.diff.return.self__diff_fold_axis_axis", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2051, "end_line": 2065, "span_ids": ["PandasQueryCompiler:401", "PandasQueryCompiler.diff", "PandasQueryCompiler.describe"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END Column/Row partitions reduce operations over select indices\n\n # Map across rows/columns\n # These operations require some global knowledge of the full column/row\n # that is being operated on. This means that we have to put all of that\n # data in the same place.\n\n cummax = Fold.register(pandas.DataFrame.cummax)\n cummin = Fold.register(pandas.DataFrame.cummin)\n cumsum = Fold.register(pandas.DataFrame.cumsum)\n cumprod = Fold.register(pandas.DataFrame.cumprod)\n _diff = Fold.register(pandas.DataFrame.diff)\n\n def diff(self, axis, periods):\n return self._diff(fold_axis=axis, axis=axis, periods=periods)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.clip_PandasQueryCompiler.cov.return.self__nancorr_min_periods": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.clip_PandasQueryCompiler.cov.return.self__nancorr_min_periods", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2067, "end_line": 2084, "span_ids": ["PandasQueryCompiler.cov", "PandasQueryCompiler.clip", "PandasQueryCompiler:411"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def clip(self, lower, upper, **kwargs):\n if isinstance(lower, BaseQueryCompiler):\n lower = lower.to_pandas().squeeze(1)\n if isinstance(upper, BaseQueryCompiler):\n upper = upper.to_pandas().squeeze(1)\n kwargs[\"upper\"] = upper\n kwargs[\"lower\"] = lower\n axis = kwargs.get(\"axis\", 0)\n if is_list_like(lower) or is_list_like(upper):\n new_modin_frame = self._modin_frame.fold(axis, lambda df: df.clip(**kwargs))\n else:\n new_modin_frame = self._modin_frame.map(lambda df: df.clip(**kwargs))\n return self.__constructor__(new_modin_frame)\n\n corr = CorrCovBuilder.build_corr_method()\n\n def cov(self, min_periods=None, ddof=1):\n return self._nancorr(min_periods=min_periods, cov=True, ddof=ddof)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nancorr_PandasQueryCompiler._nancorr.if_min_periods_is_None_.min_periods.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nancorr_PandasQueryCompiler._nancorr.if_min_periods_is_None_.min_periods.1", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2086, "end_line": 2121, "span_ids": ["PandasQueryCompiler._nancorr"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _nancorr(self, min_periods=1, cov=False, ddof=1):\n \"\"\"\n Compute either pairwise covariance or pairwise correlation of columns.\n\n This function considers NA/null values the same like pandas does.\n\n Parameters\n ----------\n min_periods : int, default: 1\n Minimum number of observations required per pair of columns\n to have a valid result.\n cov : boolean, default: False\n Either covariance or correlation should be computed.\n ddof : int, default: 1\n Means Delta Degrees of Freedom. The divisor used in calculations.\n\n Returns\n -------\n PandasQueryCompiler\n The covariance or correlation matrix.\n\n Notes\n -----\n This method is only used to compute covariance at the moment.\n \"\"\"\n other = self.to_numpy()\n try:\n other_mask = self._isfinite().to_numpy()\n except TypeError as err:\n # Pandas raises ValueError on unsupported types, so casting\n # the exception to a proper type\n raise ValueError(\"Unsupported types with 'numeric_only=False'\") from err\n n_cols = other.shape[1]\n\n if min_periods is None:\n min_periods = 1\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nancorr.map_func_PandasQueryCompiler._nancorr.return.transponed_self___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nancorr.map_func_PandasQueryCompiler._nancorr.return.transponed_self___constru", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2123, "end_line": 2168, "span_ids": ["PandasQueryCompiler._nancorr"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _nancorr(self, min_periods=1, cov=False, ddof=1):\n # ... other code\n\n def map_func(df): # pragma: no cover\n \"\"\"Compute covariance or correlation matrix for the passed frame.\"\"\"\n df = df.to_numpy()\n n_rows = df.shape[0]\n df_mask = np.isfinite(df)\n\n result = np.empty((n_rows, n_cols), dtype=np.float64)\n\n for i in range(n_rows):\n df_ith_row = df[i]\n df_ith_mask = df_mask[i]\n\n for j in range(n_cols):\n other_jth_col = other[:, j]\n\n valid = df_ith_mask & other_mask[:, j]\n\n vx = df_ith_row[valid]\n vy = other_jth_col[valid]\n\n nobs = len(vx)\n\n if nobs < min_periods:\n result[i, j] = np.nan\n else:\n vx = vx - vx.mean()\n vy = vy - vy.mean()\n sumxy = (vx * vy).sum()\n sumxx = (vx * vx).sum()\n sumyy = (vy * vy).sum()\n\n denom = (nobs - ddof) if cov else np.sqrt(sumxx * sumyy)\n if denom != 0:\n result[i, j] = sumxy / denom\n else:\n result[i, j] = np.nan\n\n return pandas.DataFrame(result)\n\n columns = self.columns\n index = columns.copy()\n transponed_self = self.transpose()\n new_modin_frame = transponed_self._modin_frame.apply_full_axis(\n 1, map_func, new_index=index, new_columns=columns\n )\n return transponed_self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dot_PandasQueryCompiler.dot.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.dot_PandasQueryCompiler.dot.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2170, "end_line": 2205, "span_ids": ["PandasQueryCompiler.dot"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def dot(self, other, squeeze_self=None, squeeze_other=None):\n if isinstance(other, PandasQueryCompiler):\n other = (\n other.to_pandas().squeeze(axis=1)\n if squeeze_other\n else other.to_pandas()\n )\n\n def map_func(df, other=other, squeeze_self=squeeze_self): # pragma: no cover\n \"\"\"Compute matrix multiplication of the passed frames.\"\"\"\n result = df.squeeze(axis=1).dot(other) if squeeze_self else df.dot(other)\n if is_list_like(result):\n return pandas.DataFrame(result)\n else:\n return pandas.DataFrame([result])\n\n num_cols = other.shape[1] if len(other.shape) > 1 else 1\n if len(self.columns) == 1:\n new_index = (\n [MODIN_UNNAMED_SERIES_LABEL]\n if (len(self.index) == 1 or squeeze_self) and num_cols == 1\n else None\n )\n new_columns = (\n [MODIN_UNNAMED_SERIES_LABEL] if squeeze_self and num_cols == 1 else None\n )\n axis = 0\n else:\n new_index = self.index\n new_columns = [MODIN_UNNAMED_SERIES_LABEL] if num_cols == 1 else None\n axis = 1\n\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis, map_func, new_index=new_index, new_columns=new_columns\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nsort_PandasQueryCompiler._nsort.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._nsort_PandasQueryCompiler._nsort.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2207, "end_line": 2253, "span_ids": ["PandasQueryCompiler._nsort"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _nsort(self, n, columns=None, keep=\"first\", sort_type=\"nsmallest\"):\n \"\"\"\n Return first N rows of the data sorted in the specified order.\n\n Parameters\n ----------\n n : int\n Number of rows to return.\n columns : list of labels, optional\n Column labels to sort data by.\n keep : {\"first\", \"last\", \"all\"}, default: \"first\"\n How to pick first rows in case of duplicated values:\n - \"first\": prioritize first occurrence.\n - \"last\": prioritize last occurrence.\n - \"all\": do not drop any duplicates, even if it means selecting more than `n` rows.\n sort_type : {\"nsmallest\", \"nlargest\"}, default: \"nsmallest\"\n \"nsmallest\" means sort in descending order, \"nlargest\" means\n sort in ascending order.\n\n Returns\n -------\n PandasQueryCompiler\n New QueryCompiler containing the first N rows of the data\n sorted in the given order.\n \"\"\"\n\n def map_func(df, n=n, keep=keep, columns=columns): # pragma: no cover\n \"\"\"Return first `N` rows of the sorted data for a single partition.\"\"\"\n if columns is None:\n return pandas.DataFrame(\n getattr(pandas.Series, sort_type)(\n df.squeeze(axis=1), n=n, keep=keep\n )\n )\n return getattr(pandas.DataFrame, sort_type)(\n df, n=n, columns=columns, keep=keep\n )\n\n if columns is None:\n new_columns = [MODIN_UNNAMED_SERIES_LABEL]\n else:\n new_columns = self.columns\n\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis=0, func=map_func, new_columns=new_columns\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.nsmallest_PandasQueryCompiler.eval.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.nsmallest_PandasQueryCompiler.eval.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2255, "end_line": 2283, "span_ids": ["PandasQueryCompiler.eval", "PandasQueryCompiler.nlargest", "PandasQueryCompiler.nsmallest"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def nsmallest(self, *args, **kwargs):\n return self._nsort(sort_type=\"nsmallest\", *args, **kwargs)\n\n def nlargest(self, *args, **kwargs):\n return self._nsort(sort_type=\"nlargest\", *args, **kwargs)\n\n def eval(self, expr, **kwargs):\n # Make a copy of columns and eval on the copy to determine if result type is\n # series or not\n empty_eval = (\n pandas.DataFrame(columns=self.columns)\n .astype(self.dtypes)\n .eval(expr, inplace=False, **kwargs)\n )\n if isinstance(empty_eval, pandas.Series):\n new_columns = (\n [empty_eval.name]\n if empty_eval.name is not None\n else [MODIN_UNNAMED_SERIES_LABEL]\n )\n else:\n new_columns = empty_eval.columns\n new_modin_frame = self._modin_frame.apply_full_axis(\n 1,\n lambda df: pandas.DataFrame(df.eval(expr, inplace=False, **kwargs)),\n new_index=self.index,\n new_columns=new_columns,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mode_PandasQueryCompiler.mode.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.mode_PandasQueryCompiler.mode.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2285, "end_line": 2310, "span_ids": ["PandasQueryCompiler.mode"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def mode(self, **kwargs):\n axis = kwargs.get(\"axis\", 0)\n\n def mode_builder(df): # pragma: no cover\n \"\"\"Compute modes for a single partition.\"\"\"\n result = pandas.DataFrame(df.mode(**kwargs))\n # We return a dataframe with the same shape as the input to ensure\n # that all the partitions will be the same shape\n if axis == 0 and len(df) != len(result):\n # Pad rows\n result = result.reindex(index=pandas.RangeIndex(len(df.index)))\n elif axis == 1 and len(df.columns) != len(result.columns):\n # Pad columns\n result = result.reindex(columns=pandas.RangeIndex(len(df.columns)))\n return pandas.DataFrame(result)\n\n if axis == 0:\n new_index = pandas.RangeIndex(len(self.index))\n new_columns = self.columns\n else:\n new_index = self.index\n new_columns = pandas.RangeIndex(len(self.columns))\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis, mode_builder, new_index=new_index, new_columns=new_columns\n )\n return self.__constructor__(new_modin_frame).dropna(axis=axis, how=\"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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.fillna_PandasQueryCompiler.fillna.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.fillna_PandasQueryCompiler.fillna.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2312, "end_line": 2396, "span_ids": ["PandasQueryCompiler.fillna"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def fillna(self, **kwargs):\n squeeze_self = kwargs.pop(\"squeeze_self\", False)\n squeeze_value = kwargs.pop(\"squeeze_value\", False)\n axis = kwargs.get(\"axis\", 0)\n value = kwargs.pop(\"value\")\n method = kwargs.get(\"method\", None)\n limit = kwargs.get(\"limit\", None)\n full_axis = method is not None or limit is not None\n if isinstance(value, BaseQueryCompiler):\n if squeeze_self:\n # Self is a Series type object\n if full_axis:\n value = value.to_pandas().squeeze(axis=1)\n\n def fillna_builder(series): # pragma: no cover\n # `limit` parameter works only on `Series` type, so we have to squeeze both objects to get\n # correct behavior.\n return series.squeeze(axis=1).fillna(value=value, **kwargs)\n\n new_modin_frame = self._modin_frame.apply_full_axis(\n 0, fillna_builder\n )\n else:\n\n def fillna_builder(df, value_arg):\n if isinstance(value_arg, pandas.DataFrame):\n value_arg = value_arg.squeeze(axis=1)\n res = df.squeeze(axis=1).fillna(value=value_arg, **kwargs)\n return pandas.DataFrame(res)\n\n new_modin_frame = self._modin_frame.n_ary_op(\n fillna_builder,\n [value._modin_frame],\n join_type=\"left\",\n copartition_along_columns=False,\n )\n\n return self.__constructor__(new_modin_frame)\n else:\n # Self is a DataFrame type object\n if squeeze_value:\n # Value is Series type object\n value = value.to_pandas().squeeze(axis=1)\n\n def fillna(df):\n return df.fillna(value=value, **kwargs)\n\n # Continue to end of this function\n\n else:\n # Value is a DataFrame type object\n def fillna_builder(df, right):\n return df.fillna(value=right, **kwargs)\n\n new_modin_frame = self._modin_frame.broadcast_apply(\n 0, fillna_builder, value._modin_frame\n )\n return self.__constructor__(new_modin_frame)\n\n elif isinstance(value, dict):\n if squeeze_self:\n # For Series dict works along the index.\n def fillna(df):\n return pandas.DataFrame(\n df.squeeze(axis=1).fillna(value=value, **kwargs)\n )\n\n else:\n # For DataFrames dict works along columns, all columns have to be present.\n def fillna(df):\n func_dict = {\n col: val for (col, val) in value.items() if col in df.columns\n }\n return df.fillna(value=func_dict, **kwargs)\n\n else:\n\n def fillna(df):\n return df.fillna(value=value, **kwargs)\n\n if full_axis:\n new_modin_frame = self._modin_frame.fold(axis, fillna)\n else:\n new_modin_frame = self._modin_frame.map(fillna)\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.quantile_for_list_of_values_PandasQueryCompiler.quantile_for_list_of_values.return.result_transpose_if_axi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.quantile_for_list_of_values_PandasQueryCompiler.quantile_for_list_of_values.return.result_transpose_if_axi", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2398, "end_line": 2443, "span_ids": ["PandasQueryCompiler.quantile_for_list_of_values"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def quantile_for_list_of_values(self, **kwargs):\n axis = kwargs.get(\"axis\", 0)\n q = kwargs.get(\"q\")\n numeric_only = kwargs.get(\"numeric_only\", True)\n assert isinstance(q, (pandas.Series, np.ndarray, pandas.Index, list))\n\n if numeric_only:\n new_columns = self._modin_frame.numeric_columns()\n else:\n new_columns = [\n col\n for col, dtype in zip(self.columns, self.dtypes)\n if (is_numeric_dtype(dtype) or is_datetime_or_timedelta_dtype(dtype))\n ]\n if axis == 1:\n query_compiler = self.getitem_column_array(new_columns)\n new_columns = self.index\n else:\n query_compiler = self\n\n def quantile_builder(df, **kwargs):\n result = df.quantile(**kwargs)\n return result.T if kwargs.get(\"axis\", 0) == 1 else result\n\n # This took a long time to debug, so here is the rundown of why this is needed.\n # Previously, we were operating on select indices, but that was broken. We were\n # not correctly setting the columns/index. Because of how we compute `to_pandas`\n # and because of the static nature of the index for `axis=1` it is easier to\n # just handle this as the transpose (see `quantile_builder` above for the\n # transpose within the partition) than it is to completely rework other\n # internal methods. Basically we are returning the transpose of the object for\n # correctness and cleanliness of the code.\n if axis == 1:\n q_index = new_columns\n new_columns = pandas.Index(q)\n else:\n q_index = pandas.Index(q)\n new_modin_frame = query_compiler._modin_frame.apply_full_axis(\n axis,\n lambda df: quantile_builder(df, **kwargs),\n new_index=q_index,\n new_columns=new_columns,\n dtypes=np.float64,\n )\n result = self.__constructor__(new_modin_frame)\n return result.transpose() if axis == 1 else 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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.query_PandasQueryCompiler.rank.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.query_PandasQueryCompiler.rank.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2445, "end_line": 2461, "span_ids": ["PandasQueryCompiler.rank", "PandasQueryCompiler.query"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def query(self, expr, **kwargs):\n def query_builder(df, **modin_internal_kwargs):\n return df.query(expr, inplace=False, **kwargs, **modin_internal_kwargs)\n\n return self.__constructor__(self._modin_frame.filter(1, query_builder))\n\n def rank(self, **kwargs):\n axis = kwargs.get(\"axis\", 0)\n numeric_only = True if axis else kwargs.get(\"numeric_only\", False)\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis,\n lambda df: df.rank(**kwargs),\n new_index=self.index,\n new_columns=self.columns if not numeric_only else None,\n dtypes=np.float64,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.sort_index_PandasQueryCompiler.sort_index.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.sort_index_PandasQueryCompiler.sort_index.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2463, "end_line": 2500, "span_ids": ["PandasQueryCompiler.sort_index"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def sort_index(self, **kwargs):\n axis = kwargs.pop(\"axis\", 0)\n level = kwargs.pop(\"level\", None)\n sort_remaining = kwargs.pop(\"sort_remaining\", True)\n kwargs[\"inplace\"] = False\n\n if level is not None or self.has_multiindex(axis=axis):\n return self.default_to_pandas(\n pandas.DataFrame.sort_index,\n axis=axis,\n level=level,\n sort_remaining=sort_remaining,\n **kwargs,\n )\n\n # sort_index can have ascending be None and behaves as if it is False.\n # sort_values cannot have ascending be None. Thus, the following logic is to\n # convert the ascending argument to one that works with sort_values\n ascending = kwargs.pop(\"ascending\", True)\n if ascending is None:\n ascending = False\n kwargs[\"ascending\"] = ascending\n if axis:\n new_columns = self.columns.to_frame().sort_index(**kwargs).index\n new_index = self.index\n else:\n new_index = self.index.to_frame().sort_index(**kwargs).index\n new_columns = self.columns\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis,\n lambda df: df.sort_index(\n axis=axis, level=level, sort_remaining=sort_remaining, **kwargs\n ),\n new_index,\n new_columns,\n dtypes=\"copy\" if axis == 0 else None,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt_PandasQueryCompiler.melt.if_len_id_vars_0_.else_.to_broadcast.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt_PandasQueryCompiler.melt.if_len_id_vars_0_.else_.to_broadcast.None", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2502, "end_line": 2536, "span_ids": ["PandasQueryCompiler.melt"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def melt(\n self,\n id_vars=None,\n value_vars=None,\n var_name=None,\n value_name=\"value\",\n col_level=None,\n ignore_index=True,\n ):\n ErrorMessage.missmatch_with_pandas(\n operation=\"melt\", message=\"Order of rows could be different from pandas\"\n )\n\n if var_name is None:\n var_name = \"variable\"\n\n def _convert_to_list(x):\n \"\"\"Convert passed object to a list.\"\"\"\n if is_list_like(x):\n x = [*x]\n elif x is not None:\n x = [x]\n else:\n x = []\n return x\n\n id_vars, value_vars = map(_convert_to_list, [id_vars, value_vars])\n\n if len(value_vars) == 0:\n value_vars = self.columns.drop(id_vars)\n\n if len(id_vars) != 0:\n to_broadcast = self.getitem_column_array(id_vars)._modin_frame\n else:\n to_broadcast = None\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt.applyier_PandasQueryCompiler.melt.applyier.return.df_melt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt.applyier_PandasQueryCompiler.melt.applyier.return.df_melt_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2538, "end_line": 2571, "span_ids": ["PandasQueryCompiler.melt"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def melt(\n self,\n id_vars=None,\n value_vars=None,\n var_name=None,\n value_name=\"value\",\n col_level=None,\n ignore_index=True,\n ):\n # ... other code\n\n def applyier(df, internal_indices, other=[], internal_other_indices=[]):\n \"\"\"\n Apply `melt` function to a single partition.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition of the self frame.\n internal_indices : list of ints\n Positional indices of columns in this particular partition which\n represents `value_vars` columns in the source frame.\n other : pandas.DataFrame\n Broadcasted partition which contains `id_vars` columns of the\n source frame.\n internal_other_indices : list of ints\n Positional indices of columns in `other` partition which\n represents `id_vars` columns in the source frame.\n\n Returns\n -------\n pandas.DataFrame\n The result of the `melt` function for this particular partition.\n \"\"\"\n if len(other):\n other = pandas.concat(other, axis=1)\n columns_to_add = other.columns.difference(df.columns)\n df = pandas.concat([df, other[columns_to_add]], axis=1)\n return df.melt(\n id_vars=id_vars,\n value_vars=df.columns[internal_indices],\n var_name=var_name,\n value_name=value_name,\n col_level=col_level,\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt._we_have_no_able_to_calc_PandasQueryCompiler.___setitem___methods": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.melt._we_have_no_able_to_calc_PandasQueryCompiler.___setitem___methods", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2573, "end_line": 2611, "span_ids": ["PandasQueryCompiler:413", "PandasQueryCompiler.melt"], "tokens": 473}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def melt(\n self,\n id_vars=None,\n value_vars=None,\n var_name=None,\n value_name=\"value\",\n col_level=None,\n ignore_index=True,\n ):\n\n # we have no able to calculate correct indices here, so making it `dummy_index`\n inconsistent_frame = self._modin_frame.broadcast_apply_select_indices(\n axis=0,\n apply_indices=value_vars,\n func=applyier,\n other=to_broadcast,\n new_index=[\"dummy_index\"] * len(id_vars),\n new_columns=[\"dummy_index\"] * len(id_vars),\n )\n # after applying `melt` for selected indices we will get partitions like this:\n # id_vars vars value | id_vars vars value\n # 0 foo col3 1 | 0 foo col5 a so stacking it into\n # 1 fiz col3 2 | 1 fiz col5 b `new_parts` to get\n # 2 bar col3 3 | 2 bar col5 c correct answer\n # 3 zoo col3 4 | 3 zoo col5 d\n new_parts = np.array(\n [np.array([x]) for x in np.concatenate(inconsistent_frame._partitions.T)]\n )\n new_index = pandas.RangeIndex(len(self.index) * len(value_vars))\n new_modin_frame = self._modin_frame.__constructor__(\n new_parts,\n index=new_index,\n columns=id_vars + [var_name, value_name],\n )\n result = self.__constructor__(new_modin_frame)\n # this assigment needs to propagate correct indices into partitions\n result.index = new_index\n return result\n\n # END Map across rows/columns\n\n # __getitem__ methods\n __getitem_bool = Binary.register(\n lambda df, r: df[[r]] if is_scalar(r) else df[r],\n join_type=\"left\",\n labels=\"drop\",\n )\n\n # __setitem__ methods", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.setitem_bool_PandasQueryCompiler.setitem_bool.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.setitem_bool_PandasQueryCompiler.setitem_bool.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2612, "end_line": 2651, "span_ids": ["PandasQueryCompiler.setitem_bool"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n def setitem_bool(self, row_loc, col_loc, item):\n def _set_item(df, row_loc): # pragma: no cover\n df = df.copy()\n df.loc[row_loc.squeeze(axis=1), col_loc] = item\n return df\n\n if self._modin_frame.has_materialized_dtypes and is_scalar(item):\n new_dtypes = self.dtypes.copy()\n old_dtypes = new_dtypes[col_loc]\n\n if hasattr(item, \"dtype\"):\n # If we're dealing with a numpy scalar (np.int, np.datetime64, ...)\n # we would like to get its internal dtype\n item_type = item.dtype\n elif hasattr(item, \"to_numpy\"):\n # If we're dealing with a scalar that can be converted to numpy (for example pandas.Timestamp)\n # we would like to convert it and get its proper internal dtype\n item_type = item.to_numpy().dtype\n else:\n item_type = type(item)\n\n if isinstance(old_dtypes, pandas.Series):\n new_dtypes[col_loc] = [\n find_common_type([dtype, item_type]) for dtype in old_dtypes.values\n ]\n else:\n new_dtypes[col_loc] = find_common_type([old_dtypes, item_type])\n else:\n new_dtypes = None\n\n new_modin_frame = self._modin_frame.broadcast_apply_full_axis(\n axis=1,\n func=_set_item,\n other=row_loc._modin_frame,\n new_index=self._modin_frame.copy_index_cache(),\n new_columns=self._modin_frame.copy_columns_cache(),\n keep_partitioning=False,\n dtypes=new_dtypes,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END___setitem___methods_PandasQueryCompiler.getitem_array.if_is_bool_indexer_key_.else_.return.self_getitem_column_array": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END___setitem___methods_PandasQueryCompiler.getitem_array.if_is_bool_indexer_key_.else_.return.self_getitem_column_array", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2653, "end_line": 2698, "span_ids": ["PandasQueryCompiler.__validate_bool_indexer", "PandasQueryCompiler.setitem_bool", "PandasQueryCompiler.getitem_array"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END __setitem__ methods\n\n def __validate_bool_indexer(self, indexer):\n if len(indexer) != len(self.index):\n raise ValueError(\n f\"Item wrong length {len(indexer)} instead of {len(self.index)}.\"\n )\n if isinstance(indexer, pandas.Series) and not indexer.equals(self.index):\n warnings.warn(\n \"Boolean Series key will be reindexed to match DataFrame index.\",\n PendingDeprecationWarning,\n stacklevel=4,\n )\n\n def getitem_array(self, key):\n if isinstance(key, type(self)):\n # here we check for a subset of bool indexers only to simplify the code;\n # there could (potentially) be more of those, but we assume the most frequent\n # ones are just of bool dtype\n if len(key.dtypes) == 1 and is_bool_dtype(key.dtypes[0]):\n self.__validate_bool_indexer(key.index)\n return self.__getitem_bool(key, broadcast=True, dtypes=\"copy\")\n\n key = key.to_pandas().squeeze(axis=1)\n\n if is_bool_indexer(key):\n self.__validate_bool_indexer(key)\n key = check_bool_indexer(self.index, key)\n # We convert to a RangeIndex because getitem_row_array is expecting a list\n # of indices, and RangeIndex will give us the exact indices of each boolean\n # requested.\n key = pandas.RangeIndex(len(self.index))[key]\n if len(key):\n return self.getitem_row_array(key)\n else:\n return self.from_pandas(\n pandas.DataFrame(columns=self.columns), type(self._modin_frame)\n )\n else:\n if any(k not in self.columns for k in key):\n raise KeyError(\n \"{} not index\".format(\n str([k for k in key if k not in self.columns]).replace(\",\", \"\")\n )\n )\n return self.getitem_column_array(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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.getitem_column_array_PandasQueryCompiler.setitem.return.self__setitem_axis_axis_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.getitem_column_array_PandasQueryCompiler.setitem.return.self__setitem_axis_axis_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2700, "end_line": 2723, "span_ids": ["PandasQueryCompiler.getitem_row_array", "PandasQueryCompiler.setitem", "PandasQueryCompiler.getitem_column_array"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def getitem_column_array(self, key, numeric=False, ignore_order=False):\n shape_hint = \"column\" if len(key) == 1 else None\n if numeric:\n if ignore_order and is_list_like(key):\n key = np.sort(key)\n new_modin_frame = self._modin_frame.take_2d_labels_or_positional(\n col_positions=key\n )\n else:\n if ignore_order and is_list_like(key):\n key_set = frozenset(key)\n key = [col for col in self.columns if col in key_set]\n new_modin_frame = self._modin_frame.take_2d_labels_or_positional(\n col_labels=key\n )\n return self.__constructor__(new_modin_frame, shape_hint=shape_hint)\n\n def getitem_row_array(self, key):\n return self.__constructor__(\n self._modin_frame.take_2d_labels_or_positional(row_positions=key)\n )\n\n def setitem(self, axis, key, value):\n return self._setitem(axis=axis, key=key, value=value, how=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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem_PandasQueryCompiler._setitem._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem_PandasQueryCompiler._setitem._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2720, "end_line": 2743, "span_ids": ["PandasQueryCompiler._setitem"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _setitem(self, axis, key, value, how=\"inner\"):\n \"\"\"\n Set the row/column defined by `key` to the `value` provided.\n\n In contrast with `setitem` with this function you can specify how\n to handle non-aligned `self` and `value`.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to set `value` along. 0 means set row, 1 means set column.\n key : scalar\n Row/column label to set `value` in.\n value : PandasQueryCompiler (1xN), list-like or scalar\n Define new row/column value.\n how : {\"inner\", \"outer\", \"left\", \"right\", None}, default: \"inner\"\n Type of join to perform if specified axis of `self` and `value` are not\n equal. If `how` is `None`, reindex `value` with `self` labels without joining.\n\n Returns\n -------\n BaseQueryCompiler\n New QueryCompiler with updated `key` value.\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem.setitem_builder_PandasQueryCompiler._setitem.setitem_builder.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem.setitem_builder_PandasQueryCompiler._setitem.setitem_builder.return.df", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2745, "end_line": 2773, "span_ids": ["PandasQueryCompiler._setitem"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _setitem(self, axis, key, value, how=\"inner\"):\n\n def setitem_builder(df, internal_indices=[]): # pragma: no cover\n \"\"\"\n Set the row/column to the `value` in a single partition.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition of the self frame.\n internal_indices : list of ints\n Positional indices of rows/columns in this particular partition\n which represents `key` in the source frame.\n\n Returns\n -------\n pandas.DataFrame\n Partition data with updated values.\n \"\"\"\n df = df.copy()\n if len(internal_indices) == 1:\n if axis == 0:\n df[df.columns[internal_indices[0]]] = value\n else:\n df.iloc[internal_indices[0]] = value\n else:\n if axis == 0:\n df[df.columns[internal_indices]] = value\n else:\n df.iloc[internal_indices] = value\n return df\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem.if_isinstance_value_type_PandasQueryCompiler._setitem.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._setitem.if_isinstance_value_type_PandasQueryCompiler._setitem.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2775, "end_line": 2802, "span_ids": ["PandasQueryCompiler._setitem"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _setitem(self, axis, key, value, how=\"inner\"):\n # ... other code\n\n if isinstance(value, type(self)):\n value.columns = [key]\n if axis == 1:\n value = value.transpose()\n idx = self.get_axis(axis ^ 1).get_indexer_for([key])[0]\n return self.insert_item(axis ^ 1, idx, value, how, replace=True)\n\n # TODO: rework by passing list-like values to `apply_select_indices`\n # as an item to distribute\n if is_list_like(value):\n new_modin_frame = self._modin_frame.apply_full_axis_select_indices(\n axis,\n setitem_builder,\n [key],\n new_index=self.index,\n new_columns=self.columns,\n keep_remaining=True,\n )\n else:\n new_modin_frame = self._modin_frame.apply_select_indices(\n axis,\n setitem_builder,\n [key],\n new_index=self.index,\n new_columns=self.columns,\n keep_remaining=True,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END___getitem___methods_PandasQueryCompiler._END_Drop_Dropna": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END___getitem___methods_PandasQueryCompiler._END_Drop_Dropna", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2804, "end_line": 2832, "span_ids": ["PandasQueryCompiler._setitem", "PandasQueryCompiler.dropna", "PandasQueryCompiler.drop"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END __getitem__ methods\n\n # Drop/Dropna\n # This will change the shape of the resulting data.\n def dropna(self, **kwargs):\n return self.__constructor__(\n self._modin_frame.filter(\n kwargs.get(\"axis\", 0) ^ 1,\n lambda df: pandas.DataFrame.dropna(df, **kwargs),\n )\n )\n\n def drop(self, index=None, columns=None, errors: str = \"raise\"):\n # `errors` parameter needs to be part of the function signature because\n # other query compilers may not take care of error handling at the API\n # layer. This query compiler assumes there won't be any errors due to\n # invalid keys.\n if index is not None:\n index = np.sort(self.index.get_indexer_for(self.index.difference(index)))\n if columns is not None:\n columns = np.sort(\n self.columns.get_indexer_for(self.columns.difference(columns))\n )\n new_modin_frame = self._modin_frame.take_2d_labels_or_positional(\n row_positions=index, col_positions=columns\n )\n return self.__constructor__(new_modin_frame)\n\n # END Drop/Dropna", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.duplicated_PandasQueryCompiler.duplicated.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.duplicated_PandasQueryCompiler.duplicated.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2834, "end_line": 2875, "span_ids": ["PandasQueryCompiler.duplicated"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def duplicated(self, **kwargs):\n def _compute_hash(df):\n result = df.apply(\n lambda s: hashlib.new(\"md5\", str(tuple(s)).encode()).hexdigest(), axis=1\n )\n if isinstance(result, pandas.Series):\n result = result.to_frame(\n result.name\n if result.name is not None\n else MODIN_UNNAMED_SERIES_LABEL\n )\n return result\n\n def _compute_duplicated(df): # pragma: no cover\n result = df.duplicated(**kwargs)\n if isinstance(result, pandas.Series):\n result = result.to_frame(\n result.name\n if result.name is not None\n else MODIN_UNNAMED_SERIES_LABEL\n )\n return result\n\n if self._modin_frame._partitions.shape[1] > 1:\n # if the number of columns (or column partitions) we are checking for duplicates is larger than 1,\n # we must first hash them to generate a single value that can be compared across rows.\n hashed_modin_frame = self._modin_frame.reduce(\n axis=1,\n function=_compute_hash,\n dtypes=np.dtype(\"O\"),\n )\n else:\n hashed_modin_frame = self._modin_frame\n new_modin_frame = hashed_modin_frame.apply_full_axis(\n axis=0,\n func=_compute_duplicated,\n new_index=self._modin_frame.copy_index_cache(),\n new_columns=[MODIN_UNNAMED_SERIES_LABEL],\n dtypes=np.bool_,\n keep_partitioning=False,\n )\n return self.__constructor__(new_modin_frame, shape_hint=\"column\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._Insert_PandasQueryCompiler.insert.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._Insert_PandasQueryCompiler.insert.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2877, "end_line": 2913, "span_ids": ["PandasQueryCompiler.insert", "PandasQueryCompiler.duplicated"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # Insert\n # This method changes the shape of the resulting data. In Pandas, this\n # operation is always inplace, but this object is immutable, so we just\n # return a new one from here and let the front end handle the inplace\n # update.\n def insert(self, loc, column, value):\n if isinstance(value, type(self)):\n value.columns = [column]\n return self.insert_item(axis=1, loc=loc, value=value, how=None)\n\n def insert(df, internal_indices=[]): # pragma: no cover\n \"\"\"\n Insert new column to the partition.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition of the self frame.\n internal_indices : list of ints\n Positional index of the column in this particular partition\n to insert new column after.\n \"\"\"\n internal_idx = int(internal_indices[0])\n df.insert(internal_idx, column, value)\n return df\n\n # TODO: rework by passing list-like values to `apply_select_indices`\n # as an item to distribute\n new_modin_frame = self._modin_frame.apply_full_axis_select_indices(\n 0,\n insert,\n numeric_indices=[loc],\n keep_remaining=True,\n new_index=self.index,\n new_columns=self.columns.insert(loc, column),\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Insert_PandasQueryCompiler.apply.if_isinstance_func_dict_.else_.return.self__callable_func_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Insert_PandasQueryCompiler.apply.if_isinstance_func_dict_.else_.return.self__callable_func_func_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2915, "end_line": 2935, "span_ids": ["PandasQueryCompiler.explode", "PandasQueryCompiler.insert", "PandasQueryCompiler.apply"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END Insert\n\n def explode(self, column):\n return self.__constructor__(\n self._modin_frame.explode(1, lambda df: df.explode(column))\n )\n\n # UDF (apply and agg) methods\n # There is a wide range of behaviors that are supported, so a lot of the\n # logic can get a bit convoluted.\n def apply(self, func, axis, *args, **kwargs):\n # if any of args contain modin object, we should\n # convert it to pandas\n args = try_cast_to_pandas(args)\n kwargs = try_cast_to_pandas(kwargs)\n if isinstance(func, dict):\n return self._dict_func(func, axis, *args, **kwargs)\n elif is_list_like(func):\n return self._list_like_func(func, axis, *args, **kwargs)\n else:\n return self._callable_func(func, axis, *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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.apply_on_series_PandasQueryCompiler.apply_on_series.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.apply_on_series_PandasQueryCompiler.apply_on_series.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2937, "end_line": 2952, "span_ids": ["PandasQueryCompiler.apply_on_series"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def apply_on_series(self, func, *args, **kwargs):\n args = try_cast_to_pandas(args)\n kwargs = try_cast_to_pandas(kwargs)\n\n assert self.is_series_like()\n\n # We use apply_full_axis here instead of map since the latter assumes that the\n # shape of the DataFrame does not change. However, it is possible for functions\n # applied to Series objects to end up creating DataFrames. It is possible that\n # using apply_full_axis is much less performant compared to using a variant of\n # map.\n return self.__constructor__(\n self._modin_frame.apply_full_axis(\n 1, lambda df: df.squeeze(axis=1).apply(func, *args, **kwargs)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._dict_func_PandasQueryCompiler._dict_func.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._dict_func_PandasQueryCompiler._dict_func.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2954, "end_line": 2997, "span_ids": ["PandasQueryCompiler._dict_func"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _dict_func(self, func, axis, *args, **kwargs):\n \"\"\"\n Apply passed functions to the specified rows/columns.\n\n Parameters\n ----------\n func : dict(label) -> [callable, str]\n Dictionary that maps axis labels to the function to apply against them.\n axis : {0, 1}\n Target axis to apply functions along. 0 means apply to columns,\n 1 means apply to rows.\n *args : args\n Arguments to pass to the specified functions.\n **kwargs : kwargs\n Arguments to pass to the specified functions.\n\n Returns\n -------\n PandasQueryCompiler\n New QueryCompiler containing the results of passed functions.\n \"\"\"\n if \"axis\" not in kwargs:\n kwargs[\"axis\"] = axis\n\n func = {k: wrap_udf_function(v) if callable(v) else v for k, v in func.items()}\n\n def dict_apply_builder(df, internal_indices=[]): # pragma: no cover\n # Sometimes `apply` can return a `Series`, but we require that internally\n # all objects are `DataFrame`s.\n # It looks like it doesn't need to use `internal_indices` option internally\n # for the case since `apply` use labels from dictionary keys in `func` variable.\n return pandas.DataFrame(df.apply(func, *args, **kwargs))\n\n labels = list(func.keys())\n return self.__constructor__(\n self._modin_frame.apply_full_axis_select_indices(\n axis,\n dict_apply_builder,\n labels,\n new_index=labels if axis == 1 else None,\n new_columns=labels if axis == 0 else None,\n keep_remaining=False,\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._list_like_func_PandasQueryCompiler._list_like_func.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._list_like_func_PandasQueryCompiler._list_like_func.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2999, "end_line": 3038, "span_ids": ["PandasQueryCompiler._list_like_func"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _list_like_func(self, func, axis, *args, **kwargs):\n \"\"\"\n Apply passed functions to each row/column.\n\n Parameters\n ----------\n func : list of callable\n List of functions to apply against each row/column.\n axis : {0, 1}\n Target axis to apply functions along. 0 means apply to columns,\n 1 means apply to rows.\n *args : args\n Arguments to pass to the specified functions.\n **kwargs : kwargs\n Arguments to pass to the specified functions.\n\n Returns\n -------\n PandasQueryCompiler\n New QueryCompiler containing the results of passed functions.\n \"\"\"\n # When the function is list-like, the function names become the index/columns\n new_index = (\n [f if isinstance(f, str) else f.__name__ for f in func]\n if axis == 0\n else self.index\n )\n new_columns = (\n [f if isinstance(f, str) else f.__name__ for f in func]\n if axis == 1\n else self.columns\n )\n func = [wrap_udf_function(f) if callable(f) else f for f in func]\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis,\n lambda df: pandas.DataFrame(df.apply(func, axis, *args, **kwargs)),\n new_index=new_index,\n new_columns=new_columns,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._callable_func_PandasQueryCompiler._after_the_shuffle_ther": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._callable_func_PandasQueryCompiler._after_the_shuffle_ther", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3040, "end_line": 3075, "span_ids": ["PandasQueryCompiler._callable_func"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _callable_func(self, func, axis, *args, **kwargs):\n \"\"\"\n Apply passed function to each row/column.\n\n Parameters\n ----------\n func : callable or str\n Function to apply.\n axis : {0, 1}\n Target axis to apply function along. 0 means apply to columns,\n 1 means apply to rows.\n *args : args\n Arguments to pass to the specified function.\n **kwargs : kwargs\n Arguments to pass to the specified function.\n\n Returns\n -------\n PandasQueryCompiler\n New QueryCompiler containing the results of passed function\n for each row/column.\n \"\"\"\n if callable(func):\n func = wrap_udf_function(func)\n\n new_modin_frame = self._modin_frame.apply_full_axis(\n axis, lambda df: df.apply(func, axis=axis, *args, **kwargs)\n )\n return self.__constructor__(new_modin_frame)\n\n # END UDF\n\n # Manual Partitioning methods (e.g. merge, groupby)\n # These methods require some sort of manual partitioning due to their\n # nature. They require certain data to exist on the same partition, and\n # after the shuffle, there should be only a local map required.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_internal_columns_PandasQueryCompiler._groupby_internal_columns.return.by_internal_by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_internal_columns_PandasQueryCompiler._groupby_internal_columns.return.by_internal_by", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3077, "end_line": 3114, "span_ids": ["PandasQueryCompiler._groupby_internal_columns"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _groupby_internal_columns(self, by, drop):\n \"\"\"\n Extract internal columns from by argument of groupby.\n\n Parameters\n ----------\n by : BaseQueryCompiler, column or index label, Grouper or list\n drop : bool\n Indicates whether or not by data came from self frame.\n True, by data came from self. False, external by data.\n\n Returns\n -------\n by : list of BaseQueryCompiler, column or index label, or Grouper\n internal_by : list of str\n List of internal column name to be dropped during groupby.\n \"\"\"\n if isinstance(by, type(self)):\n if drop:\n internal_by = by.columns\n by = [by]\n else:\n internal_by = []\n by = [by]\n else:\n if not isinstance(by, list):\n by = [by] if by is not None else []\n internal_by = []\n for o in by:\n if isinstance(o, pandas.Grouper) and o.key in self.columns:\n internal_by.append(o.key)\n elif hashable(o) and o in self.columns:\n internal_by.append(o)\n internal_qc = (\n [self.getitem_column_array(internal_by)] if len(internal_by) else []\n )\n by = internal_qc + by[len(internal_by) :]\n return by, internal_by", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_all_PandasQueryCompiler.groupby_nth.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_all_PandasQueryCompiler.groupby_nth.return.result", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3116, "end_line": 3140, "span_ids": ["PandasQueryCompiler.groupby_nth", "PandasQueryCompiler:415"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n groupby_all = GroupbyReduceImpl.build_qc_method(\"all\")\n groupby_any = GroupbyReduceImpl.build_qc_method(\"any\")\n groupby_count = GroupbyReduceImpl.build_qc_method(\"count\")\n groupby_max = GroupbyReduceImpl.build_qc_method(\"max\")\n groupby_min = GroupbyReduceImpl.build_qc_method(\"min\")\n groupby_prod = GroupbyReduceImpl.build_qc_method(\"prod\")\n groupby_sum = GroupbyReduceImpl.build_qc_method(\"sum\")\n groupby_skew = GroupbyReduceImpl.build_qc_method(\"skew\")\n\n def groupby_nth(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n result = super().groupby_nth(\n by, axis, groupby_kwargs, agg_args, agg_kwargs, drop\n )\n if not groupby_kwargs.get(\"as_index\", True):\n # pandas keeps order of columns intact, follow suit\n return result.getitem_column_array(self.columns)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_mean_PandasQueryCompiler.groupby_mean.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_mean_PandasQueryCompiler.groupby_mean.return.result", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3142, "end_line": 3203, "span_ids": ["PandasQueryCompiler.groupby_mean"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_mean(self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False):\n if ExperimentalGroupbyImpl.get():\n try:\n return self._groupby_shuffle(\n by=by,\n agg_func=\"mean\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n except NotImplementedError as e:\n ErrorMessage.warn(\n f\"Can't use experimental reshuffling groupby implementation because of: {e}\"\n + \"\\nFalling back to a TreeReduce implementation.\"\n )\n\n _, internal_by = self._groupby_internal_columns(by, drop)\n\n numeric_only = agg_kwargs.get(\"numeric_only\", False)\n datetime_cols = (\n {\n col: dtype\n for col, dtype in zip(self.dtypes.index, self.dtypes)\n if is_datetime64_any_dtype(dtype) and col not in internal_by\n }\n if not numeric_only\n else dict()\n )\n\n if len(datetime_cols) > 0:\n datetime_qc = self.getitem_array(datetime_cols)\n if datetime_qc.isna().any().any(axis=1).to_pandas().squeeze():\n return super().groupby_mean(\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n qc_with_converted_datetime_cols = (\n self.astype({col: \"int64\" for col in datetime_cols.keys()})\n if len(datetime_cols) > 0\n else self\n )\n\n result = GroupbyReduceImpl.build_qc_method(\"mean\")(\n query_compiler=qc_with_converted_datetime_cols,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n if len(datetime_cols) > 0:\n result = result.astype({col: dtype for col, dtype in datetime_cols.items()})\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_size_PandasQueryCompiler.groupby_size.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_size_PandasQueryCompiler.groupby_size.return.result", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3205, "end_line": 3249, "span_ids": ["PandasQueryCompiler.groupby_size"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_size(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n if ExperimentalGroupbyImpl.get():\n try:\n return self._groupby_shuffle(\n by=by,\n agg_func=\"size\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n except NotImplementedError as e:\n ErrorMessage.warn(\n f\"Can't use experimental reshuffling groupby implementation because of: {e}\"\n + \"\\nFalling back to a TreeReduce implementation.\"\n )\n\n result = self._groupby_dict_reduce(\n by=by,\n axis=axis,\n agg_func={self.columns[0]: [(\"__size_col__\", \"size\")]},\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n groupby_kwargs=groupby_kwargs,\n drop=drop,\n method=\"size\",\n default_to_pandas_func=lambda grp: grp.size(),\n )\n if groupby_kwargs.get(\"as_index\", True):\n result.columns = [MODIN_UNNAMED_SERIES_LABEL]\n elif isinstance(result.columns, pandas.MultiIndex):\n # Dropping one extra-level which was added because of renaming aggregation\n result.columns = (\n result.columns[:-1].droplevel(-1).append(pandas.Index([\"size\"]))\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_dict_reduce_PandasQueryCompiler.groupby_dtypes.return.self_groupby_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_dict_reduce_PandasQueryCompiler.groupby_dtypes.return.self_groupby_agg_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3251, "end_line": 3365, "span_ids": ["PandasQueryCompiler._groupby_dict_reduce", "PandasQueryCompiler.groupby_dtypes"], "tokens": 831}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _groupby_dict_reduce(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n **kwargs,\n ):\n \"\"\"\n Group underlying data and apply aggregation functions to each group of the specified column/row.\n\n This method is responsible of performing dictionary groupby aggregation for such functions,\n that can be implemented via TreeReduce approach.\n\n Parameters\n ----------\n by : PandasQueryCompiler, column or index label, Grouper or list of such\n Object that determine groups.\n agg_func : dict(label) -> str\n Dictionary that maps row/column labels to the function names.\n **Note:** specified functions have to be supported by ``modin.core.dataframe.algebra.GroupByReduce``.\n Supported functions are listed in the ``modin.core.dataframe.algebra.GroupByReduce.groupby_reduce_functions``\n dictionary.\n axis : {0, 1}\n Axis to group and apply aggregation function along.\n 0 is for index, when 1 is for columns.\n groupby_kwargs : dict\n GroupBy parameters in the format of ``modin.pandas.DataFrame.groupby`` signature.\n agg_args : list-like\n Serves the compatibility purpose. Does not affect the result.\n agg_kwargs : dict\n Arguments to pass to the aggregation functions.\n drop : bool, default: False\n If `by` is a QueryCompiler indicates whether or not by-data came\n from the `self`.\n **kwargs : dict\n Additional parameters to pass to the ``modin.core.dataframe.algebra.GroupByReduce.register``.\n\n Returns\n -------\n PandasQueryCompiler\n New QueryCompiler containing the result of groupby dictionary aggregation.\n \"\"\"\n map_dict = {}\n reduce_dict = {}\n kwargs.setdefault(\n \"default_to_pandas_func\",\n lambda grp, *args, **kwargs: grp.agg(agg_func, *args, **kwargs),\n )\n\n rename_columns = any(\n not isinstance(fn, str) and isinstance(fn, Iterable)\n for fn in agg_func.values()\n )\n for col, col_funcs in agg_func.items():\n if not rename_columns:\n map_dict[col], reduce_dict[col], _ = GroupbyReduceImpl.get_impl(\n col_funcs\n )\n continue\n\n if isinstance(col_funcs, str):\n col_funcs = [col_funcs]\n\n map_fns = []\n for i, fn in enumerate(col_funcs):\n if not isinstance(fn, str) and isinstance(fn, Iterable):\n new_col_name, func = fn\n elif isinstance(fn, str):\n new_col_name, func = fn, fn\n else:\n raise TypeError\n\n map_fn, reduce_fn, _ = GroupbyReduceImpl.get_impl(func)\n\n map_fns.append((new_col_name, map_fn))\n reduced_col_name = (\n (*col, new_col_name)\n if isinstance(col, tuple)\n else (col, new_col_name)\n )\n reduce_dict[reduced_col_name] = reduce_fn\n map_dict[col] = map_fns\n return GroupByReduce.register(map_dict, reduce_dict, **kwargs)(\n query_compiler=self,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n\n def groupby_dtypes(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n return self.groupby_agg(\n by=by,\n axis=axis,\n agg_func=lambda df: df.dtypes,\n how=\"group_wise\",\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n groupby_kwargs=groupby_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_shuffle_PandasQueryCompiler._groupby_shuffle.return.result_qc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._groupby_shuffle_PandasQueryCompiler._groupby_shuffle.return.result_qc", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3367, "end_line": 3452, "span_ids": ["PandasQueryCompiler._groupby_shuffle"], "tokens": 760}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n @_inherit_docstrings(BaseQueryCompiler.groupby_agg)\n def _groupby_shuffle(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n how=\"axis_wise\",\n ):\n # Defaulting to pandas in case of an empty frame as we can't process it properly.\n # Higher API level won't pass empty data here unless the frame has delayed\n # computations. FIXME: We apparently lose some laziness here (due to index access)\n # because of the inability to process empty groupby natively.\n if len(self.columns) == 0 or len(self.index) == 0:\n return super().groupby_agg(\n by, agg_func, axis, groupby_kwargs, agg_args, agg_kwargs, how, drop\n )\n\n if isinstance(by, type(self)) and drop:\n by = by.columns.tolist()\n\n if not isinstance(by, list):\n by = [by]\n\n is_all_labels = all(isinstance(col, (str, tuple)) for col in by)\n is_all_column_names = (\n all(col in self.columns for col in by) if is_all_labels else False\n )\n\n if not is_all_column_names:\n raise NotImplementedError(\n \"Reshuffling groupby is only supported when grouping on a column(s) of the same frame. \"\n + \"https://github.com/modin-project/modin/issues/5926\"\n )\n\n # So this check works only if we have dtypes cache materialized, otherwise the exception will be thrown\n # inside the kernel and so it will be uncatchable. TODO: figure out a better way to handle this.\n if self._modin_frame._dtypes is not None and any(\n dtype == \"category\" for dtype in self.dtypes[by].values\n ):\n raise NotImplementedError(\n \"Reshuffling groupby is not yet supported when grouping on a categorical column. \"\n + \"https://github.com/modin-project/modin/issues/5925\"\n )\n\n is_transform = how == \"transform\" or GroupBy.is_transformation_kernel(agg_func)\n\n if is_transform:\n # https://github.com/modin-project/modin/issues/5924\n ErrorMessage.missmatch_with_pandas(\n operation=\"reshuffling groupby\",\n message=\"the order of rows may be shuffled for the result\",\n )\n\n if isinstance(agg_func, dict):\n assert (\n how == \"axis_wise\"\n ), f\"Only 'axis_wise' aggregation is supported with dictionary functions, got: {how}\"\n\n subset = by + list(agg_func.keys())\n # extracting unique values; no we can't use np.unique here as it would\n # convert a list of tuples to a 2D matrix and so mess up the result\n subset = list(dict.fromkeys(subset))\n obj = self.getitem_column_array(subset)\n else:\n obj = self\n\n agg_func = functools.partial(\n GroupByDefault.get_aggregation_method(how), func=agg_func\n )\n\n result = obj._modin_frame.groupby(\n axis=axis,\n by=by,\n operator=lambda grp: agg_func(grp, *agg_args, **agg_kwargs),\n **groupby_kwargs,\n )\n result_qc = self.__constructor__(result)\n\n if not is_transform and not groupby_kwargs.get(\"as_index\", True):\n return result_qc.reset_index(drop=True)\n\n return result_qc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_corr_PandasQueryCompiler.groupby_corr.return.super_groupby_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_corr_PandasQueryCompiler.groupby_corr.return.super_groupby_agg_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3454, "end_line": 3476, "span_ids": ["PandasQueryCompiler.groupby_corr"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_corr(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n ErrorMessage.default_to_pandas(\"`GroupBy.corr`\")\n # TODO(https://github.com/modin-project/modin/issues/1323) implement this.\n # Right now, using this class's groupby_agg method, even with how=\"group_wise\",\n # produces a result with the wrong index, so default to pandas by using the\n # super class's groupby_agg method.\n return super().groupby_agg(\n by=by,\n agg_func=\"corr\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_cov_PandasQueryCompiler.groupby_cov.return.super_groupby_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_cov_PandasQueryCompiler.groupby_cov.return.super_groupby_agg_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3478, "end_line": 3500, "span_ids": ["PandasQueryCompiler.groupby_cov"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_cov(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n ErrorMessage.default_to_pandas(\"`GroupBy.cov`\")\n # TODO(https://github.com/modin-project/modin/issues/1322) implement this.\n # Right now, using this class's groupby_agg method, even with how=\"group_wise\",\n # produces a result with the wrong index, so default to pandas by using the\n # super class's groupby_agg method.\n return super().groupby_agg(\n by=by,\n agg_func=\"cov\",\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg_PandasQueryCompiler.groupby_agg.not_broadcastable_by._o_for_o_in_by_if_not_isi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg_PandasQueryCompiler.groupby_agg.not_broadcastable_by._o_for_o_in_by_if_not_isi", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3502, "end_line": 3573, "span_ids": ["PandasQueryCompiler.groupby_agg"], "tokens": 613}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_agg(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n how=\"axis_wise\",\n drop=False,\n series_groupby=False,\n ):\n # Defaulting to pandas in case of an empty frame as we can't process it properly.\n # Higher API level won't pass empty data here unless the frame has delayed\n # computations. So we apparently lose some laziness here (due to index access)\n # because of the inability to process empty groupby natively.\n if len(self.columns) == 0 or len(self.index) == 0:\n return super().groupby_agg(\n by, agg_func, axis, groupby_kwargs, agg_args, agg_kwargs, how, drop\n )\n\n if ExperimentalGroupbyImpl.get():\n try:\n return self._groupby_shuffle(\n by=by,\n agg_func=agg_func,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n how=how,\n )\n except NotImplementedError as e:\n ErrorMessage.warn(\n f\"Can't use experimental reshuffling groupby implementation because of: {e}\"\n + \"\\nFalling back to a full-axis implementation.\"\n )\n\n if isinstance(agg_func, dict) and GroupbyReduceImpl.has_impl_for(agg_func):\n return self._groupby_dict_reduce(\n by, agg_func, axis, groupby_kwargs, agg_args, agg_kwargs, drop\n )\n\n is_transform_method = how == \"transform\" or (\n isinstance(agg_func, str) and agg_func in transformation_kernels\n )\n\n original_agg_func = agg_func\n\n if isinstance(agg_func, dict):\n assert (\n how == \"axis_wise\"\n ), f\"Only 'axis_wise' aggregation is supported with dictionary functions, got: {how}\"\n else:\n agg_func = functools.partial(\n (\n SeriesGroupByDefault if series_groupby else GroupByDefault\n ).get_aggregation_method(how),\n func=agg_func,\n )\n\n # since we're going to modify `groupby_kwargs` dict in a `groupby_agg_builder`,\n # we want to copy it to not propagate these changes into source dict, in case\n # of unsuccessful end of function\n groupby_kwargs = groupby_kwargs.copy()\n\n as_index = groupby_kwargs.get(\"as_index\", True)\n by, internal_by = self._groupby_internal_columns(by, drop)\n\n broadcastable_by = [o._modin_frame for o in by if isinstance(o, type(self))]\n not_broadcastable_by = [o for o in by if not isinstance(o, type(self))]\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.groupby_agg_builder_PandasQueryCompiler.groupby_agg.groupby_agg_builder.if_level_is_not_None_and_.else_.by_length.len_by_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.groupby_agg_builder_PandasQueryCompiler.groupby_agg.groupby_agg_builder.if_level_is_not_None_and_.else_.by_length.len_by_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3575, "end_line": 3644, "span_ids": ["PandasQueryCompiler.groupby_agg"], "tokens": 611}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_agg(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n how=\"axis_wise\",\n drop=False,\n series_groupby=False,\n ):\n # ... other code\n\n def groupby_agg_builder(df, by=None, drop=False, partition_idx=None):\n \"\"\"\n Compute groupby aggregation for a single partition.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition of the self frame.\n by : pandas.DataFrame, optional\n Broadcasted partition which contains `by` columns.\n drop : bool, default: False\n Indicates whether `by` partition came from the `self` frame.\n partition_idx : int, optional\n Positional partition index along groupby axis.\n\n Returns\n -------\n pandas.DataFrame\n DataFrame containing the result of groupby aggregation\n for this particular partition.\n \"\"\"\n # Set `as_index` to True to track the metadata of the grouping object\n # It is used to make sure that between phases we are constructing the\n # right index and placing columns in the correct order.\n groupby_kwargs[\"as_index\"] = True\n\n # We have to filter func-dict BEFORE inserting broadcasted 'by' columns\n # to avoid multiple aggregation results for 'by' cols in case they're\n # present in the func-dict:\n partition_agg_func = GroupByReduce.get_callable(agg_func, df)\n\n internal_by_cols = pandas.Index([])\n missed_by_cols = pandas.Index([])\n\n if by is not None:\n internal_by_df = by[internal_by]\n\n if isinstance(internal_by_df, pandas.Series):\n internal_by_df = internal_by_df.to_frame()\n\n missed_by_cols = internal_by_df.columns.difference(df.columns)\n if len(missed_by_cols) > 0:\n df = pandas.concat(\n [df, internal_by_df[missed_by_cols]],\n axis=1,\n copy=False,\n )\n\n internal_by_cols = internal_by_df.columns\n\n external_by = by.columns.difference(internal_by).unique()\n external_by_df = by[external_by].squeeze(axis=1)\n\n if isinstance(external_by_df, pandas.DataFrame):\n external_by_cols = [o for _, o in external_by_df.items()]\n else:\n external_by_cols = [external_by_df]\n\n by = internal_by_cols.tolist() + external_by_cols\n\n else:\n by = []\n\n by += not_broadcastable_by\n level = groupby_kwargs.get(\"level\", None)\n if level is not None and not by:\n by = None\n by_length = len(level) if is_list_like(level) else 1\n else:\n by_length = len(by)\n # ... other code\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.groupby_agg_builder.compute_groupby_PandasQueryCompiler.groupby_agg.groupby_agg_builder.try_.except_ValueError_KeyEr.return.compute_groupby_df_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.groupby_agg_builder.compute_groupby_PandasQueryCompiler.groupby_agg.groupby_agg_builder.try_.except_ValueError_KeyEr.return.compute_groupby_df_copy_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3646, "end_line": 3710, "span_ids": ["PandasQueryCompiler.groupby_agg"], "tokens": 698}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_agg(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n how=\"axis_wise\",\n drop=False,\n series_groupby=False,\n ):\n\n def groupby_agg_builder(df, by=None, drop=False, partition_idx=None):\n # ... other code\n\n def compute_groupby(df, drop=False, partition_idx=0):\n \"\"\"Compute groupby aggregation for a single partition.\"\"\"\n target_df = df.squeeze(axis=1) if series_groupby else df\n grouped_df = target_df.groupby(by=by, axis=axis, **groupby_kwargs)\n try:\n result = partition_agg_func(grouped_df, *agg_args, **agg_kwargs)\n except DataError:\n # This happens when the partition is filled with non-numeric data and a\n # numeric operation is done. We need to build the index here to avoid\n # issues with extracting the index.\n result = pandas.DataFrame(index=grouped_df.size().index)\n if isinstance(result, pandas.Series):\n result = result.to_frame(\n result.name\n if result.name is not None\n else MODIN_UNNAMED_SERIES_LABEL\n )\n\n selection = agg_func.keys() if isinstance(agg_func, dict) else None\n if selection is None:\n # Some pandas built-in aggregation functions aggregate 'by' columns\n # (for example 'apply', 'dtypes', maybe more...). Since we make sure\n # that all of the 'by' columns are presented in every partition by\n # inserting the missed ones, we will end up with all of the 'by'\n # columns being aggregated in every partition. To avoid duplications\n # in the result we drop all of the 'by' columns that were inserted\n # in this partition AFTER handling 'as_index' parameter. The order\n # is important for proper naming-conflicts handling.\n misaggregated_cols = missed_by_cols.intersection(result.columns)\n else:\n misaggregated_cols = []\n\n if not as_index:\n GroupBy.handle_as_index_for_dataframe(\n result,\n internal_by_cols,\n by_cols_dtypes=df[internal_by_cols].dtypes.values,\n by_length=by_length,\n selection=selection,\n partition_idx=partition_idx,\n drop=drop,\n inplace=True,\n method=\"transform\" if is_transform_method else None,\n )\n else:\n new_index_names = tuple(\n None\n if isinstance(name, str)\n and name.startswith(MODIN_UNNAMED_SERIES_LABEL)\n else name\n for name in result.index.names\n )\n result.index.names = new_index_names\n\n if len(misaggregated_cols) > 0:\n result.drop(columns=misaggregated_cols, inplace=True)\n\n return result\n\n try:\n return compute_groupby(df, drop, partition_idx)\n except (ValueError, KeyError):\n # This will happen with Arrow buffer read-only errors. We don't want to copy\n # all the time, so this will try to fast-path the code first.\n return compute_groupby(df.copy(), drop, partition_idx)\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.if_isinstance_original_ag_PandasQueryCompiler._END_Manual_Partitioning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.groupby_agg.if_isinstance_original_ag_PandasQueryCompiler._END_Manual_Partitioning", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3712, "end_line": 3741, "span_ids": ["PandasQueryCompiler.groupby_agg"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def groupby_agg(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n how=\"axis_wise\",\n drop=False,\n series_groupby=False,\n ):\n # ... other code\n\n if isinstance(original_agg_func, dict):\n apply_indices = list(agg_func.keys())\n elif isinstance(original_agg_func, list):\n apply_indices = self.columns.difference(internal_by).tolist()\n else:\n apply_indices = None\n\n new_modin_frame = self._modin_frame.broadcast_apply_full_axis(\n axis=axis,\n func=lambda df, by=None, partition_idx=None: groupby_agg_builder(\n df, by, drop, partition_idx\n ),\n other=broadcastable_by,\n apply_indices=apply_indices,\n enumerate_partitions=True,\n )\n result = self.__constructor__(new_modin_frame)\n\n # that means that exception in `compute_groupby` was raised\n # in every partition, so we also should raise it\n if (\n len(result.columns) == 0\n and len(self.columns) != 0\n and agg_kwargs.get(\"numeric_only\", False)\n ):\n raise TypeError(\"No numeric types to aggregate.\")\n\n return result\n\n # END Manual Partitioning methods", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_PandasQueryCompiler.pivot.return.unstacked": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_PandasQueryCompiler.pivot.return.unstacked", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3743, "end_line": 3791, "span_ids": ["PandasQueryCompiler.pivot"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def pivot(self, index, columns, values):\n from pandas.core.reshape.pivot import _convert_by\n\n def __convert_by(by):\n \"\"\"Convert passed value to a list.\"\"\"\n if isinstance(by, pandas.Index):\n by = list(by)\n by = _convert_by(by)\n if (\n len(by) > 0\n and (not is_list_like(by[0]) or isinstance(by[0], tuple))\n and not all([key in self.columns for key in by])\n ):\n by = [by]\n return by\n\n index, columns, values = map(__convert_by, [index, columns, values])\n is_custom_index = (\n len(index) == 1\n and is_list_like(index[0])\n and not isinstance(index[0], tuple)\n )\n\n if is_custom_index or len(index) == 0:\n to_reindex = columns\n else:\n to_reindex = index + columns\n\n if len(values) != 0:\n obj = self.getitem_column_array(to_reindex + values)\n else:\n obj = self\n\n if is_custom_index:\n obj.index = index\n\n reindexed = self.__constructor__(\n obj._modin_frame.apply_full_axis(\n 1,\n lambda df: df.set_index(to_reindex, append=(len(to_reindex) == 1)),\n new_columns=obj.columns.drop(to_reindex),\n )\n )\n\n unstacked = reindexed.unstack(level=columns, fill_value=None)\n if len(reindexed.columns) == 1 and unstacked.columns.nlevels > 1:\n unstacked.columns = unstacked.columns.droplevel(0)\n\n return unstacked", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_table_PandasQueryCompiler.pivot_table.if_len_values_0_.len_values.len_self_columns_drop_uni": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_table_PandasQueryCompiler.pivot_table.if_len_values_0_.len_values.len_self_columns_drop_uni", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3854, "end_line": 3910, "span_ids": ["PandasQueryCompiler.pivot_table"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def pivot_table(\n self,\n index,\n values,\n columns,\n aggfunc,\n fill_value,\n margins,\n dropna,\n margins_name,\n observed,\n sort,\n ):\n ErrorMessage.missmatch_with_pandas(\n operation=\"pivot_table\",\n message=\"Order of columns could be different from pandas\",\n )\n\n from pandas.core.reshape.pivot import _convert_by\n\n def __convert_by(by):\n \"\"\"Convert passed value to a list.\"\"\"\n if isinstance(by, pandas.Index):\n return list(by)\n return _convert_by(by)\n\n drop_column_level = values is not None and not is_list_like(values)\n index, columns, values = map(__convert_by, [index, columns, values])\n\n unique_keys = np.unique(index + columns)\n unique_values = np.unique(values)\n\n if len(values):\n to_group = self.getitem_column_array(unique_values, ignore_order=True)\n else:\n to_group = self.drop(columns=unique_keys)\n\n keys_columns = self.getitem_column_array(unique_keys, ignore_order=True)\n\n # Here we can use TreeReduce implementation that tends to be more efficient rather full-axis one\n if (\n not margins\n and GroupbyReduceImpl.has_impl_for(aggfunc)\n and len(set(index).intersection(columns)) == 0\n ):\n return to_group._pivot_table_tree_reduce(\n keys_columns,\n aggfunc,\n drop_column_level=drop_column_level,\n fill_value=fill_value,\n dropna=dropna,\n to_unstack=columns if index else None,\n )\n\n len_values = len(values)\n if len_values == 0:\n len_values = len(self.columns.drop(unique_keys))\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_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_table.applyier_PandasQueryCompiler._Get_dummies": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.pivot_table.applyier_PandasQueryCompiler._Get_dummies", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3834, "end_line": 3891, "span_ids": ["PandasQueryCompiler.pivot_table"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def pivot_table(\n self,\n index,\n values,\n columns,\n aggfunc,\n fill_value,\n margins,\n dropna,\n margins_name,\n observed,\n sort,\n ):\n # ... other code\n\n def applyier(df, other): # pragma: no cover\n \"\"\"\n Build pivot table for a single partition.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Partition of the self frame.\n other : pandas.DataFrame\n Broadcasted partition that contains `value` columns\n of the self frame.\n\n Returns\n -------\n pandas.DataFrame\n Pivot table for this particular partition.\n \"\"\"\n concated = pandas.concat([df, other], axis=1, copy=False)\n result = pandas.pivot_table(\n concated,\n index=index,\n values=values if len(values) > 0 else None,\n columns=columns,\n aggfunc=aggfunc,\n fill_value=fill_value,\n margins=margins,\n dropna=dropna,\n margins_name=margins_name,\n observed=observed,\n sort=sort,\n )\n\n # if only one value is specified, removing level that maps\n # columns from `values` to the actual values\n if len(index) > 0 and len_values == 1 and result.columns.nlevels > 1:\n result.columns = result.columns.droplevel(int(margins))\n\n # in that case Pandas transposes the result of `pivot_table`,\n # transposing it back to be consistent with column axis values along\n # different partitions\n if len(index) == 0 and len(columns) > 0:\n result = result.T\n\n return result\n\n result = self.__constructor__(\n to_group._modin_frame.broadcast_apply_full_axis(\n axis=0, func=applyier, other=keys_columns._modin_frame\n )\n )\n\n # transposing the result again, to be consistent with Pandas result\n if len(index) == 0 and len(columns) > 0:\n result = result.transpose()\n\n return result\n\n # Get_dummies", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.get_dummies_PandasQueryCompiler.get_dummies.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.get_dummies_PandasQueryCompiler.get_dummies.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3892, "end_line": 3928, "span_ids": ["PandasQueryCompiler.get_dummies"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n def get_dummies(self, columns, **kwargs):\n # `columns` as None does not mean all columns, by default it means only\n # non-numeric columns.\n if columns is None:\n columns = [c for c in self.columns if not is_numeric_dtype(self.dtypes[c])]\n # If we aren't computing any dummies, there is no need for any\n # remote compute.\n if len(columns) == 0:\n return self.copy()\n elif not is_list_like(columns):\n columns = [columns]\n\n def map_fn(df): # pragma: no cover\n cols_to_encode = df.columns.intersection(columns)\n return pandas.get_dummies(df, columns=cols_to_encode, **kwargs)\n\n # In some cases, we are mapping across all of the data. It is more\n # efficient if we are mapping over all of the data to do it this way\n # than it would be to reuse the code for specific columns.\n if len(columns) == len(self.columns):\n new_modin_frame = self._modin_frame.apply_full_axis(\n 0, map_fn, new_index=self.index\n )\n untouched_frame = None\n else:\n new_modin_frame = self._modin_frame.take_2d_labels_or_positional(\n col_labels=columns\n ).apply_full_axis(0, map_fn, new_index=self.index)\n untouched_frame = self.drop(columns=columns)\n # If we mapped over all the data we are done. If not, we need to\n # prepend the `new_modin_frame` with the raw data from the columns that were\n # not selected.\n if len(columns) != len(self.columns):\n new_modin_frame = untouched_frame._modin_frame.concat(\n 1, [new_modin_frame], how=\"left\", sort=False\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Get_dummies_PandasQueryCompiler.write_items.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._END_Get_dummies_PandasQueryCompiler.write_items.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3930, "end_line": 3977, "span_ids": ["PandasQueryCompiler.get_dummies", "PandasQueryCompiler.take_2d_positional", "PandasQueryCompiler.write_items"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # END Get_dummies\n\n # Indexing\n def take_2d_positional(self, index=None, columns=None):\n return self.__constructor__(\n self._modin_frame.take_2d_labels_or_positional(\n row_positions=index, col_positions=columns\n )\n )\n\n def write_items(self, row_numeric_index, col_numeric_index, broadcasted_items):\n def iloc_mut(partition, row_internal_indices, col_internal_indices, item):\n \"\"\"\n Write `value` in a specified location in a single partition.\n\n Parameters\n ----------\n partition : pandas.DataFrame\n Partition of the self frame.\n row_internal_indices : list of ints\n Positional indices of rows in this particular partition\n to write `item` to.\n col_internal_indices : list of ints\n Positional indices of columns in this particular partition\n to write `item` to.\n item : 2D-array\n Value to write.\n\n Returns\n -------\n pandas.DataFrame\n Partition data with updated values.\n \"\"\"\n partition = partition.copy()\n partition.iloc[row_internal_indices, col_internal_indices] = item\n return partition\n\n new_modin_frame = self._modin_frame.apply_select_indices(\n axis=None,\n func=iloc_mut,\n row_labels=row_numeric_index,\n col_labels=col_numeric_index,\n new_index=self.index,\n new_columns=self.columns,\n keep_remaining=True,\n item_to_distribute=broadcasted_items,\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.sort_rows_by_column_values_PandasQueryCompiler.sort_columns_by_row_values.return.self_reindex_axis_1_labe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler.sort_rows_by_column_values_PandasQueryCompiler.sort_columns_by_row_values.return.self_reindex_axis_1_labe", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3979, "end_line": 4000, "span_ids": ["PandasQueryCompiler.sort_rows_by_column_values", "PandasQueryCompiler.sort_columns_by_row_values"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def sort_rows_by_column_values(self, columns, ascending=True, **kwargs):\n new_modin_frame = self._modin_frame.sort_by(\n 0, columns, ascending=ascending, **kwargs\n )\n return self.__constructor__(new_modin_frame)\n\n def sort_columns_by_row_values(self, rows, ascending=True, **kwargs):\n if not is_list_like(rows):\n rows = [rows]\n ErrorMessage.default_to_pandas(\"sort_values\")\n broadcast_value_list = [\n self.getitem_row_array([row]).to_pandas() for row in rows\n ]\n index_builder = list(zip(broadcast_value_list, rows))\n broadcast_values = pandas.concat(\n [row for row, idx in index_builder], copy=False\n )\n broadcast_values.columns = self.columns\n new_columns = broadcast_values.sort_values(\n by=rows, axis=1, ascending=ascending, **kwargs\n ).columns\n return self.reindex(axis=1, labels=new_columns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._Cat_operations_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._Cat_operations_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4002, "end_line": 4024, "span_ids": ["PandasQueryCompiler.compare", "PandasQueryCompiler.cat_codes", "PandasQueryCompiler.sort_columns_by_row_values"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n # Cat operations\n def cat_codes(self):\n def func(df: pandas.DataFrame) -> pandas.DataFrame:\n ser = df.iloc[:, 0]\n assert ser.dtype == \"category\"\n return ser.cat.codes.to_frame(name=MODIN_UNNAMED_SERIES_LABEL)\n\n res = self._modin_frame.map(func=func, new_columns=[MODIN_UNNAMED_SERIES_LABEL])\n return self.__constructor__(res, shape_hint=\"column\")\n\n # END Cat operations\n\n def compare(self, other, **kwargs):\n return self.__constructor__(\n self._modin_frame.broadcast_apply_full_axis(\n 0,\n lambda left, right: pandas.DataFrame.compare(\n left, other=right, **kwargs\n ),\n other._modin_frame,\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_modin-project__modin/modin/core/storage_formats/pandas/utils.py_re_compute_chunksize.return.max_chunksize_min_block_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_re_compute_chunksize.return.max_chunksize_min_block_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 70, "span_ids": ["compute_chunksize", "_nullcontext", "docstring"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nfrom typing import Hashable, List\nimport contextlib\n\nimport numpy as np\nimport pandas\n\nfrom modin.config import MinPartitionSize, NPartitions\nfrom math import ceil\n\n\n@contextlib.contextmanager\ndef _nullcontext(dummy_value=None): # noqa: PR01\n \"\"\"\n Act as a replacement for contextlib.nullcontext missing in older Python.\n\n Notes\n -----\n contextlib.nullcontext is only available from Python 3.7.\n \"\"\"\n yield dummy_value\n\n\ndef compute_chunksize(axis_len, num_splits, min_block_size=None):\n \"\"\"\n Compute the number of elements (rows/columns) to include in each partition.\n\n Chunksize is defined the same for both axes.\n\n Parameters\n ----------\n axis_len : int\n Element count in an axis.\n num_splits : int\n The number of splits.\n min_block_size : int, optional\n Minimum number of rows/columns in a single split.\n If not specified, the value is assumed equal to ``MinPartitionSize``.\n\n Returns\n -------\n int\n Integer number of rows/columns to split the DataFrame will be returned.\n \"\"\"\n if min_block_size is None:\n min_block_size = MinPartitionSize.get()\n\n assert min_block_size > 0, \"`min_block_size` should be > 0\"\n\n chunksize = axis_len // num_splits\n if axis_len % num_splits:\n chunksize += 1\n # chunksize shouldn't be less than `min_block_size` to avoid a\n # large amount of small partitions.\n return max(chunksize, min_block_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_modin-project__modin/modin/core/storage_formats/pandas/utils.py_split_result_of_axis_func_pandas_split_result_of_axis_func_pandas.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_split_result_of_axis_func_pandas_split_result_of_axis_func_pandas.return._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 118, "span_ids": ["split_result_of_axis_func_pandas"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_result_of_axis_func_pandas(axis, num_splits, result, length_list=None):\n \"\"\"\n Split pandas DataFrame evenly based on the provided number of splits.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to split across. 0 means index axis when 1 means column axis.\n num_splits : int\n Number of splits to separate the DataFrame into.\n This parameter is ignored if `length_list` is specified.\n result : pandas.DataFrame\n DataFrame to split.\n length_list : list of ints, optional\n List of slice lengths to split DataFrame into. This is used to\n return the DataFrame to its original partitioning schema.\n\n Returns\n -------\n list of pandas.DataFrames\n Splitted dataframe represented by list of frames.\n \"\"\"\n if num_splits == 1:\n return [result]\n\n if length_list is None:\n length_list = get_length_list(result.shape[axis], num_splits)\n # Inserting the first \"zero\" to properly compute cumsum indexing slices\n length_list = np.insert(length_list, obj=0, values=[0])\n\n sums = np.cumsum(length_list)\n axis = 0 if isinstance(result, pandas.Series) else axis\n # We do this to restore block partitioning\n if axis == 0:\n chunked = [result.iloc[sums[i] : sums[i + 1]] for i in range(len(sums) - 1)]\n else:\n chunked = [result.iloc[:, sums[i] : sums[i + 1]] for i in range(len(sums) - 1)]\n\n return [\n # Sliced MultiIndex still stores all encoded values of the original index, explicitly\n # asking it to drop unused values in order to save memory.\n chunk.set_axis(chunk.axes[axis].remove_unused_levels(), axis=axis, copy=False)\n if isinstance(chunk.axes[axis], pandas.MultiIndex)\n else chunk\n for chunk in chunked\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_get_length_list_get_length_list.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_get_length_list_get_length_list.return._", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 143, "span_ids": ["get_length_list"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_length_list(axis_len: int, num_splits: int) -> list:\n \"\"\"\n Compute partitions lengths along the axis with the specified number of splits.\n\n Parameters\n ----------\n axis_len : int\n Element count in an axis.\n num_splits : int\n Number of splits along the axis.\n\n Returns\n -------\n list of ints\n List of integer lengths of partitions.\n \"\"\"\n chunksize = compute_chunksize(axis_len, num_splits)\n return [\n chunksize\n if (i + 1) * chunksize <= axis_len\n else max(0, axis_len - i * chunksize)\n for i in range(num_splits)\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_length_fn_pandas_get_group_names.return._names_get_1_i_i_for_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_length_fn_pandas_get_group_names.return._names_get_1_i_i_for_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 193, "span_ids": ["get_group_names", "width_fn_pandas", "length_fn_pandas"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def length_fn_pandas(df):\n \"\"\"\n Compute number of rows of passed `pandas.DataFrame`.\n\n Parameters\n ----------\n df : pandas.DataFrame\n\n Returns\n -------\n int\n \"\"\"\n assert isinstance(df, pandas.DataFrame)\n return len(df) if len(df) > 0 else 0\n\n\ndef width_fn_pandas(df):\n \"\"\"\n Compute number of columns of passed `pandas.DataFrame`.\n\n Parameters\n ----------\n df : pandas.DataFrame\n\n Returns\n -------\n int\n \"\"\"\n assert isinstance(df, pandas.DataFrame)\n return len(df.columns) if len(df.columns) > 0 else 0\n\n\ndef get_group_names(regex: \"re.Pattern\") -> \"List[Hashable]\":\n \"\"\"\n Get named groups from compiled regex.\n\n Unnamed groups are numbered.\n\n Parameters\n ----------\n regex : compiled regex\n\n Returns\n -------\n list of column labels\n \"\"\"\n names = {v: k for k, v in regex.groupindex.items()}\n return [names.get(1 + i, i) for i in range(regex.groups)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_merge_partitioning_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/utils.py_merge_partitioning_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 221, "span_ids": ["merge_partitioning"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def merge_partitioning(left, right, axis=1):\n \"\"\"\n Get the number of splits across the `axis` for the two dataframes being concatenated.\n\n Parameters\n ----------\n left : PandasDataframe\n right : PandasDataframe\n axis : int, default: 1\n\n Returns\n -------\n int\n \"\"\"\n lshape = left._row_lengths_cache if axis == 0 else left._column_widths_cache\n rshape = right._row_lengths_cache if axis == 0 else right._column_widths_cache\n\n if lshape is not None and rshape is not None:\n res_shape = sum(lshape) + sum(rshape)\n chunk_size = compute_chunksize(axis_len=res_shape, num_splits=NPartitions.get())\n return ceil(res_shape / chunk_size)\n else:\n lsplits = left._partitions.shape[axis]\n rsplits = right._partitions.shape[axis]\n return min(lsplits + rsplits, NPartitions.get())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_from_typing_import_Any_S_ModinDatabaseConnection.__init__.self._dialect_is_microsoft_sql_cache.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_from_typing_import_Any_S_ModinDatabaseConnection.__init__.self._dialect_is_microsoft_sql_cache.None", "embedding": null, "metadata": {"file_path": "modin/db_conn.py", "file_name": "db_conn.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 64, "span_ids": ["ModinDatabaseConnection", "ModinDatabaseConnection.__init__", "UnsupportedDatabaseException", "docstring"], "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 typing import Any, Sequence, Dict, Optional\n\n_PSYCOPG_LIB_NAME = \"psycopg2\"\n_SQLALCHEMY_LIB_NAME = \"sqlalchemy\"\n\n\nclass UnsupportedDatabaseException(Exception):\n \"\"\"Modin can't create a particular kind of database connection.\"\"\"\n\n pass\n\n\nclass ModinDatabaseConnection:\n \"\"\"\n Creates a SQL database connection.\n\n Parameters\n ----------\n lib : str\n The library for the SQL connection.\n *args : iterable\n Positional arguments to pass when creating the connection.\n **kwargs : dict\n Keyword arguments to pass when creating the connection.\n \"\"\"\n\n lib: str\n args: Sequence\n kwargs: Dict\n _dialect_is_microsoft_sql_cache: Optional[bool]\n\n def __init__(self, lib: str, *args: Any, **kwargs: Any) -> None:\n lib = lib.lower()\n if lib not in (_PSYCOPG_LIB_NAME, _SQLALCHEMY_LIB_NAME):\n raise UnsupportedDatabaseException(f\"Unsupported database library {lib}\")\n self.lib = lib\n self.args = args\n self.kwargs = kwargs\n self._dialect_is_microsoft_sql_cache = 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_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection._dialect_is_microsoft_sql_ModinDatabaseConnection._dialect_is_microsoft_sql.return.self__dialect_is_microsof": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection._dialect_is_microsoft_sql_ModinDatabaseConnection._dialect_is_microsoft_sql.return.self__dialect_is_microsof", "embedding": null, "metadata": {"file_path": "modin/db_conn.py", "file_name": "db_conn.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 87, "span_ids": ["ModinDatabaseConnection._dialect_is_microsoft_sql"], "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 ModinDatabaseConnection:\n\n def _dialect_is_microsoft_sql(self) -> bool:\n \"\"\"\n Tell whether this connection requires Microsoft SQL dialect.\n\n If this is a sqlalchemy connection, create an engine from args and\n kwargs. If that engine's driver is pymssql or pyodbc, this\n connection requires Microsoft SQL. Otherwise, it doesn't.\n\n Returns\n -------\n bool\n \"\"\"\n if self._dialect_is_microsoft_sql_cache is None:\n self._dialect_is_microsoft_sql_cache = False\n if self.lib == _SQLALCHEMY_LIB_NAME:\n from sqlalchemy import create_engine\n\n self._dialect_is_microsoft_sql_cache = create_engine(\n *self.args, **self.kwargs\n ).driver in (\"pymssql\", \"pyodbc\")\n\n return self._dialect_is_microsoft_sql_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_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.get_connection_ModinDatabaseConnection.get_connection.raise_UnsupportedDatabase": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.get_connection_ModinDatabaseConnection.get_connection.raise_UnsupportedDatabase", "embedding": null, "metadata": {"file_path": "modin/db_conn.py", "file_name": "db_conn.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 112, "span_ids": ["ModinDatabaseConnection.get_connection"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModinDatabaseConnection:\n\n def get_connection(self) -> Any:\n \"\"\"\n Make the database connection and get it.\n\n For psycopg2, pass all arguments to psycopg2.connect() and return the\n result of psycopg2.connect(). For sqlalchemy, pass all arguments to\n sqlalchemy.create_engine() and return the result of calling connect()\n on the engine.\n\n Returns\n -------\n Any\n The open database connection.\n \"\"\"\n if self.lib == _PSYCOPG_LIB_NAME:\n import psycopg2\n\n return psycopg2.connect(*self.args, **self.kwargs)\n if self.lib == _SQLALCHEMY_LIB_NAME:\n from sqlalchemy import create_engine\n\n return create_engine(*self.args, **self.kwargs).connect()\n\n raise UnsupportedDatabaseException(\"Unsupported database library\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.get_string_ModinDatabaseConnection.row_count_query.return.f_SELECT_COUNT_FROM_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.get_string_ModinDatabaseConnection.row_count_query.return.f_SELECT_COUNT_FROM_", "embedding": null, "metadata": {"file_path": "modin/db_conn.py", "file_name": "db_conn.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 154, "span_ids": ["ModinDatabaseConnection.column_names_query", "ModinDatabaseConnection.get_string", "ModinDatabaseConnection.row_count_query"], "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 ModinDatabaseConnection:\n\n def get_string(self) -> str:\n \"\"\"\n Get input connection string.\n\n Returns\n -------\n str\n \"\"\"\n return self.args[0]\n\n def column_names_query(self, query: str) -> str:\n \"\"\"\n Get a query that gives the names of columns that `query` would produce.\n\n Parameters\n ----------\n query : str\n The SQL query to check.\n\n Returns\n -------\n str\n \"\"\"\n # This query looks odd, but it works in both PostgreSQL and Microsoft\n # SQL, which doesn't let you use a \"limit\" clause to select 0 rows.\n return f\"SELECT * FROM ({query}) AS _MODIN_COUNT_QUERY WHERE 1 = 0\"\n\n def row_count_query(self, query: str) -> str:\n \"\"\"\n Get a query that gives the names of rows that `query` would produce.\n\n Parameters\n ----------\n query : str\n The SQL query to check.\n\n Returns\n -------\n str\n \"\"\"\n return f\"SELECT COUNT(*) FROM ({query}) AS _MODIN_COUNT_QUERY\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.partition_query_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/db_conn.py_ModinDatabaseConnection.partition_query_", "embedding": null, "metadata": {"file_path": "modin/db_conn.py", "file_name": "db_conn.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 182, "span_ids": ["ModinDatabaseConnection.partition_query"], "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 ModinDatabaseConnection:\n\n def partition_query(self, query: str, limit: int, offset: int) -> str:\n \"\"\"\n Get a query that partitions the original `query`.\n\n Parameters\n ----------\n query : str\n The SQL query to get a partition.\n limit : int\n The size of the partition.\n offset : int\n Where the partition begins.\n\n Returns\n -------\n str\n \"\"\"\n return (\n (\n f\"SELECT * FROM ({query}) AS _MODIN_COUNT_QUERY ORDER BY(SELECT NULL)\"\n + f\" OFFSET {offset} ROWS FETCH NEXT {limit} ROWS ONLY\"\n )\n if self._dialect_is_microsoft_sql()\n else f\"SELECT * FROM ({query}) AS _MODIN_COUNT_QUERY LIMIT \"\n + f\"{limit} OFFSET {offset}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/distributed/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/distributed/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/distributed/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/distributed/dataframe/pandas/__init__.py_unwrap_partitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/__init__.py_unwrap_partitions_", "embedding": null, "metadata": {"file_path": "modin/distributed/dataframe/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "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 .partitions import unwrap_partitions, from_partitions\n\n__all__ = [\"unwrap_partitions\", \"from_partitions\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_typing_import_Option_if_TYPE_CHECKING_.else_.PartitionUnionType.Any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_typing_import_Option_if_TYPE_CHECKING_.else_.PartitionUnionType.Any", "embedding": null, "metadata": {"file_path": "modin/distributed/dataframe/pandas/partitions.py", "file_name": "partitions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 42, "span_ids": ["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": "from typing import Optional, Union, TYPE_CHECKING\nimport numpy as np\nfrom pandas._typing import Axes\n\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.pandas.dataframe import DataFrame, Series\n\nif TYPE_CHECKING:\n from modin.core.execution.ray.implementations.pandas_on_ray.partitioning import (\n PandasOnRayDataframePartition,\n )\n from modin.core.execution.dask.implementations.pandas_on_dask.partitioning import (\n PandasOnDaskDataframePartition,\n )\n from modin.core.execution.unidist.implementations.pandas_on_unidist.partitioning.partition import (\n PandasOnUnidistDataframePartition,\n )\n\n PartitionUnionType = Union[\n PandasOnRayDataframePartition,\n PandasOnDaskDataframePartition,\n PandasOnUnidistDataframePartition,\n ]\nelse:\n from typing import Any\n\n PartitionUnionType = Any", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_unwrap_partitions_unwrap_partitions.if_axis_is_None_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_unwrap_partitions_unwrap_partitions.if_axis_is_None_.else_.return._", "embedding": null, "metadata": {"file_path": "modin/distributed/dataframe/pandas/partitions.py", "file_name": "partitions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 126, "span_ids": ["unwrap_partitions"], "tokens": 656}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def unwrap_partitions(\n api_layer_object: Union[DataFrame, Series],\n axis: Optional[int] = None,\n get_ip: bool = False,\n) -> list:\n \"\"\"\n Unwrap partitions of the ``api_layer_object``.\n\n Parameters\n ----------\n api_layer_object : DataFrame or Series\n The API layer object.\n axis : {None, 0, 1}, default: None\n The axis to unwrap partitions for (0 - row partitions, 1 - column partitions).\n If ``axis is None``, the partitions are unwrapped as they are currently stored.\n get_ip : bool, default: False\n Whether to get node ip address to each partition or not.\n\n Returns\n -------\n list\n A list of Ray.ObjectRef/Dask.Future to partitions of the ``api_layer_object``\n if Ray/Dask is used as an engine.\n\n Notes\n -----\n If ``get_ip=True``, a list of tuples of Ray.ObjectRef/Dask.Future to node ip addresses and\n partitions of the ``api_layer_object``, respectively, is returned if Ray/Dask is used as an engine\n (i.e. ``[(Ray.ObjectRef/Dask.Future, Ray.ObjectRef/Dask.Future), ...]``).\n \"\"\"\n if not hasattr(api_layer_object, \"_query_compiler\"):\n raise ValueError(\n f\"Only API Layer objects may be passed in here, got {type(api_layer_object)} instead.\"\n )\n\n modin_frame = api_layer_object._query_compiler._modin_frame\n modin_frame._propagate_index_objs(None)\n if axis is None:\n\n def _unwrap_partitions() -> list:\n [p.drain_call_queue() for p in modin_frame._partitions.flatten()]\n\n def get_block(partition: PartitionUnionType) -> np.ndarray:\n blocks = partition.list_of_blocks\n assert (\n len(blocks) == 1\n ), f\"Implementation assumes that partition contains a single block, but {len(blocks)} recieved.\"\n return blocks[0]\n\n if get_ip:\n return [\n [(partition._ip_cache, get_block(partition)) for partition in row]\n for row in modin_frame._partitions\n ]\n else:\n return [\n [get_block(partition) for partition in row]\n for row in modin_frame._partitions\n ]\n\n actual_engine = type(\n api_layer_object._query_compiler._modin_frame._partitions[0][0]\n ).__name__\n if actual_engine in (\n \"PandasOnRayDataframePartition\",\n \"PandasOnDaskDataframePartition\",\n \"PandasOnUnidistDataframePartition\",\n ):\n return _unwrap_partitions()\n raise ValueError(\n f\"Do not know how to unwrap '{actual_engine}' underlying partitions\"\n )\n else:\n partitions = modin_frame._partition_mgr_cls.axis_partition(\n modin_frame._partitions, axis ^ 1\n )\n return [\n part.force_materialization(get_ip=get_ip).unwrap(\n squeeze=True, get_ip=get_ip\n )\n for part in partitions\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_partitions_from_partitions._axis_None_convert_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_partitions_from_partitions._axis_None_convert_2", "embedding": null, "metadata": {"file_path": "modin/distributed/dataframe/pandas/partitions.py", "file_name": "partitions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 129, "end_line": 189, "span_ids": ["from_partitions"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def from_partitions(\n partitions: list,\n axis: Optional[int],\n index: Optional[Axes] = None,\n columns: Optional[Axes] = None,\n row_lengths: Optional[list] = None,\n column_widths: Optional[list] = None,\n) -> DataFrame:\n \"\"\"\n Create DataFrame from remote partitions.\n\n Parameters\n ----------\n partitions : list\n A list of Ray.ObjectRef/Dask.Future to partitions depending on the engine used.\n Or a list of tuples of Ray.ObjectRef/Dask.Future to node ip addresses and partitions\n depending on the engine used (i.e. ``[(Ray.ObjectRef/Dask.Future, Ray.ObjectRef/Dask.Future), ...]``).\n axis : {None, 0 or 1}\n The ``axis`` parameter is used to identify what are the partitions passed.\n You have to set:\n\n * ``axis=0`` if you want to create DataFrame from row partitions\n * ``axis=1`` if you want to create DataFrame from column partitions\n * ``axis=None`` if you want to create DataFrame from 2D list of partitions\n index : sequence, optional\n The index for the DataFrame. Is computed if not provided.\n columns : sequence, optional\n The columns for the DataFrame. Is computed if not provided.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n\n Returns\n -------\n modin.pandas.DataFrame\n DataFrame instance created from remote partitions.\n\n Notes\n -----\n Pass `index`, `columns`, `row_lengths` and `column_widths` to avoid triggering\n extra computations of the metadata when creating a DataFrame.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n factory = FactoryDispatcher.get_factory()\n # TODO(https://github.com/modin-project/modin/issues/5127):\n # Remove these assertions once the dependencies of this function all have types.\n assert factory is not None\n assert factory.io_cls is not None\n assert factory.io_cls.frame_cls is not None\n assert factory.io_cls.frame_cls._partition_mgr_cls is not None # type: ignore[unreachable]\n partition_class = factory.io_cls.frame_cls._partition_mgr_cls._partition_class\n partition_frame_class = factory.io_cls.frame_cls\n partition_mgr_class = factory.io_cls.frame_cls._partition_mgr_cls\n\n # Since we store partitions of Modin DataFrame as a 2D NumPy array we need to place\n # passed partitions to 2D NumPy array to pass it to internal Modin Frame class.\n # `axis=None` - convert 2D list to 2D NumPy array\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_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_partitions.if_axis_is_None__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/distributed/dataframe/pandas/partitions.py_from_partitions.if_axis_is_None__", "embedding": null, "metadata": {"file_path": "modin/distributed/dataframe/pandas/partitions.py", "file_name": "partitions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 251, "span_ids": ["from_partitions"], "tokens": 561}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def from_partitions(\n partitions: list,\n axis: Optional[int],\n index: Optional[Axes] = None,\n columns: Optional[Axes] = None,\n row_lengths: Optional[list] = None,\n column_widths: Optional[list] = None,\n) -> DataFrame:\n # ... other code\n if axis is None:\n if isinstance(partitions[0][0], tuple):\n parts = np.array(\n [\n [partition_class(partition, ip=ip) for ip, partition in row]\n for row in partitions\n ]\n )\n else:\n parts = np.array(\n [\n [partition_class(partition) for partition in row]\n for row in partitions\n ]\n )\n # `axis=0` - place row partitions to 2D NumPy array so that each row of the array is one row partition.\n elif axis == 0:\n if isinstance(partitions[0], tuple):\n parts = np.array(\n [[partition_class(partition, ip=ip)] for ip, partition in partitions]\n )\n else:\n parts = np.array([[partition_class(partition)] for partition in partitions])\n # `axis=1` - place column partitions to 2D NumPy array so that each column of the array is one column partition.\n elif axis == 1:\n if isinstance(partitions[0], tuple):\n parts = np.array(\n [[partition_class(partition, ip=ip) for ip, partition in partitions]]\n )\n else:\n parts = np.array([[partition_class(partition) for partition in partitions]])\n else:\n raise ValueError(\n f\"Got unacceptable value of axis {axis}. Possible values are {0}, {1} or {None}.\"\n )\n\n labels_axis_to_sync = None\n if index is None:\n labels_axis_to_sync = 1\n index, internal_indices = partition_mgr_class.get_indices(0, parts)\n if row_lengths is None:\n row_lengths = [len(idx) for idx in internal_indices]\n\n if columns is None:\n labels_axis_to_sync = 0 if labels_axis_to_sync is None else -1\n columns, internal_indices = partition_mgr_class.get_indices(1, parts)\n if column_widths is None:\n column_widths = [len(idx) for idx in internal_indices]\n\n frame = partition_frame_class(\n parts,\n index,\n columns,\n row_lengths=row_lengths,\n column_widths=column_widths,\n )\n\n if labels_axis_to_sync != -1:\n frame.synchronize_labels(axis=labels_axis_to_sync)\n\n return DataFrame(query_compiler=PandasQueryCompiler(frame))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_from_typing_import_NoRetu_ErrorMessage.single_warning.cls_printed_warnings_add_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_from_typing_import_NoRetu_ErrorMessage.single_warning.cls_printed_warnings_add_", "embedding": null, "metadata": {"file_path": "modin/error_message.py", "file_name": "error_message.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 49, "span_ids": ["ErrorMessage.not_implemented", "ErrorMessage", "ErrorMessage.single_warning", "docstring"], "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": "from typing import NoReturn, Set\nimport warnings\nfrom modin.logging import get_logger\nfrom modin.utils import get_current_execution\n\n\nclass ErrorMessage(object):\n # Only print full ``default to pandas`` warning one time.\n printed_default_to_pandas = False\n printed_warnings: Set[int] = set() # Set of hashes of printed warnings\n\n @classmethod\n def not_implemented(cls, message: str = \"\") -> NoReturn:\n if message == \"\":\n message = \"This functionality is not yet available in Modin.\"\n get_logger().info(f\"Modin Error: NotImplementedError: {message}\")\n raise NotImplementedError(\n f\"{message}\\n\"\n + \"To request implementation, file an issue at \"\n + \"https://github.com/modin-project/modin/issues or, if that's \"\n + \"not possible, send an email to feature_requests@modin.org.\"\n )\n\n @classmethod\n def single_warning(cls, message: str) -> None:\n message_hash = hash(message)\n logger = get_logger()\n if message_hash in cls.printed_warnings:\n logger.debug(\n f\"Modin Warning: Single Warning: {message} was raised and suppressed.\"\n )\n return\n\n logger.debug(f\"Modin Warning: Single Warning: {message} was raised.\")\n warnings.warn(message)\n cls.printed_warnings.add(message_hash)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.default_to_pandas_ErrorMessage.default_to_pandas.warnings_warn_message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.default_to_pandas_ErrorMessage.default_to_pandas.warnings_warn_message_", "embedding": null, "metadata": {"file_path": "modin/error_message.py", "file_name": "error_message.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 72, "span_ids": ["ErrorMessage.default_to_pandas"], "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 ErrorMessage(object):\n\n @classmethod\n def default_to_pandas(cls, message: str = \"\", reason: str = \"\") -> None:\n if message != \"\":\n execution_str = get_current_execution()\n message = (\n f\"{message} is not currently supported by {execution_str}, \"\n + \"defaulting to pandas implementation.\"\n )\n else:\n message = \"Defaulting to pandas implementation.\"\n\n if not cls.printed_default_to_pandas:\n message = (\n f\"{message}\\n\"\n + \"Please refer to \"\n + \"https://modin.readthedocs.io/en/stable/supported_apis/defaulting_to_pandas.html for explanation.\"\n )\n cls.printed_default_to_pandas = True\n if reason:\n message += f\"\\nReason: {reason}\"\n get_logger().debug(f\"Modin Warning: Default to pandas: {message}\")\n warnings.warn(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_modin-project__modin/modin/error_message.py_ErrorMessage.catch_bugs_and_request_email_ErrorMessage.catch_bugs_and_request_email.if_failure_condition_.raise_Exception_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.catch_bugs_and_request_email_ErrorMessage.catch_bugs_and_request_email.if_failure_condition_.raise_Exception_", "embedding": null, "metadata": {"file_path": "modin/error_message.py", "file_name": "error_message.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 86, "span_ids": ["ErrorMessage.catch_bugs_and_request_email"], "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 ErrorMessage(object):\n\n @classmethod\n def catch_bugs_and_request_email(\n cls, failure_condition: bool, extra_log: str = \"\"\n ) -> None:\n if failure_condition:\n get_logger().info(f\"Modin Error: Internal Error: {extra_log}\")\n raise Exception(\n \"Internal Error. \"\n + \"Please visit https://github.com/modin-project/modin/issues \"\n + \"to file an issue with the traceback and the command that \"\n + \"caused this error. If you can't file a GitHub issue, \"\n + f\"please email bug_reports@modin.org.\\n{extra_log}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.non_verified_udf_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/error_message.py_ErrorMessage.non_verified_udf_", "embedding": null, "metadata": {"file_path": "modin/error_message.py", "file_name": "error_message.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 123, "span_ids": ["ErrorMessage.warn", "ErrorMessage.missmatch_with_pandas", "ErrorMessage.non_verified_udf", "ErrorMessage.bad_type_for_numpy_op", "ErrorMessage.not_initialized"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ErrorMessage(object):\n\n @classmethod\n def non_verified_udf(cls) -> None:\n get_logger().debug(\"Modin Warning: Non Verified UDF\")\n warnings.warn(\n \"User-defined function verification is still under development in Modin. \"\n + \"The function provided is not verified.\"\n )\n\n @classmethod\n def bad_type_for_numpy_op(cls, function_name: str, operand_type: type) -> None:\n cls.single_warning(\n f\"Modin NumPy only supports objects of modin.numpy.array types for {function_name}, not {operand_type}. Defaulting to NumPy.\"\n )\n\n @classmethod\n def missmatch_with_pandas(cls, operation: str, message: str) -> None:\n get_logger().debug(\n f\"Modin Warning: {operation} mismatch with pandas: {message}\"\n )\n cls.single_warning(\n f\"`{operation}` implementation has mismatches with pandas:\\n{message}.\"\n )\n\n @classmethod\n def warn(cls, message: str) -> None:\n warnings.warn(message)\n\n @classmethod\n def not_initialized(cls, engine: str, code: str) -> None:\n get_logger().debug(f\"Modin Warning: Not Initialized: {engine}\")\n warnings.warn(\n f\"{engine} execution environment not yet initialized. Initializing...\\n\"\n + \"To remove this warning, run the following python code before doing dataframe operations:\\n\"\n + f\"{code}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/batch/__init__.py_PandasQueryPipeline_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/__init__.py_PandasQueryPipeline_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 20, "span_ids": ["docstring"], "tokens": 22}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .pipeline import PandasQueryPipeline\n\n\n__all__ = [\n \"PandasQueryPipeline\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_from_typing_import_Callab_PandasQuery.__init__.self.operators.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_from_typing_import_Callab_PandasQuery.__init__.self.operators.None", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 84, "span_ids": ["PandasQuery.__init__", "PandasQuery", "docstring"], "tokens": 622}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Callable, Optional\nimport numpy as np\n\nimport modin.pandas as pd\nfrom modin.core.storage_formats.pandas import PandasQueryCompiler\nfrom modin.error_message import ErrorMessage\nfrom modin.core.execution.ray.implementations.pandas_on_ray.dataframe.dataframe import (\n PandasOnRayDataframe,\n)\nfrom modin.config import NPartitions\nfrom modin.utils import get_current_execution\n\n\nclass PandasQuery(object):\n \"\"\"\n Internal representation of a single query in a pipeline.\n\n This object represents a single function to be pipelined in a batch pipeline.\n\n Parameters\n ----------\n func : Callable\n The function to apply to the dataframe.\n is_output : bool, default: False\n Whether this query is an output query and should be passed both to the next query, and\n directly to postprocessing.\n repartition_after : bool, default: False\n Whether to repartition after this query is computed. Currently, repartitioning is only\n supported if there is 1 partition prior to repartitioning.\n fan_out : bool, default: False\n Whether to fan out this node. If True and only 1 partition is passed as input, the partition\n is replicated `PandasQueryPipeline.num_partitions` (default: `NPartitions.get`) times, and\n the function is called on each. The `reduce_fn` must also be specified.\n pass_partition_id : bool, default: False\n Whether to pass the numerical partition id to the query.\n reduce_fn : Callable, default: None\n The reduce function to apply if `fan_out` is set to True. This takes the\n `PandasQueryPipeline.num_partitions` (default: `NPartitions.get`) partitions that result from\n this query, and combines them into 1 partition.\n output_id : int, default: None\n An id to assign to this node if it is an output.\n\n Notes\n -----\n `func` must be a function that is applied along an axis of the dataframe.\n\n Use `pandas` for any module level functions inside `func` since it operates directly on\n partitions.\n \"\"\"\n\n def __init__(\n self,\n func: Callable,\n is_output: bool = False,\n repartition_after: bool = False,\n fan_out: bool = False,\n pass_partition_id: bool = False,\n reduce_fn: Optional[Callable] = None,\n output_id: Optional[int] = None,\n ):\n self.func = func\n self.is_output = is_output\n self.repartition_after = repartition_after\n self.fan_out = fan_out\n self.pass_partition_id = pass_partition_id\n self.reduce_fn = reduce_fn\n self.output_id = output_id\n # List of sub-queries to feed into this query, if this query is an output node.\n self.operators = 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_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline_PandasQueryPipeline.__init__.self.is_output_id_specified._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline_PandasQueryPipeline.__init__.self.is_output_id_specified._", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 122, "span_ids": ["PandasQueryPipeline.__init__", "PandasQueryPipeline"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasQueryPipeline(object):\n \"\"\"\n Internal representation of a query pipeline.\n\n This object keeps track of the functions that compose to form a query pipeline.\n\n Parameters\n ----------\n df : modin.pandas.Dataframe\n The dataframe to perform this pipeline on.\n num_partitions : int, optional\n The number of partitions to maintain for the batched dataframe.\n If not specified, the value is assumed equal to ``NPartitions.get()``.\n\n Notes\n -----\n Only row-parallel pipelines are supported. All queries will be applied along the row axis.\n \"\"\"\n\n def __init__(self, df, num_partitions: Optional[int] = None):\n if get_current_execution() != \"PandasOnRay\" or (\n not isinstance(df._query_compiler._modin_frame, PandasOnRayDataframe)\n ): # pragma: no cover\n ErrorMessage.not_implemented(\n \"Batch Pipeline API is only implemented for `PandasOnRay` execution.\"\n )\n ErrorMessage.single_warning(\n \"The Batch Pipeline API is an experimental feature and still under development in Modin.\"\n )\n self.df = df\n self.num_partitions = num_partitions if num_partitions else NPartitions.get()\n self.outputs = [] # List of output queries.\n self.query_list = [] # List of all queries.\n self.is_output_id_specified = (\n False # Flag to indicate that `output_id` has been specified for a node.\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.update_df_PandasQueryPipeline.update_df.self.df.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.update_df_PandasQueryPipeline.update_df.self.df.df", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 139, "span_ids": ["PandasQueryPipeline.update_df"], "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 PandasQueryPipeline(object):\n\n def update_df(self, df):\n \"\"\"\n Update the dataframe to perform this pipeline on.\n\n Parameters\n ----------\n df : modin.pandas.DataFrame\n The new dataframe to perform this pipeline on.\n \"\"\"\n if get_current_execution() != \"PandasOnRay\" or (\n not isinstance(df._query_compiler._modin_frame, PandasOnRayDataframe)\n ): # pragma: no cover\n ErrorMessage.not_implemented(\n \"Batch Pipeline API is only implemented for `PandasOnRay` execution.\"\n )\n self.df = df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.add_query_PandasQueryPipeline.add_query.None_2.self.query_list._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.add_query_PandasQueryPipeline.add_query.None_2.self.query_list._", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 206, "span_ids": ["PandasQueryPipeline.add_query"], "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": "class PandasQueryPipeline(object):\n\n def add_query(\n self,\n func: Callable,\n is_output: bool = False,\n repartition_after: bool = False,\n fan_out: bool = False,\n pass_partition_id: bool = False,\n reduce_fn: Optional[Callable] = None,\n output_id: Optional[int] = None,\n ):\n \"\"\"\n Add a query to the current pipeline.\n\n Parameters\n ----------\n func : Callable\n DataFrame query to perform.\n is_output : bool, default: False\n Whether this query should be designated as an output query. If `True`, the output of\n this query is passed both to the next query and directly to postprocessing.\n repartition_after : bool, default: False\n Whether the dataframe should be repartitioned after this query. Currently,\n repartitioning is only supported if there is 1 partition prior.\n fan_out : bool, default: False\n Whether to fan out this node. If True and only 1 partition is passed as input, the\n partition is replicated `self.num_partitions` (default: `NPartitions.get`) times,\n and the function is called on each. The `reduce_fn` must also be specified.\n pass_partition_id : bool, default: False\n Whether to pass the numerical partition id to the query.\n reduce_fn : Callable, default: None\n The reduce function to apply if `fan_out` is set to True. This takes the\n `self.num_partitions` (default: `NPartitions.get`) partitions that result from this\n query, and combines them into 1 partition.\n output_id : int, default: None\n An id to assign to this node if it is an output.\n\n Notes\n -----\n Use `pandas` for any module level functions inside `func` since it operates directly on\n partitions.\n \"\"\"\n if not is_output and output_id is not None:\n raise ValueError(\"Output ID cannot be specified for non-output node.\")\n if is_output:\n if not self.is_output_id_specified and output_id is not None:\n if len(self.outputs) != 0:\n raise ValueError(\"Output ID must be specified for all nodes.\")\n if output_id is None and self.is_output_id_specified:\n raise ValueError(\"Output ID must be specified for all nodes.\")\n self.query_list.append(\n PandasQuery(\n func,\n is_output,\n repartition_after,\n fan_out,\n pass_partition_id,\n reduce_fn,\n output_id,\n )\n )\n if is_output:\n self.outputs.append(self.query_list[-1])\n if output_id is not None:\n self.is_output_id_specified = True\n self.outputs[-1].operators = self.query_list[:-1]\n self.query_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_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline._complete_nodes_PandasQueryPipeline._complete_nodes.return.partitions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline._complete_nodes_PandasQueryPipeline._complete_nodes.return.partitions", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 285, "span_ids": ["PandasQueryPipeline._complete_nodes"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PandasQueryPipeline(object):\n\n def _complete_nodes(self, list_of_nodes, partitions):\n \"\"\"\n Run a sub-query end to end.\n\n Parameters\n ----------\n list_of_nodes : list of PandasQuery\n The functions that compose this query.\n partitions : list of PandasOnRayDataframeVirtualPartition\n The partitions that compose the dataframe that is input to this sub-query.\n\n Returns\n -------\n list of PandasOnRayDataframeVirtualPartition\n The partitions that result from computing the functions represented by `list_of_nodes`.\n \"\"\"\n for node in list_of_nodes:\n if node.fan_out:\n if len(partitions) > 1:\n ErrorMessage.not_implemented(\n \"Fan out is only supported with DataFrames with 1 partition.\"\n )\n partitions[0] = partitions[0].force_materialization()\n partition_list = partitions[0].list_of_block_partitions\n partitions[0] = partitions[0].add_to_apply_calls(node.func, 0)\n partitions[0].drain_call_queue(num_splits=1)\n new_dfs = []\n for i in range(1, self.num_partitions):\n new_dfs.append(\n type(partitions[0])(\n partition_list,\n full_axis=partitions[0].full_axis,\n ).add_to_apply_calls(node.func, i)\n )\n new_dfs[-1].drain_call_queue(num_splits=1)\n\n def reducer(df):\n df_inputs = [df]\n for df in new_dfs:\n df_inputs.append(df.to_pandas())\n return node.reduce_fn(df_inputs)\n\n partitions = [partitions[0].add_to_apply_calls(reducer)]\n elif node.repartition_after:\n if len(partitions) > 1:\n ErrorMessage.not_implemented(\n \"Dynamic repartitioning is currently only supported for DataFrames with 1 partition.\"\n )\n partitions[0] = (\n partitions[0].add_to_apply_calls(node.func).force_materialization()\n )\n new_dfs = []\n\n def mask_partition(df, i): # pragma: no cover\n new_length = len(df.index) // self.num_partitions\n if i == self.num_partitions - 1:\n return df.iloc[i * new_length :]\n return df.iloc[i * new_length : (i + 1) * new_length]\n\n for i in range(self.num_partitions):\n new_dfs.append(\n type(partitions[0])(\n partitions[0].list_of_block_partitions,\n full_axis=partitions[0].full_axis,\n ).add_to_apply_calls(mask_partition, i)\n )\n partitions = new_dfs\n else:\n if node.pass_partition_id:\n partitions = [\n part.add_to_apply_calls(node.func, i)\n for i, part in enumerate(partitions)\n ]\n else:\n partitions = [\n part.add_to_apply_calls(node.func) for part in partitions\n ]\n return partitions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.compute_batch_PandasQueryPipeline.compute_batch.None_4.else_.id_df_iter.enumerate_outs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.compute_batch_PandasQueryPipeline.compute_batch.None_4.else_.id_df_iter.enumerate_outs_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 364, "span_ids": ["PandasQueryPipeline.compute_batch"], "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": "class PandasQueryPipeline(object):\n\n def compute_batch(\n self,\n postprocessor: Optional[Callable] = None,\n pass_partition_id: Optional[bool] = False,\n pass_output_id: Optional[bool] = False,\n ):\n \"\"\"\n Run the completed pipeline + any postprocessing steps end to end.\n\n Parameters\n ----------\n postprocessor : Callable, default: None\n A postprocessing function to be applied to each output partition.\n The order of arguments passed is `df` (the partition), `output_id`\n (if `pass_output_id=True`), and `partition_id` (if `pass_partition_id=True`).\n pass_partition_id : bool, default: False\n Whether or not to pass the numerical partition id to the postprocessing function.\n pass_output_id : bool, default: False\n Whether or not to pass the output ID associated with output queries to the\n postprocessing function.\n\n Returns\n -------\n list or dict or DataFrame\n If output ids are specified, a dictionary mapping output id to the resulting dataframe\n is returned, otherwise, a list of the resulting dataframes is returned.\n \"\"\"\n if len(self.outputs) == 0:\n ErrorMessage.single_warning(\n \"No outputs to compute. Returning an empty list. Please specify outputs by calling `add_query` with `is_output=True`.\"\n )\n return []\n if not self.is_output_id_specified and pass_output_id:\n raise ValueError(\n \"`pass_output_id` is set to True, but output ids have not been specified. \"\n + \"To pass output ids, please specify them using the `output_id` kwarg with pipeline.add_query\"\n )\n if self.is_output_id_specified:\n outs = {}\n else:\n outs = []\n modin_frame = self.df._query_compiler._modin_frame\n partitions = modin_frame._partition_mgr_cls.row_partitions(\n modin_frame._partitions\n )\n for node in self.outputs:\n partitions = self._complete_nodes(node.operators + [node], partitions)\n for part in partitions:\n part.drain_call_queue(num_splits=1)\n if postprocessor:\n output_partitions = []\n for partition_id, partition in enumerate(partitions):\n args = []\n if pass_output_id:\n args.append(node.output_id)\n if pass_partition_id:\n args.append(partition_id)\n output_partitions.append(\n partition.add_to_apply_calls(postprocessor, *args)\n )\n else:\n output_partitions = [\n part.add_to_apply_calls(lambda df: df) for part in partitions\n ]\n [\n part.drain_call_queue(num_splits=self.num_partitions)\n for part in output_partitions\n ] # Ensures our result df is block partitioned.\n if not self.is_output_id_specified:\n outs.append(output_partitions)\n else:\n outs[node.output_id] = output_partitions\n if self.is_output_id_specified:\n final_results = {}\n id_df_iter = outs.items()\n else:\n final_results = [None] * len(outs)\n id_df_iter = enumerate(outs)\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_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.compute_batch.for_id_df_in_id_df_iter__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/pipeline.py_PandasQueryPipeline.compute_batch.for_id_df_in_id_df_iter__", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 366, "end_line": 386, "span_ids": ["PandasQueryPipeline.compute_batch"], "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 PandasQueryPipeline(object):\n\n def compute_batch(\n self,\n postprocessor: Optional[Callable] = None,\n pass_partition_id: Optional[bool] = False,\n pass_output_id: Optional[bool] = False,\n ):\n # ... other code\n\n for id, df in id_df_iter:\n partitions = []\n for row_partition in df:\n partitions.append(row_partition.list_of_block_partitions)\n partitions = np.array(partitions)\n partition_mgr_class = PandasOnRayDataframe._partition_mgr_cls\n index, internal_rows = partition_mgr_class.get_indices(0, partitions)\n columns, internal_cols = partition_mgr_class.get_indices(1, partitions)\n result_modin_frame = PandasOnRayDataframe(\n partitions,\n index,\n columns,\n row_lengths=list(map(len, internal_rows)),\n column_widths=list(map(len, internal_cols)),\n )\n query_compiler = PandasQueryCompiler(result_modin_frame)\n result_df = pd.DataFrame(query_compiler=query_compiler)\n final_results[id] = result_df\n\n return final_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_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_pytest_TestPipelineRayEngine.test_warnings.assert_output_Emp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_pytest_TestPipelineRayEngine.test_warnings.assert_output_Emp", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 46, "span_ids": ["TestPipelineRayEngine", "TestPipelineRayEngine.test_warnings", "docstring"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport numpy as np\nimport pandas\n\nimport modin.pandas as pd\nfrom modin.config import Engine, NPartitions\nfrom modin.distributed.dataframe.pandas.partitions import from_partitions\nfrom modin.experimental.batch.pipeline import PandasQueryPipeline\nfrom modin.pandas.test.utils import df_equals\nfrom modin.core.execution.ray.common import RayWrapper\n\n\n@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n def test_warnings(self):\n \"\"\"Ensure that creating a Pipeline object raises the correct warnings.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n # Ensure that building a pipeline warns users that it is an experimental feature\n with pytest.warns(\n UserWarning,\n match=\"The Batch Pipeline API is an experimental feature and still under development in Modin.\",\n ):\n pipeline = PandasQueryPipeline(df)\n with pytest.warns(\n UserWarning,\n match=\"No outputs to compute. Returning an empty list. Please specify outputs by calling `add_query` with `is_output=True`.\",\n ):\n output = pipeline.compute_batch()\n assert output == [], \"Empty pipeline did not return an empty 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_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_pipeline_simple_TestPipelineRayEngine.test_pipeline_simple.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_pipeline_simple_TestPipelineRayEngine.test_pipeline_simple.assert_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 94, "span_ids": ["TestPipelineRayEngine.test_pipeline_simple"], "tokens": 474}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_pipeline_simple(self):\n \"\"\"Create a simple pipeline and ensure that it runs end to end correctly.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n\n def add_col(df):\n df[\"new_col\"] = df.sum(axis=1)\n return df\n\n # Build pipeline\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(add_col)\n pipeline.add_query(lambda df: df * -30)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)})\n )\n\n def add_row_to_partition(df):\n return pandas.concat([df, df.iloc[[-1]]])\n\n pipeline.add_query(add_row_to_partition, is_output=True)\n new_df = pipeline.compute_batch()[0]\n # Build df without pipelining to ensure correctness\n correct_df = add_col(pd.DataFrame(arr))\n correct_df *= -30\n correct_df = pd.DataFrame(\n correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})._to_pandas()\n )\n correct_modin_frame = correct_df._query_compiler._modin_frame\n partitions = correct_modin_frame._partition_mgr_cls.row_partitions(\n correct_modin_frame._partitions\n )\n partitions = [\n partition.add_to_apply_calls(add_row_to_partition)\n for partition in partitions\n ]\n [partition.drain_call_queue() for partition in partitions]\n partitions = [partition.list_of_blocks for partition in partitions]\n correct_df = from_partitions(partitions, axis=None)\n # Compare pipelined and non-pipelined df\n df_equals(correct_df, new_df)\n # Ensure that setting `num_partitions` when creating a pipeline does not change `NPartitions`\n num_partitions = NPartitions.get()\n PandasQueryPipeline(df, num_partitions=(num_partitions - 1))\n assert (\n NPartitions.get() == num_partitions\n ), \"Pipeline did not change NPartitions.get()\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_update_df_TestPipelineRayEngine.test_update_df.df_equals_df_1_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_update_df_TestPipelineRayEngine.test_update_df.df_equals_df_1_3_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 104, "span_ids": ["TestPipelineRayEngine.test_update_df"], "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": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_update_df(self):\n \"\"\"Ensure that `update_df` updates the df that the pipeline runs on.\"\"\"\n df = pd.DataFrame([[1, 2, 3], [4, 5, 6]])\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df + 3, is_output=True)\n new_df = df * -1\n pipeline.update_df(new_df)\n output_df = pipeline.compute_batch()[0]\n df_equals((df * -1) + 3, output_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_multiple_outputs_TestPipelineRayEngine.test_multiple_outputs._Third_output_computed_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_multiple_outputs_TestPipelineRayEngine.test_multiple_outputs._Third_output_computed_c", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 106, "end_line": 124, "span_ids": ["TestPipelineRayEngine.test_multiple_outputs"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_multiple_outputs(self):\n \"\"\"Create a pipeline with multiple outputs, and check that all are computed correctly.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n )\n pipeline.add_query(lambda df: df + 30, is_output=True)\n new_dfs = pipeline.compute_batch()\n assert len(new_dfs) == 3, \"Pipeline did not return all outputs\"\n correct_df = pd.DataFrame(arr) * -30\n df_equals(correct_df, new_dfs[0]) # First output computed correctly\n correct_df = correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})\n df_equals(correct_df, new_dfs[1]) # Second output computed correctly\n correct_df += 30\n df_equals(correct_df, new_dfs[2]) # Third output computed correctly", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_output_id_TestPipelineRayEngine.test_output_id.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_output_id_TestPipelineRayEngine.test_output_id.None_2", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 172, "span_ids": ["TestPipelineRayEngine.test_output_id"], "tokens": 510}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_output_id(self):\n \"\"\"Ensure `output_id` is handled correctly when passed.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df, 0)\n pipeline.add_query(lambda df: df * -30, is_output=True, output_id=20)\n with pytest.raises(\n ValueError, match=\"Output ID must be specified for all nodes.\"\n ):\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n )\n assert (\n len(pipeline.query_list) == 0 and len(pipeline.outputs) == 1\n ), \"Invalid `add_query` incorrectly added a node to the pipeline.\"\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True)\n with pytest.raises(\n ValueError, match=\"Output ID must be specified for all nodes.\"\n ):\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n output_id=20,\n )\n assert (\n len(pipeline.query_list) == 0 and len(pipeline.outputs) == 1\n ), \"Invalid `add_query` incorrectly added a node to the pipeline.\"\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df, is_output=True)\n with pytest.raises(\n ValueError,\n match=(\n \"`pass_output_id` is set to True, but output ids have not been specified. \"\n + \"To pass output ids, please specify them using the `output_id` kwarg with pipeline.add_query\"\n ),\n ):\n pipeline.compute_batch(postprocessor=lambda df: df, pass_output_id=True)\n with pytest.raises(\n ValueError,\n match=\"Output ID cannot be specified for non-output node.\",\n ):\n pipeline.add_query(lambda df: df, output_id=22)\n assert (\n len(pipeline.query_list) == 0 and len(pipeline.outputs) == 1\n ), \"Invalid `add_query` incorrectly added a node to the pipeline.\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_output_id_multiple_outputs_TestPipelineRayEngine.test_output_id_multiple_outputs._Third_output_computed_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_output_id_multiple_outputs_TestPipelineRayEngine.test_output_id_multiple_outputs._Third_output_computed_c", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 174, "end_line": 199, "span_ids": ["TestPipelineRayEngine.test_output_id_multiple_outputs"], "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": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_output_id_multiple_outputs(self):\n \"\"\"Ensure `output_id` is handled correctly when multiple outputs are computed.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True, output_id=20)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n output_id=21,\n )\n pipeline.add_query(lambda df: df + 30, is_output=True, output_id=22)\n new_dfs = pipeline.compute_batch()\n assert isinstance(\n new_dfs, dict\n ), \"Pipeline did not return a dictionary mapping output_ids to dfs\"\n assert 20 in new_dfs, \"Output ID 1 not cached correctly\"\n assert 21 in new_dfs, \"Output ID 2 not cached correctly\"\n assert 22 in new_dfs, \"Output ID 3 not cached correctly\"\n assert len(new_dfs) == 3, \"Pipeline did not return all outputs\"\n correct_df = pd.DataFrame(arr) * -30\n df_equals(correct_df, new_dfs[20]) # First output computed correctly\n correct_df = correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})\n df_equals(correct_df, new_dfs[21]) # Second output computed correctly\n correct_df += 30\n df_equals(correct_df, new_dfs[22]) # Third output computed correctly", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_TestPipelineRayEngine.test_postprocessing.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_TestPipelineRayEngine.test_postprocessing.None_5", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 201, "end_line": 229, "span_ids": ["TestPipelineRayEngine.test_postprocessing"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_postprocessing(self):\n \"\"\"Check that the `postprocessor` argument to `_compute_batch` is handled correctly.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n )\n pipeline.add_query(lambda df: df + 30, is_output=True)\n\n def new_col_adder(df):\n df[\"new_col\"] = df.iloc[:, -1]\n return df\n\n new_dfs = pipeline.compute_batch(postprocessor=new_col_adder)\n assert len(new_dfs) == 3, \"Pipeline did not return all outputs\"\n correct_df = pd.DataFrame(arr) * -30\n correct_df[\"new_col\"] = correct_df.iloc[:, -1]\n df_equals(correct_df, new_dfs[0])\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df = correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})\n correct_df[\"new_col\"] = correct_df.iloc[:, -1]\n df_equals(correct_df, new_dfs[1])\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df += 30\n correct_df[\"new_col\"] = correct_df.iloc[:, -1]\n df_equals(correct_df, new_dfs[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_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_output_id_TestPipelineRayEngine.test_postprocessing_with_output_id.assert_len_new_dfs_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_output_id_TestPipelineRayEngine.test_postprocessing_with_output_id.assert_len_new_dfs_3_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 231, "end_line": 249, "span_ids": ["TestPipelineRayEngine.test_postprocessing_with_output_id"], "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.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_postprocessing_with_output_id(self):\n \"\"\"Check that the `postprocessor` argument is correctly handled when `output_id` is specified.\"\"\"\n\n def new_col_adder(df):\n df[\"new_col\"] = df.iloc[:, -1]\n return df\n\n arr = np.random.randint(0, 1000, (1000, 1000))\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True, output_id=20)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n output_id=21,\n )\n pipeline.add_query(lambda df: df + 30, is_output=True, output_id=22)\n new_dfs = pipeline.compute_batch(postprocessor=new_col_adder)\n assert len(new_dfs) == 3, \"Pipeline did not return all outputs\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_output_id_passed_TestPipelineRayEngine.test_postprocessing_with_output_id_passed.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_output_id_passed_TestPipelineRayEngine.test_postprocessing_with_output_id_passed.None_5", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 251, "end_line": 281, "span_ids": ["TestPipelineRayEngine.test_postprocessing_with_output_id_passed"], "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": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_postprocessing_with_output_id_passed(self):\n \"\"\"Check that the `postprocessor` argument is correctly passed `output_id` when `pass_output_id` is `True`.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n\n def new_col_adder(df, o_id):\n df[\"new_col\"] = o_id\n return df\n\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True, output_id=20)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n output_id=21,\n )\n pipeline.add_query(lambda df: df + 30, is_output=True, output_id=22)\n new_dfs = pipeline.compute_batch(\n postprocessor=new_col_adder, pass_output_id=True\n )\n correct_df = pd.DataFrame(arr) * -30\n correct_df[\"new_col\"] = 20\n df_equals(correct_df, new_dfs[20])\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df = correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})\n correct_df[\"new_col\"] = 21\n df_equals(correct_df, new_dfs[21])\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df += 30\n correct_df[\"new_col\"] = 22\n df_equals(correct_df, new_dfs[22])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_partition_id_TestPipelineRayEngine.test_postprocessing_with_partition_id.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_partition_id_TestPipelineRayEngine.test_postprocessing_with_partition_id.None_3", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 283, "end_line": 330, "span_ids": ["TestPipelineRayEngine.test_postprocessing_with_partition_id"], "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": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_postprocessing_with_partition_id(self):\n \"\"\"Check that the postprocessing is correctly handled when `partition_id` is passed.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n\n def new_col_adder(df, partition_id):\n df[\"new_col\"] = partition_id\n return df\n\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True, output_id=20)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n output_id=21,\n )\n new_dfs = pipeline.compute_batch(\n postprocessor=new_col_adder, pass_partition_id=True\n )\n correct_df = pd.DataFrame(arr) * -30\n correct_modin_frame = correct_df._query_compiler._modin_frame\n partitions = correct_modin_frame._partition_mgr_cls.row_partitions(\n correct_modin_frame._partitions\n )\n partitions = [\n partition.add_to_apply_calls(new_col_adder, i)\n for i, partition in enumerate(partitions)\n ]\n [partition.drain_call_queue() for partition in partitions]\n partitions = [partition.list_of_blocks for partition in partitions]\n correct_df = from_partitions(partitions, axis=None)\n df_equals(correct_df, new_dfs[20])\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df = pd.DataFrame(\n correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})._to_pandas()\n )\n correct_modin_frame = correct_df._query_compiler._modin_frame\n partitions = correct_modin_frame._partition_mgr_cls.row_partitions(\n correct_modin_frame._partitions\n )\n partitions = [\n partition.add_to_apply_calls(new_col_adder, i)\n for i, partition in enumerate(partitions)\n ]\n [partition.drain_call_queue() for partition in partitions]\n partitions = [partition.list_of_blocks for partition in partitions]\n correct_df = from_partitions(partitions, axis=None)\n df_equals(correct_df, new_dfs[21])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_all_metadata_TestPipelineRayEngine.test_postprocessing_with_all_metadata.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_postprocessing_with_all_metadata_TestPipelineRayEngine.test_postprocessing_with_all_metadata.None_3", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 332, "end_line": 379, "span_ids": ["TestPipelineRayEngine.test_postprocessing_with_all_metadata"], "tokens": 533}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_postprocessing_with_all_metadata(self):\n \"\"\"Check that postprocessing is correctly handled when `partition_id` and `output_id` are passed.\"\"\"\n arr = np.random.randint(0, 1000, (1000, 1000))\n\n def new_col_adder(df, o_id, partition_id):\n df[\"new_col\"] = f\"{o_id} {partition_id}\"\n return df\n\n df = pd.DataFrame(arr)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(lambda df: df * -30, is_output=True, output_id=20)\n pipeline.add_query(\n lambda df: df.rename(columns={i: f\"col {i}\" for i in range(1000)}),\n is_output=True,\n output_id=21,\n )\n new_dfs = pipeline.compute_batch(\n postprocessor=new_col_adder, pass_partition_id=True, pass_output_id=True\n )\n correct_df = pd.DataFrame(arr) * -30\n correct_modin_frame = correct_df._query_compiler._modin_frame\n partitions = correct_modin_frame._partition_mgr_cls.row_partitions(\n correct_modin_frame._partitions\n )\n partitions = [\n partition.add_to_apply_calls(new_col_adder, 20, i)\n for i, partition in enumerate(partitions)\n ]\n [partition.drain_call_queue() for partition in partitions]\n partitions = [partition.list_of_blocks for partition in partitions]\n correct_df = from_partitions(partitions, axis=None)\n df_equals(correct_df, new_dfs[20])\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df = pd.DataFrame(\n correct_df.rename(columns={i: f\"col {i}\" for i in range(1000)})._to_pandas()\n )\n correct_modin_frame = correct_df._query_compiler._modin_frame\n partitions = correct_modin_frame._partition_mgr_cls.row_partitions(\n correct_modin_frame._partitions\n )\n partitions = [\n partition.add_to_apply_calls(new_col_adder, 21, i)\n for i, partition in enumerate(partitions)\n ]\n [partition.drain_call_queue() for partition in partitions]\n partitions = [partition.list_of_blocks for partition in partitions]\n correct_df = from_partitions(partitions, axis=None)\n df_equals(correct_df, new_dfs[21])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_repartition_after_TestPipelineRayEngine.test_repartition_after.with_pytest_raises_.pipeline_compute_batch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_repartition_after_TestPipelineRayEngine.test_repartition_after.with_pytest_raises_.pipeline_compute_batch_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 381, "end_line": 412, "span_ids": ["TestPipelineRayEngine.test_repartition_after"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_repartition_after(self):\n \"\"\"Check that the `repartition_after` argument is appropriately handled.\"\"\"\n df = pd.DataFrame([list(range(1000))])\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(\n lambda df: pandas.concat([df] * 1000), repartition_after=True\n )\n\n def new_col_adder(df, partition_id):\n df[\"new_col\"] = partition_id\n return df\n\n pipeline.add_query(new_col_adder, is_output=True, pass_partition_id=True)\n new_dfs = pipeline.compute_batch()\n # new_col_adder should set `new_col` to the partition ID\n # throughout the dataframe. We expect there to be\n # NPartitions.get() partitions by the time new_col_adder runs,\n # because the previous step has repartitioned.\n assert len(new_dfs[0][\"new_col\"].unique()) == NPartitions.get()\n # Test that `repartition_after=True` raises an error when the result has more than\n # one partition.\n partition1 = RayWrapper.put(pandas.DataFrame([[0, 1, 2]]))\n partition2 = RayWrapper.put(pandas.DataFrame([[3, 4, 5]]))\n df = from_partitions([partition1, partition2], 0)\n pipeline = PandasQueryPipeline(df, 0)\n pipeline.add_query(lambda df: df, repartition_after=True, is_output=True)\n\n with pytest.raises(\n NotImplementedError,\n match=\"Dynamic repartitioning is currently only supported for DataFrames with 1 partition.\",\n ):\n pipeline.compute_batch()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_fan_out_TestPipelineRayEngine.test_fan_out.with_pytest_raises_.pipeline_compute_batch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_fan_out_TestPipelineRayEngine.test_fan_out.with_pytest_raises_.pipeline_compute_batch_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 414, "end_line": 457, "span_ids": ["TestPipelineRayEngine.test_fan_out"], "tokens": 407}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_fan_out(self):\n \"\"\"Check that the fan_out argument is appropriately handled.\"\"\"\n df = pd.DataFrame([[0, 1, 2]])\n\n def new_col_adder(df, partition_id):\n df[\"new_col\"] = partition_id\n return df\n\n def reducer(dfs):\n new_cols = \"\".join([str(df[\"new_col\"].values[0]) for df in dfs])\n dfs[0][\"new_col1\"] = new_cols\n return dfs[0]\n\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(\n new_col_adder,\n fan_out=True,\n reduce_fn=reducer,\n pass_partition_id=True,\n is_output=True,\n )\n new_df = pipeline.compute_batch()[0]\n correct_df = pd.DataFrame([[0, 1, 2]])\n correct_df[\"new_col\"] = 0\n correct_df[\"new_col1\"] = \"\".join([str(i) for i in range(NPartitions.get())])\n df_equals(correct_df, new_df)\n # Test that `fan_out=True` raises an error when the input has more than\n # one partition.\n partition1 = RayWrapper.put(pandas.DataFrame([[0, 1, 2]]))\n partition2 = RayWrapper.put(pandas.DataFrame([[3, 4, 5]]))\n df = from_partitions([partition1, partition2], 0)\n pipeline = PandasQueryPipeline(df)\n pipeline.add_query(\n new_col_adder,\n fan_out=True,\n reduce_fn=reducer,\n pass_partition_id=True,\n is_output=True,\n )\n with pytest.raises(\n NotImplementedError,\n match=\"Fan out is only supported with DataFrames with 1 partition.\",\n ):\n pipeline.compute_batch()[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_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_pipeline_complex_TestPipelineRayEngine.test_pipeline_complex.None_1.remove_f_i_csv_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_TestPipelineRayEngine.test_pipeline_complex_TestPipelineRayEngine.test_pipeline_complex.None_1.remove_f_i_csv_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 459, "end_line": 542, "span_ids": ["TestPipelineRayEngine.test_pipeline_complex"], "tokens": 778}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 Engine.get() != \"Ray\",\n reason=\"Only Ray supports the Batch Pipeline API\",\n)\nclass TestPipelineRayEngine:\n\n def test_pipeline_complex(self):\n \"\"\"Create a complex pipeline with both `fan_out`, `repartition_after` and postprocessing and ensure that it runs end to end correctly.\"\"\"\n from os.path import exists\n from os import remove\n from time import sleep\n\n df = pd.DataFrame([[0, 1, 2]])\n\n def new_col_adder(df, partition_id):\n sleep(60)\n df[\"new_col\"] = partition_id\n return df\n\n def reducer(dfs):\n new_cols = \"\".join([str(df[\"new_col\"].values[0]) for df in dfs])\n dfs[0][\"new_col1\"] = new_cols\n return dfs[0]\n\n desired_num_partitions = 24\n pipeline = PandasQueryPipeline(df, num_partitions=desired_num_partitions)\n pipeline.add_query(\n new_col_adder,\n fan_out=True,\n reduce_fn=reducer,\n pass_partition_id=True,\n is_output=True,\n output_id=20,\n )\n pipeline.add_query(\n lambda df: pandas.concat([df] * 1000),\n repartition_after=True,\n )\n\n def to_csv(df, partition_id):\n df = df.drop(columns=[\"new_col\"])\n df.to_csv(f\"{partition_id}.csv\")\n return df\n\n pipeline.add_query(to_csv, is_output=True, output_id=21, pass_partition_id=True)\n\n def post_proc(df, o_id, partition_id):\n df[\"new_col_proc\"] = f\"{o_id} {partition_id}\"\n return df\n\n new_dfs = pipeline.compute_batch(\n postprocessor=post_proc,\n pass_partition_id=True,\n pass_output_id=True,\n )\n correct_df = pd.DataFrame([[0, 1, 2]])\n correct_df[\"new_col\"] = 0\n correct_df[\"new_col1\"] = \"\".join(\n [str(i) for i in range(desired_num_partitions)]\n )\n correct_df[\"new_col_proc\"] = \"20 0\"\n df_equals(correct_df, new_dfs[20])\n correct_df = pd.concat([correct_df] * 1000)\n correct_df = correct_df.drop(columns=[\"new_col\"])\n correct_df[\"new_col_proc\"] = \"21 0\"\n new_length = len(correct_df.index) // desired_num_partitions\n for i in range(desired_num_partitions):\n if i == desired_num_partitions - 1:\n correct_df.iloc[i * new_length :, -1] = f\"21 {i}\"\n else:\n correct_df.iloc[i * new_length : (i + 1) * new_length, -1] = f\"21 {i}\"\n df_equals(correct_df, new_dfs[21])\n correct_df = correct_df.drop(columns=[\"new_col_proc\"])\n for i in range(desired_num_partitions):\n if i == desired_num_partitions - 1:\n correct_partition = correct_df.iloc[i * new_length :]\n else:\n correct_partition = correct_df.iloc[\n i * new_length : (i + 1) * new_length\n ]\n assert exists(\n f\"{i}.csv\"\n ), \"CSV File for Partition {i} does not exist, even though dataframe should have been repartitioned.\"\n df_equals(\n correct_partition,\n pd.read_csv(f\"{i}.csv\", index_col=\"Unnamed: 0\").rename(\n columns={\"0\": 0, \"1\": 1, \"2\": 2}\n ),\n )\n remove(f\"{i}.csv\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_test_pipeline_unsupported_engine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/batch/test/test_pipeline.py_test_pipeline_unsupported_engine_", "embedding": null, "metadata": {"file_path": "modin/experimental/batch/test/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 545, "end_line": 582, "span_ids": ["test_pipeline_unsupported_engine"], "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": "@pytest.mark.skipif(\n Engine.get() == \"Ray\",\n reason=\"Ray supports the Batch Pipeline API\",\n)\ndef test_pipeline_unsupported_engine():\n \"\"\"Ensure that trying to use the Pipeline API with an unsupported Engine raises errors.\"\"\"\n # Check that pipeline does not allow `Engine` to not be Ray.\n df = pd.DataFrame([[1]])\n with pytest.raises(\n NotImplementedError,\n match=\"Batch Pipeline API is only implemented for `PandasOnRay` execution.\",\n ):\n PandasQueryPipeline(df)\n\n eng = Engine.get()\n Engine.put(\"Ray\")\n # Check that even if Engine is Ray, if the df is not backed by Ray, the Pipeline does not allow initialization.\n with pytest.raises(\n NotImplementedError,\n match=\"Batch Pipeline API is only implemented for `PandasOnRay` execution.\",\n ):\n PandasQueryPipeline(df, 0)\n df_on_ray_engine = pd.DataFrame([[1]])\n pipeline = PandasQueryPipeline(df_on_ray_engine)\n # Check that even if Engine is Ray, if the new df is not backed by Ray, the Pipeline does not allow an update.\n with pytest.raises(\n NotImplementedError,\n match=\"Batch Pipeline API is only implemented for `PandasOnRay` execution.\",\n ):\n pipeline.update_df(df)\n Engine.put(eng)\n # Check that pipeline does not allow an update when `Engine` is not Ray.\n with pytest.raises(\n NotImplementedError,\n match=\"Batch Pipeline API is only implemented for `PandasOnRay` execution.\",\n ):\n pipeline.update_df(df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/__init__.py_ClusterError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/__init__.py_ClusterError_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 34, "span_ids": ["get_connection", "impl", "docstring"], "tokens": 100}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .base import ClusterError, CannotSpawnCluster, CannotDestroyCluster\nfrom .cluster import Provider, create as create_cluster\nfrom .connection import Connection\n\n\ndef get_connection():\n \"\"\"\n Returns an RPyC connection object to execute Python code remotely on the active cluster.\n \"\"\"\n return Connection.get()\n\n\n__all__ = [\n \"ClusterError\",\n \"CannotSpawnCluster\",\n \"CannotDestroyCluster\",\n \"Provider\",\n \"create_cluster\",\n \"get_connection\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/base.py_from_typing_import_NamedT_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/base.py_from_typing_import_NamedT_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 79, "span_ids": ["impl", "ClusterError", "ClusterError.__init__", "_which", "ConnectionDetails", "_get_ssh_proxy_command", "CannotSpawnCluster", "CannotDestroyCluster", "docstring", "ClusterError.__str__"], "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": "from typing import NamedTuple\nimport os\nimport sys\n\nfrom modin.config import SocksProxy\n\n\nclass ClusterError(Exception):\n \"\"\"\n Generic cluster operating exception\n \"\"\"\n\n def __init__(self, *args, cause: BaseException = None, traceback: str = None, **kw):\n self.cause = cause\n self.traceback = traceback\n super().__init__(*args, **kw)\n\n def __str__(self):\n if self.cause:\n return f\"cause: {self.cause}\\n{super().__str__()}\"\n return super().__str__()\n\n\nclass CannotSpawnCluster(ClusterError):\n \"\"\"\n Raised when cluster cannot be spawned in the cloud\n \"\"\"\n\n\nclass CannotDestroyCluster(ClusterError):\n \"\"\"\n Raised when cluster cannot be destroyed in the cloud\n \"\"\"\n\n\nclass ConnectionDetails(NamedTuple):\n user_name: str = \"modin\"\n key_file: str = None\n address: str = None\n port: int = 22\n\n\n_EXT = (\".exe\", \".com\", \".cmd\", \".bat\", \"\") if sys.platform == \"win32\" else (\"\",)\n\n\ndef _which(prog):\n for entry in os.environ[\"PATH\"].split(os.pathsep):\n for ext in _EXT:\n path = os.path.join(entry, prog + ext)\n if os.access(path, os.X_OK):\n return path\n return None\n\n\ndef _get_ssh_proxy_command():\n socks_proxy = SocksProxy.get()\n if socks_proxy is None:\n return None\n if _which(\"nc\"):\n return f\"nc -x {socks_proxy} %h %p\"\n elif _which(\"connect\"):\n return f\"connect -S {socks_proxy} %h %p\"\n raise ClusterError(\n \"SSH through proxy required but no supported proxying tools found\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_os_Provider.default_worker_type.return.self___DEFAULT_WORKER_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_os_Provider.default_worker_type.return.self___DEFAULT_WORKER_sel", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/cluster.py", "file_name": "cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 91, "span_ids": ["Provider.__init__", "Provider.default_head_type", "Provider", "Provider.default_worker_type", "docstring", "_RegionZone"], "tokens": 539}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport errno\nfrom typing import NamedTuple, Union\nimport atexit\nimport warnings\n\nfrom modin import set_execution\n\nfrom .base import ConnectionDetails\nfrom .connection import Connection\n\n\nclass _RegionZone(NamedTuple):\n region: str\n zone: str\n\n\nclass Provider:\n AWS = \"aws\"\n\n __KNOWN = {AWS: [_RegionZone(region=\"us-west-1\", zone=\"us-west-1a\")]}\n __DEFAULT_HEAD = {AWS: \"m5.large\"}\n __DEFAULT_WORKER = {AWS: \"m5.large\"}\n __DEFAULT_IMAGE = {AWS: \"ami-0f56279347d2fa43e\"}\n\n def __init__(\n self,\n name: str,\n credentials_file: str = None,\n region: str = None,\n zone: str = None,\n image: str = None,\n ):\n \"\"\"\n Class that holds all information about particular connection to cluster provider, namely\n * provider name (must be one of known ones)\n * path to file with credentials (file format is provider-specific); omit to use global provider-default credentials\n * region and zone where cluster is to be spawned (optional, would be deduced if omitted)\n * image to use (optional, would use default for provider if omitted)\n \"\"\"\n\n if name not in self.__KNOWN:\n raise ValueError(f\"Unknown provider name: {name}\")\n if credentials_file is not None and not os.path.exists(credentials_file):\n raise OSError(\n errno.ENOENT, \"Credentials file does not exist\", credentials_file\n )\n\n if region is None:\n if zone is not None:\n raise ValueError(\"Cannot specify a zone without specifying a region\")\n try:\n region, zone = self.__KNOWN[name][0]\n except IndexError:\n raise ValueError(f\"No defaults for provider {name}\")\n elif zone is None:\n for regzone in self.__KNOWN[name]:\n if regzone.region == region:\n zone = regzone.zone\n break\n else:\n raise ValueError(f\"No default for region {region} for provider {name}\")\n\n self.name = name\n self.region = region\n self.zone = zone\n self.credentials_file = (\n os.path.abspath(credentials_file) if credentials_file is not None else None\n )\n self.image = image or self.__DEFAULT_IMAGE[name]\n\n @property\n def default_head_type(self):\n return self.__DEFAULT_HEAD[self.name]\n\n @property\n def default_worker_type(self):\n return self.__DEFAULT_WORKER[self.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_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster_BaseCluster.__init__.self.connection.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster_BaseCluster.__init__.self.connection.None", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/cluster.py", "file_name": "cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 134, "span_ids": ["BaseCluster", "BaseCluster.__init__"], "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 BaseCluster:\n \"\"\"\n Cluster manager for Modin. Knows how to use certain tools to spawn and destroy clusters,\n can serve as context manager to switch execution engine and storage format to remote.\n \"\"\"\n\n target_engine = None\n target_storage_format = None\n wrap_cmd = None\n Connector = Connection\n\n def __init__(\n self,\n provider: Provider,\n project_name: str = None,\n cluster_name: str = \"modin-cluster\",\n worker_count: int = 4,\n head_node_type: str = None,\n worker_node_type: str = None,\n add_conda_packages: list = None,\n ):\n \"\"\"\n Prepare the cluster manager. It needs to know a few things:\n * which cloud provider to use\n * what is project name (could be omitted to use default one for account used to connect)\n * cluster name\n * worker count\n * head and worker node instance types (can be omitted to default to provider-defined)\n * custom conda packages for remote environment\n \"\"\"\n\n self.provider = provider\n self.project_name = project_name\n self.cluster_name = cluster_name\n self.worker_count = worker_count\n self.head_node_type = head_node_type or provider.default_head_type\n self.worker_node_type = worker_node_type or provider.default_worker_type\n self.add_conda_packages = add_conda_packages\n\n self.old_execution = None\n self.connection: Connection = 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_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster.spawn_BaseCluster.spawn.if_wait_.if_self_connection_is_Non.self.connection.self_Connector_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster.spawn_BaseCluster.spawn.if_wait_.if_self_connection_is_Non.self.connection.self_Connector_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/cluster.py", "file_name": "cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 152, "span_ids": ["BaseCluster.spawn"], "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 BaseCluster:\n\n def spawn(self, wait=False):\n \"\"\"\n Actually spawns the cluster. When already spawned, should be a no-op.\n Always call .spawn(True) before assuming a cluster is ready.\n\n When wait==False it spawns cluster asynchronously.\n \"\"\"\n self._spawn(wait=wait)\n atexit.register(self.destroy, wait=True)\n if wait:\n # cluster is ready now\n if self.connection is None:\n self.connection = self.Connector(\n self._get_connection_details(),\n self._get_main_python(),\n self.wrap_cmd,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster.destroy_BaseCluster._somewhere_in_the_innard": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_BaseCluster.destroy_BaseCluster._somewhere_in_the_innard", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/cluster.py", "file_name": "cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 205, "span_ids": ["BaseCluster.__exit__", "BaseCluster._destroy", "BaseCluster.__enter__", "BaseCluster._get_main_python", "BaseCluster.destroy", "BaseCluster._spawn", "BaseCluster._get_connection_details"], "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 BaseCluster:\n\n def destroy(self, wait=False):\n \"\"\"\n Destroys the cluster. When already destroyed, should be a no-op.\n Always call .destroy(True) before assuming a cluster is dead.\n\n When wait==False it destroys cluster asynchronously.\n \"\"\"\n if self.connection is not None:\n self.connection.stop()\n self._destroy(wait=wait)\n if wait:\n atexit.unregister(self.destroy)\n\n def _spawn(self, wait=False):\n \"\"\"\n Subclass must implement the real spawning\n \"\"\"\n raise NotImplementedError()\n\n def _destroy(self, wait=False):\n \"\"\"\n Subclass must implement the real destruction\n \"\"\"\n raise NotImplementedError()\n\n def _get_connection_details(self) -> ConnectionDetails:\n \"\"\"\n Gets the coordinates on how to connect to cluster frontend node.\n \"\"\"\n raise NotImplementedError()\n\n def _get_main_python(self) -> str:\n \"\"\"\n Gets the path to 'main' interpreter (the one that houses created environment for running everything)\n \"\"\"\n raise NotImplementedError()\n\n def __enter__(self):\n self.spawn(wait=True) # make sure cluster is ready\n self.connection.activate()\n self.old_execution = set_execution(\n self.target_engine, self.target_storage_format\n )\n return self\n\n def __exit__(self, *a, **kw):\n set_execution(*self.old_execution)\n self.connection.deactivate()\n self.old_execution = None\n\n # TODO: implement __del__() properly; naive implementation calling .destroy() crashes\n # somewhere in the innards of Ray when a cluster is destroyed during interpreter exit.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_create_create._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_create_create._", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/cluster.py", "file_name": "cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 276, "span_ids": ["create"], "tokens": 687}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create(\n provider: Union[Provider, str],\n credentials: str = None,\n region: str = None,\n zone: str = None,\n image: str = None,\n project_name: str = None,\n cluster_name: str = \"modin-cluster\",\n workers: int = 4,\n head_node: str = None,\n worker_node: str = None,\n add_conda_packages: list = None,\n cluster_type: str = \"rayscale\",\n) -> BaseCluster:\n \"\"\"\n Creates an instance of a cluster with desired characteristics in a cloud.\n Upon entering a context via with statement Modin will redirect its work to the remote cluster.\n Spawned cluster can be destroyed manually, or it will be destroyed when the program exits.\n\n Parameters\n ----------\n provider : str or instance of Provider class\n Specify the name of the provider to use or a Provider object.\n If Provider object is given, then credentials, region and zone are ignored.\n credentials : str, optional\n Path to the file which holds credentials used by given cloud provider.\n If not specified, cloud provider will use its default means of finding credentials on the system.\n region : str, optional\n Region in the cloud where to spawn the cluster.\n If omitted a default for given provider will be taken.\n zone : str, optional\n Availability zone (part of region) where to spawn the cluster.\n If omitted a default for given provider and region will be taken.\n image: str, optional\n Image to use for spawning head and worker nodes.\n If omitted a default for given provider will be taken.\n project_name : str, optional\n Project name to assign to the cluster in cloud, for easier manual tracking.\n cluster_name : str, optional\n Name to be given to the cluster.\n To spawn multiple clusters in single region and zone use different names.\n workers : int, optional\n How many worker nodes to spawn in the cluster. Head node is not counted for here.\n head_node : str, optional\n What machine type to use for head node in the cluster.\n worker_node : str, optional\n What machine type to use for worker nodes in the cluster.\n add_conda_packages : list, optional\n Custom conda packages for remote environments. By default remote modin version is\n the same as local version.\n cluster_type : str, optional\n How to spawn the cluster.\n Currently spawning by Ray autoscaler (\"rayscale\" for general and \"hdk\" for HDK-based) is supported\n\n Returns\n -------\n BaseCluster descendant\n The object that knows how to destroy the cluster and how to activate it as remote context.\n Note that by default spawning and destroying of the cluster happens in the background,\n as it's usually a rather lengthy process.\n\n Notes\n -----\n Cluster computation actually can work when proxies are required to access the cloud.\n You should set normal \"http_proxy\"/\"https_proxy\" variables for HTTP/HTTPS proxies and\n set \"MODIN_SOCKS_PROXY\" variable for SOCKS proxy before calling the function.\n\n Using SOCKS proxy requires Ray newer than 0.8.6, which might need to be installed manually.\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_modin-project__modin/modin/experimental/cloud/cluster.py_create.if_not_isinstance_provide_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/cluster.py_create.if_not_isinstance_provide_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/cluster.py", "file_name": "cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 310, "span_ids": ["create"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create(\n provider: Union[Provider, str],\n credentials: str = None,\n region: str = None,\n zone: str = None,\n image: str = None,\n project_name: str = None,\n cluster_name: str = \"modin-cluster\",\n workers: int = 4,\n head_node: str = None,\n worker_node: str = None,\n add_conda_packages: list = None,\n cluster_type: str = \"rayscale\",\n) -> BaseCluster:\n if not isinstance(provider, Provider) and cluster_type != \"local\":\n provider = Provider(\n name=provider,\n credentials_file=credentials,\n region=region,\n zone=zone,\n image=image,\n )\n else:\n if any(p is not None for p in (credentials, region, zone, image)):\n warnings.warn(\n \"Ignoring credentials, region, zone and image parameters because provider is specified as Provider descriptor, not as name\",\n UserWarning,\n )\n if cluster_type == \"rayscale\":\n from .rayscale import RayCluster as Spawner\n elif cluster_type == \"hdk\":\n from .hdk import RemoteHdk as Spawner\n elif cluster_type == \"local\":\n from .local_cluster import LocalCluster as Spawner\n else:\n raise ValueError(f\"Unknown cluster type: {cluster_type}\")\n instance = Spawner(\n provider,\n project_name,\n cluster_name,\n worker_count=workers,\n head_node_type=head_node,\n worker_node_type=worker_node,\n add_conda_packages=add_conda_packages,\n )\n instance.spawn(wait=False)\n return instance", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_subprocess_Connection._get_service.return.WrappingService": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_subprocess_Connection._get_service.return.WrappingService", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 112, "span_ids": ["Connection", "Connection._get_service", "Connection.get", "Connection.__wait_noexc", "Connection.__init__", "docstring"], "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": "import subprocess\nimport signal\nimport random\nimport time\nimport tempfile\nimport sys\n\nfrom .base import ClusterError, ConnectionDetails, _get_ssh_proxy_command\nfrom modin.config import DoLogRpyc\n\nRPYC_REQUEST_TIMEOUT = 2400\n\n\nclass Connection:\n __current = None\n connect_timeout = 10\n tries = 10\n rpyc_port = 18813\n\n @staticmethod\n def __wait_noexc(proc: subprocess.Popen, timeout: float):\n try:\n return proc.wait(timeout=timeout)\n except subprocess.TimeoutExpired:\n return None\n\n def __init__(\n self, details: ConnectionDetails, main_python: str, wrap_cmd=None, log_rpyc=None\n ):\n self.log_rpyc = log_rpyc if log_rpyc is not None else DoLogRpyc.get()\n self.proc = None\n self.wrap_cmd = wrap_cmd or subprocess.list2cmdline\n\n # find where rpyc_classic is located\n locator = self._run(\n self._build_sshcmd(details),\n [\n main_python,\n \"-c\",\n \"import os; from distutils.dist import Distribution; from distutils.command.install import install; cmd = install(Distribution()); cmd.finalize_options(); print(os.path.join(cmd.install_scripts, 'rpyc_classic.py'))\",\n ],\n )\n try:\n out, err = locator.communicate(timeout=self.connect_timeout)\n except subprocess.TimeoutExpired as ex:\n raise ClusterError(\n \"Cannot get path to rpyc_classic: cannot connect to host\", cause=ex\n )\n if locator.returncode != 0:\n raise ClusterError(\n f\"Cannot get path to rpyc_classic, return code: {locator.returncode}\"\n )\n rpyc_classic = out.splitlines()[0].strip().decode(\"utf8\")\n if not rpyc_classic:\n raise ClusterError(\"Got empty path to rpyc_classic\")\n\n port = self.rpyc_port\n cmd = [\n main_python,\n rpyc_classic,\n ]\n if self.log_rpyc:\n cmd.extend([\"--logfile\", f\"{tempfile.gettempdir()}/rpyc.log\"])\n for _ in range(self.tries):\n proc = self._run(\n self._build_sshcmd(details, forward_port=port),\n cmd + [\"--port\", str(port)],\n capture_out=False,\n )\n if self.__wait_noexc(proc, 3) is None:\n # started successfully\n self.proc = proc\n self.rpyc_port = port\n break\n # most likely port is busy, pick random one\n port = random.randint(1024, 65000)\n else:\n raise ClusterError(\"Unable to bind a local port when forwarding\")\n self.__connection = None\n self.__started = time.time()\n\n @classmethod\n def get(cls):\n if (\n not cls.__current\n or not cls.__current.proc\n or cls.__current.proc.poll() is not None\n ):\n raise ClusterError(\"SSH tunnel is not running\")\n if cls.__current.__connection is None:\n raise ClusterError(\"Connection not activated\")\n\n return cls.__current.__connection\n\n @staticmethod\n def _get_service():\n from .rpyc_proxy import WrappingService\n\n return WrappingService", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection.__try_connect_Connection.__try_connect.try_.except_ConnectionRefused.if_self_proc_poll_is_no.raise_ClusterError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection.__try_connect_Connection.__try_connect.try_.except_ConnectionRefused.if_self_proc_poll_is_no.raise_ClusterError_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 130, "span_ids": ["Connection.__try_connect"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Connection:\n\n def __try_connect(self):\n import rpyc\n\n try:\n stream = rpyc.SocketStream.connect(\n host=\"127.0.0.1\", port=self.rpyc_port, nodelay=True, keepalive=True\n )\n self.__connection = rpyc.connect_stream(\n stream,\n self._get_service(),\n config={\"sync_request_timeout\": RPYC_REQUEST_TIMEOUT},\n )\n except (ConnectionRefusedError, EOFError):\n if self.proc.poll() is not None:\n raise ClusterError(\n f\"SSH tunnel died, return code: {self.proc.returncode}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection.activate_Connection.__del__.self_stop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection.activate_Connection.__del__.self_stop_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 163, "span_ids": ["Connection.stop", "Connection.deactivate", "Connection.__del__", "Connection.activate"], "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 Connection:\n\n def activate(self):\n if self.__connection is None:\n self.__try_connect()\n while (\n self.__connection is None\n and time.time() < self.__started + self.connect_timeout + 1.0\n ):\n time.sleep(1.0)\n self.__try_connect()\n if self.__connection is None:\n raise ClusterError(\"Timeout establishing RPyC connection\")\n\n Connection.__current = self\n\n def deactivate(self):\n if Connection.__current is self:\n Connection.__current = None\n\n def stop(self, sigint=signal.SIGINT if sys.platform != \"win32\" else signal.SIGTERM):\n # capture signal number in closure so it won't get removed before __del__ is called\n # which might happen if connection is being destroyed during interpreter destruction\n self.deactivate()\n if self.proc and self.proc.poll() is None:\n self.proc.send_signal(sigint)\n if self.__wait_noexc(self.proc, self.connect_timeout) is None:\n self.proc.terminate()\n if self.__wait_noexc(self.proc, self.connect_timeout) is None:\n self.proc.kill()\n self.proc = None\n\n def __del__(self):\n self.stop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection._build_sshcmd_Connection._build_sshcmd.return.cmdline": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection._build_sshcmd_Connection._build_sshcmd.return.cmdline", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 189, "span_ids": ["Connection._build_sshcmd"], "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 Connection:\n\n def _build_sshcmd(self, details: ConnectionDetails, forward_port: int = None):\n opts = [\n (\"ConnectTimeout\", \"{}s\".format(self.connect_timeout)),\n (\"StrictHostKeyChecking\", \"no\"),\n # Try fewer extraneous key pairs.\n (\"IdentitiesOnly\", \"yes\"),\n # Abort if port forwarding fails (instead of just printing to stderr).\n (\"ExitOnForwardFailure\", \"yes\"),\n # Quickly kill the connection if network connection breaks (as opposed to hanging/blocking).\n (\"ServerAliveInterval\", 5),\n (\"ServerAliveCountMax\", 3),\n ]\n\n socks_proxy_cmd = _get_ssh_proxy_command()\n if socks_proxy_cmd:\n opts += [(\"ProxyCommand\", socks_proxy_cmd)]\n\n cmdline = [\"ssh\", \"-i\", details.key_file]\n for oname, ovalue in opts:\n cmdline.extend([\"-o\", f\"{oname}={ovalue}\"])\n if forward_port:\n cmdline.extend([\"-L\", f\"127.0.0.1:{forward_port}:127.0.0.1:{forward_port}\"])\n cmdline.append(f\"{details.user_name}@{details.address}\")\n\n return cmdline", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection._redirect_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/connection.py_Connection._redirect_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 206, "span_ids": ["Connection._run", "Connection._redirect"], "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 Connection:\n\n def _redirect(self, capture_out):\n if capture_out:\n return subprocess.PIPE\n if self.log_rpyc:\n return open(f\"{tempfile.gettempdir()}/rpyc.out\", \"a\")\n return subprocess.DEVNULL\n\n def _run(self, sshcmd: list, cmd: list, capture_out: bool = True):\n redirect = self._redirect(capture_out)\n return subprocess.Popen(\n sshcmd + [self.wrap_cmd(cmd)],\n stdin=subprocess.DEVNULL,\n stdout=redirect,\n stderr=redirect,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/hdk.py_warnings_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/hdk.py_warnings_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/hdk.py", "file_name": "hdk.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 47, "span_ids": ["RemoteHdk.__init__", "RemoteHdk", "docstring"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import warnings\n\nfrom .rayscale import RayCluster\nfrom .cluster import Provider\n\n\nclass RemoteHdk(RayCluster):\n target_engine = \"Cloudnative\"\n target_storage_format = \"Hdk\"\n\n def __init__(\n self,\n provider: Provider,\n project_name: str = None,\n cluster_name: str = \"modin-cluster\",\n worker_count: int = 0,\n head_node_type: str = None,\n worker_node_type: str = None,\n add_conda_packages: list = None,\n ):\n if worker_count != 0:\n warnings.warn(\n \"Current HDK on cloud does not support multi-node setups, not requesting worker nodes\"\n )\n super().__init__(\n provider,\n project_name,\n cluster_name,\n 0,\n head_node_type,\n worker_node_type,\n add_conda_packages,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_subprocess_LocalWrappingConnection._init_deliver.super__init_deliver_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_subprocess_LocalWrappingConnection._init_deliver.super__init_deliver_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/local_cluster.py", "file_name": "local_cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 46, "span_ids": ["LocalWrappingConnection", "LocalWrappingConnection._init_deliver", "docstring"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import subprocess\nimport sys\nimport warnings\n\nfrom .base import ConnectionDetails\nfrom .cluster import BaseCluster\nfrom .connection import Connection\nfrom .rpyc_proxy import WrappingConnection, WrappingService\nfrom .tracing.tracing_connection import TracingWrappingConnection\nfrom modin.config import DoTraceRpyc\n\n_IS_PYTEST_DEBUG = (\n any(arg.endswith(\"pytest\") for arg in sys.argv) and \"--pdb\" in sys.argv\n)\n\n\nclass LocalWrappingConnection(\n TracingWrappingConnection if DoTraceRpyc.get() else WrappingConnection\n):\n def _init_deliver(self):\n def ensure_modin(modin_init):\n import sys\n import os\n\n modin_dir = os.path.abspath(os.path.join(os.path.dirname(modin_init), \"..\"))\n # make sure \"import modin\" will be taken from current modin, not something potentially installed in the system\n if modin_dir not in sys.path:\n sys.path.insert(0, modin_dir)\n\n import modin\n\n self.teleport(ensure_modin)(modin.__file__)\n super()._init_deliver()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_LocalWrappingService__UNUSED.object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_LocalWrappingService__UNUSED.object_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/local_cluster.py", "file_name": "local_cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 74, "span_ids": ["LocalConnection._run", "impl:3", "LocalConnection", "LocalConnection._build_sshcmd", "LocalWrappingService", "LocalConnection._get_service"], "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 LocalWrappingService(WrappingService):\n _protocol = LocalWrappingConnection\n\n\nclass LocalConnection(Connection):\n def _build_sshcmd(self, details: ConnectionDetails, forward_port: int = None):\n return []\n\n def _run(self, sshcmd: list, cmd: list, capture_out: bool = True):\n assert not sshcmd, \"LocalConnection does not support running things via ssh\"\n redirect = self._redirect(capture_out)\n if not capture_out and hasattr(redirect, \"write\"):\n redirect.write(f\"Running: {cmd}\\n\")\n return subprocess.Popen(\n cmd,\n stdin=None if _IS_PYTEST_DEBUG and not capture_out else subprocess.DEVNULL,\n stdout=None if _IS_PYTEST_DEBUG and not capture_out else redirect,\n stderr=None if _IS_PYTEST_DEBUG and not capture_out else redirect,\n )\n\n @staticmethod\n def _get_service():\n return LocalWrappingService\n\n\n_UNUSED = object()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_LocalCluster_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/local_cluster.py_LocalCluster_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/local_cluster.py", "file_name": "local_cluster.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 123, "span_ids": ["LocalCluster", "LocalCluster._get_connection_details", "LocalCluster._get_main_python", "LocalCluster.__init__", "LocalCluster._spawn", "LocalCluster._destroy"], "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 LocalCluster(BaseCluster):\n target_engine = \"Cloudpython\"\n target_storage_format = \"Pandas\"\n\n Connector = LocalConnection\n\n def __init__(\n self,\n provider,\n project_name=_UNUSED,\n cluster_name=_UNUSED,\n worker_count=_UNUSED,\n head_node_type=_UNUSED,\n worker_node_type=_UNUSED,\n add_conda_packages=_UNUSED,\n ):\n assert (\n provider == \"local\"\n ), \"Local cluster can only be spawned with 'local' provider\"\n if any(\n arg is not _UNUSED\n for arg in (\n project_name,\n cluster_name,\n worker_count,\n head_node_type,\n worker_node_type,\n add_conda_packages,\n )\n ):\n warnings.warn(\n \"All parameters except 'provider' are ignored for LocalCluster, do not pass them\"\n )\n super().__init__(provider, \"test-project\", \"test-cluster\", 1, \"head\", \"worker\")\n\n def _spawn(self, wait=False):\n pass\n\n def _destroy(self, wait=False):\n pass\n\n def _get_connection_details(self) -> ConnectionDetails:\n return ConnectionDetails()\n\n def _get_main_python(self) -> str:\n return sys.executable", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_sys__LOCAL_ATTRS.frozenset_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_sys__LOCAL_ATTRS.frozenset_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/meta_magic.py", "file_name": "meta_magic.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 32, "span_ids": ["docstring"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport inspect\nimport types\n\nfrom modin.config import Engine\nfrom modin.core.execution.dispatching.factories import REMOTE_ENGINES\n\n# the attributes that must be alwasy taken from a local part of dual-nature class,\n# never going to remote end\n_LOCAL_ATTRS = frozenset(\n (\n \"__new__\",\n \"__dict__\",\n \"__wrapper_remote__\",\n \"__real_cls__\",\n \"__mro__\",\n \"__class__\",\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_modin-project__modin/modin/experimental/cloud/meta_magic.py_RemoteMeta_RemoteMeta.__signature__.return.inspect_signature_types_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_RemoteMeta_RemoteMeta.__signature__.return.inspect_signature_types_M", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/meta_magic.py", "file_name": "meta_magic.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 56, "span_ids": ["RemoteMeta.__signature__", "RemoteMeta"], "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 RemoteMeta(type):\n \"\"\"\n Metaclass that relays getting non-existing attributes from\n a proxying object *CLASS* to a remote end transparently.\n\n Attributes existing on a proxying object are retrieved locally.\n \"\"\"\n\n @property\n def __signature__(self):\n \"\"\"\n Override detection performed by inspect.signature().\n Defining custom __new__() throws off inspect.signature(ClassType)\n as it returns a signature of __new__(), even if said __new__() is defined\n in a parent class.\n \"\"\"\n # Note that we create an artificial bound method here, as otherwise\n # self.__init__ is an ordinary function, and inspect.signature() shows\n # \"self\" argument while it should hide it for our purposes.\n # So we make a method bound to class type (it would normally be bound to instance)\n # and pass that to .signature()\n return inspect.signature(types.MethodType(self.__init__, 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_modin-project__modin/modin/experimental/cloud/meta_magic.py_RemoteMeta.__getattribute____KNOWN_DUALS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_RemoteMeta.__getattribute____KNOWN_DUALS._", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/meta_magic.py", "file_name": "meta_magic.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 101, "span_ids": ["RemoteMeta.__getattribute__", "impl:3"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteMeta(type):\n\n def __getattribute__(self, name):\n if name in _LOCAL_ATTRS:\n # never proxy special attributes, always get them from the class type\n return super().__getattribute__(name)\n else:\n try:\n # Go for proxying class-level attributes first;\n # make sure to check for attribute in self.__dict__ to get the class-level\n # attribute from the class itself, not from some of its parent classes.\n res = super().__getattribute__(\"__dict__\")[name]\n except KeyError:\n # Class-level attribute not found in the class itself; it might be present\n # in its parents, but we must first see if we should go to a remote\n # end, because in \"remote context\" local attributes are only those which\n # are explicitly allowed by being defined in the class itself.\n frame = sys._getframe()\n try:\n is_inspect = frame.f_back.f_code.co_filename == inspect.__file__\n except AttributeError:\n is_inspect = False\n finally:\n del frame\n if is_inspect:\n # be always-local for inspect.* functions\n return super().__getattribute__(name)\n else:\n try:\n remote = self.__real_cls__.__wrapper_remote__\n except AttributeError:\n # running in local mode, fall back\n return super().__getattribute__(name)\n return getattr(remote, name)\n else:\n try:\n # note that any attribute might be in fact a data descriptor,\n # account for that; we only need it for attributes we get from __dict__[],\n # because other cases are handled by super().__getattribute__ for us\n getter = res.__get__\n except AttributeError:\n return res\n return getter(None, self)\n\n\n_KNOWN_DUALS = {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_make_wrapped_class_make_wrapped_class.result.RemoteMeta_local_cls___na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_make_wrapped_class_make_wrapped_class.result.RemoteMeta_local_cls___na", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/meta_magic.py", "file_name": "meta_magic.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 138, "span_ids": ["make_wrapped_class"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_wrapped_class(local_cls: type, rpyc_wrapper_name: str):\n \"\"\"\n Replaces given local class in its module with a replacement class\n which has __new__ defined (a dual-nature class).\n This new class is instantiated differently depending on\n whether this is done in remote or local context.\n\n In local context we effectively get the same behavior, but in remote\n context the created class is actually of separate type which\n proxies most requests to a remote end.\n\n Parameters\n ----------\n local_cls: class\n The class to replace with a dual-nature class\n rpyc_wrapper_name: str\n The function *name* to make a proxy class type.\n Note that this is specifically taken as string to not import\n \"rpyc_proxy\" module in top-level, as it requires RPyC to be\n installed, and not all users of Modin (even in experimental mode)\n need remote context.\n \"\"\"\n # get a copy of local_cls attributes' dict but skip _very_ special attributes,\n # because copying them to a different type leads to them not working.\n # Python should create new descriptors automatically for us instead.\n namespace = {\n name: value\n for name, value in local_cls.__dict__.items()\n if not isinstance(value, types.GetSetDescriptorType)\n }\n namespace[\"__real_cls__\"] = None\n namespace[\"__new__\"] = None\n # define a new class the same way original was defined but with replaced\n # metaclass and a few more attributes in namespace\n result = RemoteMeta(local_cls.__name__, local_cls.__bases__, namespace)\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_modin-project__modin/modin/experimental/cloud/meta_magic.py_make_wrapped_class.make_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/meta_magic.py_make_wrapped_class.make_new_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/meta_magic.py", "file_name": "meta_magic.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 175, "span_ids": ["make_wrapped_class"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_wrapped_class(local_cls: type, rpyc_wrapper_name: str):\n # ... other code\n\n def make_new(__class__):\n \"\"\"\n Define a __new__() with a __class__ that is closure-bound, needed for super() to work\n \"\"\"\n # update '__class__' magic closure value - used by super()\n # FIXME: make __closure__ replacement recursive, as it breaks for decorated functions:\n # https://github.com/modin-project/modin/issues/4663\n for attr in __class__.__dict__.values():\n if not callable(attr):\n continue\n cells = getattr(attr, \"__closure__\", None) or ()\n for cell in cells:\n if cell.cell_contents is local_cls:\n cell.cell_contents = __class__\n\n def __new__(cls, *a, **kw):\n if cls is result and cls.__real_cls__ is not result:\n return cls.__real_cls__(*a, **kw)\n return super().__new__(cls)\n\n __class__.__new__ = __new__\n\n make_new(result)\n setattr(sys.modules[local_cls.__module__], local_cls.__name__, result)\n _KNOWN_DUALS[local_cls] = result\n\n def update_class(_):\n if Engine.get() in REMOTE_ENGINES:\n from . import rpyc_proxy\n\n result.__real_cls__ = getattr(rpyc_proxy, rpyc_wrapper_name)(result)\n else:\n result.__real_cls__ = result\n\n Engine.subscribe(update_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_modin-project__modin/modin/experimental/cloud/rayscale.py_threading__Immediate.join.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_threading__Immediate.join.pass", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 67, "span_ids": ["_Immediate.start", "_Immediate.__init__", "_ThreadTask", "_ThreadTask.__init__", "_Immediate", "docstring", "_Immediate.join"], "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": "import threading\nimport os\nimport re\nimport traceback\nimport sys\nfrom hashlib import sha1\nfrom typing import Callable\nimport subprocess\n\nimport yaml\n\ntry:\n # for ray>=1.0.1\n from ray.autoscaler.sdk import (\n create_or_update_cluster,\n teardown_cluster,\n get_head_node_ip,\n bootstrap_config,\n )\nexcept ModuleNotFoundError:\n # for ray==1.0.0\n from ray.autoscaler.commands import (\n create_or_update_cluster,\n teardown_cluster,\n get_head_node_ip,\n _bootstrap_config as bootstrap_config,\n )\n\nfrom .base import (\n CannotSpawnCluster,\n CannotDestroyCluster,\n ConnectionDetails,\n _get_ssh_proxy_command,\n)\nfrom .cluster import BaseCluster, Provider\n\n\nclass _ThreadTask:\n def __init__(self, target: Callable):\n self.target = target\n self.thread: threading.Thread = None\n self.exc: Exception = None\n self.silent = False\n\n\nclass _Immediate:\n def __init__(self, target: Callable):\n self.target = target\n\n def start(self):\n self.target()\n\n def join(self):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster_RayCluster.__run_thread.if_wait_.if_exc_.raise_exc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster_RayCluster.__run_thread.if_wait_.if_exc_.raise_exc", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 114, "span_ids": ["RayCluster._spawn", "RayCluster.__run_thread", "RayCluster._destroy", "RayCluster.__init__", "RayCluster"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RayCluster(BaseCluster):\n target_engine = \"Cloudray\"\n target_storage_format = \"Pandas\"\n\n __base_config = os.path.join(\n os.path.abspath(os.path.dirname(__file__)), \"ray-autoscaler.yml\"\n )\n __instance_key = {Provider.AWS: \"InstanceType\"}\n __image_key = {Provider.AWS: \"ImageId\"}\n __credentials_env = {Provider.AWS: \"AWS_SHARED_CREDENTIALS_FILE\"}\n\n def __init__(self, *a, **kw):\n self.spawner = _ThreadTask(self.__do_spawn)\n self.destroyer = _ThreadTask(self.__do_destroy)\n\n self.ready = False\n super().__init__(*a, **kw)\n\n if self.provider.credentials_file is not None:\n try:\n config_key = self.__credentials_env[self.provider.name]\n except KeyError:\n raise ValueError(f\"Unsupported provider: {self.provider.name}\")\n os.environ[config_key] = self.provider.credentials_file\n\n self.config = self.__make_config()\n self.config_file = self.__save_config(self.config)\n\n def _spawn(self, wait=True):\n self.__run_thread(wait, self.spawner)\n\n def _destroy(self, wait=True):\n self.__run_thread(wait, self.destroyer)\n\n def __run_thread(self, wait, task: _ThreadTask):\n if not task.thread:\n task.thread = (_Immediate if wait else threading.Thread)(target=task.target)\n task.thread.start()\n\n if wait:\n task.silent = True\n task.thread.join()\n exc, task.exc = task.exc, None\n if exc:\n raise exc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__make_config_RayCluster.__make_config.return.bootstrap_config_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__make_config_RayCluster.__make_config.return.bootstrap_config_config_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 154, "span_ids": ["RayCluster.__make_config"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RayCluster(BaseCluster):\n\n def __make_config(self):\n with open(self.__base_config) as inp:\n config = yaml.safe_load(inp.read())\n\n # cluster and provider details\n config[\"cluster_name\"] = self.cluster_name\n config[\"min_workers\"] = self.worker_count\n config[\"max_workers\"] = self.worker_count\n config[\"initial_workers\"] = self.worker_count\n config[\"provider\"][\"type\"] = self.provider.name\n if self.provider.region:\n config[\"provider\"][\"region\"] = self.provider.region\n if self.provider.zone:\n config[\"provider\"][\"availability_zone\"] = self.provider.zone\n\n # connection details\n config[\"auth\"][\"ssh_user\"] = \"ubuntu\"\n socks_proxy_cmd = _get_ssh_proxy_command()\n if socks_proxy_cmd:\n config[\"auth\"][\"ssh_proxy_command\"] = socks_proxy_cmd\n\n # instance types\n try:\n instance_key = self.__instance_key[self.provider.name]\n image_key = self.__image_key[self.provider.name]\n except KeyError:\n raise ValueError(f\"Unsupported provider: {self.provider.name}\")\n\n config[\"head_node\"][instance_key] = self.head_node_type\n config[\"head_node\"][image_key] = self.provider.image\n config[\"worker_nodes\"][instance_key] = self.worker_node_type\n config[\"worker_nodes\"][image_key] = self.provider.image\n\n # NOTE: setup_commands may be list with several sets of shell commands\n # this change only first set defining the remote environment\n res = self._update_conda_requirements(config[\"setup_commands\"][0])\n config[\"setup_commands\"][0] = res\n\n return bootstrap_config(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_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster._conda_requirements_RayCluster._conda_requirements.return.reqs_with_quotes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster._conda_requirements_RayCluster._conda_requirements.return.reqs_with_quotes", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 177, "span_ids": ["RayCluster._conda_requirements"], "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 RayCluster(BaseCluster):\n\n def _conda_requirements(self):\n import shlex\n\n reqs = []\n\n reqs.extend(self._get_python_version())\n\n if self.add_conda_packages:\n if not any(re.match(r\"modin(\\W|$)\", p) for p in self.add_conda_packages):\n # user didn't define modin release;\n # use automatically detected modin release from local context\n reqs.append(self._get_modin_version())\n\n reqs.extend(self.add_conda_packages)\n else:\n reqs.append(self._get_modin_version())\n\n # this is needed, for example, for dependencies that\n # looks like: \"scikit-learn>=0.23\"\n reqs_with_quotes = [shlex.quote(req) for req in reqs]\n\n return reqs_with_quotes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster._update_conda_requirements_RayCluster.__save_config.return.entry": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster._update_conda_requirements_RayCluster.__save_config.return.entry", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 207, "span_ids": ["RayCluster.__save_config", "RayCluster._get_python_version", "RayCluster._get_modin_version", "RayCluster._update_conda_requirements"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RayCluster(BaseCluster):\n\n def _update_conda_requirements(self, setup_commands: str):\n return setup_commands.replace(\n \"{{CONDA_PACKAGES}}\", \" \".join(self._conda_requirements())\n )\n\n @staticmethod\n def _get_python_version():\n major = sys.version_info.major\n minor = sys.version_info.minor\n micro = sys.version_info.micro\n return [f\"python>={major}.{minor}\", f\"python<={major}.{minor}.{micro}\"]\n\n @staticmethod\n def _get_modin_version():\n from modin import __version__\n\n # for example: 0.8.0+116.g5e50eef.dirty\n return f\"modin=={__version__.split('+')[0]}\"\n\n @staticmethod\n def __save_config(config):\n cfgdir = os.path.abspath(os.path.expanduser(\"~/.modin/cloud\"))\n os.makedirs(cfgdir, mode=0o700, exist_ok=True)\n namehash = sha1(repr(config).encode(\"utf8\")).hexdigest()[:8]\n entry = os.path.join(cfgdir, f\"config-{namehash}.yml\")\n\n with open(entry, \"w\") as out:\n out.write(yaml.dump(config))\n return 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_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__do_spawn_RayCluster.__do_spawn.try_.except_BaseException_as_e.if_not_self_spawner_silen.sys_stderr_write_f_Cannot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__do_spawn_RayCluster.__do_spawn.try_.except_BaseException_as_e.if_not_self_spawner_silen.sys_stderr_write_f_Cannot", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 226, "span_ids": ["RayCluster.__do_spawn"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RayCluster(BaseCluster):\n\n def __do_spawn(self):\n try:\n create_or_update_cluster(\n self.config_file,\n no_restart=False,\n restart_only=False,\n no_config_cache=False,\n )\n # need to re-load the config, as create_or_update_cluster() modifies it\n with open(self.config_file) as inp:\n self.config = yaml.safe_load(inp.read())\n self.ready = True\n except BaseException as err:\n self.spawner.exc = CannotSpawnCluster(\n \"Cannot spawn cluster\", cause=err, traceback=traceback.format_exc()\n )\n if not self.spawner.silent:\n sys.stderr.write(f\"Cannot spawn cluster:\\n{traceback.format_exc()}\\n\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__do_destroy_RayCluster._get_main_python.return._miniconda_envs_modin_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.__do_destroy_RayCluster._get_main_python.return._miniconda_envs_modin_b", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 255, "span_ids": ["RayCluster._get_main_python", "RayCluster._get_connection_details", "RayCluster.__do_destroy"], "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 RayCluster(BaseCluster):\n\n def __do_destroy(self):\n try:\n teardown_cluster(self.config_file)\n self.ready = False\n self.config = None\n except BaseException as err:\n self.destroyer.exc = CannotDestroyCluster(\n \"Cannot destroy cluster\", cause=err, traceback=traceback.format_exc()\n )\n if not self.destroyer.silent:\n sys.stderr.write(f\"Cannot destroy cluster:\\n{traceback.format_exc()}\\n\")\n\n def _get_connection_details(self) -> ConnectionDetails:\n \"\"\"\n Gets the coordinates on how to connect to cluster frontend node.\n \"\"\"\n assert self.ready, \"Cluster is not ready, cannot get connection details\"\n return ConnectionDetails(\n user_name=self.config[\"auth\"][\"ssh_user\"],\n key_file=self.config[\"auth\"][\"ssh_private_key\"],\n address=get_head_node_ip(self.config_file),\n )\n\n def _get_main_python(self) -> str:\n \"\"\"\n Gets the path to 'main' interpreter (the one that houses created environment for running everything)\n \"\"\"\n return \"~/miniconda/envs/modin/bin/python\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.wrap_cmd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rayscale.py_RayCluster.wrap_cmd_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rayscale.py", "file_name": "rayscale.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 270, "span_ids": ["RayCluster.wrap_cmd"], "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": "class RayCluster(BaseCluster):\n\n def wrap_cmd(self, cmd: list):\n \"\"\"\n Wraps command into required incantation for bash to read ~/.bashrc which is needed\n to make \"conda foo\" commands work\n \"\"\"\n return subprocess.list2cmdline(\n [\n \"bash\",\n \"-ic\",\n # workaround for https://github.com/conda/conda/issues/8385\n subprocess.list2cmdline([\"conda\", \"activate\", \"modin\", \"&&\"] + cmd),\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_modin-project__modin/modin/experimental/cloud/rpyc_patches.py_numpy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_patches.py_numpy_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_patches.py", "file_name": "rpyc_patches.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 43, "span_ids": ["apply_pathes", "docstring"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\nfrom rpyc.core import netref\n\n\ndef apply_pathes():\n def fixed_make_method(name, doc, orig=netref._make_method):\n if name == \"__array__\":\n\n def __array__(self, dtype=None):\n # Note that protocol=-1 will only work between python\n # interpreters of the same version.\n res = netref.pickle.loads(\n netref.syncreq(\n self,\n netref.consts.HANDLE_PICKLE,\n netref.pickle.HIGHEST_PROTOCOL,\n )\n )\n\n if dtype is not None:\n res = numpy.asarray(res, dtype=dtype)\n\n return res\n\n __array__.__doc__ = doc\n return __array__\n return orig(name, doc)\n\n netref._make_method = fixed_make_method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_types__pickled_array.return.pickle_dumps_obj___array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_types__pickled_array.return.pickle_dumps_obj___array_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 43, "span_ids": ["_pickled_array", "_tuplize", "_batch_loads", "docstring"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import types\nimport collections\n\nimport rpyc\nimport cloudpickle as pickle\nfrom rpyc.lib import get_methods\n\nfrom rpyc.core import netref, AsyncResult, consts\n\nfrom . import get_connection\nfrom .meta_magic import _LOCAL_ATTRS, RemoteMeta, _KNOWN_DUALS\nfrom modin.config import DoTraceRpyc\n\nfrom .rpyc_patches import apply_pathes\n\n\napply_pathes()\n\n\ndef _batch_loads(items):\n return tuple(pickle.loads(item) for item in items)\n\n\ndef _tuplize(arg):\n \"\"\"turns any sequence or iterator into a flat tuple\"\"\"\n return tuple(arg)\n\n\ndef _pickled_array(obj):\n return pickle.dumps(obj.__array__())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection_WrappingConnection.__wrap.return.bytes_pickle_dumps_local_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection_WrappingConnection.__wrap.return.bytes_pickle_dumps_local_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 68, "span_ids": ["WrappingConnection.__wrap", "WrappingConnection.__init__", "WrappingConnection"], "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 WrappingConnection(rpyc.Connection):\n def __init__(self, *a, **kw):\n super().__init__(*a, **kw)\n self._remote_batch_loads = None\n self._remote_cls_cache = {}\n self._static_cache = collections.defaultdict(dict)\n self._remote_dumps = None\n self._remote_tuplize = None\n self._remote_pickled_array = None\n\n def __wrap(self, local_obj):\n while True:\n # unwrap magic wrappers first; keep unwrapping in case it's a wrapper-in-a-wrapper\n # this shouldn't usually happen, so this is mostly a safety net\n try:\n local_obj = object.__getattribute__(local_obj, \"__remote_end__\")\n except AttributeError:\n break\n # do not pickle netrefs of our current connection, but do pickle those of other;\n # example of this: an object made in _other_ remote context being pased to ours\n if isinstance(local_obj, netref.BaseNetref) and local_obj.____conn__ is self:\n return None\n return bytes(pickle.dumps(local_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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.deliver_WrappingConnection.deliver.return.tuple_delivered_args_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.deliver_WrappingConnection.deliver.return.tuple_delivered_args_de", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 91, "span_ids": ["WrappingConnection.deliver"], "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 WrappingConnection(rpyc.Connection):\n\n def deliver(self, args, kw):\n \"\"\"\n More efficient, batched version of rpyc.classic.deliver()\n \"\"\"\n pickled_args = [self.__wrap(arg) for arg in args]\n pickled_kw = [(k, self.__wrap(v)) for (k, v) in kw.items()]\n\n pickled = [i for i in pickled_args if i is not None] + [\n v for (k, v) in pickled_kw if v is not None\n ]\n remote = iter(self._remote_batch_loads(tuple(pickled)))\n\n delivered_args = []\n for local_arg, pickled_arg in zip(args, pickled_args):\n delivered_args.append(\n next(remote) if pickled_arg is not None else local_arg\n )\n delivered_kw = {}\n for k, pickled_v in pickled_kw:\n delivered_kw[k] = next(remote) if pickled_v is not None else kw[k]\n\n return tuple(delivered_args), delivered_kw", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.obtain_WrappingConnection.obtain_tuple.return.self__remote_tuplize_remo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.obtain_WrappingConnection.obtain_tuple.return.self__remote_tuplize_remo", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 109, "span_ids": ["WrappingConnection.obtain_tuple", "WrappingConnection.obtain"], "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 WrappingConnection(rpyc.Connection):\n\n def obtain(self, remote):\n while True:\n try:\n remote = object.__getattribute__(remote, \"__remote_end__\")\n except AttributeError:\n break\n if isinstance(remote, netref.BaseNetref) and remote.____conn__ is self:\n return pickle.loads(self._remote_dumps(remote))\n return remote\n\n def obtain_tuple(self, remote):\n while True:\n try:\n remote = object.__getattribute__(remote, \"__remote_end__\")\n except AttributeError:\n break\n return self._remote_tuplize(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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.sync_request_WrappingConnection.sync_request.return.super_sync_request_hand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.sync_request_WrappingConnection.sync_request.return.super_sync_request_hand", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 164, "span_ids": ["WrappingConnection.sync_request"], "tokens": 551}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrappingConnection(rpyc.Connection):\n\n def sync_request(self, handler, *args):\n \"\"\"\n Intercept outgoing synchronous requests from RPyC to add caching or\n fulfilling them locally if possible to improve performance.\n We should try to make as few remote calls as possible, because each\n call adds up to latency.\n \"\"\"\n if handler == consts.HANDLE_INSPECT:\n # always inspect classes from modin, pandas and numpy locally,\n # do not go to network for those\n id_name = str(args[0][0])\n if id_name.split(\".\", 1)[0] in (\"modin\", \"pandas\", \"numpy\"):\n try:\n modobj = __import__(id_name)\n for subname in id_name.split(\".\")[1:]:\n modobj = getattr(modobj, subname)\n except (ImportError, AttributeError):\n pass\n else:\n return get_methods(netref.LOCAL_ATTRS, modobj)\n modname, clsname = id_name.rsplit(\".\", 1)\n try:\n modobj = __import__(modname)\n for subname in modname.split(\".\")[1:]:\n modobj = getattr(modobj, subname)\n clsobj = getattr(modobj, clsname)\n except (ImportError, AttributeError):\n pass\n else:\n return get_methods(netref.LOCAL_ATTRS, clsobj)\n elif handler in (consts.HANDLE_GETATTR, consts.HANDLE_STR, consts.HANDLE_HASH):\n if handler == consts.HANDLE_GETATTR:\n obj, attr = args\n key = (attr, handler)\n else:\n obj = args[0]\n key = handler\n\n if str(obj.____id_pack__[0]) in {\"numpy\", \"numpy.dtype\"}:\n # always assume numpy attributes and numpy.dtype attributes are always the same;\n # note that we're using RPyC id_pack as cache key, and it includes the name,\n # class id and instance id, so this cache is unique to each instance of, say,\n # numpy.dtype(), hence numpy.int16 and numpy.float64 got different caches.\n cache = self._static_cache[obj.____id_pack__]\n try:\n result = cache[key]\n except KeyError:\n result = cache[key] = super().sync_request(handler, *args)\n if handler == consts.HANDLE_GETATTR:\n # save an entry in our cache telling that we get this attribute cached\n self._static_cache[result.____id_pack__][\"__getattr__\"] = True\n return result\n\n return super().sync_request(handler, *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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.async_request_WrappingConnection.async_request.return.super_async_request_han": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.async_request_WrappingConnection.async_request.return.super_async_request_han", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 182, "span_ids": ["WrappingConnection.async_request"], "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 WrappingConnection(rpyc.Connection):\n\n def async_request(self, handler, *args, **kw):\n \"\"\"\n Override async request handling to intercept outgoing deletion requests because we cache\n certain things, and if we allow deletion of cached things our cache becomes stale.\n We can clean the cache upon deletion, but it would increase cache misses a lot.\n\n Also note that memory is not leaked forever, RPyC frees all of it upon disconnect.\n \"\"\"\n if handler == consts.HANDLE_DEL:\n obj, _ = args\n if obj.____id_pack__ in self._static_cache:\n # object is cached by us, so ignore the request or remote end dies and cache is suddenly stale;\n # we shouldn't remove item from cache as it would reduce performance\n res = AsyncResult(self)\n res._is_ready = True # simulate finished async request\n return res\n return super().async_request(handler, *args, **kw)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.__patched_netref_WrappingConnection.__patched_netref.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection.__patched_netref_WrappingConnection.__patched_netref.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 217, "span_ids": ["WrappingConnection.__patched_netref"], "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 WrappingConnection(rpyc.Connection):\n\n def __patched_netref(self, id_pack):\n \"\"\"\n Default RPyC behavior is to defer almost everything to be always obtained\n from remote side. This is almost always correct except when Python behaves\n strangely. For example, when checking for isinstance() or issubclass() it\n gets obj.__bases__ tuple and uses its elements *after* calling a decref\n on the __bases__, because Python assumes that the class type holds\n a reference to __bases__, which isn't true for RPyC proxy classes, so in\n RPyC case the element gets destroyed and undefined behavior happens.\n\n So we're patching RPyC netref __getattribute__ to keep a reference\n for certain read-only properties to better emulate local objects.\n\n Also __array__() implementation works only for numpy arrays, but not other types,\n like scalars (which should become arrays)\n \"\"\"\n result = super()._netref_factory(id_pack)\n cls = type(result)\n if not hasattr(cls, \"__readonly_cache__\"):\n orig_getattribute = cls.__getattribute__\n type.__setattr__(cls, \"__readonly_cache__\", {})\n\n def __getattribute__(this, name):\n if name in {\"__bases__\", \"__base__\", \"__mro__\"}:\n cache = object.__getattribute__(this, \"__readonly_cache__\")\n try:\n return cache[name]\n except KeyError:\n res = cache[name] = orig_getattribute(this, name)\n return res\n return orig_getattribute(this, name)\n\n cls.__getattribute__ = __getattribute__\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection._netref_factory_WrappingConnection._netref_factory.return.wrapping_cls_from_remote_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection._netref_factory_WrappingConnection._netref_factory.return.wrapping_cls_from_remote_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 260, "span_ids": ["WrappingConnection._netref_factory"], "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": "class WrappingConnection(rpyc.Connection):\n\n def _netref_factory(self, id_pack):\n id_name, cls_id, inst_id = id_pack\n id_name = str(id_name)\n first = id_name.split(\".\", 1)[0]\n if first in (\"modin\", \"numpy\", \"pandas\") and inst_id:\n try:\n cached_cls = self._remote_cls_cache[(id_name, cls_id)]\n except KeyError:\n result = self.__patched_netref(id_pack)\n self._remote_cls_cache[(id_name, cls_id)] = type(result)\n else:\n result = cached_cls(self, id_pack)\n else:\n result = self.__patched_netref(id_pack)\n # try getting __real_cls__ from result.__class__ BUT make sure to\n # NOT get it from some parent class for result.__class__, otherwise\n # multiple wrappings happen\n\n # we cannot use 'result.__class__' as this could cause a lookup of\n # '__class__' on remote end\n try:\n local_cls = object.__getattribute__(result, \"__class__\")\n except AttributeError:\n return result\n\n try:\n # first of all, check if remote object has a known \"wrapping\" class\n # example: _DataFrame has DataFrame dual-nature wrapper\n local_cls = _KNOWN_DUALS[local_cls]\n except KeyError:\n pass\n try:\n # Try to get local_cls.__real_cls__ but look it up within\n # local_cls.__dict__ to not grab it from any parent class.\n # Also get the __dict__ by using low-level __getattribute__\n # to override any potential __getattr__ callbacks on the class.\n wrapping_cls = object.__getattribute__(local_cls, \"__dict__\")[\n \"__real_cls__\"\n ]\n except (AttributeError, KeyError):\n return result\n return wrapping_cls.from_remote_end(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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection._box_WrappingConnection._init_deliver.self._remote_pickled_array.remote_proxy__pickled_arr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingConnection._box_WrappingConnection._init_deliver.self._remote_pickled_array.remote_proxy__pickled_arr", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 275, "span_ids": ["WrappingConnection._init_deliver", "WrappingConnection._box"], "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 WrappingConnection(rpyc.Connection):\n\n def _box(self, obj):\n while True:\n try:\n obj = object.__getattribute__(obj, \"__remote_end__\")\n except AttributeError:\n break\n return super()._box(obj)\n\n def _init_deliver(self):\n remote_proxy = self.modules[\"modin.experimental.cloud.rpyc_proxy\"]\n self._remote_batch_loads = remote_proxy._batch_loads\n self._remote_dumps = self.modules[\"rpyc.lib.compat\"].pickle.dumps\n self._remote_tuplize = remote_proxy._tuplize\n self._remote_pickled_array = remote_proxy._pickled_array", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingService__NO_OVERRIDE._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_WrappingService__NO_OVERRIDE._", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 305, "span_ids": ["WrappingService.on_connect", "impl:2", "_in_empty_class", "WrappingService"], "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 WrappingService(rpyc.ClassicService):\n if DoTraceRpyc.get():\n from .tracing.tracing_connection import TracingWrappingConnection as _protocol\n else:\n _protocol = WrappingConnection\n\n def on_connect(self, conn):\n super().on_connect(conn)\n conn._init_deliver()\n\n\ndef _in_empty_class():\n class Empty:\n pass\n\n return frozenset(Empty.__dict__.keys())\n\n\n_EMPTY_CLASS_ATTRS = _in_empty_class()\n\n_PROXY_LOCAL_ATTRS = frozenset([\"__name__\", \"__remote_end__\"])\n_NO_OVERRIDE = (\n _LOCAL_ATTRS\n | _PROXY_LOCAL_ATTRS\n | rpyc.core.netref.DELETED_ATTRS\n | frozenset([\"__getattribute__\"])\n | _EMPTY_CLASS_ATTRS\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls_make_proxy_cls._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls_make_proxy_cls._", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 339, "span_ids": ["make_proxy_cls"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_proxy_cls(\n remote_cls: netref.BaseNetref,\n origin_cls: type,\n override: type,\n cls_name: str = None,\n):\n \"\"\"\n Makes a new class type which inherits from (for isinstance() and issubtype()),\n takes methods from as-is and proxy all requests for other members to .\n Note that origin_cls and remote_cls are assumed to be the same class types, but one is local\n and other is obtained from RPyC.\n\n Effectively implements subclassing, but without subclassing. This is needed because it is\n impossible to subclass a remote-obtained class, something in the very internals of RPyC bugs out.\n\n Parameters\n ----------\n remote_cls: netref.BaseNetref\n Type obtained from RPyC connection, expected to mirror origin_cls\n origin_cls: type\n The class to prepare a proxying wrapping for\n override: type\n The mixin providing methods and attributes to overlay on top of remote values and methods.\n cls_name: str, optional\n The name to give to the resulting class.\n\n Returns\n -------\n type\n New wrapper that takes attributes from override and relays requests to all other\n attributes to remote_cls\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.ProxyMeta_make_proxy_cls.ProxyMeta.__repr__.return.f_proxy_for_origin_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.ProxyMeta_make_proxy_cls.ProxyMeta.__repr__.return.f_proxy_for_origin_cls_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 341, "end_line": 357, "span_ids": ["make_proxy_cls"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_proxy_cls(\n remote_cls: netref.BaseNetref,\n origin_cls: type,\n override: type,\n cls_name: str = None,\n):\n\n class ProxyMeta(RemoteMeta):\n \"\"\"\n This metaclass deals with printing a telling repr() to assist in debugging,\n and to actually implement the \"subclass without subclassing\" thing by\n directly adding references to attributes of \"override\" and by making proxy methods\n for other functions of origin_cls. Class-level attributes being proxied is managed\n by RemoteMeta parent.\n\n Do note that we cannot do the same for certain special members like __getitem__\n because CPython for optimization doesn't do a lookup of \"type(obj).__getitem__(foo)\" when\n \"obj[foo]\" is called, but it effectively does \"type(obj).__dict__['__getitem__'](foo)\"\n (but even without checking for __dict__), so all present methods must be declared\n beforehand.\n \"\"\"\n\n def __repr__(self):\n return f\"\"\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.ProxyMeta.__prepare___make_proxy_cls.ProxyMeta.__prepare__.return.namespace": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.ProxyMeta.__prepare___make_proxy_cls.ProxyMeta.__prepare__.return.namespace", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 417, "span_ids": ["make_proxy_cls"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_proxy_cls(\n remote_cls: netref.BaseNetref,\n origin_cls: type,\n override: type,\n cls_name: str = None,\n):\n\n class ProxyMeta(RemoteMeta):\n\n def __prepare__(*args, **kw):\n \"\"\"\n Cooks the __dict__ of the type being constructed. Takes attributes from as is\n and adds proxying wrappers for other attributes of .\n This \"manual inheritance\" is needed for RemoteMeta.__getattribute__ which first looks into\n type(obj).__dict__ (EXCLUDING parent classes) and then goes to proxy type.\n \"\"\"\n namespace = type.__prepare__(*args, **kw)\n namespace[\"__remote_methods__\"] = {}\n\n # try computing overridden differently to allow subclassing one override from another\n no_override = set(_NO_OVERRIDE)\n for base in override.__mro__:\n if base == object:\n continue\n for attr_name, attr_value in base.__dict__.items():\n if (\n attr_name not in namespace\n and attr_name not in no_override\n and getattr(object, attr_name, None) != attr_value\n ):\n namespace[\n attr_name\n ] = attr_value # force-inherit an attribute manually\n no_override.add(attr_name)\n\n for base in origin_cls.__mro__:\n if base == object:\n continue\n # try unwrapping a dual-nature class first\n while True:\n try:\n sub_base = object.__getattribute__(base, \"__real_cls__\")\n except AttributeError:\n break\n if sub_base is base:\n break\n base = sub_base\n for name, entry in base.__dict__.items():\n if (\n name not in namespace\n and name not in no_override\n and isinstance(entry, types.FunctionType)\n ):\n\n def method(_self, *_args, __method_name__=name, **_kw):\n try:\n remote = _self.__remote_methods__[__method_name__]\n except KeyError:\n # use remote_cls.__getattr__ to force RPyC return us\n # a proxy for remote method call instead of its local wrapper\n _self.__remote_methods__[\n __method_name__\n ] = remote = remote_cls.__getattr__(__method_name__)\n return remote(_self.__remote_end__, *_args, **_kw)\n\n method.__name__ = name\n namespace[name] = method\n return namespace\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper_make_proxy_cls.Wrapper.from_remote_end.return.cls___remote_end___remote": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper_make_proxy_cls.Wrapper.from_remote_end.return.cls___remote_end___remote", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 419, "end_line": 450, "span_ids": ["make_proxy_cls"], "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": "def make_proxy_cls(\n remote_cls: netref.BaseNetref,\n origin_cls: type,\n override: type,\n cls_name: str = None,\n):\n # ... other code\n\n class Wrapper(override, origin_cls, metaclass=ProxyMeta):\n \"\"\"\n Subclass origin_cls replacing attributes with what is defined in override while\n relaying requests for all other attributes to remote_cls.\n \"\"\"\n\n __name__ = cls_name or origin_cls.__name__\n __wrapper_remote__ = remote_cls\n\n def __init__(self, *a, __remote_end__=None, **kw):\n if __remote_end__ is None:\n try:\n preprocess = object.__getattribute__(self, \"_preprocess_init_args\")\n except AttributeError:\n pass\n else:\n a, kw = preprocess(*a, **kw)\n\n __remote_end__ = remote_cls(*a, **kw)\n while True:\n # unwrap the object if it's a wrapper\n try:\n __remote_end__ = object.__getattribute__(\n __remote_end__, \"__remote_end__\"\n )\n except AttributeError:\n break\n object.__setattr__(self, \"__remote_end__\", __remote_end__)\n\n @classmethod\n def from_remote_end(cls, remote_inst):\n return cls(__remote_end__=remote_inst)\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper.__getattribute___make_proxy_cls.Wrapper.__getattribute__.return.getattr_dct___remote_end": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper.__getattribute___make_proxy_cls.Wrapper.__getattribute__.return.getattr_dct___remote_end", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 452, "end_line": 500, "span_ids": ["make_proxy_cls"], "tokens": 529}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_proxy_cls(\n remote_cls: netref.BaseNetref,\n origin_cls: type,\n override: type,\n cls_name: str = None,\n):\n\n class Wrapper(override, origin_cls, metaclass=ProxyMeta):\n\n def __getattribute__(self, name):\n \"\"\"\n Implement \"default\" resolution order to override whatever __getattribute__\n a parent being wrapped may have defined, but only look up on own __dict__\n without looking into ancestors' ones, because we copy them in __prepare__.\n\n Effectively, any attributes not currently known to Wrapper (i.e. not defined here\n or in override class) will be retrieved from the remote end.\n\n Algorithm (mimicking default Python behavior):\n 1) check if type(self).__dict__[name] exists and is a get/set data descriptor\n 2) check if self.__dict__[name] exists\n 3) check if type(self).__dict__[name] is a non-data descriptor\n 4) check if type(self).__dict__[name] exists\n 5) pass through to remote end\n \"\"\"\n if name == \"__class__\":\n return object.__getattribute__(self, \"__class__\")\n dct = object.__getattribute__(self, \"__dict__\")\n if name == \"__dict__\":\n return dct\n cls_dct = object.__getattribute__(type(self), \"__dict__\")\n try:\n cls_attr, has_cls_attr = cls_dct[name], True\n except KeyError:\n has_cls_attr = False\n else:\n oget = None\n try:\n oget = object.__getattribute__(cls_attr, \"__get__\")\n object.__getattribute__(cls_attr, \"__set__\")\n except AttributeError:\n pass # not a get/set data descriptor, go next\n else:\n return oget(self, type(self))\n # type(self).name is not a get/set data descriptor\n try:\n return dct[name]\n except KeyError:\n # instance doesn't have an attribute\n if has_cls_attr:\n # type(self) has this attribute, but it's not a get/set descriptor\n if oget:\n # this attribute is a get data descriptor\n return oget(self, type(self))\n return cls_attr # not a data descriptor whatsoever\n\n # this instance/class does not have this attribute, pass it through to remote end\n return getattr(dct[\"__remote_end__\"], name)\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper.if_override___setattr____make_proxy_cls.return.Wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_proxy_cls.Wrapper.if_override___setattr____make_proxy_cls.return.Wrapper", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 502, "end_line": 516, "span_ids": ["make_proxy_cls"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_proxy_cls(\n remote_cls: netref.BaseNetref,\n origin_cls: type,\n override: type,\n cls_name: str = None,\n):\n\n class Wrapper(override, origin_cls, metaclass=ProxyMeta):\n\n if override.__setattr__ == object.__setattr__:\n # no custom attribute setting, define our own relaying to remote end\n def __setattr__(self, name, value):\n if name not in _PROXY_LOCAL_ATTRS:\n setattr(self.__remote_end__, name, value)\n else:\n object.__setattr__(self, name, value)\n\n if override.__delattr__ == object.__delattr__:\n # no custom __delattr__, define our own\n def __delattr__(self, name):\n if name not in _PROXY_LOCAL_ATTRS:\n delattr(self.__remote_end__, name)\n\n return Wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py__deliveringWrapper__deliveringWrapper.return.make_proxy_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py__deliveringWrapper__deliveringWrapper.return.make_proxy_cls_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 519, "end_line": 581, "span_ids": ["_deliveringWrapper"], "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": "def _deliveringWrapper(\n origin_cls: type, methods=(), mixin: type = None, target_name: str = None\n):\n \"\"\"\n Prepare a proxying wrapper for origin_cls which overrides methods specified in\n \"methods\" with \"delivering\" versions of methods.\n A \"delivering\" method is a method which delivers its arguments to a remote end\n before calling the remote method, effectively calling it with arguments passed\n by value, not by reference.\n This is mostly a workaround for RPyC bug when it translates a non-callable\n type to a remote type which has __call__() method (which would raise TypeError\n when called because local class is not callable).\n\n Note: this could lead to some weird side-effects if any arguments passed\n in are very funny, but this should never happen in a real data science life.\n\n Parameters\n ----------\n origin_cls: type\n Local class to make a \"delivering wrapper\" for.\n methods: sequence of method names, optional\n List of methods to override making \"delivering wrappers\" for.\n mixin: type, optional\n Parent mixin class to subclass (to inherit already prepared wrappers).\n If not specified, a new mixin is created.\n target_name: str, optional\n Name to give to prepared wrapper class.\n If not specified, take the name of local class being wrapped.\n\n Returns\n -------\n type\n The \"delivering wrapper\" mixin, to be used in conjunction with make_proxy_cls()\n \"\"\"\n conn = get_connection()\n remote_cls = getattr(conn.modules[origin_cls.__module__], origin_cls.__name__)\n\n if mixin is None:\n\n class DeliveringMixin:\n pass\n\n mixin = DeliveringMixin\n\n for method in methods:\n\n def wrapper(self, *args, __remote_conn__=conn, __method_name__=method, **kw):\n args, kw = __remote_conn__.deliver(args, kw)\n cache = object.__getattribute__(self, \"__remote_methods__\")\n try:\n remote = cache[__method_name__]\n except KeyError:\n # see comments in ProxyMeta.__prepare__ on using remote_cls.__getattr__\n cache[__method_name__] = remote = remote_cls.__getattr__(\n __method_name__\n )\n return remote(self.__remote_end__, *args, **kw)\n\n wrapper.__name__ = method\n setattr(mixin, method, wrapper)\n return make_proxy_cls(\n remote_cls, origin_cls, mixin, target_name or origin_cls.__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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py__prepare_loc_mixin__prepare_loc_mixin.return.DeliveringMixin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py__prepare_loc_mixin__prepare_loc_mixin.return.DeliveringMixin", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 584, "end_line": 607, "span_ids": ["_prepare_loc_mixin"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _prepare_loc_mixin():\n \"\"\"\n Prepare a mixin that overrides .loc and .iloc properties with versions\n which return a special \"delivering\" instances of indexers.\n \"\"\"\n from modin.pandas.indexing import _LocIndexer, _iLocIndexer\n\n DeliveringLocIndexer = _deliveringWrapper(\n _LocIndexer, [\"__getitem__\", \"__setitem__\"]\n )\n DeliveringILocIndexer = _deliveringWrapper(\n _iLocIndexer, [\"__getitem__\", \"__setitem__\"]\n )\n\n class DeliveringMixin:\n @property\n def loc(self):\n return DeliveringLocIndexer(self.__remote_end__)\n\n @property\n def iloc(self):\n return DeliveringILocIndexer(self.__remote_end__)\n\n return DeliveringMixin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_dataframe_wrapper_make_dataframe_wrapper.ObtainingItems._deliveringWrapper_Series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_dataframe_wrapper_make_dataframe_wrapper.ObtainingItems._deliveringWrapper_Series", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 610, "end_line": 628, "span_ids": ["make_dataframe_wrapper"], "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 make_dataframe_wrapper(DataFrame):\n \"\"\"\n Prepares a \"delivering wrapper\" proxy class for DataFrame.\n It makes DF.loc, DF.groupby() and other methods listed below deliver their\n arguments to remote end by value.\n \"\"\"\n\n from modin.pandas.series import Series\n\n conn = get_connection()\n\n class ObtainingItems:\n def items(self):\n return conn.obtain_tuple(self.__remote_end__.items())\n\n def iteritems(self):\n return conn.obtain_tuple(self.__remote_end__.iteritems())\n\n ObtainingItems = _deliveringWrapper(Series, mixin=ObtainingItems)\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_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_dataframe_wrapper.DataFrameOverrides_make_dataframe_wrapper.return.DeliveringDataFrame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_dataframe_wrapper.DataFrameOverrides_make_dataframe_wrapper.return.DeliveringDataFrame", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 630, "end_line": 672, "span_ids": ["make_dataframe_wrapper"], "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 make_dataframe_wrapper(DataFrame):\n # ... other code\n\n class DataFrameOverrides(_prepare_loc_mixin()):\n @classmethod\n def _preprocess_init_args(\n cls,\n data=None,\n index=None,\n columns=None,\n dtype=None,\n copy=None,\n query_compiler=None,\n ):\n (data,) = conn.deliver((data,), {})[0]\n return (), dict(\n data=data,\n index=index,\n columns=columns,\n dtype=dtype,\n copy=copy,\n query_compiler=query_compiler,\n )\n\n @property\n def dtypes(self):\n remote_dtypes = self.__remote_end__.dtypes\n return ObtainingItems(__remote_end__=remote_dtypes)\n\n DeliveringDataFrame = _deliveringWrapper(\n DataFrame,\n [\n \"groupby\",\n \"agg\",\n \"aggregate\",\n \"__getitem__\",\n \"astype\",\n \"drop\",\n \"merge\",\n \"apply\",\n \"applymap\",\n ],\n DataFrameOverrides,\n \"DataFrame\",\n )\n return DeliveringDataFrame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_base_dataset_wrapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/rpyc_proxy.py_make_base_dataset_wrapper_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/rpyc_proxy.py", "file_name": "rpyc_proxy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 675, "end_line": 710, "span_ids": ["make_base_dataset_wrapper", "make_dataframe_groupby_wrapper", "make_series_wrapper"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_base_dataset_wrapper(BasePandasDataset):\n \"\"\"\n Prepares a \"delivering wrapper\" proxy class for BasePandasDataset.\n Look for deatils in make_dataframe_wrapper() and _deliveringWrapper().\n \"\"\"\n DeliveringBasePandasDataset = _deliveringWrapper(\n BasePandasDataset,\n [\"agg\", \"aggregate\"],\n _prepare_loc_mixin(),\n \"BasePandasDataset\",\n )\n return DeliveringBasePandasDataset\n\n\ndef make_dataframe_groupby_wrapper(DataFrameGroupBy):\n \"\"\"\n Prepares a \"delivering wrapper\" proxy class for DataFrameGroupBy.\n Look for deatils in make_dataframe_wrapper() and _deliveringWrapper().\n \"\"\"\n DeliveringDataFrameGroupBy = _deliveringWrapper(\n DataFrameGroupBy,\n [\"agg\", \"aggregate\", \"apply\"],\n target_name=\"DataFrameGroupBy\",\n )\n return DeliveringDataFrameGroupBy\n\n\ndef make_series_wrapper(Series):\n \"\"\"\n Prepares a \"delivering wrapper\" proxy class for Series.\n Note that for now _no_ methods that really deliver their arguments by value\n are overridded here, so what it mostly does is it produces a wrapper class\n inherited from normal Series but wrapping all access to remote end transparently.\n \"\"\"\n return _deliveringWrapper(Series, [\"apply\"], target_name=\"Series\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/cloud/test/test_cloud.py_mock_test_create_or_update_cluster.with_mock_patch_.make_ray_cluster__spawn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/test_cloud.py_mock_test_create_or_update_cluster.with_mock_patch_.make_ray_cluster__spawn", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/test/test_cloud.py", "file_name": "test_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 101, "span_ids": ["make_create_or_update_cluster_mock", "make_get_head_node_ip_mock", "test_get_head_node_ip", "test_bootstrap_config", "test_create_or_update_cluster", "make_teardown_cluster_mock", "make_bootstrap_config_mock", "docstring", "make_ray_cluster", "test_teardown_cluster"], "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": "import unittest.mock as mock\nimport pytest\nfrom collections import namedtuple\nfrom inspect import signature\nfrom modin.experimental.cloud.rayscale import (\n RayCluster,\n create_or_update_cluster,\n teardown_cluster,\n get_head_node_ip,\n bootstrap_config,\n)\nfrom modin.experimental.cloud.cluster import Provider\n\n\n@pytest.fixture\ndef make_bootstrap_config_mock():\n def bootstrap_config_mock(config, *args, **kwargs):\n signature(bootstrap_config).bind(config, *args, **kwargs)\n config[\"auth\"][\"ssh_user\"] = \"modin\"\n config[\"auth\"][\"ssh_private_key\"] = \"X\" * 20\n return config\n\n return bootstrap_config_mock\n\n\n@pytest.fixture\ndef make_get_head_node_ip_mock():\n def get_head_node_ip_mock(*args, **kwargs):\n signature(get_head_node_ip).bind(*args, **kwargs)\n return \"127.0.0.1\"\n\n return get_head_node_ip_mock\n\n\n@pytest.fixture\ndef make_teardown_cluster_mock():\n return lambda *args, **kw: signature(teardown_cluster).bind(*args, **kw)\n\n\n@pytest.fixture\ndef make_create_or_update_cluster_mock():\n return lambda *args, **kw: signature(create_or_update_cluster).bind(*args, **kw)\n\n\n@pytest.fixture\ndef make_ray_cluster(make_bootstrap_config_mock):\n def ray_cluster(conda_packages=None):\n with mock.patch(\n \"modin.experimental.cloud.rayscale.bootstrap_config\",\n make_bootstrap_config_mock,\n ):\n ray_cluster = RayCluster(\n Provider(name=\"aws\"),\n add_conda_packages=conda_packages,\n )\n return ray_cluster\n\n return ray_cluster\n\n\ndef test_bootstrap_config(make_ray_cluster):\n make_ray_cluster()\n\n\ndef test_get_head_node_ip(make_ray_cluster, make_get_head_node_ip_mock):\n ray_cluster = make_ray_cluster()\n\n with mock.patch(\n \"modin.experimental.cloud.rayscale.get_head_node_ip\", make_get_head_node_ip_mock\n ):\n ray_cluster.ready = True\n details = ray_cluster._get_connection_details()\n assert details.address == \"127.0.0.1\"\n\n\ndef test_teardown_cluster(make_ray_cluster, make_teardown_cluster_mock):\n with mock.patch(\n \"modin.experimental.cloud.rayscale.teardown_cluster\", make_teardown_cluster_mock\n ):\n make_ray_cluster()._destroy(wait=True)\n\n\ndef test_create_or_update_cluster(make_ray_cluster, make_create_or_update_cluster_mock):\n with mock.patch(\n \"modin.experimental.cloud.rayscale.create_or_update_cluster\",\n make_create_or_update_cluster_mock,\n ):\n make_ray_cluster()._spawn(wait=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_modin-project__modin/modin/experimental/cloud/test/test_cloud.py_test_update_conda_requirements_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/test/test_cloud.py_test_update_conda_requirements_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/test/test_cloud.py", "file_name": "test_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 140, "span_ids": ["test_update_conda_requirements"], "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.parametrize(\n \"setup_commands_source\",\n [\n r\"\"\"conda create --clone base --name modin --yes\n conda activate modin\n conda install --yes {{CONDA_PACKAGES}}\n \"\"\"\n ],\n)\n@pytest.mark.parametrize(\n \"user_packages\",\n [[\"scikit-learn>=0.23\", \"modin==0.8.0\"], None],\n)\ndef test_update_conda_requirements(\n make_ray_cluster,\n setup_commands_source,\n user_packages,\n):\n fake_version = namedtuple(\"FakeVersion\", \"major minor micro\")(7, 12, 45)\n with mock.patch(\"sys.version_info\", fake_version):\n setup_commands_result = make_ray_cluster(\n user_packages\n )._update_conda_requirements(setup_commands_source)\n\n assert f\"python>={fake_version.major}.{fake_version.minor}\" in setup_commands_result\n assert (\n f\"python<={fake_version.major}.{fake_version.minor}.{fake_version.micro}\"\n in setup_commands_result\n )\n assert \"{{CONDA_PACKAGES}}\" not in setup_commands_result\n\n if user_packages:\n for package in user_packages:\n assert package in setup_commands_result\n else:\n assert \"modin=\" in setup_commands_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_modin-project__modin/modin/experimental/cloud/tracing/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_from_rpyc_core_import_con_read_log.return.items": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_from_rpyc_core_import_con_read_log.return.items", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/parse_rpyc_trace.py", "file_name": "parse_rpyc_trace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 41, "span_ids": ["read_log", "docstring"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from rpyc.core import consts\nimport re\nimport collections\nimport sys\n\n\ndef read_log(fname):\n with open(fname, \"rb\") as inp:\n data = inp.read()\n data = data.decode(\"utf8\", \"xmlcharrefreplace\")\n # split the last logging chunk\n data = data.rsplit(\"---[\", 1)[1]\n\n items = []\n for line in data.splitlines():\n if \":args=\" not in line:\n continue\n preargs, args = line.split(\":args=\", 1)\n pieces = (\"kind=\" + preargs).split(\":\") + [\"args=\" + args]\n item = dict(piece.split(\"=\", 1) for piece in pieces)\n item[\"timing\"] = eval(item.get(\"timing\", \"0\"))\n items.append(item)\n\n return items", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_get_syncs_getattrs._p_for_p_in_pairs_if_p_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_get_syncs_getattrs._p_for_p_in_pairs_if_p_0_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/parse_rpyc_trace.py", "file_name": "parse_rpyc_trace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 87, "span_ids": ["get_syncs", "impl"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_syncs(items):\n # dels are asynchronous, assume others are synchronous\n dels = {\n i[\"seq\"]\n for i in items\n if i[\"kind\"] == \"send\" and i.get(\"req\", \"\") == \"HANDLE_DEL\"\n }\n return [i for i in items if i[\"seq\"] not in dels]\n\n\nitems = read_log((sys.argv[1:] or [\"rpyc-trace.log\"])[0])\nsyncs = get_syncs(items)\n\nprint( # noqa: T201\n f\"total time={sum(i['timing'] for i in syncs if i['kind'] == 'recv' and i['msg'] == 'MSG_REPLY')}\"\n)\n\nlongs = [i for i in syncs if i[\"timing\"] > 0.5]\nprint(f'longs ({len(longs)}) time={sum(i[\"timing\"] for i in longs)}') # noqa: T201\n\ns_sends = [i for i in syncs if i[\"kind\"] == \"send\"]\n\nbuckets = collections.defaultdict(list)\n\nfor i in s_sends:\n buckets[i.get(\"req\", \"\")].append(i[\"args\"])\n\nprint(\"-------------------\") # noqa: T201\nfor k, v in buckets.items():\n print(f\"{k}={len(v)}\") # noqa: T201\nprint(\"-------------------\") # noqa: T201\n\nsends = {\n i[\"seq\"]: i for i in items if i[\"kind\"] == \"send\" and i[\"msg\"] == \"MSG_REQUEST\"\n}\npairs, responses = [], {}\nfor i in items:\n if i[\"kind\"] == \"recv\" and i[\"msg\"] == \"MSG_REPLY\":\n try:\n pairs.append((sends[i[\"seq\"]], i))\n responses[i[\"seq\"]] = i\n except KeyError:\n pass\ngetattrs = [p for p in pairs if p[0].get(\"req\", \"\") == \"HANDLE_GETATTR\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py__unbox__unbox.raise_ValueError_invalid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py__unbox__unbox.raise_ValueError_invalid", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/parse_rpyc_trace.py", "file_name": "parse_rpyc_trace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 102, "span_ids": ["_unbox"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _unbox(package): # boxing\n label, value = package\n if label == consts.LABEL_VALUE:\n return value\n if label == consts.LABEL_TUPLE:\n return tuple(_unbox(item) for item in value)\n if label == consts.LABEL_LOCAL_REF:\n id_pack = (str(value[0]), value[1], value[2]) # so value is a id_pack\n return f\"[local]{id_pack[0]}(cls={id_pack[1]}:inst={id_pack[2]})\"\n if label == consts.LABEL_REMOTE_REF:\n id_pack = (str(value[0]), value[1], value[2]) # so value is a id_pack\n return f\"[remote]{id_pack[0]}(cls={id_pack[1]}:inst={id_pack[2]})\"\n raise ValueError(\"invalid label %r\" % (label,))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_from_getattr_send_from_call_send.return.obj_args_kw": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_from_getattr_send_from_call_send.return.obj_args_kw", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/parse_rpyc_trace.py", "file_name": "parse_rpyc_trace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 166, "span_ids": ["from_getattr_recv", "from_hash_send", "_format_args", "_stringify", "from_getattr_send", "from_call_send", "_unwrap_obj", "from_callattr_send"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def from_getattr_send(i, s=True):\n _, args = eval(i[\"args\"])\n obj, attr = _unbox(args)\n return f\"{obj}::{attr}\" if s else (obj, attr)\n\n\ndef from_getattr_recv(i, s=True):\n if not i:\n return \"\"\n args = eval(i[\"args\"])\n return _unbox(args)\n\n\ndef from_hash_send(i, s=True):\n _, args = eval(i[\"args\"])\n obj = _unbox(args)[0]\n return obj\n\n\ndef _unwrap_obj(obj, remote):\n try:\n obj, attr = remote[obj.replace(\"[local]\", \"[remote]\")]\n except (KeyError, ValueError):\n obj = \"[>_<] \" + obj\n else:\n obj = f\"{obj.replace('[local]', '[remote]')}.{attr}\"\n return obj\n\n\ndef _stringify(obj):\n if not isinstance(obj, str):\n return str(obj)\n if \"[local]\" in obj or \"[remote]\" in obj:\n return obj\n return repr(obj)\n\n\ndef _format_args(args, kw):\n fargs = \", \".join(_stringify(x) for x in args)\n fkw = \", \".join(f\"{k}={_stringify(v)}\" for (k, v) in kw)\n if fargs and fkw:\n fargs += \", \"\n return f\"({fargs}{fkw})\"\n\n\ndef from_callattr_send(i, s=True, remote=None):\n _, args = eval(i[\"args\"])\n obj, name, args, kw = _unbox(args)\n if remote:\n obj = _unwrap_obj(obj, remote)\n return f\"{obj}.{name}{_format_args(args, kw)}\" if s else (obj, name, args, kw)\n\n\ndef from_call_send(i, s=True, remote=None):\n _, args = eval(i[\"args\"])\n obj, args, kw = _unbox(args)\n if remote:\n obj = _unwrap_obj(obj, remote)\n if s:\n res = f\"{obj}{_format_args(args, kw)}\"\n return re.sub(r\"\\(cls=\\d+:inst=\", \"(inst:\", res)\n return obj, args, kw", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py__parse_msg__parse_msg.return.from_getattr_recv_m_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py__parse_msg__parse_msg.return.from_getattr_recv_m_s_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/parse_rpyc_trace.py", "file_name": "parse_rpyc_trace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 180, "span_ids": ["_parse_msg"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _parse_msg(m, s=False, **kw):\n if m[\"kind\"] == \"send\":\n if m.get(\"req\") == \"HANDLE_GETATTR\":\n return from_getattr_send(m, s, **kw)\n if m.get(\"req\") in (\"HANDLE_HASH\", \"HANDLE_STR\"):\n return from_hash_send(m, s, **kw)\n if m.get(\"req\") == \"HANDLE_CALLATTR\":\n return from_callattr_send(m, s, **kw)\n if m.get(\"req\") == \"HANDLE_CALL\":\n return from_call_send(m, s, **kw)\n return str(m)\n return from_getattr_recv(m, s, **kw)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_remote_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/parse_rpyc_trace.py_remote_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/parse_rpyc_trace.py", "file_name": "parse_rpyc_trace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 230, "span_ids": ["impl:31"], "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": "#\n\n\nremote = {}\nfor gsend, grecv in pairs:\n got, sent = _parse_msg(grecv, False), _parse_msg(gsend, False)\n if isinstance(got, str):\n remote[got] = sent\n # remote[from_getattr_recv(grecv, False)] = from_getattr_send(gsend, False)\n\nprint(f\"total time getattrs={sum(x[1]['timing'] for x in getattrs)}\") # noqa: T201\n\n# import pdb; pdb.set_trace()\n\nprint(\"\\n\\n----[ getattr ]----\") # noqa: T201\nfor gsend, grecv in getattrs:\n print(f\"{from_getattr_send(gsend)} --> {from_getattr_recv(grecv)}\") # noqa: T201\n\n\nprint(\"\\n\\n----[ hash ]----\") # noqa: T201\nfor i in syncs:\n if i.get(\"req\", \"\") == \"HANDLE_HASH\" and i[\"kind\"] == \"send\":\n print( # noqa: T201\n from_hash_send(i), \"-->\", from_getattr_recv(responses.get(i[\"seq\"]))\n )\n\nprint(\"\\n\\n----[ str ]----\") # noqa: T201\nfor i in syncs:\n if i.get(\"req\", \"\") == \"HANDLE_STR\" and i[\"kind\"] == \"send\":\n print( # noqa: T201\n from_hash_send(i), \"-->\", from_getattr_recv(responses.get(i[\"seq\"]))\n )\n\nprint(\"\\n\\n----[ callattr ]----\") # noqa: T201\nfor i in syncs:\n if i.get(\"req\", \"\") == \"HANDLE_CALLATTR\" and i[\"kind\"] == \"send\":\n print( # noqa: T201\n from_callattr_send(i, remote=remote),\n \"-->\",\n from_getattr_recv(responses.get(i[\"seq\"])),\n )\n\nprint(\"\\n\\n----[ call ]----\") # noqa: T201\nfor i in syncs:\n if i.get(\"req\", \"\") == \"HANDLE_CALL\" and i[\"kind\"] == \"send\":\n print( # noqa: T201\n from_call_send(i, remote=remote),\n \"-->\",\n from_getattr_recv(responses.get(i[\"seq\"])),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_threading__Logger.__exit__.with_self_conn_logLock_.self_conn_logfiles_remove": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_threading__Logger.__exit__.with_self_conn_logLock_.self_conn_logfiles_remove", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/tracing_connection.py", "file_name": "tracing_connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 44, "span_ids": ["_Logger", "_Logger.__enter__", "_Logger.__exit__", "docstring", "_Logger.__init__"], "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 threading\nimport time\nimport collections\n\nfrom rpyc.core import brine, consts, netref\n\nfrom ..rpyc_proxy import WrappingConnection\n\n_msg_to_name = collections.defaultdict(dict)\nfor name in dir(consts):\n if name.upper() == name:\n category, _ = name.split(\"_\", 1)\n _msg_to_name[category][getattr(consts, name)] = name\n_msg_to_name = dict(_msg_to_name)\n\n\nclass _Logger:\n def __init__(self, conn, logname):\n self.conn = conn\n self.logname = logname\n\n def __enter__(self):\n with self.conn.logLock:\n self.conn.logfiles.add(self.logname)\n with open(self.logname, \"a\") as out:\n out.write(f\"------------[new trace at {time.asctime()}]----------\\n\")\n return self\n\n def __exit__(self, *a, **kw):\n with self.conn.logLock:\n self.conn.logfiles.remove(self.logname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection_TracingWrappingConnection.__to_text.return.str_cls___stringify_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection_TracingWrappingConnection.__to_text.return.str_cls___stringify_args_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/tracing_connection.py", "file_name": "tracing_connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 66, "span_ids": ["TracingWrappingConnection.__stringify", "TracingWrappingConnection.__init__", "TracingWrappingConnection", "TracingWrappingConnection.__to_text"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TracingWrappingConnection(WrappingConnection):\n def __init__(self, *a, **kw):\n super().__init__(*a, **kw)\n self.logLock = threading.RLock()\n self.timings = {}\n with open(\"rpyc-trace.log\", \"a\") as out:\n out.write(f\"------------[new trace at {time.asctime()}]----------\\n\")\n self.logfiles = set([\"rpyc-trace.log\"])\n\n @classmethod\n def __stringify(cls, args):\n if isinstance(args, (tuple, list)):\n return tuple(cls.__stringify(i) for i in args)\n if isinstance(args, netref.BaseNetref):\n return str(args.____id_pack__)\n return args\n\n @classmethod\n def __to_text(cls, args):\n return str(cls.__stringify(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_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection._send_TracingWrappingConnection._send.return.super__send_msg_seq_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection._send_TracingWrappingConnection._send.return.super__send_msg_seq_a", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/tracing_connection.py", "file_name": "tracing_connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 82, "span_ids": ["TracingWrappingConnection._send"], "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 TracingWrappingConnection(WrappingConnection):\n\n def _send(self, msg, seq, args):\n str_args = self.__to_text(args).replace(\"\\r\", \"\").replace(\"\\n\", \"\\tNEWLINE\\t\")\n if msg == consts.MSG_REQUEST:\n handler, _ = args\n str_handler = f\":req={_msg_to_name['HANDLE'][handler]}\"\n else:\n str_handler = \"\"\n with self.logLock:\n for logfile in self.logfiles:\n with open(logfile, \"a\") as out:\n out.write(\n f\"send:msg={_msg_to_name['MSG'][msg]}:seq={seq}{str_handler}:args={str_args}\\n\"\n )\n self.timings[seq] = time.time()\n return super()._send(msg, seq, 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_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection._dispatch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/cloud/tracing/tracing_connection.py_TracingWrappingConnection._dispatch_", "embedding": null, "metadata": {"file_path": "modin/experimental/cloud/tracing/tracing_connection.py", "file_name": "tracing_connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 110, "span_ids": ["TracingWrappingConnection._log_extra", "TracingWrappingConnection._dispatch"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TracingWrappingConnection(WrappingConnection):\n\n def _dispatch(self, data):\n \"\"\"tracing only\"\"\"\n got1 = time.time()\n try:\n return super()._dispatch(data)\n finally:\n got2 = time.time()\n msg, seq, args = brine.load(data)\n sent = self.timings.pop(seq, got1)\n if msg == consts.MSG_REQUEST:\n handler, args = args\n str_handler = f\":req={_msg_to_name['HANDLE'][handler]}\"\n else:\n str_handler = \"\"\n str_args = (\n self.__to_text(args).replace(\"\\r\", \"\").replace(\"\\n\", \"\\tNEWLINE\\t\")\n )\n with self.logLock:\n for logfile in self.logfiles:\n with open(logfile, \"a\") as out:\n out.write(\n f\"recv:timing={got1 - sent}+{got2 - got1}:msg={_msg_to_name['MSG'][msg]}:seq={seq}{str_handler}:args={str_args}\\n\"\n )\n\n def _log_extra(self, logname):\n return _Logger(self, logname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/dask/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/dask/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/dask/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/dask/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/dask/implementations/pandas_on_dask/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/__init__.py_ExperimentalPandasOnDaskIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/__init__.py_ExperimentalPandasOnDaskIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 25}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import ExperimentalPandasOnDaskIO\n\n__all__ = [\"ExperimentalPandasOnDaskIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py_from_modin_core_storage_f_None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py_from_modin_core_storage_f_None_6", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 41, "span_ids": ["docstring"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.storage_formats.pandas.parsers import (\n PandasCSVGlobParser,\n ExperimentalPandasPickleParser,\n ExperimentalCustomTextParser,\n)\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.dask.implementations.pandas_on_dask.io import PandasOnDaskIO\nfrom modin.experimental.core.io import (\n ExperimentalCSVGlobDispatcher,\n ExperimentalSQLDispatcher,\n ExperimentalPickleDispatcher,\n ExperimentalCustomTextDispatcher,\n)\n\nfrom modin.core.execution.dask.implementations.pandas_on_dask.dataframe import (\n PandasOnDaskDataframe,\n)\nfrom modin.core.execution.dask.implementations.pandas_on_dask.partitioning import (\n PandasOnDaskDataframePartition,\n)\nfrom modin.core.execution.dask.common import DaskWrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py_ExperimentalPandasOnDaskIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py_ExperimentalPandasOnDaskIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/dask/implementations/pandas_on_dask/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 79, "span_ids": ["ExperimentalPandasOnDaskIO", "ExperimentalPandasOnDaskIO.__make_read", "ExperimentalPandasOnDaskIO.__make_write", "ExperimentalPandasOnDaskIO:5"], "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 ExperimentalPandasOnDaskIO(PandasOnDaskIO):\n \"\"\"\n Class for handling experimental IO functionality with pandas storage format and Dask engine.\n\n ``ExperimentalPandasOnDaskIO`` inherits some util functions and unmodified IO functions\n from ``PandasOnDaskIO`` class.\n \"\"\"\n\n build_args = dict(\n frame_partition_cls=PandasOnDaskDataframePartition,\n query_compiler_cls=PandasQueryCompiler,\n frame_cls=PandasOnDaskDataframe,\n base_io=PandasOnDaskIO,\n )\n\n def __make_read(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (DaskWrapper, *classes), build_args).read\n\n def __make_write(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (DaskWrapper, *classes), build_args).write\n\n read_csv_glob = __make_read(PandasCSVGlobParser, ExperimentalCSVGlobDispatcher)\n read_pickle_distributed = __make_read(\n ExperimentalPandasPickleParser, ExperimentalPickleDispatcher\n )\n to_pickle_distributed = __make_write(ExperimentalPickleDispatcher)\n read_custom_text = __make_read(\n ExperimentalCustomTextParser, ExperimentalCustomTextDispatcher\n )\n read_sql = __make_read(ExperimentalSQLDispatcher)\n\n del __make_read # to not pollute class namespace\n del __make_write # to not pollute class namespace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_abc_BaseDbWorker._genName.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_abc_BaseDbWorker._genName.return.name", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py", "file_name": "base_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 98, "span_ids": ["BaseDbWorker", "BaseDbWorker.executeDML", "BaseDbWorker.dropTable", "BaseDbWorker.executeRA", "BaseDbWorker._genName", "docstring"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import abc\nimport uuid\nimport os\n\nimport pyarrow as pa\nimport numpy as np\n\nfrom modin.config import OmnisciFragmentSize, HdkFragmentSize\nfrom modin.error_message import ErrorMessage\n\n\nclass BaseDbWorker(abc.ABC):\n \"\"\"Base class for HDK storage format based execution engine .\"\"\"\n\n @classmethod\n @abc.abstractmethod\n def dropTable(cls, name):\n \"\"\"\n Drops table with the specified name.\n\n Parameters\n ----------\n name : str\n A table to drop.\n \"\"\"\n pass\n\n @classmethod\n @abc.abstractmethod\n def executeDML(cls, query):\n \"\"\"\n Execute DML SQL query.\n\n Parameters\n ----------\n query : str\n SQL query.\n\n Returns\n -------\n pyarrow.Table\n Execution result.\n \"\"\"\n pass\n\n @classmethod\n @abc.abstractmethod\n def executeRA(cls, query):\n \"\"\"\n Execute calcite query.\n\n Parameters\n ----------\n query : str\n Serialized calcite query.\n\n Returns\n -------\n pyarrow.Table\n Execution result.\n \"\"\"\n pass\n\n @classmethod\n def _genName(cls, name):\n \"\"\"\n Generate or mangle a table name.\n\n Parameters\n ----------\n name : str or None\n Table name to mangle or None to generate a unique\n table name.\n\n Returns\n -------\n str\n Table name.\n \"\"\"\n if not name:\n name = \"frame_\" + str(uuid.uuid4()).replace(\"-\", \"\")\n # TODO: reword name in case of caller's mistake\n return 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.cast_to_compatible_types_BaseDbWorker.cast_to_compatible_types.return.table": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.cast_to_compatible_types_BaseDbWorker.cast_to_compatible_types.return.table", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py", "file_name": "base_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 185, "span_ids": ["BaseDbWorker.cast_to_compatible_types"], "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 BaseDbWorker(abc.ABC):\n\n @staticmethod\n def cast_to_compatible_types(table):\n \"\"\"\n Cast PyArrow table to be fully compatible with HDK.\n\n Parameters\n ----------\n table : pyarrow.Table\n Source table.\n\n Returns\n -------\n pyarrow.Table\n Table with fully compatible types with HDK.\n \"\"\"\n schema = table.schema\n new_schema = schema\n need_cast = False\n uint_to_int_cast = False\n new_cols = {}\n uint_to_int_map = {\n pa.uint8(): pa.int16(),\n pa.uint16(): pa.int32(),\n pa.uint32(): pa.int64(),\n pa.uint64(): pa.int64(), # May cause overflow\n }\n for i, field in enumerate(schema):\n # Currently HDK doesn't support Arrow table import with\n # dictionary columns. Here we cast dictionaries until support\n # is in place.\n # https://github.com/modin-project/modin/issues/1738\n if pa.types.is_dictionary(field.type):\n # Conversion for dictionary of null type to string is not supported\n # in Arrow. Build new column for this case for now.\n if pa.types.is_null(field.type.value_type):\n mask = np.full(table.num_rows, True, dtype=bool)\n new_col_data = np.empty(table.num_rows, dtype=str)\n new_col = pa.array(new_col_data, pa.string(), mask)\n new_cols[i] = new_col\n else:\n need_cast = True\n new_field = pa.field(\n field.name, pa.string(), field.nullable, field.metadata\n )\n new_schema = new_schema.set(i, new_field)\n # HDK doesn't support importing Arrow's date type:\n # https://github.com/omnisci/omniscidb/issues/678\n elif pa.types.is_date(field.type):\n # Arrow's date is the number of days since the UNIX-epoch, so we can convert it\n # to a timestamp[s] (number of seconds since the UNIX-epoch) without losing precision\n new_field = pa.field(\n field.name, pa.timestamp(\"s\"), field.nullable, field.metadata\n )\n new_schema = new_schema.set(i, new_field)\n need_cast = True\n # HDK doesn't support unsigned types\n elif pa.types.is_unsigned_integer(field.type):\n new_field = pa.field(\n field.name,\n uint_to_int_map[field.type],\n field.nullable,\n field.metadata,\n )\n new_schema = new_schema.set(i, new_field)\n need_cast = True\n uint_to_int_cast = True\n\n # Such cast may affect the data, so we have to raise a warning about it\n if uint_to_int_cast:\n ErrorMessage.single_warning(\n \"HDK does not support unsigned integer types, such types will be rounded up to the signed equivalent.\"\n )\n\n for i, col in new_cols.items():\n table = table.set_column(i, new_schema[i], col)\n\n if need_cast:\n try:\n table = table.cast(new_schema)\n except pa.lib.ArrowInvalid as err:\n raise (OverflowError if uint_to_int_cast else RuntimeError)(\n \"An error occurred when trying to convert unsupported by HDK 'dtypes' \"\n + f\"to the supported ones, the schema to cast was: \\n{new_schema}.\"\n ) from err\n\n return table", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.compute_fragment_size_BaseDbWorker.compute_fragment_size.return.fragment_size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.compute_fragment_size_BaseDbWorker.compute_fragment_size.return.fragment_size", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py", "file_name": "base_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 215, "span_ids": ["BaseDbWorker.compute_fragment_size"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseDbWorker(abc.ABC):\n\n @classmethod\n def compute_fragment_size(cls, table):\n \"\"\"\n Compute fragment size to be used for table import.\n\n Parameters\n ----------\n table : pyarrow.Table\n A table to import.\n\n Returns\n -------\n int\n Fragment size to use for import.\n \"\"\"\n fragment_size = HdkFragmentSize.get()\n if fragment_size is None:\n fragment_size = OmnisciFragmentSize.get()\n if fragment_size is None:\n cpu_count = os.cpu_count()\n if cpu_count is not None:\n fragment_size = table.num_rows // cpu_count\n fragment_size = min(fragment_size, 2**25)\n fragment_size = max(fragment_size, 2**18)\n else:\n fragment_size = 0\n else:\n fragment_size = int(fragment_size)\n return fragment_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.import_arrow_table_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py_BaseDbWorker.import_arrow_table_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/base_worker.py", "file_name": "base_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 255, "span_ids": ["BaseDbWorker.import_arrow_table", "BaseDbWorker.import_pandas_dataframe"], "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 BaseDbWorker(abc.ABC):\n\n @classmethod\n @abc.abstractmethod\n def import_arrow_table(cls, table, name=None):\n \"\"\"\n Import Arrow table to the worker.\n\n Parameters\n ----------\n table : pyarrow.Table\n A table to import.\n name : str, optional\n A table name to use. None to generate a unique name.\n\n Returns\n -------\n str\n Imported table name.\n \"\"\"\n pass\n\n @classmethod\n def import_pandas_dataframe(cls, df, name=None):\n \"\"\"\n Import ``pandas.DataFrame`` to the worker.\n\n Parameters\n ----------\n df : pandas.DataFrame\n A frame to import.\n name : str, optional\n A table name to use. None to generate a unique name.\n\n Returns\n -------\n str\n Imported table name.\n \"\"\"\n return cls.import_arrow_table(pa.Table.from_pandas(df), name=name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_abc_CalciteInputRefExpr.__repr__.return.f_input_self_input_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_abc_CalciteInputRefExpr.__repr__.return.f_input_self_input_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 69, "span_ids": ["CalciteInputRefExpr.__init__", "CalciteInputRefExpr.__repr__", "docstring", "CalciteInputRefExpr", "CalciteInputRefExpr.copy"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import abc\n\nfrom .dataframe.utils import ColNameCodec\nfrom .expr import BaseExpr\n\n\nclass CalciteInputRefExpr(BaseExpr):\n \"\"\"\n Calcite version of input column reference.\n\n Calcite translation should replace all ``InputRefExpr``.\n\n Calcite references columns by their indexes (positions in input table).\n If there are multiple input tables for Calcite node, then a position\n in a concatenated list of all columns is used.\n\n Parameters\n ----------\n idx : int\n Input column index.\n\n Attributes\n ----------\n input : int\n Input column index.\n \"\"\"\n\n def __init__(self, idx):\n self.input = idx\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n CalciteInputRefExpr\n \"\"\"\n return CalciteInputRefExpr(self.input)\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the expression.\n\n Returns\n -------\n str\n \"\"\"\n return f\"(input {self.input})\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteInputIdxExpr_CalciteInputIdxExpr.__repr__.return.f_input_idx_self_input_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteInputIdxExpr_CalciteInputIdxExpr.__repr__.return.f_input_idx_self_input_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 108, "span_ids": ["CalciteInputIdxExpr", "CalciteInputIdxExpr.copy", "CalciteInputIdxExpr.__init__", "CalciteInputIdxExpr.__repr__"], "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 CalciteInputIdxExpr(BaseExpr):\n \"\"\"\n Basically the same as ``CalciteInputRefExpr`` but with a different serialization.\n\n Parameters\n ----------\n idx : int\n Input column index.\n\n Attributes\n ----------\n input : int\n Input column index.\n \"\"\"\n\n def __init__(self, idx):\n self.input = idx\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n CalciteInputIdxExpr\n \"\"\"\n return CalciteInputIdxExpr(self.input)\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the expression.\n\n Returns\n -------\n str\n \"\"\"\n return f\"(input_idx {self.input})\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteBaseNode_CalciteBaseNode.reset_id.cls__next_id_0_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteBaseNode_CalciteBaseNode.reset_id.cls__next_id_0_0", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 155, "span_ids": ["CalciteBaseNode.__init__", "CalciteBaseNode.reset_id", "CalciteBaseNode"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBaseNode(abc.ABC):\n \"\"\"\n A base class for a Calcite computation sequence node.\n\n Calcite nodes are not combined into a tree but usually stored\n in a sequence which works similar to a stack machine: the result\n of the previous operation is an implicit operand of the current\n one. Input nodes also can be referenced directly via its unique\n ID number.\n\n Calcite nodes structure is based on a JSON representation used by\n HDK for parsed queries serialization/deserialization for\n interactions with a Calcite server. Currently, this format is\n internal and is not a part of public API. It's not documented\n and can be modified in an incompatible way in the future.\n\n Parameters\n ----------\n relOp : str\n An operation name.\n\n Attributes\n ----------\n id : int\n Id of the node. Should be unique within a single query.\n relOp : str\n Operation name.\n \"\"\"\n\n _next_id = [0]\n\n def __init__(self, relOp):\n self.id = str(type(self)._next_id[0])\n type(self)._next_id[0] += 1\n self.relOp = relOp\n\n @classmethod\n def reset_id(cls):\n \"\"\"\n Reset ID to be used for the next new node to 0.\n\n Can be used to have a zero-based numbering for each\n generated query.\n \"\"\"\n cls._next_id[0] = 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteScanNode_CalciteScanNode.__init__.self.inputs._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteScanNode_CalciteScanNode.__init__.self.inputs._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 192, "span_ids": ["CalciteScanNode.__init__", "CalciteScanNode"], "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 CalciteScanNode(CalciteBaseNode):\n \"\"\"\n A node to represent a scan operation.\n\n Scan operation can only be applied to physical tables.\n\n Parameters\n ----------\n modin_frame : HdkOnNativeDataframe\n A frame to scan. The frame should have a materialized table\n in HDK.\n\n Attributes\n ----------\n table : list of str\n A list holding a database name and a table name.\n fieldNames : list of str\n A list of columns to include into the scan.\n inputs : list\n An empty list existing for the sake of serialization\n simplicity. Has no meaning but is expected by HDK\n deserializer.\n \"\"\"\n\n def __init__(self, modin_frame):\n assert modin_frame._partitions is not None\n assert modin_frame._partitions[0][0].frame_id is not None\n super(CalciteScanNode, self).__init__(\"EnumerableTableScan\")\n self.table = [\"hdk\", modin_frame._partitions[0][0].frame_id]\n self.fieldNames = [\n ColNameCodec.encode(col) for col in modin_frame._table_cols\n ] + [\"rowid\"]\n # HDK expects from scan node to have 'inputs' field\n # holding empty list\n self.inputs = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteProjectionNode_CalciteFilterNode.__init__.self.condition.condition": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteProjectionNode_CalciteFilterNode.__init__.self.condition.condition", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 238, "span_ids": ["CalciteFilterNode.__init__", "CalciteProjectionNode.__init__", "CalciteFilterNode", "CalciteProjectionNode"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteProjectionNode(CalciteBaseNode):\n \"\"\"\n A node to represent a projection operation.\n\n Parameters\n ----------\n fields : list of str\n Output column names.\n exprs : list of BaseExpr\n Output column expressions.\n\n Attributes\n ----------\n fields : list of str\n A list of output columns.\n exprs : list of BaseExpr\n A list of expressions describing how output columns are computed.\n Order of expression follows `fields` order.\n \"\"\"\n\n def __init__(self, fields, exprs):\n super(CalciteProjectionNode, self).__init__(\"LogicalProject\")\n self.fields = [ColNameCodec.encode(field) for field in fields]\n self.exprs = exprs\n\n\nclass CalciteFilterNode(CalciteBaseNode):\n \"\"\"\n A node to represent a filter operation.\n\n Parameters\n ----------\n condition : BaseExpr\n A filtering condition.\n\n Attributes\n ----------\n condition : BaseExpr\n A filter to apply.\n \"\"\"\n\n def __init__(self, condition):\n super(CalciteFilterNode, self).__init__(\"LogicalFilter\")\n self.condition = condition", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteAggregateNode_CalciteAggregateNode.__init__.self.aggs.aggs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteAggregateNode_CalciteAggregateNode.__init__.self.aggs.aggs", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 241, "end_line": 268, "span_ids": ["CalciteAggregateNode.__init__", "CalciteAggregateNode"], "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 CalciteAggregateNode(CalciteBaseNode):\n \"\"\"\n A node to represent an aggregate operation.\n\n Parameters\n ----------\n fields : list of str\n Output field names.\n group : list of CalciteInputIdxExpr\n Group key columns.\n aggs : list of BaseExpr\n Aggregates to compute.\n\n Attributes\n ----------\n fields : list of str\n Output field names.\n group : list of CalciteInputIdxExpr\n Group key columns.\n aggs : list of BaseExpr\n Aggregates to compute.\n \"\"\"\n\n def __init__(self, fields, group, aggs):\n super(CalciteAggregateNode, self).__init__(\"LogicalAggregate\")\n self.fields = [ColNameCodec.encode(field) for field in fields]\n self.group = group\n self.aggs = aggs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteCollation_CalciteSortNode.__init__.self.collation.collation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteCollation_CalciteSortNode.__init__.self.collation.collation", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 317, "span_ids": ["CalciteSortNode", "CalciteSortNode.__init__", "CalciteCollation", "CalciteCollation.__init__"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteCollation:\n \"\"\"\n A structure to describe sorting order.\n\n Parameters\n ----------\n field : CalciteInputIdxExpr\n A column to sort by.\n dir : {\"ASCENDING\", \"DESCENDING\"}, default: \"ASCENDING\"\n A sort order.\n nulls : {\"LAST\", \"FIRST\"}, default: \"LAST\"\n NULLs position after the sort.\n\n Attributes\n ----------\n field : CalciteInputIdxExpr\n A column to sort by.\n dir : {\"ASCENDING\", \"DESCENDING\"}\n A sort order.\n nulls : {\"LAST\", \"FIRST\"}\n NULLs position after the sort.\n \"\"\"\n\n def __init__(self, field, dir=\"ASCENDING\", nulls=\"LAST\"):\n self.field = field\n self.direction = dir\n self.nulls = nulls\n\n\nclass CalciteSortNode(CalciteBaseNode):\n \"\"\"\n A node to represent a sort operation.\n\n Parameters\n ----------\n collation : list of CalciteCollation\n Sort keys.\n\n Attributes\n ----------\n collation : list of CalciteCollation\n Sort keys.\n \"\"\"\n\n def __init__(self, collation):\n super(CalciteSortNode, self).__init__(\"LogicalSort\")\n self.collation = collation", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteJoinNode_CalciteJoinNode.__init__.self.condition.condition": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteJoinNode_CalciteJoinNode.__init__.self.condition.condition", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 349, "span_ids": ["CalciteJoinNode", "CalciteJoinNode.__init__"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteJoinNode(CalciteBaseNode):\n \"\"\"\n A node to represent a join operation.\n\n Parameters\n ----------\n left_id : int\n ID of the left join operand.\n right_id : int\n ID of the right join operand.\n how : str\n Type of the join.\n condition : BaseExpr\n Join condition.\n\n Attributes\n ----------\n inputs : list of int\n IDs of the left and the right operands of the join.\n joinType : str\n Type of the join.\n condition : BaseExpr\n Join condition.\n \"\"\"\n\n def __init__(self, left_id, right_id, how, condition):\n super(CalciteJoinNode, self).__init__(\"LogicalJoin\")\n self.inputs = [left_id, right_id]\n self.joinType = how\n self.condition = condition", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteUnionNode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py_CalciteUnionNode_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_algebra.py", "file_name": "calcite_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 352, "end_line": 375, "span_ids": ["CalciteUnionNode.__init__", "CalciteUnionNode"], "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 CalciteUnionNode(CalciteBaseNode):\n \"\"\"\n A node to represent a union operation.\n\n Parameters\n ----------\n inputs : list of int\n Input frame IDs.\n all : bool\n True for UNION ALL operation.\n\n Attributes\n ----------\n inputs : list of int\n Input frame IDs.\n all : bool\n True for UNION ALL operation.\n \"\"\"\n\n def __init__(self, inputs, all):\n super(CalciteUnionNode, self).__init__(\"LogicalUnion\")\n self.inputs = inputs\n self.all = 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_ColNameCodec_from_pandas_core_dtypes_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_ColNameCodec_from_pandas_core_dtypes_c", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 48, "span_ids": ["docstring"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .dataframe.utils import ColNameCodec\nfrom .expr import (\n InputRefExpr,\n LiteralExpr,\n AggregateExpr,\n build_if_then_else,\n build_row_idx_filter_expr,\n)\nfrom .calcite_algebra import (\n CalciteBaseNode,\n CalciteInputRefExpr,\n CalciteInputIdxExpr,\n CalciteScanNode,\n CalciteProjectionNode,\n CalciteFilterNode,\n CalciteAggregateNode,\n CalciteCollation,\n CalciteSortNode,\n CalciteJoinNode,\n CalciteUnionNode,\n)\nfrom .df_algebra import (\n FrameNode,\n MaskNode,\n GroupbyAggNode,\n TransformNode,\n JoinNode,\n UnionNode,\n SortNode,\n FilterNode,\n)\n\nfrom collections import abc\nfrom pandas.core.dtypes.common import get_dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder_CalciteBuilder.CompoundAggregate.gen_reduce_expr.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder_CalciteBuilder.CompoundAggregate.gen_reduce_expr.pass", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 107, "span_ids": ["CalciteBuilder.CompoundAggregate", "CalciteBuilder.CompoundAggregate.__init__", "CalciteBuilder", "CalciteBuilder.CompoundAggregate.gen_proj_exprs", "CalciteBuilder.CompoundAggregate.gen_reduce_expr", "CalciteBuilder.CompoundAggregate.gen_agg_exprs"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n \"\"\"Translator used to transform ``DFAlgNode`` tree into a calcite node sequence.\"\"\"\n\n class CompoundAggregate:\n \"\"\"\n A base class for a compound aggregate translation.\n\n Translation is done in three steps. Step 1 is an additional\n values generation using a projection. Step 2 is a generation\n of aggregates that will be later used for a compound aggregate\n value computation. Step 3 is a final aggregate value generation\n using another projection.\n\n Parameters\n ----------\n builder : CalciteBuilder\n A builder to use for translation.\n arg : BaseExpr\n An aggregated value.\n \"\"\"\n\n def __init__(self, builder, arg):\n self._builder = builder\n self._arg = arg\n\n def gen_proj_exprs(self):\n \"\"\"\n Generate values required for intermediate aggregates computation.\n\n Returns\n -------\n dict\n New column expressions mapped to their names.\n \"\"\"\n return []\n\n def gen_agg_exprs(self):\n \"\"\"\n Generate intermediate aggregates required for a compound aggregate computation.\n\n Returns\n -------\n dict\n New aggregate expressions mapped to their names.\n \"\"\"\n pass\n\n def gen_reduce_expr(self):\n \"\"\"\n Generate an expression for a compound aggregate.\n\n Returns\n -------\n BaseExpr\n A final compound aggregate expression.\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate_CalciteBuilder.StdAggregate.gen_proj_exprs.return._self__quad_name_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate_CalciteBuilder.StdAggregate.gen_proj_exprs.return._self__quad_name_expr_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 140, "span_ids": ["CalciteBuilder.StdAggregate.gen_proj_exprs", "CalciteBuilder.StdAggregate.__init__", "CalciteBuilder.StdAggregate"], "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 CalciteBuilder:\n\n class StdAggregate(CompoundAggregate):\n \"\"\"\n A sample standard deviation aggregate generator.\n\n Parameters\n ----------\n builder : CalciteBuilder\n A builder to use for translation.\n arg : BaseExpr\n An aggregated value.\n \"\"\"\n\n def __init__(self, builder, arg):\n assert isinstance(arg, InputRefExpr)\n super().__init__(builder, arg)\n\n self._quad_name = self._arg.column + \"__quad__\"\n self._sum_name = self._arg.column + \"__sum__\"\n self._quad_sum_name = self._arg.column + \"__quad_sum__\"\n self._count_name = self._arg.column + \"__count__\"\n\n def gen_proj_exprs(self):\n \"\"\"\n Generate values required for intermediate aggregates computation.\n\n Returns\n -------\n dict\n New column expressions mapped to their names.\n \"\"\"\n expr = self._builder._translate(self._arg.mul(self._arg))\n return {self._quad_name: expr}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate.gen_agg_exprs_CalciteBuilder.StdAggregate.gen_agg_exprs.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate.gen_agg_exprs_CalciteBuilder.StdAggregate.gen_agg_exprs.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 164, "span_ids": ["CalciteBuilder.StdAggregate.gen_agg_exprs"], "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 CalciteBuilder:\n\n class StdAggregate(CompoundAggregate):\n\n def gen_agg_exprs(self):\n \"\"\"\n Generate intermediate aggregates required for a compound aggregate computation.\n\n Returns\n -------\n dict\n New aggregate expressions mapped to their names.\n \"\"\"\n count_expr = self._builder._translate(AggregateExpr(\"count\", self._arg))\n sum_expr = self._builder._translate(AggregateExpr(\"sum\", self._arg))\n self._sum_dtype = sum_expr._dtype\n qsum_expr = AggregateExpr(\n \"SUM\",\n self._builder._ref_idx(self._arg.modin_frame, self._quad_name),\n dtype=sum_expr._dtype,\n )\n\n return {\n self._sum_name: sum_expr,\n self._quad_sum_name: qsum_expr,\n self._count_name: count_expr,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate.gen_reduce_expr_CalciteBuilder.StdAggregate.gen_reduce_expr.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.StdAggregate.gen_reduce_expr_CalciteBuilder.StdAggregate.gen_reduce_expr.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 198, "span_ids": ["CalciteBuilder.StdAggregate.gen_reduce_expr"], "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 CalciteBuilder:\n\n class StdAggregate(CompoundAggregate):\n\n def gen_reduce_expr(self):\n \"\"\"\n Generate an expression for a compound aggregate.\n\n Returns\n -------\n BaseExpr\n A final compound aggregate expression.\n \"\"\"\n count_expr = self._builder._ref(self._arg.modin_frame, self._count_name)\n count_expr._dtype = get_dtype(int)\n sum_expr = self._builder._ref(self._arg.modin_frame, self._sum_name)\n sum_expr._dtype = self._sum_dtype\n qsum_expr = self._builder._ref(self._arg.modin_frame, self._quad_sum_name)\n qsum_expr._dtype = self._sum_dtype\n\n null_expr = LiteralExpr(None)\n count_or_null = build_if_then_else(\n count_expr.eq(LiteralExpr(0)), null_expr, count_expr, count_expr._dtype\n )\n count_m_1_or_null = build_if_then_else(\n count_expr.eq(LiteralExpr(1)),\n null_expr,\n count_expr.sub(LiteralExpr(1)),\n count_expr._dtype,\n )\n\n # sqrt((sum(x * x) - sum(x) * sum(x) / n) / (n - 1))\n return (\n qsum_expr.sub(sum_expr.mul(sum_expr).truediv(count_or_null))\n .truediv(count_m_1_or_null)\n .pow(LiteralExpr(0.5))\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate_CalciteBuilder.SkewAggregate.gen_proj_exprs.return._self__quad_name_quad_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate_CalciteBuilder.SkewAggregate.gen_proj_exprs.return._self__quad_name_quad_ex", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 236, "span_ids": ["CalciteBuilder.SkewAggregate.gen_proj_exprs", "CalciteBuilder.SkewAggregate", "CalciteBuilder.SkewAggregate.__init__"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n class SkewAggregate(CompoundAggregate):\n \"\"\"\n An unbiased skew aggregate generator.\n\n Parameters\n ----------\n builder : CalciteBuilder\n A builder to use for translation.\n arg : BaseExpr\n An aggregated value.\n \"\"\"\n\n def __init__(self, builder, arg):\n assert isinstance(arg, InputRefExpr)\n super().__init__(builder, arg)\n\n self._quad_name = self._arg.column + \"__quad__\"\n self._cube_name = self._arg.column + \"__cube__\"\n self._sum_name = self._arg.column + \"__sum__\"\n self._quad_sum_name = self._arg.column + \"__quad_sum__\"\n self._cube_sum_name = self._arg.column + \"__cube_sum__\"\n self._count_name = self._arg.column + \"__count__\"\n\n def gen_proj_exprs(self):\n \"\"\"\n Generate values required for intermediate aggregates computation.\n\n Returns\n -------\n dict\n New column expressions mapped to their names.\n \"\"\"\n quad_expr = self._builder._translate(self._arg.mul(self._arg))\n cube_expr = self._builder._translate(\n self._arg.mul(self._arg).mul(self._arg)\n )\n return {self._quad_name: quad_expr, self._cube_name: cube_expr}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate.gen_agg_exprs_CalciteBuilder.SkewAggregate.gen_agg_exprs.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate.gen_agg_exprs_CalciteBuilder.SkewAggregate.gen_agg_exprs.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 266, "span_ids": ["CalciteBuilder.SkewAggregate.gen_agg_exprs"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n class SkewAggregate(CompoundAggregate):\n\n def gen_agg_exprs(self):\n \"\"\"\n Generate intermediate aggregates required for a compound aggregate computation.\n\n Returns\n -------\n dict\n New aggregate expressions mapped to their names.\n \"\"\"\n count_expr = self._builder._translate(AggregateExpr(\"count\", self._arg))\n sum_expr = self._builder._translate(AggregateExpr(\"sum\", self._arg))\n self._sum_dtype = sum_expr._dtype\n qsum_expr = AggregateExpr(\n \"SUM\",\n self._builder._ref_idx(self._arg.modin_frame, self._quad_name),\n dtype=sum_expr._dtype,\n )\n csum_expr = AggregateExpr(\n \"SUM\",\n self._builder._ref_idx(self._arg.modin_frame, self._cube_name),\n dtype=sum_expr._dtype,\n )\n\n return {\n self._sum_name: sum_expr,\n self._quad_sum_name: qsum_expr,\n self._cube_sum_name: csum_expr,\n self._count_name: count_expr,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate.gen_reduce_expr_CalciteBuilder._compound_aggregates._std_StdAggregate_sk": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.SkewAggregate.gen_reduce_expr_CalciteBuilder._compound_aggregates._std_StdAggregate_sk", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 268, "end_line": 308, "span_ids": ["CalciteBuilder:3", "CalciteBuilder.SkewAggregate.gen_reduce_expr"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n class SkewAggregate(CompoundAggregate):\n\n def gen_reduce_expr(self):\n \"\"\"\n Generate an expression for a compound aggregate.\n\n Returns\n -------\n BaseExpr\n A final compound aggregate expression.\n \"\"\"\n count_expr = self._builder._ref(self._arg.modin_frame, self._count_name)\n count_expr._dtype = get_dtype(int)\n sum_expr = self._builder._ref(self._arg.modin_frame, self._sum_name)\n sum_expr._dtype = self._sum_dtype\n qsum_expr = self._builder._ref(self._arg.modin_frame, self._quad_sum_name)\n qsum_expr._dtype = self._sum_dtype\n csum_expr = self._builder._ref(self._arg.modin_frame, self._cube_sum_name)\n csum_expr._dtype = self._sum_dtype\n\n mean_expr = sum_expr.truediv(count_expr)\n\n # n * sqrt(n - 1) / (n - 2)\n # * (sum(x ** 3) - 3 * mean * sum(x * x) + 2 * mean * mean * sum(x))\n # / (sum(x * x) - mean * sum(x)) ** 1.5\n part1 = count_expr.mul(\n count_expr.sub(LiteralExpr(1)).pow(LiteralExpr(0.5))\n ).truediv(count_expr.sub(LiteralExpr(2)))\n part2 = csum_expr.sub(mean_expr.mul(qsum_expr).mul(LiteralExpr(3.0))).add(\n mean_expr.mul(mean_expr).mul(sum_expr).mul(LiteralExpr(2.0))\n )\n part3 = qsum_expr.sub(mean_expr.mul(sum_expr)).pow(LiteralExpr(1.5))\n skew_expr = part1.mul(part2).truediv(part3)\n\n # The result is NULL if n <= 2\n return build_if_then_else(\n count_expr.le(LiteralExpr(2)),\n LiteralExpr(None),\n skew_expr,\n skew_expr._dtype,\n )\n\n _compound_aggregates = {\"std\": StdAggregate, \"skew\": SkewAggregate}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext_CalciteBuilder.InputContext.replace_input_node.self_replacements_frame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext_CalciteBuilder.InputContext.replace_input_node.self_replacements_frame_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 374, "span_ids": ["CalciteBuilder.InputContext.__init__", "CalciteBuilder.InputContext.replace_input_node", "CalciteBuilder.InputContext"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n class InputContext:\n \"\"\"\n A class to track current input frames and corresponding nodes.\n\n Used to translate input column references to numeric indices.\n\n Parameters\n ----------\n input_frames : list of DFAlgNode\n Input nodes of the currently translated node.\n input_nodes : list of CalciteBaseNode\n Translated input nodes.\n\n Attributes\n ----------\n input_nodes : list of CalciteBaseNode\n Input nodes of the currently translated node.\n frame_to_node : dict\n Maps input frames to corresponding calcite nodes.\n input_offsets : dict\n Maps input frame to an input index used for its first column.\n replacements : dict\n Maps input frame to a new list of columns to use. Used when\n a single `DFAlgNode` is lowered into multiple computation\n steps, e.g. for compound aggregates requiring additional\n projections.\n \"\"\"\n\n _simple_aggregates = {\n \"sum\": \"SUM\",\n \"mean\": \"AVG\",\n \"max\": \"MAX\",\n \"min\": \"MIN\",\n \"size\": \"COUNT\",\n \"count\": \"COUNT\",\n }\n _no_arg_aggregates = {\"size\"}\n\n def __init__(self, input_frames, input_nodes):\n self.input_nodes = input_nodes\n self.frame_to_node = {x: y for x, y in zip(input_frames, input_nodes)}\n self.input_offsets = {}\n self.replacements = {}\n offs = 0\n for frame in input_frames:\n self.input_offsets[frame] = offs\n offs += len(frame._table_cols)\n # Materialized frames have additional 'rowid' column\n if isinstance(frame._op, FrameNode):\n offs += 1\n\n def replace_input_node(self, frame, node, new_cols):\n \"\"\"\n Use `node` as an input node for references to columns of `frame`.\n\n Parameters\n ----------\n frame : DFAlgNode\n Replaced input frame.\n node : CalciteBaseNode\n A new node to use.\n new_cols : list of str\n A new columns list to use.\n \"\"\"\n self.replacements[frame] = new_cols", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext._idx_CalciteBuilder.InputContext._idx.return.frame__table_cols_index_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext._idx_CalciteBuilder.InputContext._idx.return.frame__table_cols_index_c", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 376, "end_line": 410, "span_ids": ["CalciteBuilder.InputContext._idx"], "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 CalciteBuilder:\n\n class InputContext:\n\n def _idx(self, frame, col):\n \"\"\"\n Get a numeric input index for an input column.\n\n Parameters\n ----------\n frame : DFAlgNode\n An input frame.\n col : str\n An input column.\n\n Returns\n -------\n int\n \"\"\"\n assert (\n frame in self.input_offsets\n ), f\"unexpected reference to {frame.id_str()}\"\n\n offs = self.input_offsets[frame]\n\n if frame in self.replacements:\n return self.replacements[frame].index(col) + offs\n\n if col == ColNameCodec.ROWID_COL_NAME:\n if not isinstance(self.frame_to_node[frame], CalciteScanNode):\n raise NotImplementedError(\n \"rowid can be accessed in materialized frames only\"\n )\n return len(frame._table_cols) + offs\n\n assert (\n col in frame._table_cols\n ), f\"unexpected reference to '{col}' in {frame.id_str()}\"\n return frame._table_cols.index(col) + offs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext.ref_CalciteBuilder.InputContext.translate.return.self__maybe_copy_and_tran": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext.ref_CalciteBuilder.InputContext.translate.return.self__maybe_copy_and_tran", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 412, "end_line": 473, "span_ids": ["CalciteBuilder.InputContext.translate", "CalciteBuilder.InputContext.input_ids", "CalciteBuilder.InputContext.ref_idx", "CalciteBuilder.InputContext.ref"], "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 CalciteBuilder:\n\n class InputContext:\n\n def ref(self, frame, col):\n \"\"\"\n Translate input column into ``CalciteInputRefExpr``.\n\n Parameters\n ----------\n frame : DFAlgNode\n An input frame.\n col : str\n An input column.\n\n Returns\n -------\n CalciteInputRefExpr\n \"\"\"\n return CalciteInputRefExpr(self._idx(frame, col))\n\n def ref_idx(self, frame, col):\n \"\"\"\n Translate input column into ``CalciteInputIdxExpr``.\n\n Parameters\n ----------\n frame : DFAlgNode\n An input frame.\n col : str\n An input column.\n\n Returns\n -------\n CalciteInputIdxExpr\n \"\"\"\n return CalciteInputIdxExpr(self._idx(frame, col))\n\n def input_ids(self):\n \"\"\"\n Get ids of all input nodes.\n\n Returns\n -------\n list of int\n \"\"\"\n return [x.id for x in self.input_nodes]\n\n def translate(self, expr):\n \"\"\"\n Translate an expression.\n\n Translation is done by replacing ``InputRefExpr`` with\n ``CalciteInputRefExpr`` and ``CalciteInputIdxExpr``.\n\n Parameters\n ----------\n expr : BaseExpr\n An expression to translate.\n\n Returns\n -------\n BaseExpr\n Translated expression.\n \"\"\"\n return self._maybe_copy_and_translate_expr(expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext._maybe_copy_and_translate_expr_CalciteBuilder.InputContext._maybe_copy_and_translate_expr.return.expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContext._maybe_copy_and_translate_expr_CalciteBuilder.InputContext._maybe_copy_and_translate_expr.return.expr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 475, "end_line": 516, "span_ids": ["CalciteBuilder.InputContext._maybe_copy_and_translate_expr"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n class InputContext:\n\n def _maybe_copy_and_translate_expr(self, expr, ref_idx=False):\n \"\"\"\n Translate an expression.\n\n Translate an expression replacing ``InputRefExpr`` with ``CalciteInputRefExpr``\n and ``CalciteInputIdxExpr``. An expression tree branches with input columns\n are copied into a new tree, other branches are used as is.\n\n Parameters\n ----------\n expr : BaseExpr\n An expression to translate.\n ref_idx : bool, default: False\n If True then translate ``InputRefExpr`` to ``CalciteInputIdxExpr``,\n use ``CalciteInputRefExr`` otherwise.\n\n Returns\n -------\n BaseExpr\n Translated expression.\n \"\"\"\n if isinstance(expr, InputRefExpr):\n if ref_idx:\n return self.ref_idx(expr.modin_frame, expr.column)\n else:\n return self.ref(expr.modin_frame, expr.column)\n\n if isinstance(expr, AggregateExpr):\n expr = expr.copy()\n if expr.agg in self._no_arg_aggregates:\n expr.operands = []\n else:\n expr.operands[0] = self._maybe_copy_and_translate_expr(\n expr.operands[0], True\n )\n expr.agg = self._simple_aggregates[expr.agg]\n return expr\n\n gen = expr.nested_expressions()\n for op in gen:\n expr = gen.send(self._maybe_copy_and_translate_expr(op))\n return expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContextMgr_CalciteBuilder.InputContextMgr.__exit__.self_builder__input_ctx_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.InputContextMgr_CalciteBuilder.InputContextMgr.__exit__.self_builder__input_ctx_s", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 576, "span_ids": ["CalciteBuilder.InputContextMgr.__init__", "CalciteBuilder.InputContextMgr", "CalciteBuilder.InputContextMgr.__enter__", "CalciteBuilder.InputContextMgr.__exit__"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n class InputContextMgr:\n \"\"\"\n A helper class to manage an input context stack.\n\n The class is designed to be used in a recursion with nested\n 'with' statements.\n\n Parameters\n ----------\n builder : CalciteBuilder\n An outer builder.\n input_frames : list of DFAlgNode\n Input nodes for the new context.\n input_nodes : list of CalciteBaseNode\n Translated input nodes.\n\n Attributes\n ----------\n builder : CalciteBuilder\n An outer builder.\n input_frames : list of DFAlgNode\n Input nodes for the new context.\n input_nodes : list of CalciteBaseNode\n Translated input nodes.\n \"\"\"\n\n def __init__(self, builder, input_frames, input_nodes):\n self.builder = builder\n self.input_frames = input_frames\n self.input_nodes = input_nodes\n\n def __enter__(self):\n \"\"\"\n Push new input context into the input context stack.\n\n Returns\n -------\n InputContext\n New input context.\n \"\"\"\n self.builder._input_ctx_stack.append(\n self.builder.InputContext(self.input_frames, self.input_nodes)\n )\n return self.builder._input_ctx_stack[-1]\n\n def __exit__(self, type, value, traceback):\n \"\"\"\n Pop current input context.\n\n Parameters\n ----------\n type : Any\n An exception type.\n value : Any\n An exception value.\n traceback : Any\n A traceback.\n \"\"\"\n self.builder._input_ctx_stack.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.type_strings_CalciteBuilder.build.return.self_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder.type_strings_CalciteBuilder.build.return.self_res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 578, "end_line": 603, "span_ids": ["CalciteBuilder:5", "CalciteBuilder.build", "CalciteBuilder.__init__"], "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 CalciteBuilder:\n\n type_strings = {\n int: \"INTEGER\",\n bool: \"BOOLEAN\",\n }\n\n def __init__(self):\n self._input_ctx_stack = []\n\n def build(self, op):\n \"\"\"\n Translate a ``DFAlgNode`` tree into a calcite nodes sequence.\n\n Parameters\n ----------\n op : DFAlgNode\n A tree to translate.\n\n Returns\n -------\n list of CalciteBaseNode\n The resulting calcite nodes sequence.\n \"\"\"\n CalciteBaseNode.reset_id()\n self.res = []\n self._to_calcite(op)\n return self.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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._add_projection_CalciteBuilder._add_projection.return.proj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._add_projection_CalciteBuilder._add_projection.return.proj", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 605, "end_line": 626, "span_ids": ["CalciteBuilder._add_projection"], "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 CalciteBuilder:\n\n def _add_projection(self, frame):\n \"\"\"\n Add a projection node to the resulting sequence.\n\n Added node simply selects all frame's columns. This method can be used\n to discard a virtual 'rowid' column provided by all scan nodes.\n\n Parameters\n ----------\n frame : HdkOnNativeDataframe\n An input frame for a projection.\n\n Returns\n -------\n CalciteProjectionNode\n Created projection node.\n \"\"\"\n proj = CalciteProjectionNode(\n frame._table_cols, [self._ref(frame, col) for col in frame._table_cols]\n )\n self._push(proj)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._input_ctx_CalciteBuilder._ref_idx.return.self__input_ctx_ref_idx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._input_ctx_CalciteBuilder._ref_idx.return.self__input_ctx_ref_idx", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 628, "end_line": 708, "span_ids": ["CalciteBuilder._set_tmp_ctx", "CalciteBuilder._ref_idx", "CalciteBuilder._input_ctx", "CalciteBuilder._ref", "CalciteBuilder._set_input_ctx"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n def _input_ctx(self):\n \"\"\"\n Get current input context.\n\n Returns\n -------\n InputContext\n \"\"\"\n return self._input_ctx_stack[-1]\n\n def _set_input_ctx(self, op):\n \"\"\"\n Create input context manager for a node translation.\n\n Parameters\n ----------\n op : DFAlgNode\n A translated node.\n\n Returns\n -------\n InputContextMgr\n Created input context manager.\n \"\"\"\n input_frames = getattr(op, \"input\", [])\n input_nodes = [self._to_calcite(x._op) for x in input_frames]\n return self.InputContextMgr(self, input_frames, input_nodes)\n\n def _set_tmp_ctx(self, input_frames, input_nodes):\n \"\"\"\n Create a temporary input context manager.\n\n This method is deprecated.\n\n Parameters\n ----------\n input_frames : list of DFAlgNode\n Input nodes of the currently translated node.\n input_nodes : list of CalciteBaseNode\n Translated input nodes.\n\n Returns\n -------\n InputContextMgr\n Created input context manager.\n \"\"\"\n return self.InputContextMgr(self, input_frames, input_nodes)\n\n def _ref(self, frame, col):\n \"\"\"\n Translate input column into ``CalciteInputRefExpr``.\n\n Parameters\n ----------\n frame : DFAlgNode\n An input frame.\n col : str\n An input column.\n\n Returns\n -------\n CalciteInputRefExpr\n \"\"\"\n return self._input_ctx().ref(frame, col)\n\n def _ref_idx(self, frame, col):\n \"\"\"\n Translate input column into ``CalciteInputIdxExpr``.\n\n Parameters\n ----------\n frame : DFAlgNode\n An input frame.\n col : str\n An input column.\n\n Returns\n -------\n CalciteInputIdxExpr\n \"\"\"\n return self._input_ctx().ref_idx(frame, 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._translate_CalciteBuilder._translate.return.self__input_ctx_transla": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._translate_CalciteBuilder._translate.return.self__input_ctx_transla", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 710, "end_line": 729, "span_ids": ["CalciteBuilder._translate"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n def _translate(self, exprs):\n \"\"\"\n Translate expressions.\n\n Translate expressions replacing ``InputRefExpr`` with ``CalciteInputRefExpr`` and\n ``CalciteInputIdxExpr``.\n\n Parameters\n ----------\n exprs : BaseExpr or list-like of BaseExpr\n Expressions to translate.\n\n Returns\n -------\n BaseExpr or list of BaseExpr\n Translated expression.\n \"\"\"\n if isinstance(exprs, abc.Iterable):\n return [self._input_ctx().translate(x) for x in exprs]\n return self._input_ctx().translate(exprs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._push_CalciteBuilder._input_ids.return.self__input_ctx_input_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._push_CalciteBuilder._input_ids.return.self__input_ctx_input_i", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 731, "end_line": 785, "span_ids": ["CalciteBuilder._input_nodes", "CalciteBuilder._push", "CalciteBuilder._last", "CalciteBuilder._input_node", "CalciteBuilder._input_ids"], "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 CalciteBuilder:\n\n def _push(self, node):\n \"\"\"\n Append node to the resulting sequence.\n\n Parameters\n ----------\n node : CalciteBaseNode\n A node to add.\n \"\"\"\n self.res.append(node)\n\n def _last(self):\n \"\"\"\n Get the last node of the resulting calcite node sequence.\n\n Returns\n -------\n CalciteBaseNode\n \"\"\"\n return self.res[-1]\n\n def _input_nodes(self):\n \"\"\"\n Get current input calcite nodes.\n\n Returns\n -------\n list if CalciteBaseNode\n \"\"\"\n return self._input_ctx().input_nodes\n\n def _input_node(self, idx):\n \"\"\"\n Get an input calcite node by index.\n\n Parameters\n ----------\n idx : int\n An input node's index.\n\n Returns\n -------\n CalciteBaseNode\n \"\"\"\n return self._input_nodes()[idx]\n\n def _input_ids(self):\n \"\"\"\n Get ids of the current input nodes.\n\n Returns\n -------\n list of int\n \"\"\"\n return self._input_ctx().input_ids()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._to_calcite_CalciteBuilder._to_calcite.return.self_res_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._to_calcite_CalciteBuilder._to_calcite.return.self_res_1_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 787, "end_line": 825, "span_ids": ["CalciteBuilder._to_calcite"], "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 CalciteBuilder:\n\n def _to_calcite(self, op):\n \"\"\"\n Translate tree to a calcite node sequence.\n\n Parameters\n ----------\n op : DFAlgNode\n A tree to translate.\n\n Returns\n -------\n CalciteBaseNode\n The last node of the generated sequence.\n \"\"\"\n # This context translates input operands and setup current\n # input context to translate input references (recursion\n # over tree happens here).\n with self._set_input_ctx(op):\n if isinstance(op, FrameNode):\n self._process_frame(op)\n elif isinstance(op, MaskNode):\n self._process_mask(op)\n elif isinstance(op, GroupbyAggNode):\n self._process_groupby(op)\n elif isinstance(op, TransformNode):\n self._process_transform(op)\n elif isinstance(op, JoinNode):\n self._process_join(op)\n elif isinstance(op, UnionNode):\n self._process_union(op)\n elif isinstance(op, SortNode):\n self._process_sort(op)\n elif isinstance(op, FilterNode):\n self._process_filter(op)\n else:\n raise NotImplementedError(\n f\"CalciteBuilder doesn't support {type(op).__name__}\"\n )\n return self.res[-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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_frame_CalciteBuilder._process_mask.self__add_projection_fram": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_frame_CalciteBuilder._process_mask.self__add_projection_fram", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 827, "end_line": 859, "span_ids": ["CalciteBuilder._process_frame", "CalciteBuilder._process_mask"], "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 CalciteBuilder:\n\n def _process_frame(self, op):\n \"\"\"\n Translate ``FrameNode`` node.\n\n Parameters\n ----------\n op : FrameNode\n A frame to translate.\n \"\"\"\n self._push(CalciteScanNode(op.modin_frame))\n\n def _process_mask(self, op):\n \"\"\"\n Translate ``MaskNode`` node.\n\n Parameters\n ----------\n op : MaskNode\n An operation to translate.\n \"\"\"\n if op.row_labels is not None:\n raise NotImplementedError(\"row indices masking is not yet supported\")\n\n frame = op.input[0]\n\n # select rows by rowid\n rowid_col = self._ref(frame, ColNameCodec.ROWID_COL_NAME)\n condition = build_row_idx_filter_expr(op.row_positions, rowid_col)\n self._push(CalciteFilterNode(condition))\n\n # mask is currently always applied over scan, it means\n # we need additional projection to remove rowid column\n self._add_projection(frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_groupby_CalciteBuilder._process_groupby.if_op_groupby_opts_sort_.self__push_CalciteSortNod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_groupby_CalciteBuilder._process_groupby.if_op_groupby_opts_sort_.self__push_CalciteSortNod", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 861, "end_line": 923, "span_ids": ["CalciteBuilder._process_groupby"], "tokens": 559}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteBuilder:\n\n def _process_groupby(self, op):\n \"\"\"\n Translate ``GroupbyAggNode`` node.\n\n Parameters\n ----------\n op : GroupbyAggNode\n An operation to translate.\n \"\"\"\n frame = op.input[0]\n\n # Aggregation's input should always be a projection and\n # group key columns should always go first\n proj_cols = op.by.copy()\n for col in frame._table_cols:\n if col not in op.by:\n proj_cols.append(col)\n proj_exprs = [self._ref(frame, col) for col in proj_cols]\n # Add expressions required for compound aggregates\n compound_aggs = {}\n for agg, expr in op.agg_exprs.items():\n if expr.agg in self._compound_aggregates:\n compound_aggs[agg] = self._compound_aggregates[expr.agg](\n self, expr.operands[0]\n )\n extra_exprs = compound_aggs[agg].gen_proj_exprs()\n proj_cols.extend(extra_exprs.keys())\n proj_exprs.extend(extra_exprs.values())\n proj = CalciteProjectionNode(proj_cols, proj_exprs)\n self._push(proj)\n\n self._input_ctx().replace_input_node(frame, proj, proj_cols)\n\n group = [self._ref_idx(frame, col) for col in op.by]\n fields = op.by.copy()\n aggs = []\n for agg, expr in op.agg_exprs.items():\n if agg in compound_aggs:\n extra_aggs = compound_aggs[agg].gen_agg_exprs()\n fields.extend(extra_aggs.keys())\n aggs.extend(extra_aggs.values())\n else:\n fields.append(agg)\n aggs.append(self._translate(expr))\n node = CalciteAggregateNode(fields, group, aggs)\n self._push(node)\n\n if compound_aggs:\n self._input_ctx().replace_input_node(frame, node, fields)\n proj_cols = op.by.copy()\n proj_exprs = [self._ref(frame, col) for col in proj_cols]\n proj_cols.extend(op.agg_exprs.keys())\n for agg in op.agg_exprs:\n if agg in compound_aggs:\n proj_exprs.append(compound_aggs[agg].gen_reduce_expr())\n else:\n proj_exprs.append(self._ref(frame, agg))\n proj = CalciteProjectionNode(proj_cols, proj_exprs)\n self._push(proj)\n\n if op.groupby_opts[\"sort\"]:\n collation = [CalciteCollation(col) for col in group]\n self._push(CalciteSortNode(collation))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_transform_CalciteBuilder._process_union.self__push_CalciteUnionNo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_transform_CalciteBuilder._process_union.self__push_CalciteUnionNo", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 925, "end_line": 970, "span_ids": ["CalciteBuilder._process_union", "CalciteBuilder._process_join", "CalciteBuilder._process_transform"], "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 CalciteBuilder:\n\n def _process_transform(self, op):\n \"\"\"\n Translate ``TransformNode`` node.\n\n Parameters\n ----------\n op : TransformNode\n An operation to translate.\n \"\"\"\n fields = list(op.exprs.keys())\n exprs = self._translate(op.exprs.values())\n self._push(CalciteProjectionNode(fields, exprs))\n\n def _process_join(self, op):\n \"\"\"\n Translate ``JoinNode`` node.\n\n Parameters\n ----------\n op : JoinNode\n An operation to translate.\n \"\"\"\n node = CalciteJoinNode(\n left_id=self._input_node(0).id,\n right_id=self._input_node(1).id,\n how=op.how,\n condition=self._translate(op.condition),\n )\n self._push(node)\n\n self._push(\n CalciteProjectionNode(\n op.exprs.keys(), [self._translate(val) for val in op.exprs.values()]\n )\n )\n\n def _process_union(self, op):\n \"\"\"\n Translate ``UnionNode`` node.\n\n Parameters\n ----------\n op : UnionNode\n An operation to translate.\n \"\"\"\n self._push(CalciteUnionNode(self._input_ids(), 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_sort_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py_CalciteBuilder._process_sort_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_builder.py", "file_name": "calcite_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 972, "end_line": 1011, "span_ids": ["CalciteBuilder._process_filter", "CalciteBuilder._process_sort"], "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 CalciteBuilder:\n\n def _process_sort(self, op):\n \"\"\"\n Translate ``SortNode`` node.\n\n Parameters\n ----------\n op : SortNode\n An operation to translate.\n \"\"\"\n frame = op.input[0]\n if not isinstance(self._input_node(0), CalciteProjectionNode):\n proj = self._add_projection(frame)\n self._input_ctx().replace_input_node(frame, proj, frame._table_cols)\n\n nulls = op.na_position.upper()\n collations = []\n for col, asc in zip(op.columns, op.ascending):\n ascending = \"ASCENDING\" if asc else \"DESCENDING\"\n collations.append(\n CalciteCollation(self._ref_idx(frame, col), ascending, nulls)\n )\n self._push(CalciteSortNode(collations))\n\n def _process_filter(self, op):\n \"\"\"\n Translate ``FilterNode`` node.\n\n Parameters\n ----------\n op : FilterNode\n An operation to translate.\n \"\"\"\n condition = self._translate(op.condition)\n self._push(CalciteFilterNode(condition))\n\n if isinstance(self._input_node(0), CalciteScanNode):\n # if filter was applied over scan, then we need additional\n # projection to remove rowid column\n self._add_projection(op.input[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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_BaseExpr__warn_if_unsigned.if_np_issubdtype_dtype_n.ErrorMessage_single_warni": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_BaseExpr__warn_if_unsigned.if_np_issubdtype_dtype_n.ErrorMessage_single_warni", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 44, "span_ids": ["_warn_if_unsigned", "docstring"], "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": "from .expr import (\n BaseExpr,\n LiteralExpr,\n OpExpr,\n AggregateExpr,\n)\nfrom .calcite_algebra import (\n CalciteBaseNode,\n CalciteInputRefExpr,\n CalciteInputIdxExpr,\n CalciteScanNode,\n CalciteProjectionNode,\n CalciteFilterNode,\n CalciteAggregateNode,\n CalciteCollation,\n CalciteSortNode,\n CalciteJoinNode,\n CalciteUnionNode,\n)\nfrom modin.error_message import ErrorMessage\nimport json\nimport numpy as np\n\n\ndef _warn_if_unsigned(dtype): # noqa: GL08\n if np.issubdtype(dtype, np.unsignedinteger):\n ErrorMessage.single_warning(\n \"HDK does not support unsigned integer types, such types will be rounded up to the signed equivalent.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer_CalciteSerializer.expect_one_of.raise_TypeError_Can_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer_CalciteSerializer.expect_one_of.raise_TypeError_Can_not_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 112, "span_ids": ["CalciteSerializer", "CalciteSerializer.serialize", "CalciteSerializer.expect_one_of"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteSerializer:\n \"\"\"\n Serializer for calcite node sequence.\n\n ``CalciteSerializer`` is used to serialize a sequence of ``CalciteBaseNode``\n based nodes including nested ``BaseExpr`` based expression trees into\n a request in JSON format which can be fed to HDK.\n \"\"\"\n\n _DTYPE_STRINGS = {\n \"int8\": \"TINYINT\",\n \"int16\": \"SMALLINT\",\n \"int32\": \"INTEGER\",\n \"int64\": \"BIGINT\",\n \"uint8\": \"SMALLINT\",\n \"uint16\": \"INTEGER\",\n \"uint32\": \"BIGINT\",\n \"uint64\": \"BIGINT\",\n \"bool\": \"BOOLEAN\",\n \"float32\": \"FLOAT\",\n \"float64\": \"DOUBLE\",\n }\n\n _INT_OPTS = {\n np.int8: (\"TINYINT\", 3),\n np.int16: (\"SMALLINT\", 5),\n np.int32: (\"INTEGER\", 10),\n np.int64: (\"BIGINT\", 19),\n np.uint8: (\"SMALLINT\", 5),\n np.uint16: (\"INTEGER\", 10),\n np.uint32: (\"BIGINT\", 19),\n np.uint64: (\"BIGINT\", 19),\n int: (\"BIGINT\", 19),\n }\n\n def serialize(self, plan):\n \"\"\"\n Serialize a sequence of Calcite nodes into JSON format.\n\n Parameters\n ----------\n plan : list of CalciteBaseNode\n A sequence to serialize.\n\n Returns\n -------\n str\n A query in JSON format.\n \"\"\"\n return json.dumps({\"rels\": [self.serialize_item(node) for node in plan]})\n\n def expect_one_of(self, val, *types):\n \"\"\"\n Raise an error if values doesn't belong to any of specified types.\n\n Parameters\n ----------\n val : Any\n Value to check.\n *types : list of type\n Allowed value types.\n \"\"\"\n for t in types:\n if isinstance(val, t):\n return\n raise TypeError(\"Can not serialize {}\".format(type(val).__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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_item_CalciteSerializer.serialize_item.return.item": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_item_CalciteSerializer.serialize_item.return.item", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 140, "span_ids": ["CalciteSerializer.serialize_item"], "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 CalciteSerializer:\n\n def serialize_item(self, item):\n \"\"\"\n Serialize a single expression item.\n\n Parameters\n ----------\n item : Any\n Item to serialize.\n\n Returns\n -------\n str, int, None, dict or list of dict\n Serialized item.\n \"\"\"\n if isinstance(item, CalciteBaseNode):\n return self.serialize_node(item)\n elif isinstance(item, BaseExpr):\n return self.serialize_expr(item)\n elif isinstance(item, CalciteCollation):\n return self.serialize_obj(item)\n elif isinstance(item, list):\n return [self.serialize_item(v) for v in item]\n elif isinstance(item, dict):\n return {k: self.serialize_item(v) for k, v in item.items()}\n\n self.expect_one_of(item, str, int, type(None))\n return item", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_node_CalciteSerializer.serialize_node.if_isinstance_.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_node_CalciteSerializer.serialize_node.if_isinstance_.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 172, "span_ids": ["CalciteSerializer.serialize_node"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteSerializer:\n\n def serialize_node(self, node):\n \"\"\"\n Serialize a frame operation.\n\n Parameters\n ----------\n node : CalciteBaseNode\n A node to serialize.\n\n Returns\n -------\n dict\n Serialized object.\n \"\"\"\n if isinstance(\n node,\n (\n CalciteScanNode,\n CalciteProjectionNode,\n CalciteFilterNode,\n CalciteAggregateNode,\n CalciteSortNode,\n CalciteJoinNode,\n CalciteUnionNode,\n ),\n ):\n return self.serialize_obj(node)\n else:\n raise NotImplementedError(\n \"Can not serialize {}\".format(type(node).__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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_obj_CalciteSerializer.serialize_typed_obj.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_obj_CalciteSerializer.serialize_typed_obj.return.res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 219, "span_ids": ["CalciteSerializer.serialize_obj", "CalciteSerializer.serialize_typed_obj"], "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 CalciteSerializer:\n\n def serialize_obj(self, obj):\n \"\"\"\n Serialize an object into a dictionary.\n\n Add all non-hidden attributes (not starting with '_') of the object\n to the output dictionary.\n\n Parameters\n ----------\n obj : object\n An object to serialize.\n\n Returns\n -------\n dict\n Serialized object.\n \"\"\"\n res = {}\n for k, v in obj.__dict__.items():\n if k[0] != \"_\":\n if k == \"op\" and isinstance(obj, OpExpr) and v == \"//\":\n res[k] = \"/\"\n else:\n res[k] = self.serialize_item(v)\n return res\n\n def serialize_typed_obj(self, obj):\n \"\"\"\n Serialize an object and its dtype into a dictionary.\n\n Similar to `serialize_obj` but also include '_dtype' field\n of the object under 'type' key.\n\n Parameters\n ----------\n obj : object\n An object to serialize.\n\n Returns\n -------\n dict\n Serialized object.\n \"\"\"\n res = self.serialize_obj(obj)\n res[\"type\"] = self.serialize_dtype(obj._dtype)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_expr_CalciteSerializer.serialize_expr.if_isinstance_expr_Liter.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_expr_CalciteSerializer.serialize_expr.if_isinstance_expr_Liter.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 221, "end_line": 248, "span_ids": ["CalciteSerializer.serialize_expr"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteSerializer:\n\n def serialize_expr(self, expr):\n \"\"\"\n Serialize ``BaseExpr`` based expression into a dictionary.\n\n Parameters\n ----------\n expr : BaseExpr\n An expression to serialize.\n\n Returns\n -------\n dict\n Serialized expression.\n \"\"\"\n if isinstance(expr, LiteralExpr):\n return self.serialize_literal(expr)\n elif isinstance(expr, CalciteInputRefExpr):\n return self.serialize_obj(expr)\n elif isinstance(expr, CalciteInputIdxExpr):\n return self.serialize_input_idx(expr)\n elif isinstance(expr, OpExpr):\n return self.serialize_typed_obj(expr)\n elif isinstance(expr, AggregateExpr):\n return self.serialize_typed_obj(expr)\n else:\n raise NotImplementedError(\n \"Can not serialize {}\".format(type(expr).__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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_literal_CalciteSerializer.serialize_literal.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_literal_CalciteSerializer.serialize_literal.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 250, "end_line": 330, "span_ids": ["CalciteSerializer.serialize_literal"], "tokens": 533}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteSerializer:\n\n def serialize_literal(self, literal):\n \"\"\"\n Serialize ``LiteralExpr`` into a dictionary.\n\n Parameters\n ----------\n literal : LiteralExpr\n A literal to serialize.\n\n Returns\n -------\n dict\n Serialized literal.\n \"\"\"\n val = literal.val\n if val is None:\n return {\n \"literal\": None,\n \"type\": \"BIGINT\",\n \"target_type\": \"BIGINT\",\n \"scale\": 0,\n \"precision\": 19,\n \"type_scale\": 0,\n \"type_precision\": 19,\n }\n if type(val) is str:\n return {\n \"literal\": val,\n \"type\": \"CHAR\",\n \"target_type\": \"CHAR\",\n \"scale\": -2147483648,\n \"precision\": len(val),\n \"type_scale\": -2147483648,\n \"type_precision\": len(val),\n }\n if type(val) in self._INT_OPTS.keys():\n target_type, precision = self.opts_for_int_type(type(val))\n return {\n \"literal\": int(val),\n \"type\": \"DECIMAL\",\n \"target_type\": target_type,\n \"scale\": 0,\n \"precision\": len(str(val)),\n \"type_scale\": 0,\n \"type_precision\": precision,\n }\n if type(val) in (float, np.float64):\n if np.isnan(val):\n return {\n \"literal\": None,\n \"type\": \"DOUBLE\",\n \"target_type\": \"DOUBLE\",\n \"scale\": 0,\n \"precision\": 19,\n \"type_scale\": 0,\n \"type_precision\": 19,\n }\n\n str_val = f\"{val:f}\"\n precision = len(str_val) - 1\n scale = precision - str_val.index(\".\")\n return {\n \"literal\": int(str_val.replace(\".\", \"\")),\n \"type\": \"DECIMAL\",\n \"target_type\": \"DOUBLE\",\n \"scale\": scale,\n \"precision\": precision,\n \"type_scale\": -2147483648,\n \"type_precision\": 15,\n }\n if type(val) is bool:\n return {\n \"literal\": val,\n \"type\": \"BOOLEAN\",\n \"target_type\": \"BOOLEAN\",\n \"scale\": -2147483648,\n \"precision\": 1,\n \"type_scale\": -2147483648,\n \"type_precision\": 1,\n }\n raise NotImplementedError(f\"Can not serialize {type(val).__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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.opts_for_int_type_CalciteSerializer.opts_for_int_type.try_.except_KeyError_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.opts_for_int_type_CalciteSerializer.opts_for_int_type.try_.except_KeyError_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 352, "span_ids": ["CalciteSerializer.opts_for_int_type"], "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 CalciteSerializer:\n\n def opts_for_int_type(self, int_type):\n \"\"\"\n Get serialization params for an integer type.\n\n Return a SQL type name and a number of meaningful decimal digits\n for an integer type.\n\n Parameters\n ----------\n int_type : type\n An integer type to describe.\n\n Returns\n -------\n tuple\n \"\"\"\n try:\n _warn_if_unsigned(int_type)\n return self._INT_OPTS[int_type]\n except KeyError:\n raise NotImplementedError(f\"Unsupported integer type {int_type.__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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_dtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py_CalciteSerializer.serialize_dtype_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py", "file_name": "calcite_serializer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 389, "span_ids": ["CalciteSerializer.serialize_input_idx", "CalciteSerializer.serialize_dtype"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CalciteSerializer:\n\n def serialize_dtype(self, dtype):\n \"\"\"\n Serialize data type to a dictionary.\n\n Parameters\n ----------\n dtype : dtype\n Data type to serialize.\n\n Returns\n -------\n dict\n Serialized data type.\n \"\"\"\n _warn_if_unsigned(dtype)\n try:\n return {\"type\": self._DTYPE_STRINGS[dtype.name], \"nullable\": True}\n except KeyError:\n raise TypeError(f\"Unsupported dtype: {dtype}\")\n\n def serialize_input_idx(self, expr):\n \"\"\"\n Serialize ``CalciteInputIdxExpr`` expression.\n\n Parameters\n ----------\n expr : CalciteInputIdxExpr\n An expression to serialize.\n\n Returns\n -------\n int\n Serialized expression.\n \"\"\"\n return expr.input", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_re_demangle_index_names.ColNameCodec_demangle_ind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_re_demangle_index_names.ColNameCodec_demangle_ind", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 90, "span_ids": ["imports:22", "docstring"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nimport numpy as np\nfrom collections import OrderedDict\n\nfrom typing import List, Hashable, Optional, Tuple, Union, Iterable\n\nimport pyarrow\nfrom pyarrow.types import is_dictionary\n\nimport pandas as pd\nfrom pandas._libs.lib import no_default\nfrom pandas.core.indexes.api import Index, MultiIndex, RangeIndex\nfrom pandas.core.dtypes.common import (\n get_dtype,\n is_list_like,\n is_bool_dtype,\n is_string_dtype,\n is_any_int_dtype,\n is_datetime64_dtype,\n is_categorical_dtype,\n)\n\nfrom modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\nfrom modin.core.dataframe.base.dataframe.utils import Axis, JoinType\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolDataframe,\n)\nfrom modin.experimental.core.storage_formats.hdk.query_compiler import (\n DFAlgQueryCompiler,\n)\nfrom .utils import (\n ColNameCodec,\n arrow_to_pandas,\n check_join_supported,\n check_cols_to_join,\n get_data_for_join_by_index,\n build_categorical_from_at,\n)\nfrom ..partitioning.partition_manager import HdkOnNativeDataframePartitionManager\nfrom modin.core.dataframe.pandas.metadata import LazyProxyCategoricalDtype\nfrom modin.error_message import ErrorMessage\nfrom modin.utils import MODIN_UNNAMED_SERIES_LABEL, _inherit_docstrings\nfrom modin.core.dataframe.pandas.utils import concatenate\nfrom modin.core.dataframe.base.dataframe.utils import join_columns\nfrom ..df_algebra import (\n MaskNode,\n FrameNode,\n GroupbyAggNode,\n TransformNode,\n UnionNode,\n JoinNode,\n SortNode,\n FilterNode,\n translate_exprs_to_base,\n replace_frame_in_exprs,\n)\nfrom ..expr import (\n AggregateExpr,\n InputRefExpr,\n LiteralExpr,\n OpExpr,\n build_if_then_else,\n build_dt_expr,\n _get_common_dtype,\n is_cmp_op,\n)\nfrom modin.pandas.utils import check_both_not_none\n\nIDX_COL_NAME = ColNameCodec.IDX_COL_NAME\nROWID_COL_NAME = ColNameCodec.ROWID_COL_NAME\nUNNAMED_IDX_COL_NAME = ColNameCodec.UNNAMED_IDX_COL_NAME\nencode_col_name = ColNameCodec.encode\ndecode_col_name = ColNameCodec.decode\nmangle_index_names = ColNameCodec.mangle_index_names\ndemangle_index_names = ColNameCodec.demangle_index_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe_HdkOnNativeDataframe._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe_HdkOnNativeDataframe._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 169, "span_ids": ["HdkOnNativeDataframe"], "tokens": 818}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n \"\"\"\n Lazy dataframe based on Arrow table representation and embedded HDK storage format.\n\n Currently, materialized dataframe always has a single partition. This partition\n can hold either Arrow table or pandas dataframe.\n\n Operations on a dataframe are not instantly executed and build an operations\n tree instead. When frame's data is accessed this tree is transformed into\n a query which is executed in HDK storage format. In case of simple transformations\n Arrow API can be used instead of HDK storage format.\n\n Since frames are used as an input for other frames, all operations produce\n new frames and are not executed in-place.\n\n Parameters\n ----------\n partitions : np.ndarray, optional\n Partitions of the frame.\n index : pandas.Index, optional\n Index of the frame to be used as an index cache. If None then will be\n computed on demand.\n columns : pandas.Index, optional\n Columns of the frame.\n row_lengths : np.ndarray, optional\n Partition lengths. Should be None if lengths are unknown.\n column_widths : np.ndarray, optional\n Partition widths. Should be None if widths are unknown.\n dtypes : pandas.Index, optional\n Column data types.\n op : DFAlgNode, optional\n A tree describing how frame is computed. For materialized frames it\n is always ``FrameNode``.\n index_cols : list of str, optional\n A list of columns included into the frame's index. None value means\n a default index (row id is used as an index).\n uses_rowid : bool, default: False\n True for frames which require access to the virtual 'rowid' column\n for its execution.\n force_execution_mode : str or None\n Used by tests to control frame's execution process.\n has_unsupported_data : bool\n True for frames holding data not supported by Arrow or HDK storage format.\n\n Attributes\n ----------\n id : int\n ID of the frame. Used for debug prints only.\n _op : DFAlgNode\n A tree to be used to compute the frame. For materialized frames it is\n always ``FrameNode``.\n _partitions : numpy.ndarray or None\n Partitions of the frame. For materialized dataframes it holds a single\n partition. None for frames requiring execution.\n _index_cols : list of str or None\n Names of index columns. None for default index. Index columns have mangled\n names to handle labels which cannot be directly used as an HDK table\n column name (e.g. non-string labels, SQL keywords etc.).\n _table_cols : list of str\n A list of all frame's columns. It includes index columns if any. Index\n columns are always in the head of the list.\n _index_cache : pandas.Index, callable or None\n Materialized index of the frame or None when index is not materialized.\n If ``callable() -> (pandas.Index, list of row lengths or None)`` type,\n then the calculation will be done in `__init__`.\n _has_unsupported_data : bool\n True for frames holding data not supported by Arrow or HDK storage format.\n Operations on such frames are not allowed and should be defaulted\n to pandas instead.\n _dtypes : pandas.Series\n Column types.\n _uses_rowid : bool\n True for frames which require access to the virtual 'rowid' column\n for its execution.\n _force_execution_mode : str or None\n Used by tests to control frame's execution process. Value \"lazy\"\n is used to raise RuntimeError if execution is triggered for the frame.\n Value \"arrow\" is used to raise RuntimeError execution is triggered\n and cannot be done using Arrow API (have to use HDK for execution).\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._query_compiler_cls_HdkOnNativeDataframe.__init__.self._force_execution_mode.force_execution_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._query_compiler_cls_HdkOnNativeDataframe.__init__.self._force_execution_mode.force_execution_mode", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 243, "span_ids": ["HdkOnNativeDataframe", "HdkOnNativeDataframe.__init__"], "tokens": 586}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n _query_compiler_cls = DFAlgQueryCompiler\n _partition_mgr_cls = HdkOnNativeDataframePartitionManager\n\n _next_id = [1]\n\n def __init__(\n self,\n partitions=None,\n index=None,\n columns=None,\n row_lengths=None,\n column_widths=None,\n dtypes=None,\n op=None,\n index_cols=None,\n uses_rowid=False,\n force_execution_mode=None,\n has_unsupported_data=False,\n ):\n assert dtypes is not None\n assert partitions is None or (\n partitions.size == 1 and partitions[0][0] is not None\n )\n\n self.id = str(type(self)._next_id[0])\n type(self)._next_id[0] += 1\n\n self._op = op\n self._index_cols = index_cols\n self._partitions = partitions\n self.set_index_cache(index)\n self.set_columns_cache(columns)\n # The following code assumes that the type of `columns` is pandas.Index.\n # The initial type of `columns` might be callable.\n columns = self._columns_cache.get()\n self._row_lengths_cache = row_lengths\n self._column_widths_cache = column_widths\n self._has_unsupported_data = has_unsupported_data\n if self._op is None:\n self._op = FrameNode(self)\n\n if self._index_cols is not None:\n self._table_cols = self._index_cols + columns.tolist()\n else:\n self._table_cols = columns.tolist()\n\n assert len(dtypes) == len(\n self._table_cols\n ), f\"unaligned dtypes ({dtypes}) and table columns ({self._table_cols})\"\n\n if isinstance(dtypes, list):\n if self._index_cols is not None:\n # Table stores both index and data columns but those are accessed\n # differently if we have a MultiIndex for columns. To unify access\n # to dtype we extend index column names to tuples to have a MultiIndex\n # of dtypes.\n if isinstance(columns, MultiIndex):\n tail = [\"\"] * (columns.nlevels - 1)\n index_tuples = [(col, *tail) for col in self._index_cols]\n dtype_index = MultiIndex.from_tuples(index_tuples).append(columns)\n self.set_dtypes_cache(pd.Series(dtypes, index=dtype_index))\n else:\n self.set_dtypes_cache(pd.Series(dtypes, index=self._table_cols))\n else:\n self.set_dtypes_cache(pd.Series(dtypes, index=columns))\n else:\n self.set_dtypes_cache(dtypes)\n\n self._uses_rowid = uses_rowid\n self._force_execution_mode = force_execution_mode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.copy_HdkOnNativeDataframe.copy.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.copy_HdkOnNativeDataframe.copy.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 301, "span_ids": ["HdkOnNativeDataframe.copy"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def copy(\n self,\n partitions=no_default,\n index=no_default,\n columns=no_default,\n dtypes=no_default,\n op=no_default,\n index_cols=no_default,\n ):\n \"\"\"\n Copy this DataFrame.\n\n Parameters\n ----------\n partitions : np.ndarray, optional\n Partitions of the frame.\n index : pandas.Index or list, optional\n Index of the frame to be used as an index cache. If None then will be\n computed on demand.\n columns : pandas.Index or list, optional\n Columns of the frame.\n dtypes : pandas.Index or list, optional\n Column data types.\n op : DFAlgNode, optional\n A tree describing how frame is computed. For materialized frames it\n is always ``FrameNode``.\n index_cols : list of str, optional\n A list of columns included into the frame's index. None value means\n a default index (row id is used as an index).\n\n Returns\n -------\n HdkOnNativeDataframe\n A copy of this DataFrame.\n \"\"\"\n if partitions is no_default:\n partitions = self._partitions\n if index is no_default:\n index = self.copy_index_cache()\n if columns is no_default:\n columns = self.copy_columns_cache()\n if op is no_default:\n op = self._op\n if dtypes is no_default:\n dtypes = self.copy_dtypes_cache()\n if index_cols is no_default:\n index_cols = self._index_cols\n return self.__constructor__(\n partitions=partitions,\n index=index,\n columns=columns,\n row_lengths=self._row_lengths_cache,\n column_widths=self._column_widths_cache,\n dtypes=dtypes,\n op=op,\n index_cols=index_cols,\n uses_rowid=self._uses_rowid,\n force_execution_mode=self._force_execution_mode,\n has_unsupported_data=self._has_unsupported_data,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.id_str_HdkOnNativeDataframe.ref.return.InputRefExpr_self_col_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.id_str_HdkOnNativeDataframe.ref.return.InputRefExpr_self_col_s", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 349, "span_ids": ["HdkOnNativeDataframe.get_dtype", "HdkOnNativeDataframe.ref", "HdkOnNativeDataframe.id_str"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def id_str(self):\n \"\"\"\n Return string identifier of the frame.\n\n Used for debug dumps.\n\n Returns\n -------\n str\n \"\"\"\n return f\"frame${self.id}\"\n\n def get_dtype(self, col):\n \"\"\"\n Get data type for a column.\n\n Parameters\n ----------\n col : str\n Column name.\n\n Returns\n -------\n dtype\n \"\"\"\n # If we search for an index column type in a MultiIndex then we need to\n # extend index column names to tuples.\n if isinstance(self._dtypes.index, MultiIndex) and not isinstance(col, tuple):\n return self._dtypes[(col, *([\"\"] * (self._dtypes.index.nlevels - 1)))]\n return self._dtypes[col]\n\n def ref(self, col):\n \"\"\"\n Return an expression referencing a frame's column.\n\n Parameters\n ----------\n col : str\n Column name.\n\n Returns\n -------\n InputRefExpr\n \"\"\"\n if col == ROWID_COL_NAME:\n return InputRefExpr(self, col, get_dtype(int))\n return InputRefExpr(self, col, self.get_dtype(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.take_2d_labels_or_positional_HdkOnNativeDataframe.take_2d_labels_or_positional.return.base": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.take_2d_labels_or_positional_HdkOnNativeDataframe.take_2d_labels_or_positional.return.base", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 430, "span_ids": ["HdkOnNativeDataframe.take_2d_labels_or_positional"], "tokens": 617}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def take_2d_labels_or_positional(\n self,\n row_labels: Optional[List[Hashable]] = None,\n row_positions: Optional[List[int]] = None,\n col_labels: Optional[List[Hashable]] = None,\n col_positions: Optional[List[int]] = None,\n ) -> \"HdkOnNativeDataframe\":\n \"\"\"\n Mask rows and columns in the dataframe.\n\n Allow users to perform selection and projection on the row and column labels (named notation),\n in addition to the row and column number (positional notation).\n\n Parameters\n ----------\n row_labels : list of hashable, optional\n The row labels to extract.\n row_positions : list of int, optional\n The row positions to extract.\n col_labels : list of hashable, optional\n The column labels to extract.\n col_positions : list of int, optional\n The column positions to extract.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n\n Notes\n -----\n If both `row_labels` and `row_positions` are provided, a ValueError is raised.\n The same rule applies for `col_labels` and `col_positions`.\n \"\"\"\n if check_both_not_none(row_labels, row_positions):\n raise ValueError(\n \"Both row_labels and row_positions were provided - please provide only one of row_labels and row_positions.\"\n )\n if check_both_not_none(col_labels, col_positions):\n raise ValueError(\n \"Both col_labels and col_positions were provided - please provide only one of col_labels and col_positions.\"\n )\n base = self\n\n if col_labels is not None or col_positions is not None:\n if col_labels is not None:\n new_columns = col_labels\n elif col_positions is not None:\n new_columns = base.columns[col_positions]\n exprs = self._index_exprs()\n for col in new_columns:\n expr = base.ref(col)\n if exprs.setdefault(col, expr) is not expr:\n raise NotImplementedError(\n \"duplicate column names are not supported\"\n )\n dtypes = self._dtypes_for_exprs(exprs)\n base = self.__constructor__(\n columns=new_columns,\n dtypes=dtypes,\n op=TransformNode(base, exprs),\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n if row_labels is not None:\n raise NotImplementedError(\"Row labels masking is not yet supported\")\n\n if row_positions is not None:\n base = base._maybe_materialize_rowid()\n op = MaskNode(base, row_labels=row_labels, row_positions=row_positions)\n return self.__constructor__(\n columns=base.columns,\n dtypes=base.copy_dtypes_cache(),\n op=op,\n index_cols=base._index_cols,\n force_execution_mode=base._force_execution_mode,\n )\n\n return base", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._has_arrow_table_HdkOnNativeDataframe._maybe_update_proxies.if_new_parent_is_not_None.elif_self__has_arrow_tabl.super__maybe_update_pro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._has_arrow_table_HdkOnNativeDataframe._maybe_update_proxies.if_new_parent_is_not_None.elif_self__has_arrow_tabl.super__maybe_update_pro", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 435, "end_line": 468, "span_ids": ["HdkOnNativeDataframe._dtypes_for_exprs", "HdkOnNativeDataframe._maybe_update_proxies", "HdkOnNativeDataframe._has_arrow_table"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _has_arrow_table(self):\n \"\"\"\n Return True for materialized frame with Arrow table.\n\n Returns\n -------\n bool\n \"\"\"\n return self._partitions is not None and isinstance(\n self._partitions[0][0].get(), pyarrow.Table\n )\n\n def _dtypes_for_exprs(self, exprs):\n \"\"\"\n Return dtypes for expressions.\n\n Parameters\n ----------\n exprs : dict\n Expression to get types for.\n\n Returns\n -------\n list of dtype\n \"\"\"\n return [expr._dtype for expr in exprs.values()]\n\n @_inherit_docstrings(PandasDataframe._maybe_update_proxies)\n def _maybe_update_proxies(self, dtypes, new_parent=None):\n if new_parent is not None:\n super()._maybe_update_proxies(dtypes, new_parent)\n elif self._has_arrow_table():\n table = self._partitions[0, 0].get()\n super()._maybe_update_proxies(dtypes, new_parent=table)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.groupby_agg_HdkOnNativeDataframe.groupby_agg.col_to_delete_template.___delete_me__name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.groupby_agg_HdkOnNativeDataframe.groupby_agg.col_to_delete_template.___delete_me__name_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 469, "end_line": 557, "span_ids": ["HdkOnNativeDataframe.groupby_agg"], "tokens": 778}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def groupby_agg(self, by, axis, agg, groupby_args, **kwargs):\n \"\"\"\n Groupby with aggregation operation.\n\n Parameters\n ----------\n by : DFAlgQueryCompiler or list-like of str\n Grouping keys.\n axis : {0, 1}\n Only rows groupby is supported, so should be 0.\n agg : str or dict\n Aggregates to compute.\n groupby_args : dict\n Additional groupby args.\n **kwargs : dict\n Keyword args. Currently ignored.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n # Currently we only expect 'by' to be a projection of the same frame.\n # If 'by' holds a list of columns/series, then we create such projection\n # to re-use code.\n if not isinstance(by, DFAlgQueryCompiler):\n if is_list_like(by):\n by_cols = []\n by_frames = []\n for obj in by:\n if isinstance(obj, str):\n by_cols.append(obj)\n elif hasattr(obj, \"_modin_frame\"):\n by_frames.append(obj._modin_frame)\n else:\n raise NotImplementedError(\"unsupported groupby args\")\n by_cols = Index.__new__(Index, data=by_cols, dtype=self.columns.dtype)\n by_frame = self.take_2d_labels_or_positional(col_labels=by_cols)\n if by_frames:\n by_frame = by_frame.concat(\n axis=1, other_modin_frames=by_frames, ignore_index=True\n )\n else:\n raise NotImplementedError(\"unsupported groupby args\")\n else:\n by_frame = by._modin_frame\n\n if axis != 0:\n raise NotImplementedError(\"groupby is supported for axis = 0 only\")\n\n base = by_frame._find_common_projections_base(self)\n if base is None:\n raise NotImplementedError(\"unsupported groupby args\")\n\n if groupby_args[\"level\"] is not None:\n raise NotImplementedError(\"levels are not supported for groupby\")\n\n drop = kwargs.get(\"drop\", True)\n as_index = groupby_args.get(\"as_index\", True)\n groupby_cols = by_frame.columns\n if isinstance(agg, dict):\n agg_cols = agg.keys()\n elif not drop:\n # If 'by' data came from a different frame then 'self-aggregation'\n # columns are more prioritized.\n agg_cols = self.columns\n else:\n agg_cols = [col for col in self.columns if col not in groupby_cols]\n\n # Mimic pandas behavior: pandas does not allow for aggregation to be empty\n # in case of multi-column 'by'.\n if not as_index and len(agg_cols) == 0 and len(groupby_cols) > 1:\n agg_cols = self.columns\n\n # Create new base where all required columns are computed. We don't allow\n # complex expressions to be a group key or an aggeregate operand.\n allowed_nodes = (FrameNode, TransformNode)\n if not isinstance(by_frame._op, allowed_nodes):\n raise NotImplementedError(\n \"HDK doesn't allow complex expression to be a group key. \"\n + f\"The only allowed frame nodes are: {tuple(o.__name__ for o in allowed_nodes)}, \"\n + f\"met '{type(by_frame._op).__name__}'.\"\n )\n\n if agg in (\"head\", \"tail\"):\n n = kwargs[\"agg_kwargs\"][\"n\"]\n return self._groupby_head_tail(agg, n, groupby_cols)\n\n col_to_delete_template = \"__delete_me_{name}\"\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.groupby_agg.generate_by_name_HdkOnNativeDataframe.groupby_agg.return.new_frame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.groupby_agg.generate_by_name_HdkOnNativeDataframe.groupby_agg.return.new_frame", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 559, "end_line": 641, "span_ids": ["HdkOnNativeDataframe.groupby_agg"], "tokens": 768}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def groupby_agg(self, by, axis, agg, groupby_args, **kwargs):\n # ... other code\n\n def generate_by_name(by):\n \"\"\"Generate unuqie name for `by` column in the resulted frame.\"\"\"\n if as_index:\n return f\"{IDX_COL_NAME}0_{by}\"\n elif by in agg_cols:\n # Aggregation columns are more prioritized than the 'by' cols,\n # so in case of naming conflicts, we drop 'by' cols.\n return col_to_delete_template.format(name=by)\n else:\n return by\n\n exprs = OrderedDict(\n ((generate_by_name(col), by_frame.ref(col)) for col in groupby_cols)\n )\n groupby_cols = list(exprs.keys())\n exprs.update(((col, self.ref(col)) for col in agg_cols))\n exprs = translate_exprs_to_base(exprs, base)\n base_cols = Index.__new__(Index, data=exprs.keys(), dtype=self.columns.dtype)\n base = self.__constructor__(\n columns=base_cols,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(base, exprs),\n index_cols=None,\n force_execution_mode=self._force_execution_mode,\n )\n\n new_columns = []\n index_cols = None\n\n # TODO: check performance changes after enabling 'dropna' and decide\n # is it worth it or not.\n if groupby_args[\"dropna\"]:\n ErrorMessage.single_warning(\n \"'dropna' is temporary disabled due to https://github.com/modin-project/modin/issues/2896\"\n )\n # base = base.dropna(subset=groupby_cols, how=\"any\")\n\n if as_index:\n index_cols = groupby_cols.copy()\n else:\n new_columns = groupby_cols.copy()\n\n new_dtypes = base._dtypes[groupby_cols].tolist()\n\n agg_exprs = OrderedDict()\n if isinstance(agg, str):\n for col in agg_cols:\n agg_exprs[col] = AggregateExpr(agg, base.ref(col))\n else:\n assert isinstance(agg, dict), \"unsupported aggregate type\"\n multiindex = any(isinstance(v, list) for v in agg.values())\n for k, v in agg.items():\n if isinstance(v, list):\n for item in v:\n agg_exprs[(k, item)] = AggregateExpr(item, base.ref(k))\n else:\n col_name = (k, v) if multiindex else k\n agg_exprs[col_name] = AggregateExpr(v, base.ref(k))\n new_columns.extend(agg_exprs.keys())\n new_dtypes.extend((x._dtype for x in agg_exprs.values()))\n new_columns = Index.__new__(Index, data=new_columns, dtype=self.columns.dtype)\n\n new_op = GroupbyAggNode(base, groupby_cols, agg_exprs, groupby_args)\n new_frame = self.__constructor__(\n columns=new_columns,\n dtypes=new_dtypes,\n op=new_op,\n index_cols=index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n if not as_index:\n col_to_delete = col_to_delete_template.format(name=\".*\")\n filtered_columns = [\n col\n for col in new_frame.columns\n if not (isinstance(col, str) and re.match(col_to_delete, col))\n ]\n if len(filtered_columns) != len(new_frame.columns):\n new_frame = new_frame.take_2d_labels_or_positional(\n col_labels=filtered_columns\n )\n return new_frame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._groupby_head_tail_HdkOnNativeDataframe._groupby_head_tail.return.base_copy_op_TransformNod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._groupby_head_tail_HdkOnNativeDataframe._groupby_head_tail.return.base_copy_op_TransformNod", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 643, "end_line": 701, "span_ids": ["HdkOnNativeDataframe._groupby_head_tail"], "tokens": 561}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _groupby_head_tail(\n self, agg: str, n: int, cols: Iterable[str]\n ) -> \"HdkOnNativeDataframe\":\n \"\"\"\n Return first/last n rows of each group.\n\n Parameters\n ----------\n agg : {\"head\", \"tail\"}\n n : int\n If positive: number of entries to include from start/end of each group.\n If negative: number of entries to exclude from start/end of each group.\n cols : Iterable[str]\n Group by column names.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if isinstance(self._op, SortNode):\n base = self._op.input[0]\n order_keys = self._op.columns\n ascending = self._op.ascending\n na_pos = self._op.na_position.upper()\n fold = True # Fold TransformNodes\n else:\n base = self._maybe_materialize_rowid()\n order_keys = base._index_cols[0:1]\n ascending = [True]\n na_pos = \"FIRST\"\n fold = base is self # Do not fold if rowid is added\n if (n < 0) == (agg == \"head\"): # Invert sorting\n ascending = [not a for a in ascending]\n na_pos = \"FIRST\" if na_pos == \"LAST\" else \"LAST\"\n partition_keys = [base.ref(col) for col in cols]\n order_keys = [base.ref(col) for col in order_keys]\n\n row_num_name = \"__HDK_ROW_NUMBER__\"\n row_num_op = OpExpr(\"ROW_NUMBER\", [], get_dtype(int))\n row_num_op.set_window_opts(partition_keys, order_keys, ascending, na_pos)\n exprs = base._index_exprs()\n exprs.update((col, base.ref(col)) for col in base.columns)\n exprs[row_num_name] = row_num_op\n transform = base.copy(\n columns=list(base.columns) + [row_num_name],\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(base, exprs, fold),\n )\n\n if n < 0:\n cond = transform.ref(row_num_name).ge(-n + 1)\n else:\n cond = transform.ref(row_num_name).le(n)\n\n filter = transform.copy(op=FilterNode(transform, cond))\n exprs = filter._index_exprs()\n exprs.update((col, filter.ref(col)) for col in base.columns)\n return base.copy(op=TransformNode(filter, exprs))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.agg_HdkOnNativeDataframe.agg.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.agg_HdkOnNativeDataframe.agg.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 703, "end_line": 729, "span_ids": ["HdkOnNativeDataframe.agg"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def agg(self, agg):\n \"\"\"\n Perform specified aggregation along columns.\n\n Parameters\n ----------\n agg : str\n Name of the aggregation function to perform.\n\n Returns\n -------\n HdkOnNativeDataframe\n New frame containing the result of aggregation.\n \"\"\"\n assert isinstance(agg, str)\n\n agg_exprs = OrderedDict()\n for col in self.columns:\n agg_exprs[col] = AggregateExpr(agg, self.ref(col))\n\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(agg_exprs),\n op=GroupbyAggNode(self, [], agg_exprs, {\"sort\": False}),\n index_cols=None,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.fillna_HdkOnNativeDataframe.fillna.return.new_frame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.fillna_HdkOnNativeDataframe.fillna.return.new_frame", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 731, "end_line": 805, "span_ids": ["HdkOnNativeDataframe.fillna"], "tokens": 533}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def fillna(self, value=None, method=None, axis=None, limit=None, downcast=None):\n \"\"\"\n Replace NULLs operation.\n\n Parameters\n ----------\n value : dict or scalar, optional\n A value to replace NULLs with. Can be a dictionary to assign\n different values to columns.\n method : None, optional\n Should be None.\n axis : {0, 1}, optional\n Should be 0.\n limit : None, optional\n Should be None.\n downcast : None, optional\n Should be None.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if axis != 0:\n raise NotImplementedError(\"fillna is supported for axis = 0 only\")\n\n if limit is not None:\n raise NotImplementedError(\"fillna doesn't support limit yet\")\n\n if downcast is not None:\n raise NotImplementedError(\"fillna doesn't support downcast yet\")\n\n if method is not None:\n raise NotImplementedError(\"fillna doesn't support method yet\")\n\n try:\n exprs = self._index_exprs()\n if isinstance(value, dict):\n for col in self.columns:\n col_expr = self.ref(col)\n if col in value:\n value_expr = LiteralExpr(value[col])\n res_type = _get_common_dtype(value_expr._dtype, col_expr._dtype)\n exprs[col] = build_if_then_else(\n col_expr.is_null(), value_expr, col_expr, res_type\n )\n else:\n exprs[col] = col_expr\n elif np.isscalar(value):\n value_expr = LiteralExpr(value)\n for col in self.columns:\n col_expr = self.ref(col)\n res_type = _get_common_dtype(value_expr._dtype, col_expr._dtype)\n exprs[col] = build_if_then_else(\n col_expr.is_null(), value_expr, col_expr, res_type\n )\n else:\n raise NotImplementedError(\"unsupported value for fillna\")\n except TypeError:\n raise NotImplementedError(\n \"Heterogenous data is not supported in HDK storage format\"\n )\n\n new_op = TransformNode(self, exprs)\n dtypes = self._dtypes_for_exprs(exprs)\n new_frame = self.__constructor__(\n columns=self.columns,\n dtypes=dtypes,\n op=new_op,\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n return new_frame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.dropna_HdkOnNativeDataframe.dropna.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.dropna_HdkOnNativeDataframe.dropna.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 807, "end_line": 846, "span_ids": ["HdkOnNativeDataframe.dropna"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def dropna(self, subset, how=\"any\"):\n \"\"\"\n Drop rows with NULLs.\n\n Parameters\n ----------\n subset : list of str\n Columns to check.\n how : {\"any\", \"all\"}, default: \"any\"\n Determine if row is removed from DataFrame, when we have\n at least one NULL or all NULLs.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n how_to_merge = {\"any\": \"AND\", \"all\": \"OR\"}\n\n # If index columns are not presented in the frame, then we have to create them\n # based on \"rowid\". This is needed because 'dropna' preserves index.\n if self._index_cols is None:\n base = self._materialize_rowid()\n else:\n base = self\n\n checks = [base.ref(col).is_not_null() for col in subset]\n condition = (\n checks[0]\n if len(checks) == 1\n else OpExpr(how_to_merge[how], checks, np.dtype(\"bool\"))\n )\n result = base.__constructor__(\n columns=base.columns,\n dtypes=base.copy_dtypes_cache(),\n op=FilterNode(base, condition),\n index_cols=base._index_cols,\n force_execution_mode=base._force_execution_mode,\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.isna_HdkOnNativeDataframe.invert.return.self_copy_op_TransformNod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.isna_HdkOnNativeDataframe.invert.return.self_copy_op_TransformNod", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 848, "end_line": 884, "span_ids": ["HdkOnNativeDataframe.invert", "HdkOnNativeDataframe.isna"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def isna(self, invert):\n \"\"\"\n Detect missing values.\n\n Parameters\n ----------\n invert : bool\n\n Returns\n -------\n HdkOnNativeDataframe\n \"\"\"\n expr = \"is_not_null\" if invert else \"is_null\"\n exprs = self._index_exprs()\n for col in self.columns:\n exprs[col] = getattr(self.ref(col), expr)()\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n def invert(self):\n \"\"\"\n Apply bitwise inverse to each column.\n\n Returns\n -------\n HdkOnNativeDataframe\n \"\"\"\n exprs = self._index_exprs()\n for col in self.columns:\n exprs[col] = self.ref(col).invert()\n return self.copy(op=TransformNode(self, exprs))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.dt_extract_HdkOnNativeDataframe.dt_extract.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.dt_extract_HdkOnNativeDataframe.dt_extract.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 886, "end_line": 912, "span_ids": ["HdkOnNativeDataframe.dt_extract"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def dt_extract(self, obj):\n \"\"\"\n Extract a date or a time unit from a datetime value.\n\n Parameters\n ----------\n obj : str\n Datetime unit to extract.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n exprs = self._index_exprs()\n for col in self.columns:\n exprs[col] = build_dt_expr(obj, self.ref(col))\n new_op = TransformNode(self, exprs)\n dtypes = self._dtypes_for_exprs(exprs)\n return self.__constructor__(\n columns=self.columns,\n dtypes=dtypes,\n op=new_op,\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.astype_HdkOnNativeDataframe.astype.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.astype_HdkOnNativeDataframe.astype.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 914, "end_line": 961, "span_ids": ["HdkOnNativeDataframe.astype"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def astype(self, col_dtypes, **kwargs):\n \"\"\"\n Cast frame columns to specified types.\n\n Parameters\n ----------\n col_dtypes : dict\n Maps column names to new data types.\n **kwargs : dict\n Keyword args. Not used.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n columns = col_dtypes.keys()\n new_dtypes = self.copy_dtypes_cache()\n for column in columns:\n try:\n old_dtype = np.dtype(self._dtypes[column])\n new_dtype = np.dtype(col_dtypes[column])\n except TypeError:\n raise NotImplementedError(\n f\"Type conversion {self._dtypes[column]} -> {col_dtypes[column]}\"\n )\n if old_dtype != new_dtype:\n # NotImplementedError is raised if the type cast is not supported.\n _get_common_dtype(new_dtype, self._dtypes[column])\n new_dtypes[column] = new_dtype\n\n exprs = self._index_exprs()\n for col in self.columns:\n col_expr = self.ref(col)\n if col in columns:\n exprs[col] = col_expr.cast(new_dtypes[col])\n else:\n exprs[col] = col_expr\n\n new_op = TransformNode(self, exprs)\n return self.__constructor__(\n columns=self.columns,\n dtypes=new_dtypes,\n op=new_op,\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._build_equi_join_condition_HdkOnNativeDataframe._index_width.return.len_self__index_cols_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._build_equi_join_condition_HdkOnNativeDataframe._index_width.return.len_self__index_cols_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1072, "end_line": 1110, "span_ids": ["HdkOnNativeDataframe._index_width", "HdkOnNativeDataframe._build_equi_join_condition"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _build_equi_join_condition(self, rhs, lhs_cols, rhs_cols):\n \"\"\"\n Build condition for equi-join.\n\n Parameters\n ----------\n rhs : HdkOnNativeDataframe\n Joined frame.\n lhs_cols : list\n Left frame columns to join by.\n rhs_cols : list\n Right frame columns to join by.\n\n Returns\n -------\n BaseExpr\n \"\"\"\n condition = [\n self.ref(lhs_col).eq(rhs.ref(rhs_col))\n for lhs_col, rhs_col in zip(lhs_cols, rhs_cols)\n ]\n condition = (\n condition[0]\n if len(condition) == 1\n else OpExpr(\"AND\", condition, get_dtype(bool))\n )\n return condition\n\n def _index_width(self):\n \"\"\"\n Return a number of columns in the frame's index.\n\n Returns\n -------\n int\n \"\"\"\n if self._index_cols is None:\n return 1\n return len(self._index_cols)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._union_all_HdkOnNativeDataframe._union_all.for_frame_in_self_oth.if_.if_isinstance_frame__op_.else_.frames_append_frame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._union_all_HdkOnNativeDataframe._union_all.for_frame_in_self_oth.if_.if_isinstance_frame__op_.else_.frames_append_frame_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1112, "end_line": 1168, "span_ids": ["HdkOnNativeDataframe._union_all"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _union_all(\n self, axis, other_modin_frames, join=\"outer\", sort=False, ignore_index=False\n ):\n \"\"\"\n Concatenate frames' rows.\n\n Parameters\n ----------\n axis : {0, 1}\n Should be 0.\n other_modin_frames : list of HdkOnNativeDataframe\n Frames to concat.\n join : {\"outer\", \"inner\"}, default: \"outer\"\n How to handle columns with mismatched names.\n \"inner\" - drop such columns. \"outer\" - fill\n with NULLs.\n sort : bool, default: False\n Sort unaligned columns for 'outer' join.\n ignore_index : bool, default: False\n Ignore index columns.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n index_cols = None\n col_name_to_dtype = OrderedDict()\n for col in self.columns:\n col_name_to_dtype[col] = self._dtypes[col]\n\n if join == \"inner\":\n for frame in other_modin_frames:\n for col in list(col_name_to_dtype):\n if col not in frame.columns:\n del col_name_to_dtype[col]\n elif join == \"outer\":\n for frame in other_modin_frames:\n for col in frame.columns:\n if col not in col_name_to_dtype:\n col_name_to_dtype[col] = frame._dtypes[col]\n else:\n raise NotImplementedError(f\"Unsupported join type {join=}\")\n\n frames = []\n for frame in [self] + other_modin_frames:\n # Empty frames are filtered out only in case of the outer join.\n if (\n join == \"inner\"\n or len(frame.columns) != 0\n or (frame.has_index_cache and len(frame.index) != 0)\n or (not frame.has_index_cache and frame.index_cols)\n ):\n if isinstance(frame._op, UnionNode):\n frames.extend(frame._op.input)\n else:\n frames.append(frame)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._union_all.if_len_col_name_to_dtype__HdkOnNativeDataframe._union_all.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._union_all.if_len_col_name_to_dtype__HdkOnNativeDataframe._union_all.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1170, "end_line": 1243, "span_ids": ["HdkOnNativeDataframe._union_all"], "tokens": 663}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _union_all(\n self, axis, other_modin_frames, join=\"outer\", sort=False, ignore_index=False\n ):\n # ... other code\n\n if len(col_name_to_dtype) == 0:\n if len(frames) == 0:\n dtypes = pd.Series()\n elif ignore_index:\n index_cols = [UNNAMED_IDX_COL_NAME]\n dtypes = pd.Series([get_dtype(int)], index=index_cols)\n else:\n index_names = ColNameCodec.concat_index_names(frames)\n index_cols = list(index_names)\n dtypes = pd.Series(index_names.values(), index=index_cols)\n else:\n # Find common dtypes\n for frame in other_modin_frames:\n frame_dtypes = frame._dtypes\n for col in col_name_to_dtype:\n if col in frame_dtypes:\n col_name_to_dtype[col] = pd.core.dtypes.cast.find_common_type(\n [col_name_to_dtype[col], frame_dtypes[col]]\n )\n\n if sort:\n col_name_to_dtype = OrderedDict(\n (col, col_name_to_dtype[col]) for col in sorted(col_name_to_dtype)\n )\n\n if ignore_index:\n table_col_name_to_dtype = col_name_to_dtype\n else:\n table_col_name_to_dtype = ColNameCodec.concat_index_names(frames)\n index_cols = list(table_col_name_to_dtype)\n table_col_name_to_dtype.update(col_name_to_dtype)\n\n dtypes = pd.Series(\n table_col_name_to_dtype.values(), index=table_col_name_to_dtype.keys()\n )\n for i, frame in enumerate(frames):\n frame_dtypes = frame._dtypes.get()\n if (\n len(frame_dtypes) != len(dtypes)\n or any(frame_dtypes.index != dtypes.index)\n or any(frame_dtypes.values != dtypes.values)\n ):\n exprs = OrderedDict()\n uses_rowid = False\n for col in table_col_name_to_dtype:\n if col in frame_dtypes:\n expr = frame.ref(col)\n elif col == UNNAMED_IDX_COL_NAME:\n if frame._index_cols is not None:\n assert len(frame._index_cols) == 1\n expr = frame.ref(frame._index_cols[0])\n else:\n uses_rowid = True\n expr = frame.ref(ROWID_COL_NAME)\n else:\n expr = LiteralExpr(None, table_col_name_to_dtype[col])\n if expr._dtype != table_col_name_to_dtype[col]:\n expr = expr.cast(table_col_name_to_dtype[col])\n exprs[col] = expr\n frames[i] = frame.__constructor__(\n columns=dtypes.index,\n dtypes=dtypes,\n uses_rowid=uses_rowid,\n op=TransformNode(frame, exprs),\n force_execution_mode=frame._force_execution_mode,\n )\n\n return self.__constructor__(\n index_cols=index_cols,\n columns=col_name_to_dtype.keys(),\n dtypes=dtypes,\n op=UnionNode(frames, col_name_to_dtype, ignore_index),\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._join_by_index_HdkOnNativeDataframe._join_by_index.return.lhs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._join_by_index_HdkOnNativeDataframe._join_by_index.return.lhs", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1245, "end_line": 1341, "span_ids": ["HdkOnNativeDataframe._join_by_index"], "tokens": 681}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _join_by_index(self, other_modin_frames, how, sort, ignore_index):\n \"\"\"\n Perform equi-join operation for multiple frames by index columns.\n\n Parameters\n ----------\n other_modin_frames : list of HdkOnNativeDataframe\n Frames to join with.\n how : str\n A type of join.\n sort : bool\n Sort the result by join keys.\n ignore_index : bool\n If True then reset column index for the resulting frame.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n try:\n check_join_supported(how)\n except NotImplementedError as err:\n # The outer join is not supported by HDK, however, if all the frames\n # have a trivial index, we can simply concatenate the columns with arrow.\n if (frame := self._join_arrow_columns(other_modin_frames)) is not None:\n return frame\n raise err\n\n lhs = self._maybe_materialize_rowid()\n reset_index_names = False\n new_columns_dtype = self.columns.dtype\n for rhs in other_modin_frames:\n rhs = rhs._maybe_materialize_rowid()\n if len(lhs._index_cols) != len(rhs._index_cols):\n raise NotImplementedError(\n \"join by indexes with different sizes is not supported\"\n )\n if new_columns_dtype != rhs.columns.dtype:\n new_columns_dtype = None\n\n reset_index_names = reset_index_names or lhs._index_cols != rhs._index_cols\n\n condition = lhs._build_equi_join_condition(\n rhs, lhs._index_cols, rhs._index_cols\n )\n\n exprs = lhs._index_exprs()\n new_columns = lhs.columns.to_list()\n for col in lhs.columns:\n exprs[col] = lhs.ref(col)\n for col in rhs.columns:\n # Handle duplicating column names here. When user specifies\n # suffixes to make a join, actual renaming is done in front-end.\n new_col_name = col\n rename_idx = 0\n while new_col_name in exprs:\n new_col_name = f\"{col}{rename_idx}\"\n rename_idx += 1\n exprs[new_col_name] = rhs.ref(col)\n new_columns.append(new_col_name)\n\n op = JoinNode(\n lhs,\n rhs,\n how=how,\n exprs=exprs,\n condition=condition,\n )\n\n new_columns = Index.__new__(\n Index, data=new_columns, dtype=new_columns_dtype\n )\n lhs = lhs.__constructor__(\n dtypes=lhs._dtypes_for_exprs(exprs),\n columns=new_columns,\n index_cols=lhs._index_cols,\n op=op,\n force_execution_mode=self._force_execution_mode,\n )\n\n if sort:\n lhs = lhs.sort_rows(\n lhs._index_cols,\n ascending=True,\n ignore_index=False,\n na_position=\"last\",\n )\n\n if reset_index_names:\n lhs = lhs._reset_index_names()\n\n if ignore_index:\n new_columns = Index.__new__(RangeIndex, data=range(len(lhs.columns)))\n lhs = lhs._set_columns(new_columns)\n\n return lhs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._join_arrow_columns_HdkOnNativeDataframe._join_arrow_columns.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._join_arrow_columns_HdkOnNativeDataframe._join_arrow_columns.return.None", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1343, "end_line": 1383, "span_ids": ["HdkOnNativeDataframe._join_arrow_columns"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _join_arrow_columns(self, other_modin_frames):\n \"\"\"\n Join arrow table columns.\n\n If all the frames have a trivial index and an arrow\n table in partitions, concatenate the table columns.\n\n Parameters\n ----------\n other_modin_frames : list of HdkOnNativeDataframe\n Frames to join with.\n\n Returns\n -------\n HdkOnNativeDataframe or None\n \"\"\"\n frames = [self] + other_modin_frames\n if all(\n f._index_cols is None\n # Make sure all the frames have an arrow table in partitions.\n and isinstance(f._execute(), pyarrow.Table)\n for f in frames\n ):\n tables = [f._partitions[0][0].get() for f in frames]\n column_names = [c for t in tables for c in t.column_names]\n if len(column_names) != len(set(column_names)):\n raise NotImplementedError(\"Duplicate column names\")\n max_len = max(len(t) for t in tables)\n columns = [c for t in tables for c in t.columns]\n # Make all columns of the same length, if required.\n for i, col in enumerate(columns):\n if len(col) < max_len:\n columns[i] = pyarrow.chunked_array(\n col.chunks + [pyarrow.nulls(max_len - len(col), col.type)]\n )\n return self.from_arrow(\n at=pyarrow.table(columns, column_names),\n columns=[c for f in frames for c in f.columns],\n encode_col_names=False,\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.concat_HdkOnNativeDataframe.concat.return.new_frame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.concat_HdkOnNativeDataframe.concat.return.new_frame", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1385, "end_line": 1454, "span_ids": ["HdkOnNativeDataframe.concat"], "tokens": 539}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def concat(\n self,\n axis: Union[int, Axis],\n other_modin_frames: List[\"HdkOnNativeDataframe\"],\n join: Optional[str] = \"outer\",\n sort: Optional[bool] = False,\n ignore_index: Optional[bool] = False,\n ):\n \"\"\"\n Concatenate frames along a particular axis.\n\n Parameters\n ----------\n axis : int or modin.core.dataframe.base.utils.Axis\n The axis to concatenate along.\n other_modin_frames : list of HdkOnNativeDataframe\n Frames to concat.\n join : {\"outer\", \"inner\"}, default: \"outer\"\n How to handle mismatched indexes on other axis.\n sort : bool, default: False\n Sort non-concatenation axis if it is not already aligned\n when join is 'outer'.\n ignore_index : bool, default: False\n Ignore index along the concatenation axis.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n axis = Axis(axis)\n if axis == Axis.ROW_WISE:\n return self._union_all(\n axis.value, other_modin_frames, join, sort, ignore_index\n )\n\n if not other_modin_frames:\n return self\n\n base = self\n for frame in other_modin_frames:\n base = base._find_common_projections_base(frame)\n if base is None:\n return self._join_by_index(\n other_modin_frames, how=join, sort=sort, ignore_index=ignore_index\n )\n\n exprs = self._index_exprs()\n new_columns = self.columns.tolist()\n for col in self.columns:\n exprs[col] = self.ref(col)\n for frame in other_modin_frames:\n for col in frame.columns:\n if col == \"\" or col in exprs:\n new_col = f\"__col{len(exprs)}__\"\n else:\n new_col = col\n exprs[new_col] = frame.ref(col)\n new_columns.append(new_col)\n\n exprs = translate_exprs_to_base(exprs, base)\n new_columns = Index.__new__(Index, data=new_columns, dtype=self.columns.dtype)\n new_frame = self.__constructor__(\n columns=new_columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(base, exprs),\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n return new_frame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.bin_op_HdkOnNativeDataframe.bin_op.if_isinstance_other_int.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.bin_op_HdkOnNativeDataframe.bin_op.if_isinstance_other_int.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1456, "end_line": 1551, "span_ids": ["HdkOnNativeDataframe.bin_op"], "tokens": 751}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def bin_op(self, other, op_name, **kwargs):\n \"\"\"\n Perform binary operation.\n\n An arithmetic binary operation or a comparison operation to\n perform on columns.\n\n Parameters\n ----------\n other : scalar, list-like, or HdkOnNativeDataframe\n The second operand.\n op_name : str\n An operation to perform.\n **kwargs : dict\n Keyword args.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if isinstance(other, (int, float, str)):\n value_expr = LiteralExpr(other)\n exprs = self._index_exprs()\n for col in self.columns:\n exprs[col] = self.ref(col).bin_op(value_expr, op_name)\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n elif isinstance(other, list):\n if kwargs.get(\"axis\", 1) == 0:\n raise NotImplementedError(f\"{op_name} on rows\")\n if len(other) != len(self.columns):\n raise ValueError(\n f\"length must be {len(self.columns)}: given {len(other)}\"\n )\n exprs = self._index_exprs()\n for col, val in zip(self.columns, other):\n exprs[col] = self.ref(col).bin_op(LiteralExpr(val), op_name)\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n elif isinstance(other, type(self)):\n # For now we only support binary operations on\n # projections of the same frame, because we have\n # no support for outer join.\n base = self._find_common_projections_base(other)\n if base is None:\n raise NotImplementedError(\n \"unsupported binary op args (outer join is not supported)\"\n )\n\n new_columns = self.columns.tolist()\n for col in other.columns:\n if col not in self.columns:\n new_columns.append(col)\n new_columns = sorted(new_columns)\n\n fill_value = kwargs.get(\"fill_value\", None)\n if fill_value is not None:\n fill_value = LiteralExpr(fill_value)\n if is_cmp_op(op_name):\n null_value = LiteralExpr(op_name == \"ne\")\n else:\n null_value = LiteralExpr(None)\n\n exprs = self._index_exprs()\n for col in new_columns:\n lhs = self.ref(col) if col in self.columns else fill_value\n rhs = other.ref(col) if col in other.columns else fill_value\n if lhs is None or rhs is None:\n exprs[col] = null_value\n else:\n exprs[col] = lhs.bin_op(rhs, op_name)\n\n exprs = translate_exprs_to_base(exprs, base)\n return self.__constructor__(\n columns=new_columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(base, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n else:\n raise NotImplementedError(f\"unsupported operand type: {type(other)}\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.insert_HdkOnNativeDataframe.insert.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.insert_HdkOnNativeDataframe.insert.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1553, "end_line": 1592, "span_ids": ["HdkOnNativeDataframe.insert"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def insert(self, loc, column, value):\n \"\"\"\n Insert a constant column.\n\n Parameters\n ----------\n loc : int\n Inserted column location.\n column : str\n Inserted column name.\n value : scalar\n Inserted column value.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n assert column not in self._table_cols\n assert 0 <= loc <= len(self.columns)\n\n exprs = self._index_exprs()\n for i in range(0, loc):\n col = self.columns[i]\n exprs[col] = self.ref(col)\n exprs[column] = LiteralExpr(value)\n for i in range(loc, len(self.columns)):\n col = self.columns[i]\n exprs[col] = self.ref(col)\n\n new_columns = self.columns.insert(loc, column)\n\n return self.__constructor__(\n columns=new_columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.cat_codes_HdkOnNativeDataframe.cat_codes.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.cat_codes_HdkOnNativeDataframe.cat_codes.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1594, "end_line": 1625, "span_ids": ["HdkOnNativeDataframe.cat_codes"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def cat_codes(self):\n \"\"\"\n Extract codes for a category column.\n\n The frame should have a single data column.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n assert len(self.columns) == 1\n assert self._dtypes[-1] == \"category\"\n\n exprs = self._index_exprs()\n col_expr = self.ref(self.columns[-1])\n code_expr = OpExpr(\"KEY_FOR_STRING\", [col_expr], get_dtype(\"int32\"))\n null_val = LiteralExpr(np.int32(-1))\n col_name = MODIN_UNNAMED_SERIES_LABEL\n exprs[col_name] = build_if_then_else(\n col_expr.is_null(), null_val, code_expr, get_dtype(\"int32\")\n )\n dtypes = [expr._dtype for expr in exprs.values()]\n\n return self.__constructor__(\n columns=Index([col_name]),\n dtypes=pd.Series(dtypes, index=Index(exprs.keys())),\n op=TransformNode(self, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.sort_rows_HdkOnNativeDataframe.sort_rows.if_isinstance_ascending_.else_.ascending._ascending_len_columns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.sort_rows_HdkOnNativeDataframe.sort_rows.if_isinstance_ascending_.else_.ascending._ascending_len_columns", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1627, "end_line": 1667, "span_ids": ["HdkOnNativeDataframe.sort_rows"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def sort_rows(self, columns, ascending, ignore_index, na_position):\n \"\"\"\n Sort rows of the frame.\n\n Parameters\n ----------\n columns : str or list of str\n Sorting keys.\n ascending : bool or list of bool\n Sort order.\n ignore_index : bool\n Drop index columns.\n na_position : {\"first\", \"last\"}\n NULLs position.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if na_position != \"first\" and na_position != \"last\":\n raise ValueError(f\"Unsupported na_position value '{na_position}'\")\n\n base = self\n\n # If index is preserved and we have no index columns then we\n # need to create one using __rowid__ virtual column.\n if not ignore_index and base._index_cols is None:\n base = base._materialize_rowid()\n\n if not isinstance(columns, list):\n columns = [columns]\n columns = [base._find_index_or_col(col) for col in columns]\n\n if isinstance(ascending, list):\n if len(ascending) != len(columns):\n raise ValueError(\"ascending list length doesn't match columns list\")\n else:\n if not isinstance(ascending, bool):\n raise ValueError(\"unsupported ascending value\")\n ascending = [ascending] * len(columns)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.sort_rows.if_ignore_index__HdkOnNativeDataframe.sort_rows.if_ignore_index_.else_.return.base___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.sort_rows.if_ignore_index__HdkOnNativeDataframe.sort_rows.if_ignore_index_.else_.return.base___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1669, "end_line": 1736, "span_ids": ["HdkOnNativeDataframe.sort_rows"], "tokens": 547}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def sort_rows(self, columns, ascending, ignore_index, na_position):\n # ... other code\n\n if ignore_index:\n # If index is ignored then we might need to drop some columns.\n # At the same time some of dropped index columns can be used\n # for sorting and should be droped after sorting is done.\n if base._index_cols is not None:\n drop_index_cols_before = [\n col for col in base._index_cols if col not in columns\n ]\n drop_index_cols_after = [\n col for col in base._index_cols if col in columns\n ]\n if not drop_index_cols_after:\n drop_index_cols_after = None\n\n if drop_index_cols_before:\n exprs = OrderedDict()\n index_cols = (\n drop_index_cols_after if drop_index_cols_after else None\n )\n for col in drop_index_cols_after:\n exprs[col] = base.ref(col)\n for col in base.columns:\n exprs[col] = base.ref(col)\n base = base.__constructor__(\n columns=base.columns,\n dtypes=base._dtypes_for_exprs(exprs),\n op=TransformNode(base, exprs),\n index_cols=index_cols,\n force_execution_mode=base._force_execution_mode,\n )\n\n base = base.__constructor__(\n columns=base.columns,\n dtypes=base.copy_dtypes_cache(),\n op=SortNode(base, columns, ascending, na_position),\n index_cols=base._index_cols,\n force_execution_mode=base._force_execution_mode,\n )\n\n if drop_index_cols_after:\n exprs = OrderedDict()\n for col in base.columns:\n exprs[col] = base.ref(col)\n base = base.__constructor__(\n columns=base.columns,\n dtypes=base._dtypes_for_exprs(exprs),\n op=TransformNode(base, exprs),\n index_cols=None,\n force_execution_mode=base._force_execution_mode,\n )\n\n return base\n else:\n return base.__constructor__(\n columns=base.columns,\n dtypes=base.copy_dtypes_cache(),\n op=SortNode(base, columns, ascending, na_position),\n index_cols=None,\n force_execution_mode=base._force_execution_mode,\n )\n else:\n return base.__constructor__(\n columns=base.columns,\n dtypes=base.copy_dtypes_cache(),\n op=SortNode(base, columns, ascending, na_position),\n index_cols=base._index_cols,\n force_execution_mode=base._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.filter_HdkOnNativeDataframe.filter.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.filter_HdkOnNativeDataframe.filter.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1738, "end_line": 1806, "span_ids": ["HdkOnNativeDataframe.filter"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def filter(self, key):\n \"\"\"\n Filter rows by a boolean key column.\n\n Parameters\n ----------\n key : HdkOnNativeDataframe\n A frame with a single bool data column used as a filter.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if not isinstance(key, type(self)):\n raise NotImplementedError(\"Unsupported key type in filter\")\n\n if not isinstance(key._op, TransformNode) or len(key.columns) != 1:\n raise NotImplementedError(\"Unsupported key in filter\")\n\n key_col = key.columns[0]\n if not is_bool_dtype(key._dtypes[key_col]):\n raise NotImplementedError(\"Unsupported key in filter\")\n\n base = self._find_common_projections_base(key)\n if base is None:\n raise NotImplementedError(\"Unsupported key in filter\")\n\n # We build the resulting frame by applying the filter to the\n # base frame and then using the filtered result as a new base.\n # If base frame has no index columns, then we need to create\n # one.\n key_exprs = translate_exprs_to_base(key._op.exprs, base)\n if base._index_cols is None:\n filter_base = base._materialize_rowid()\n key_exprs = replace_frame_in_exprs(key_exprs, base, filter_base)\n else:\n filter_base = base\n condition = key_exprs[key_col]\n filtered_base = self.__constructor__(\n columns=filter_base.columns,\n dtypes=filter_base.copy_dtypes_cache(),\n op=FilterNode(filter_base, condition),\n index_cols=filter_base._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n if self is base:\n exprs = OrderedDict()\n for col in filtered_base._table_cols:\n exprs[col] = filtered_base.ref(col)\n else:\n assert isinstance(\n self._op, TransformNode\n ), f\"unexpected op: {self._op.dumps()}\"\n exprs = translate_exprs_to_base(self._op.exprs, base)\n exprs = replace_frame_in_exprs(exprs, base, filtered_base)\n if base._index_cols is None:\n idx_name = mangle_index_names([None])[0]\n exprs[idx_name] = filtered_base.ref(idx_name)\n exprs.move_to_end(idx_name, last=False)\n\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(filtered_base, exprs),\n index_cols=filtered_base._index_cols,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._maybe_materialize_rowid_HdkOnNativeDataframe._materialize_rowid.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._maybe_materialize_rowid_HdkOnNativeDataframe._materialize_rowid.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1808, "end_line": 1846, "span_ids": ["HdkOnNativeDataframe._materialize_rowid", "HdkOnNativeDataframe._maybe_materialize_rowid"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _maybe_materialize_rowid(self):\n \"\"\"\n Materialize virtual 'rowid' column if frame uses it as an index.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if self._index_cols is None:\n return self._materialize_rowid()\n return self\n\n def _materialize_rowid(self):\n \"\"\"\n Materialize virtual 'rowid' column.\n\n Make a projection with a virtual 'rowid' column materialized\n as '__index__' column.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n name = self._index_cache.get().name if self.has_index_cache else None\n name = mangle_index_names([name])[0]\n exprs = OrderedDict()\n exprs[name] = self.ref(ROWID_COL_NAME)\n for col in self._table_cols:\n exprs[col] = self.ref(col)\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index_cols=[name],\n uses_rowid=True,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._index_exprs_HdkOnNativeDataframe._find_common_projections_base.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._index_exprs_HdkOnNativeDataframe._find_common_projections_base.return.None", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1848, "end_line": 1893, "span_ids": ["HdkOnNativeDataframe._find_common_projections_base", "HdkOnNativeDataframe._index_exprs"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _index_exprs(self):\n \"\"\"\n Build index column expressions.\n\n Build dictionary with references to all index columns\n mapped to index column names.\n\n Returns\n -------\n dict\n \"\"\"\n exprs = OrderedDict()\n if self._index_cols:\n for col in self._index_cols:\n exprs[col] = self.ref(col)\n return exprs\n\n def _find_common_projections_base(self, rhs):\n \"\"\"\n Try to find a common base for projections.\n\n Check if two frames can be expressed as `TransformNode`\n operations from the same input frame.\n\n Parameters\n ----------\n rhs : HdkOnNativeDataframe\n The second frame.\n\n Returns\n -------\n HdkOnNativeDataframe\n The found common projection base or None.\n \"\"\"\n bases = {self}\n while self._is_projection():\n self = self._op.input[0]\n bases.add(self)\n\n while rhs not in bases and rhs._is_projection():\n rhs = rhs._op.input[0]\n\n if rhs in bases:\n return rhs\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._is_projection_HdkOnNativeDataframe._execute.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._is_projection_HdkOnNativeDataframe._execute.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1895, "end_line": 1937, "span_ids": ["HdkOnNativeDataframe._is_projection", "HdkOnNativeDataframe._execute"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _is_projection(self):\n \"\"\"\n Check if frame is a ``TranformNode`` operation.\n\n Returns\n -------\n bool\n \"\"\"\n return isinstance(self._op, TransformNode)\n\n def _execute(self):\n \"\"\"\n Materialize lazy frame.\n\n After this call frame always has ``FrameNode`` operation.\n\n Returns\n -------\n pyarrow.Table or pandas.Dataframe\n \"\"\"\n if isinstance(self._op, FrameNode):\n return self._op.execute_arrow()\n\n result = None\n stack = [self._materialize, self]\n while stack:\n frame = stack.pop()\n if callable(frame):\n result = frame()\n continue\n if isinstance(frame._op, FrameNode):\n result = frame._op.execute_arrow()\n continue\n if not frame._op.can_execute_hdk():\n stack.append(frame._materialize)\n if frame._uses_rowid or frame._op.require_executed_base():\n for i in reversed(frame._op.input):\n if not isinstance(i._op, FrameNode):\n stack.append(i._materialize)\n stack.append(i)\n else:\n stack.extend(reversed(frame._op.input))\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._materialize_HdkOnNativeDataframe._can_execute_arrow.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._materialize_HdkOnNativeDataframe._can_execute_arrow.return.True", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1952, "end_line": 1999, "span_ids": ["HdkOnNativeDataframe._can_execute_arrow", "HdkOnNativeDataframe._materialize"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _materialize(self):\n \"\"\"\n Materialize this frame.\n\n Returns\n -------\n pyarrow.Table\n \"\"\"\n assert (\n self._force_execution_mode != \"lazy\"\n ), \"Unexpected execution triggered on lazy frame!\"\n\n if self._force_execution_mode != \"hdk\" and self._can_execute_arrow():\n new_table = self._execute_arrow()\n partitions = self._partition_mgr_cls.from_arrow(\n new_table, unsupported_cols=[], encode_col_names=False\n )[0]\n else:\n assert (\n self._force_execution_mode != \"arrow\"\n ), \"Forced arrow execution failed!\"\n partitions = self._partition_mgr_cls.run_exec_plan(\n self._op, self._table_cols\n )\n\n self._partitions = partitions\n self._op = FrameNode(self)\n return partitions[0][0].get()\n\n def _can_execute_arrow(self):\n \"\"\"\n Check for possibility of Arrow execution.\n\n Check if operation's tree for the frame can be executed using\n Arrow API instead of HDK query.\n\n Returns\n -------\n bool\n \"\"\"\n stack = [self]\n while stack:\n op = stack.pop()._op\n if not op.can_execute_arrow():\n return False\n if input := getattr(op, \"input\", None):\n stack.extend(input)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._execute_arrow_HdkOnNativeDataframe._execute_arrow.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._execute_arrow_HdkOnNativeDataframe._execute_arrow.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1989, "end_line": 2039, "span_ids": ["HdkOnNativeDataframe._execute_arrow"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _execute_arrow(self):\n \"\"\"\n Compute the frame data using Arrow API.\n\n Returns\n -------\n pyarrow.Table\n The resulting table.\n \"\"\"\n result = None\n stack = [self]\n\n while stack:\n frame = stack.pop()\n\n if callable(frame):\n result = frame(result)\n elif input := getattr(frame._op, \"input\", None):\n if len(input) == 1:\n stack.append(frame._op.execute_arrow)\n stack.append(input[0])\n else:\n\n def to_arrow(result, op=frame._op, tables=[], frames=iter(input)):\n \"\"\"\n Convert the input list to a list of arrow tables.\n\n This function is created for each input list. When the function\n is created, the frames iterator is saved in the `frames` argument.\n Then, the function is added to the stack followed by the first\n frame from the `frames` iterator. When the frame is processed, the\n arrow table is added to the `tables` list. This procedure is\n repeated until the iterator is not empty. When all the frames are\n processed, the arrow tables are passed to `execute_arrow` and the\n result is returned.\n \"\"\"\n if (f := next(frames, None)) is None:\n return op.execute_arrow(tables)\n else:\n # When this function is called, the `frame` attribute contains\n # a reference to this function.\n stack.append(frame if callable(frame) else to_arrow)\n stack.append(tables.append)\n stack.append(f)\n return result\n\n to_arrow(result)\n else:\n result = frame._op.execute_arrow(result)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._get_index_HdkOnNativeDataframe._set_index.if_isinstance_obj_pd_Dat.else_.return.self_from_arrow_index_at_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._get_index_HdkOnNativeDataframe._set_index.if_isinstance_obj_pd_Dat.else_.return.self_from_arrow_index_at_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2088, "end_line": 2144, "span_ids": ["HdkOnNativeDataframe._set_index", "HdkOnNativeDataframe._get_index"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _get_index(self):\n \"\"\"\n Get the index of the frame in pandas format.\n\n Materializes the frame if required.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n self._execute()\n if not self.has_index_cache:\n self._build_index_cache()\n return self._index_cache.get()\n\n def _set_index(self, new_index):\n \"\"\"\n Set new index for the frame.\n\n Parameters\n ----------\n new_index : pandas.Index\n New index.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if not isinstance(new_index, (Index, MultiIndex)):\n raise NotImplementedError(\n \"HdkOnNativeDataframe._set_index is not yet suported\"\n )\n\n obj = self._execute()\n if isinstance(obj, pd.DataFrame):\n raise NotImplementedError(\n \"HdkOnNativeDataframe._set_index is not yet suported\"\n )\n else:\n assert isinstance(obj, pyarrow.Table)\n\n at = obj\n if self._index_cols:\n at = at.drop(self._index_cols)\n\n new_index = new_index.copy()\n index_names = mangle_index_names(new_index.names)\n new_index.names = index_names\n index_df = pd.DataFrame(data={}, index=new_index)\n index_df = index_df.reset_index()\n index_at = pyarrow.Table.from_pandas(index_df)\n\n for i, field in enumerate(at.schema):\n index_at = index_at.append_column(field, at.column(i))\n\n return self.from_arrow(index_at, index_names, new_index, self.columns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.reset_index_HdkOnNativeDataframe.reset_index.if_drop_.else_.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.reset_index_HdkOnNativeDataframe.reset_index.if_drop_.else_.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2136, "end_line": 2196, "span_ids": ["HdkOnNativeDataframe.reset_index"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def reset_index(self, drop):\n \"\"\"\n Set the default index for the frame.\n\n Parameters\n ----------\n drop : bool\n If True then drop current index columns, otherwise\n make them data columns.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if drop:\n exprs = OrderedDict()\n for c in self.columns:\n exprs[c] = self.ref(c)\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index_cols=None,\n force_execution_mode=self._force_execution_mode,\n )\n else:\n if self._index_cols is None:\n raise NotImplementedError(\n \"default index reset with no drop is not supported\"\n )\n # Need to demangle index names.\n exprs = OrderedDict()\n for i, c in enumerate(self._index_cols):\n name = ColNameCodec.demangle_index_name(c)\n if name is None:\n name = f\"level_{i}\"\n if name in exprs:\n raise ValueError(f\"cannot insert {name}, already exists\")\n if isinstance(self.columns, MultiIndex) and not isinstance(name, tuple):\n name = (name, *([\"\"] * (self.columns.nlevels - 1)))\n exprs[name] = self.ref(c)\n for c in self.columns:\n if c in exprs:\n raise ValueError(f\"cannot insert {c}, already exists\")\n exprs[c] = self.ref(c)\n new_columns = Index.__new__(\n Index,\n data=exprs.keys(),\n dtype=\"O\",\n name=self.columns.names\n if isinstance(self.columns, MultiIndex)\n else self.columns.name,\n )\n return self.__constructor__(\n columns=new_columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index_cols=None,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._reset_index_names_HdkOnNativeDataframe._get_columns.return.super_HdkOnNativeDatafram": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._reset_index_names_HdkOnNativeDataframe._get_columns.return.super_HdkOnNativeDatafram", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2198, "end_line": 2253, "span_ids": ["HdkOnNativeDataframe._set_columns", "HdkOnNativeDataframe._reset_index_names", "HdkOnNativeDataframe._get_columns"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _reset_index_names(self):\n \"\"\"\n Reset names for all index columns.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if self.has_multiindex():\n return self.set_index_names([None] * len(self._index_cols))\n return self.set_index_name(None)\n\n def _set_columns(self, new_columns):\n \"\"\"\n Rename columns.\n\n Parameters\n ----------\n new_columns : list-like of str\n New column names.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if (\n self.columns.identical(new_columns)\n if isinstance(new_columns, Index)\n else all(self.columns == new_columns)\n ):\n return self\n exprs = self._index_exprs()\n for old, new in zip(self.columns, new_columns):\n expr = self.ref(old)\n if exprs.setdefault(new, expr) is not expr:\n raise NotImplementedError(\"duplicate column names are not supported\")\n return self.__constructor__(\n columns=new_columns,\n dtypes=self._dtypes.tolist(),\n op=TransformNode(self, exprs),\n index=self._index_cache,\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n def _get_columns(self):\n \"\"\"\n Return column labels of the frame.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n return super(HdkOnNativeDataframe, self)._get_columns()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.__dataframe___HdkOnNativeDataframe.__dataframe__.return.HdkProtocolDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.__dataframe___HdkOnNativeDataframe.__dataframe__.return.HdkProtocolDataframe_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2255, "end_line": 2292, "span_ids": ["HdkOnNativeDataframe.__dataframe__"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def __dataframe__(self, nan_as_null: bool = False, allow_copy: bool = True):\n \"\"\"\n Get a DataFrame exchange protocol object representing data of the Modin DataFrame.\n\n Parameters\n ----------\n nan_as_null : bool, default: False\n A keyword intended for the consumer to tell the producer\n to overwrite null values in the data with ``NaN`` (or ``NaT``).\n This currently has no effect; once support for nullable extension\n dtypes is added, this value should be propagated to columns.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n\n Returns\n -------\n ProtocolDataframe\n A dataframe object following the dataframe exchange protocol specification.\n \"\"\"\n if self._has_unsupported_data:\n ErrorMessage.default_to_pandas(message=\"`__dataframe__`\")\n pd_df = self.to_pandas()\n if hasattr(pd_df, \"__dataframe__\"):\n return pd_df.__dataframe__()\n raise NotImplementedError(\n \"HDK execution does not support exchange protocol if the frame contains data types \"\n + \"that are unsupported by HDK.\"\n )\n\n from ..interchange.dataframe_protocol.dataframe import HdkProtocolDataframe\n\n return HdkProtocolDataframe(\n self, nan_as_null=nan_as_null, allow_copy=allow_copy\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_dataframe_HdkOnNativeDataframe.from_dataframe.return.cls_from_pandas_pd_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_dataframe_HdkOnNativeDataframe.from_dataframe.return.cls_from_pandas_pd_df_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2294, "end_line": 2327, "span_ids": ["HdkOnNativeDataframe.from_dataframe"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n @classmethod\n def from_dataframe(cls, df: ProtocolDataframe) -> \"HdkOnNativeDataframe\":\n \"\"\"\n Convert a DataFrame implementing the dataframe exchange protocol to a Core Modin Dataframe.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n df : ProtocolDataframe\n The DataFrame object supporting the dataframe exchange protocol.\n\n Returns\n -------\n HdkOnNativeDataframe\n A new Core Modin Dataframe object.\n \"\"\"\n if isinstance(df, cls):\n return df\n\n if not hasattr(df, \"__dataframe__\"):\n raise ValueError(\n \"`df` does not support DataFrame exchange protocol, i.e. `__dataframe__` method\"\n )\n\n from modin.core.dataframe.pandas.interchange.dataframe_protocol.from_dataframe import (\n from_dataframe_to_pandas,\n )\n\n # TODO: build a PyArrow table instead of a pandas DataFrame from the protocol object\n # as it's possible to do zero-copy with `cls.from_arrow`\n ErrorMessage.default_to_pandas(message=\"`from_dataframe`\")\n pd_df = from_dataframe_to_pandas(df)\n return cls.from_pandas(pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.columns_HdkOnNativeDataframe.get_index_name.return.self__index_cols_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.columns_HdkOnNativeDataframe.get_index_name.return.self__index_cols_0_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2329, "end_line": 2378, "span_ids": ["HdkOnNativeDataframe.get_index_name", "HdkOnNativeDataframe.has_multiindex", "HdkOnNativeDataframe:9", "HdkOnNativeDataframe.dtypes"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n columns = property(_get_columns)\n index = property(_get_index)\n\n @property\n def dtypes(self):\n \"\"\"\n Return column data types.\n\n Returns\n -------\n pandas.Series\n A pandas Series containing the data types for this dataframe.\n \"\"\"\n if self._index_cols is not None:\n # [] operator will return pandas.Series\n return self._dtypes[len(self._index_cols) :]\n return self._dtypes.get()\n\n def has_multiindex(self):\n \"\"\"\n Check for multi-index usage.\n\n Return True if the frame has a multi-index (index with\n multiple columns) and False otherwise.\n\n Returns\n -------\n bool\n \"\"\"\n if self.has_materialized_index:\n return isinstance(self.index, MultiIndex)\n return self._index_cols is not None and len(self._index_cols) > 1\n\n def get_index_name(self):\n \"\"\"\n Get the name of the index column.\n\n Returns None for default index and multi-index.\n\n Returns\n -------\n str or None\n \"\"\"\n if self.has_index_cache:\n return self._index_cache.get().name\n if self._index_cols is None:\n return None\n if len(self._index_cols) > 1:\n return None\n return self._index_cols[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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.set_index_name_HdkOnNativeDataframe.set_index_name.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.set_index_name_HdkOnNativeDataframe.set_index_name.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2380, "end_line": 2420, "span_ids": ["HdkOnNativeDataframe.set_index_name"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def set_index_name(self, name):\n \"\"\"\n Set new name for the index column.\n\n Shouldn't be called for frames with multi-index.\n\n Parameters\n ----------\n name : str or None\n New index name.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if self.has_multiindex():\n ErrorMessage.single_warning(\"Scalar name for MultiIndex is not supported!\")\n return self\n\n if self._index_cols is None and name is None:\n return self\n\n names = mangle_index_names([name])\n exprs = OrderedDict()\n if self._index_cols is None:\n exprs[names[0]] = self.ref(ROWID_COL_NAME)\n else:\n exprs[names[0]] = self.ref(self._index_cols[0])\n\n for col in self.columns:\n exprs[col] = self.ref(col)\n\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index_cols=names,\n uses_rowid=self._index_cols is None,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.get_index_names_HdkOnNativeDataframe.set_index_names.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.get_index_names_HdkOnNativeDataframe.set_index_names.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2422, "end_line": 2471, "span_ids": ["HdkOnNativeDataframe.set_index_names", "HdkOnNativeDataframe.get_index_names"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def get_index_names(self):\n \"\"\"\n Get index column names.\n\n Returns\n -------\n list of str\n \"\"\"\n if self.has_index_cache:\n return self._index_cache.get().names\n if self.has_multiindex():\n return self._index_cols.copy()\n return [self.get_index_name()]\n\n def set_index_names(self, names):\n \"\"\"\n Set index labels for frames with multi-index.\n\n Parameters\n ----------\n names : list of str\n New index labels.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n if not self.has_multiindex():\n raise ValueError(\"Can set names for MultiIndex only\")\n\n if len(names) != len(self._index_cols):\n raise ValueError(\n f\"Unexpected names count: expected {len(self._index_cols)} got {len(names)}\"\n )\n\n names = mangle_index_names(names)\n exprs = OrderedDict()\n for old, new in zip(self._index_cols, names):\n exprs[new] = self.ref(old)\n for col in self.columns:\n exprs[col] = self.ref(col)\n\n return self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index_cols=names,\n force_execution_mode=self._force_execution_mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.to_pandas_HdkOnNativeDataframe.to_pandas.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.to_pandas_HdkOnNativeDataframe.to_pandas.return.df", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2483, "end_line": 2543, "span_ids": ["HdkOnNativeDataframe.to_pandas"], "tokens": 502}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def to_pandas(self):\n \"\"\"\n Transform the frame to pandas format.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n if self._force_execution_mode == \"lazy\":\n raise RuntimeError(\"unexpected to_pandas triggered on lazy frame\")\n\n obj = self._execute()\n\n if isinstance(obj, pyarrow.Table):\n # If the table is exported from HDK, the string columns are converted\n # to dictionary. On conversion to pandas, these columns will be of type\n # Categorical, that is not correct. To make the valid conversion, these\n # fields are cast to string.\n schema = obj.schema\n cast = {\n idx: arrow_type.name\n for idx, (arrow_type, pandas_type) in enumerate(\n zip(schema, self._dtypes)\n )\n if is_dictionary(arrow_type.type)\n and not is_categorical_dtype(pandas_type)\n }\n if cast:\n for idx, new_type in cast.items():\n schema = schema.set(idx, pyarrow.field(new_type, pyarrow.string()))\n obj = obj.cast(schema)\n # concatenate() is called by _partition_mgr_cls.to_pandas\n # to preserve the categorical dtypes\n df = concatenate([arrow_to_pandas(obj)])\n else:\n df = obj.copy()\n\n # If we make dataframe from Arrow table then we might need to set\n # index columns.\n if len(df.columns) != len(self.columns):\n assert self._index_cols\n if self.has_materialized_index:\n df.drop(columns=self._index_cols, inplace=True)\n df.index = self._index_cache.get().copy()\n else:\n df.set_index(self._index_cols, inplace=True)\n df.index.rename(demangle_index_names(self._index_cols), inplace=True)\n assert len(df.columns) == len(self.columns)\n else:\n assert self._index_cols is None\n assert df.index.name is None or isinstance(\n self._partitions[0][0].get(), pd.DataFrame\n ), f\"index name '{df.index.name}' is not None\"\n if self.has_materialized_index:\n df.index = self._index_cache.get().copy()\n\n # Restore original column labels encoded in HDK to meet its\n # restrictions on column names.\n df.columns = self.columns\n\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._find_index_or_col_HdkOnNativeDataframe._find_index_or_col.raise_ValueError_f_Unknow": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._find_index_or_col_HdkOnNativeDataframe._find_index_or_col.raise_ValueError_f_Unknow", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2539, "end_line": 2565, "span_ids": ["HdkOnNativeDataframe._find_index_or_col"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n def _find_index_or_col(self, col):\n \"\"\"\n Find a column name corresponding to a column or index label.\n\n Parameters\n ----------\n col : str\n A column or index label.\n\n Returns\n -------\n str\n A column name corresponding to a label.\n \"\"\"\n if col in self.columns:\n return col\n\n if self._index_cols is not None:\n if col in self._index_cols:\n return col\n\n pattern = re.compile(f\"{IDX_COL_NAME}\\\\d+_{encode_col_name(col)}\")\n for idx_col in self._index_cols:\n if pattern.match(idx_col):\n return idx_col\n\n raise ValueError(f\"Unknown column '{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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_pandas_HdkOnNativeDataframe.from_pandas.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_pandas_HdkOnNativeDataframe.from_pandas.return.cls_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2567, "end_line": 2653, "span_ids": ["HdkOnNativeDataframe.from_pandas"], "tokens": 617}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n @classmethod\n def from_pandas(cls, df):\n \"\"\"\n Build a frame from a `pandas.DataFrame`.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Source frame.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n new_index = df.index\n new_columns = df.columns\n\n if isinstance(new_columns, MultiIndex):\n # MultiIndex columns are not supported by the HDK backend.\n # We just print this warning here and fall back to pandas.\n index_cols = None\n ErrorMessage.single_warning(\n \"MultiIndex columns are not currently supported by the HDK backend.\"\n )\n # If there is non-trivial index, we put it into columns.\n # If the index is trivial, but there are no columns, we put\n # it into columns either because, otherwise, we don't know\n # the number of rows and, thus, unable to restore the index.\n # That's what we usually have for arrow tables and execution\n # result. Unnamed index is renamed to {IDX_COL_PREF}. Also all\n # columns get encoded to handle names unsupported in HDK.\n elif (\n len(new_index) == 0\n and not isinstance(new_index, MultiIndex)\n and new_index.name is None\n ) or (len(new_columns) != 0 and cls._is_trivial_index(new_index)):\n index_cols = None\n else:\n orig_index_names = new_index.names\n orig_df = df\n index_cols = mangle_index_names(new_index.names)\n df.index.names = index_cols\n df = df.reset_index()\n orig_df.index.names = orig_index_names\n\n new_dtypes = df.dtypes\n\n def encoder(n):\n return (\n n\n if n == MODIN_UNNAMED_SERIES_LABEL\n else encode_col_name(n, ignore_reserved=False)\n )\n\n if index_cols is not None:\n cols = index_cols.copy()\n cols.extend([encoder(n) for n in df.columns[len(index_cols) :]])\n df.columns = cols\n else:\n df = df.rename(columns=encoder)\n\n (\n new_parts,\n new_lengths,\n new_widths,\n unsupported_cols,\n ) = cls._partition_mgr_cls.from_pandas(\n df, return_dims=True, encode_col_names=False\n )\n\n if len(unsupported_cols) > 0:\n ErrorMessage.single_warning(\n f\"Frame contain columns with unsupported data-types: {unsupported_cols}. \"\n + \"All operations with this frame will be default to pandas!\"\n )\n\n return cls(\n new_parts,\n new_index,\n new_columns,\n new_lengths,\n new_widths,\n dtypes=new_dtypes,\n index_cols=index_cols,\n has_unsupported_data=len(unsupported_cols) > 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_arrow_HdkOnNativeDataframe.from_arrow.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.from_arrow_HdkOnNativeDataframe.from_arrow.return.cls_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2655, "end_line": 2734, "span_ids": ["HdkOnNativeDataframe.from_arrow"], "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": "class HdkOnNativeDataframe(PandasDataframe):\n\n @classmethod\n def from_arrow(\n cls, at, index_cols=None, index=None, columns=None, encode_col_names=True\n ):\n \"\"\"\n Build a frame from an Arrow table.\n\n Parameters\n ----------\n at : pyarrow.Table\n Source table.\n index_cols : list of str, optional\n List of index columns in the source table which\n are ignored in transformation.\n index : pandas.Index, optional\n An index to be used by the new frame. Should present\n if `index_cols` is not None.\n columns : Index or array-like, optional\n Column labels to use for resulting frame.\n encode_col_names : bool, default: True\n Encode column names.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n (\n new_frame,\n new_lengths,\n new_widths,\n unsupported_cols,\n ) = cls._partition_mgr_cls.from_arrow(\n at, return_dims=True, encode_col_names=encode_col_names\n )\n\n if columns is not None:\n new_columns = columns\n new_index = index\n elif index_cols:\n data_cols = [col for col in at.column_names if col not in index_cols]\n new_columns = pd.Index(data=data_cols, dtype=\"O\")\n new_index = index\n else:\n assert index is None\n new_columns = pd.Index(data=at.column_names, dtype=\"O\")\n new_index = None\n\n dtype_index = [] if index_cols is None else list(index_cols)\n dtype_index.extend(new_columns)\n new_dtypes = []\n\n for col in at.columns:\n if pyarrow.types.is_dictionary(col.type):\n new_dtypes.append(\n LazyProxyCategoricalDtype._build_proxy(\n parent=at,\n column_name=col._name,\n materializer=build_categorical_from_at,\n )\n )\n else:\n new_dtypes.append(cls._arrow_type_to_dtype(col.type))\n\n if len(unsupported_cols) > 0:\n ErrorMessage.single_warning(\n f\"Frame contain columns with unsupported data-types: {unsupported_cols}. \"\n + \"All operations with this frame will be default to pandas!\"\n )\n\n return cls(\n partitions=new_frame,\n index=new_index,\n columns=new_columns,\n row_lengths=new_lengths,\n column_widths=new_widths,\n dtypes=pd.Series(data=new_dtypes, index=dtype_index),\n index_cols=index_cols,\n has_unsupported_data=len(unsupported_cols) > 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._is_trivial_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._is_trivial_index_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2736, "end_line": 2762, "span_ids": ["HdkOnNativeDataframe._is_trivial_index"], "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 HdkOnNativeDataframe(PandasDataframe):\n\n @classmethod\n def _is_trivial_index(cls, index):\n \"\"\"\n Check if an index is a trivial index, i.e. a sequence [0..n].\n\n Parameters\n ----------\n index : pandas.Index\n An index to check.\n\n Returns\n -------\n bool\n \"\"\"\n if len(index) == 0:\n return True\n if isinstance(index, pd.RangeIndex):\n return index.start == 0 and index.step == 1\n if not (isinstance(index, pd.Index) and index.dtype == np.int64):\n return False\n return (\n index.is_monotonic_increasing\n and index.is_unique\n and index.min() == 0\n and index.max() == len(index) - 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_re_ColNameCodec._DECODERS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_re_ColNameCodec._DECODERS._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 90, "span_ids": ["ColNameCodec._encode_tuple", "ColNameCodec._decode_tuple", "docstring", "ColNameCodec:16", "ColNameCodec"], "tokens": 649}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\n\nimport typing\nfrom typing import Tuple, Union, List, Any\nfrom functools import lru_cache\nfrom collections import OrderedDict\n\nimport numpy as np\nimport pandas\nfrom pandas import Timestamp\nfrom pandas.core.dtypes.common import get_dtype, is_string_dtype\nfrom pandas.core.arrays.arrow.extension_types import ArrowIntervalType\n\nimport pyarrow as pa\nfrom pyarrow.types import is_dictionary\n\nfrom modin.utils import MODIN_UNNAMED_SERIES_LABEL\n\nEMPTY_ARROW_TABLE = pa.Table.from_pandas(pandas.DataFrame({}))\n\n\nclass ColNameCodec:\n IDX_COL_NAME = \"__index__\"\n ROWID_COL_NAME = \"__rowid__\"\n UNNAMED_IDX_COL_NAME = \"__index__0__N\"\n\n _IDX_NAME_PATTERN = re.compile(f\"{IDX_COL_NAME}\\\\d+_(.*)\")\n _RESERVED_NAMES = (MODIN_UNNAMED_SERIES_LABEL, ROWID_COL_NAME)\n _COL_TYPES = Union[str, int, float, Timestamp, None]\n _COL_NAME_TYPE = Union[_COL_TYPES, Tuple[_COL_TYPES, ...]]\n\n def _encode_tuple(values: Tuple[_COL_TYPES, ...]) -> str: # noqa: GL08\n dst = [\"_T\"]\n count = len(values)\n for value in values:\n if isinstance(value, str):\n dst.append(value.replace(\"_\", \"_Q\"))\n else:\n dst.append(ColNameCodec._ENCODERS[type(value)](value))\n count -= 1\n if count != 0:\n dst.append(\"_T\")\n return \"\".join(dst)\n\n def _decode_tuple(encoded: str) -> Tuple[_COL_TYPES, ...]: # noqa: GL08\n items = []\n for item in encoded[2:].split(\"_T\"):\n dec = (\n None\n if len(item) < 2 or item[0] != \"_\"\n else ColNameCodec._DECODERS.get(item[1], None)\n )\n items.append(item.replace(\"_Q\", \"_\") if dec is None else dec(item))\n return tuple(items)\n\n _ENCODERS = {\n tuple: _encode_tuple,\n type(None): lambda v: \"_N\",\n str: lambda v: \"_E\" if len(v) == 0 else \"_S\" + v[1:] if v[0] == \"_\" else v,\n int: lambda v: f\"_I{v}\",\n float: lambda v: f\"_F{v}\",\n Timestamp: lambda v: f\"_D{v.timestamp()}_{v.tz}\",\n }\n\n _DECODERS = {\n \"T\": _decode_tuple,\n \"N\": lambda v: None,\n \"E\": lambda v: \"\",\n \"S\": lambda v: \"_\" + v[2:],\n \"I\": lambda v: int(v[2:]),\n \"F\": lambda v: float(v[2:]),\n \"D\": lambda v: Timestamp.fromtimestamp(\n float(v[2 : (idx := v.index(\"_\", 2))]), tz=v[idx + 1 :]\n ),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.encode_ColNameCodec.encode.try_.except_KeyError_.raise_TypeError_f_Unsuppo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.encode_ColNameCodec.encode.try_.except_KeyError_.raise_TypeError_f_Unsuppo", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 129, "span_ids": ["ColNameCodec.encode"], "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 ColNameCodec:\n\n @staticmethod\n @lru_cache(1024)\n def encode(\n name: _COL_NAME_TYPE,\n ignore_reserved: bool = True,\n ) -> str:\n \"\"\"\n Encode column name.\n\n The supported name types are specified in the type hints. Non-string names\n are converted to string and prefixed with a corresponding tag.\n\n Parameters\n ----------\n name : str, int, float, Timestamp, None, tuple\n Column name to be encoded.\n ignore_reserved : bool, default: True\n Do not encode reserved names.\n\n Returns\n -------\n str\n Encoded name.\n \"\"\"\n if (\n ignore_reserved\n and isinstance(name, str)\n and (\n name.startswith(ColNameCodec.IDX_COL_NAME)\n or name in ColNameCodec._RESERVED_NAMES\n )\n ):\n return name\n\n try:\n return ColNameCodec._ENCODERS[type(name)](name)\n except KeyError:\n raise TypeError(f\"Unsupported column name: {name}\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.decode_ColNameCodec.decode.try_.except_KeyError_.raise_ValueError_f_Invali": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.decode_ColNameCodec.decode.try_.except_KeyError_.raise_ValueError_f_Invali", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 158, "span_ids": ["ColNameCodec.decode"], "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 ColNameCodec:\n\n @staticmethod\n @lru_cache(1024)\n def decode(name: str) -> _COL_NAME_TYPE:\n \"\"\"\n Decode column name, previously encoded with encode_col_name().\n\n Parameters\n ----------\n name : str\n Encoded name.\n\n Returns\n -------\n str, int, float, Timestamp, None, tuple\n Decoded name.\n \"\"\"\n if (\n len(name) < 2\n or name[0] != \"_\"\n or name.startswith(ColNameCodec.IDX_COL_NAME)\n or name in ColNameCodec._RESERVED_NAMES\n ):\n return name\n\n try:\n return ColNameCodec._DECODERS[name[1]](name)\n except KeyError:\n raise ValueError(f\"Invalid encoded column name: {name}\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.mangle_index_names_ColNameCodec.mangle_index_names.return._f_pref_i___ColNameCode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.mangle_index_names_ColNameCodec.mangle_index_names.return._f_pref_i___ColNameCode", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 182, "span_ids": ["ColNameCodec.mangle_index_names"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ColNameCodec:\n\n @staticmethod\n def mangle_index_names(names: List[_COL_NAME_TYPE]) -> List[str]:\n \"\"\"\n Return mangled index names for index labels.\n\n Mangled names are used for index columns because index\n labels cannot always be used as HDK table column\n names. E.e. label can be a non-string value or an\n unallowed string (empty strings, etc.) for a table column\n name.\n\n Parameters\n ----------\n names : list of str\n Index labels.\n\n Returns\n -------\n list of str\n Mangled names.\n \"\"\"\n pref = ColNameCodec.IDX_COL_NAME\n return [f\"{pref}{i}_{ColNameCodec.encode(n)}\" for i, n in enumerate(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.demangle_index_names_ColNameCodec.demangle_index_names.return._ColNameCodec_demangle_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.demangle_index_names_ColNameCodec.demangle_index_names.return._ColNameCodec_demangle_in", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 203, "span_ids": ["ColNameCodec.demangle_index_names"], "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 ColNameCodec:\n\n @staticmethod\n def demangle_index_names(\n cols: List[str],\n ) -> Union[_COL_NAME_TYPE, List[_COL_NAME_TYPE]]:\n \"\"\"\n Demangle index column names to index labels.\n\n Parameters\n ----------\n cols : list of str\n Index column names.\n\n Returns\n -------\n list or a single demangled name\n Demangled index names.\n \"\"\"\n if len(cols) == 1:\n return ColNameCodec.demangle_index_name(cols[0])\n return [ColNameCodec.demangle_index_name(n) for n in cols]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.demangle_index_name_ColNameCodec.demangle_index_name.return.col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.demangle_index_name_ColNameCodec.demangle_index_name.return.col", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 205, "end_line": 226, "span_ids": ["ColNameCodec.demangle_index_name"], "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 ColNameCodec:\n\n @staticmethod\n def demangle_index_name(col: str) -> _COL_NAME_TYPE:\n \"\"\"\n Demangle index column name into index label.\n\n Parameters\n ----------\n col : str\n Index column name.\n\n Returns\n -------\n str\n Demangled index name.\n \"\"\"\n match = ColNameCodec._IDX_NAME_PATTERN.search(col)\n if match:\n name = match.group(1)\n if name == MODIN_UNNAMED_SERIES_LABEL:\n return None\n return ColNameCodec.decode(name)\n return 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.concat_index_names_ColNameCodec.concat_index_names.return.names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_ColNameCodec.concat_index_names_ColNameCodec.concat_index_names.return.names", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 278, "span_ids": ["ColNameCodec.concat_index_names"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ColNameCodec:\n\n @staticmethod\n def concat_index_names(frames) -> typing.OrderedDict[str, Any]:\n \"\"\"\n Calculate the index names and dtypes.\n\n Calculate the index names and dtypes, that the index\n columns will have after the frames concatenation.\n\n Parameters\n ----------\n frames : list[HdkOnNativeDataframe]\n\n Returns\n -------\n typing.OrderedDict[str, Any]\n \"\"\"\n first = frames[0]\n names = OrderedDict()\n if first._index_width() > 1:\n # When we're dealing with a MultiIndex case the resulting index\n # inherits the levels from the first frame in concatenation.\n dtypes = first._dtypes\n for n in first._index_cols:\n names[n] = dtypes[n]\n else:\n # In a non-MultiIndex case, we check if all the indices have the same\n # names, and if they do - inherit the name and dtype from the first frame,\n # otherwise return metadata matching unnamed RangeIndex.\n mangle = ColNameCodec.mangle_index_names\n idx_names = set()\n for f in frames:\n if f._index_cols is not None:\n idx_names.update(f._index_cols)\n elif f.has_index_cache:\n idx_names.update(mangle(f.index.names))\n else:\n idx_names.add(ColNameCodec.UNNAMED_IDX_COL_NAME)\n if len(idx_names) > 1:\n idx_names = [ColNameCodec.UNNAMED_IDX_COL_NAME]\n break\n\n name = next(iter(idx_names))\n # Inherit the Index's dtype from the first frame.\n if first._index_cols is not None:\n names[name] = first._dtypes.iloc[0]\n elif first.has_index_cache:\n names[name] = first.index.dtype\n else:\n # A trivial index with no name\n names[name] = get_dtype(int)\n return 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_build_categorical_from_at_check_join_supported.if_join_type_not_in_inn.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_build_categorical_from_at_check_join_supported.if_join_type_not_in_inn.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 313, "span_ids": ["build_categorical_from_at", "check_join_supported"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_categorical_from_at(table, column_name):\n \"\"\"\n Build ``pandas.CategoricalDtype`` from a dictionary column of the passed PyArrow Table.\n\n Parameters\n ----------\n table : pyarrow.Table\n column_name : str\n\n Returns\n -------\n pandas.CategoricalDtype\n \"\"\"\n chunks = table.column(column_name).chunks\n cat = pandas.concat([chunk.dictionary.to_pandas() for chunk in chunks])\n return pandas.CategoricalDtype(cat.unique())\n\n\ndef check_join_supported(join_type: str):\n \"\"\"\n Check if join type is supported by HDK.\n\n Parameters\n ----------\n join_type : str\n Join type.\n\n Returns\n -------\n None\n \"\"\"\n if join_type not in (\"inner\", \"left\"):\n raise NotImplementedError(f\"{join_type} join\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_check_cols_to_join_check_cols_to_join.return.df_new_col_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_check_cols_to_join_check_cols_to_join.return.df_new_col_names", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 358, "span_ids": ["check_cols_to_join"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_cols_to_join(what, df, col_names):\n \"\"\"\n Check the frame columns.\n\n Check if the frame (`df`) has the specified columns (`col_names`). The names referring to\n the index columns are replaced with the actual index column names.\n\n Parameters\n ----------\n what : str\n Attribute name.\n df : HdkOnNativeDataframe\n The dataframe.\n col_names : list of str\n The column names to check.\n\n Returns\n -------\n Tuple[HdkOnNativeDataframe, list]\n The aligned data frame and column names.\n \"\"\"\n cols = df.columns\n new_col_names = col_names\n for i, col in enumerate(col_names):\n if col in cols:\n continue\n new_name = None\n if df._index_cols is not None:\n for c in df._index_cols:\n if col == ColNameCodec.demangle_index_name(c):\n new_name = c\n break\n elif df.has_index_cache:\n new_name = f\"__index__{0}_{col}\"\n df = df._maybe_materialize_rowid()\n if new_name is None:\n raise ValueError(f\"'{what}' references unknown column {col}\")\n if new_col_names is col_names:\n # We are replacing the index names in the original list,\n # but creating a copy.\n new_col_names = col_names.copy()\n new_col_names[i] = new_name\n return df, new_col_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index_get_data_for_join_by_index._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index_get_data_for_join_by_index._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 398, "span_ids": ["get_data_for_join_by_index"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_data_for_join_by_index(\n left,\n right,\n how,\n left_on,\n right_on,\n sort,\n suffixes,\n):\n \"\"\"\n Return the column names, dtypes and expres, required for join by index.\n\n This is a helper function, used by `HdkOnNativeDataframe.join()`, when joining by index.\n\n Parameters\n ----------\n left : HdkOnNativeDataframe\n A frame to join.\n right : HdkOnNativeDataframe\n A frame to join with.\n how : str\n A type of join.\n left_on : list of str\n A list of columns for the left frame to join on.\n right_on : list of str\n A list of columns for the right frame to join on.\n sort : bool\n Sort the result by join keys.\n suffixes : list-like of str\n A length-2 sequence of suffixes to add to overlapping column names\n of left and right operands respectively.\n\n Returns\n -------\n tuple\n\n The index columns, exprs, dtypes and columns.\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index.to_empty_pandas_df_get_data_for_join_by_index.to_empty_pandas_df.return.pandas_DataFrame_columns_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index.to_empty_pandas_df_get_data_for_join_by_index.to_empty_pandas_df.return.pandas_DataFrame_columns_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 414, "span_ids": ["get_data_for_join_by_index"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_data_for_join_by_index(\n left,\n right,\n how,\n left_on,\n right_on,\n sort,\n suffixes,\n):\n\n def to_empty_pandas_df(df):\n # Create an empty pandas frame with the same columns and index.\n idx = df._index_cache.get() if df.has_index_cache else None\n if idx is not None:\n idx = idx[:1]\n elif df._index_cols is not None:\n if len(df._index_cols) > 1:\n arrays = [[i] for i in range(len(df._index_cols))]\n names = [ColNameCodec.demangle_index_name(n) for n in df._index_cols]\n idx = pandas.MultiIndex.from_arrays(arrays, names=names)\n else:\n idx = pandas.Index(\n name=ColNameCodec.demangle_index_name(df._index_cols[0])\n )\n return pandas.DataFrame(columns=df.columns, index=idx)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index.new_dtypes_get_data_for_join_by_index.return.index_cols_exprs_new_dt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_get_data_for_join_by_index.new_dtypes_get_data_for_join_by_index.return.index_cols_exprs_new_dt", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 416, "end_line": 465, "span_ids": ["get_data_for_join_by_index"], "tokens": 477}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_data_for_join_by_index(\n left,\n right,\n how,\n left_on,\n right_on,\n sort,\n suffixes,\n):\n # ... other code\n\n new_dtypes = []\n exprs = OrderedDict()\n merged = to_empty_pandas_df(left).merge(\n to_empty_pandas_df(right),\n how=how,\n left_on=left_on,\n right_on=right_on,\n sort=sort,\n suffixes=suffixes,\n )\n\n if len(merged.index.names) == 1 and (merged.index.names[0] is None):\n index_cols = None\n else:\n index_cols = ColNameCodec.mangle_index_names(merged.index.names)\n for orig_name, mangled_name in zip(merged.index.names, index_cols):\n # Using _dtypes here since it contains all column names,\n # including the index.\n df = left if mangled_name in left._dtypes else right\n exprs[orig_name] = df.ref(mangled_name)\n new_dtypes.append(df._dtypes[mangled_name])\n\n left_col_names = set(left.columns)\n right_col_names = set(right.columns)\n for col in merged.columns:\n orig_name = col\n if orig_name in left_col_names:\n df = left\n elif orig_name in right_col_names:\n df = right\n elif suffixes is None:\n raise ValueError(f\"Unknown column {col}\")\n elif (\n col.endswith(suffixes[0])\n and (orig_name := col[0 : -len(suffixes[0])]) in left_col_names\n and orig_name in right_col_names\n ):\n df = left # Overlapping column from the left frame\n elif (\n col.endswith(suffixes[1])\n and (orig_name := col[0 : -len(suffixes[1])]) in right_col_names\n and orig_name in left_col_names\n ):\n df = right # Overlapping column from the right frame\n else:\n raise ValueError(f\"Unknown column {col}\")\n exprs[col] = df.ref(orig_name)\n new_dtypes.append(df._dtypes[orig_name])\n\n return index_cols, exprs, new_dtypes, merged.columns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_to_arrow_type_get_common_arrow_type.return.pa_from_numpy_dtype_np_pr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_to_arrow_type_get_common_arrow_type.return.pa_from_numpy_dtype_np_pr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 468, "end_line": 511, "span_ids": ["get_common_arrow_type", "to_arrow_type"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def to_arrow_type(dtype) -> pa.lib.DataType:\n \"\"\"\n Convert the specified dtype to arrow.\n\n Parameters\n ----------\n dtype : dtype\n\n Returns\n -------\n pa.lib.DataType\n \"\"\"\n if is_string_dtype(dtype):\n return pa.from_numpy_dtype(str)\n return pa.from_numpy_dtype(dtype)\n\n\ndef get_common_arrow_type(t1: pa.lib.DataType, t2: pa.lib.DataType) -> pa.lib.DataType:\n \"\"\"\n Get common arrow data type.\n\n Parameters\n ----------\n t1 : pa.lib.DataType\n t2 : pa.lib.DataType\n\n Returns\n -------\n pa.lib.DataType\n \"\"\"\n if t1 == t2:\n return t1\n if pa.types.is_string(t1):\n return t1\n if pa.types.is_string(t2):\n return t2\n if pa.types.is_null(t1):\n return t2\n if pa.types.is_null(t2):\n return t1\n\n t1 = t1.to_pandas_dtype()\n t2 = t2.to_pandas_dtype()\n return pa.from_numpy_dtype(np.promote_types(t1, t2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_arrow_to_pandas_arrow_to_pandas.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py_arrow_to_pandas_arrow_to_pandas.return.df", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 514, "end_line": 542, "span_ids": ["arrow_to_pandas"], "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 arrow_to_pandas(at: pa.Table) -> pandas.DataFrame:\n \"\"\"\n Convert the specified arrow table to pandas.\n\n Parameters\n ----------\n at : pyarrow.Table\n The table to convert.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n\n def mapper(at):\n if is_dictionary(at) and isinstance(at.value_type, ArrowIntervalType):\n # The default mapper fails with TypeError: unhashable type: 'dict'\n return _CategoricalDtypeMapper\n return None\n\n df = at.to_pandas(types_mapper=mapper)\n dtype = {}\n for idx, _type in enumerate(at.schema.types):\n if isinstance(_type, pa.lib.TimestampType) and _type.unit != \"ns\":\n dtype[at.schema.names[idx]] = f\"datetime64[{_type.unit}]\"\n if dtype:\n # TODO: remove after https://github.com/apache/arrow/pull/35656 is merge\n df = df.astype(dtype)\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py__CategoricalDtypeMapper_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py__CategoricalDtypeMapper_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 545, "end_line": 561, "span_ids": ["_CategoricalDtypeMapper.__from_arrow__", "_CategoricalDtypeMapper"], "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 _CategoricalDtypeMapper: # noqa: GL08\n @staticmethod\n def __from_arrow__(arr): # noqa: GL08\n values = []\n # Using OrderedDict as an ordered set to preserve the categories order\n categories = OrderedDict()\n chunks = arr.chunks if isinstance(arr, pa.ChunkedArray) else (arr,)\n for chunk in chunks:\n assert isinstance(chunk, pa.DictionaryArray)\n cat = chunk.dictionary.to_pandas()\n values.append(chunk.indices.to_pandas().map(cat))\n categories.update((c, None) for c in cat)\n return pandas.Categorical(\n pandas.concat(values, ignore_index=True),\n dtype=pandas.CategoricalDtype(categories, ordered=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_abc_if_TYPE_CHECKING_.HdkOnNativeDataframe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_abc_if_TYPE_CHECKING_.HdkOnNativeDataframe", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 35, "span_ids": ["docstring"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import abc\n\nimport typing\nfrom typing import TYPE_CHECKING, List, Dict, Union\nfrom collections import OrderedDict\n\nimport pandas\nfrom pandas.core.dtypes.common import is_string_dtype\n\nimport numpy as np\nimport pyarrow as pa\n\nfrom modin.utils import _inherit_docstrings\nfrom modin.pandas.indexing import is_range_like\n\nfrom .expr import InputRefExpr, LiteralExpr, OpExpr\nfrom .dataframe.utils import ColNameCodec, EMPTY_ARROW_TABLE, get_common_arrow_type\n\nif TYPE_CHECKING:\n from .dataframe.dataframe import HdkOnNativeDataframe", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_TransformMapper_TransformMapper.translate.return.self__op_exprs_col_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_TransformMapper_TransformMapper.translate.return.self__op_exprs_col_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 76, "span_ids": ["TransformMapper.__init__", "TransformMapper.translate", "TransformMapper"], "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 TransformMapper:\n \"\"\"\n A helper class for ``InputMapper``.\n\n This class is used to map column references to expressions used\n for their computation. This mapper is used to fold expressions\n from multiple ``TransformNode``-s into a single expression.\n\n Parameters\n ----------\n op : TransformNode\n Transformation used for mapping.\n\n Attributes\n ----------\n _op : TransformNode\n Transformation used for mapping.\n \"\"\"\n\n def __init__(self, op):\n self._op = op\n\n def translate(self, col):\n \"\"\"\n Translate column reference by its name.\n\n Parameters\n ----------\n col : str\n A name of the column to translate.\n\n Returns\n -------\n BaseExpr\n Translated expression.\n \"\"\"\n if col == ColNameCodec.ROWID_COL_NAME:\n return self._op.input[0].ref(col)\n return self._op.exprs[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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameMapper_FrameMapper.translate.return.self__frame_ref_col_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameMapper_FrameMapper.translate.return.self__frame_ref_col_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 114, "span_ids": ["FrameMapper.translate", "FrameMapper.__init__", "FrameMapper"], "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 FrameMapper:\n \"\"\"\n A helper class for ``InputMapper``.\n\n This class is used to map column references to another frame.\n This mapper is used to replace input frame in expressions.\n\n Parameters\n ----------\n frame : HdkOnNativeDataframe\n Target frame.\n\n Attributes\n ----------\n _frame : HdkOnNativeDataframe\n Target frame.\n \"\"\"\n\n def __init__(self, frame):\n self._frame = frame\n\n def translate(self, col):\n \"\"\"\n Translate column reference by its name.\n\n Parameters\n ----------\n col : str\n A name of the column to translate.\n\n Returns\n -------\n BaseExpr\n Translated expression.\n \"\"\"\n return self._frame.ref(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_InputMapper_InputMapper.translate.return.ref": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_InputMapper_InputMapper.translate.return.ref", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 166, "span_ids": ["InputMapper.translate", "InputMapper.add_mapper", "InputMapper.__init__", "InputMapper"], "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 InputMapper:\n \"\"\"\n Input reference mapper.\n\n This class is used for input translation/replacement in\n expressions via ``BaseExpr.translate_input`` method.\n\n Translation is performed using column mappers registered via\n `add_mapper` method. Each input frame can have at most one mapper.\n References to frames with no registered mapper are not translated.\n\n Attributes\n ----------\n _mappers : dict\n Column mappers to use for translation.\n \"\"\"\n\n def __init__(self):\n self._mappers = {}\n\n def add_mapper(self, frame, mapper):\n \"\"\"\n Register a mapper for a frame.\n\n Parameters\n ----------\n frame : HdkOnNativeDataframe\n A frame for which a mapper is registered.\n mapper : object\n A mapper to register.\n \"\"\"\n self._mappers[frame] = mapper\n\n def translate(self, ref):\n \"\"\"\n Translate column reference by its name.\n\n Parameters\n ----------\n ref : InputRefExpr\n A column reference to translate.\n\n Returns\n -------\n BaseExpr\n Translated expression.\n \"\"\"\n if ref.modin_frame in self._mappers:\n return self._mappers[ref.modin_frame].translate(ref.column)\n return ref", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode_DFAlgNode.walk_dfs.cb_self_args_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode_DFAlgNode.walk_dfs.cb_self_args_kwargs_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 211, "span_ids": ["DFAlgNode.copy", "DFAlgNode.walk_dfs", "DFAlgNode"], "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 DFAlgNode(abc.ABC):\n \"\"\"\n A base class for dataframe algebra tree node.\n\n A dataframe algebra tree is used to describe how dataframe is computed.\n\n Attributes\n ----------\n input : list of DFAlgNode, optional\n Holds child nodes.\n \"\"\"\n\n @abc.abstractmethod\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n DFAlgNode\n \"\"\"\n pass\n\n def walk_dfs(self, cb, *args, **kwargs):\n \"\"\"\n Perform a depth-first walk over a tree.\n\n Walk over an input in the depth-first order and call a callback function\n for each node.\n\n Parameters\n ----------\n cb : callable\n A callback function.\n *args : list\n Arguments for the callback.\n **kwargs : dict\n Keyword arguments for the callback.\n \"\"\"\n if hasattr(self, \"input\"):\n for i in self.input:\n i._op.walk_dfs(cb, *args, **kwargs)\n cb(self, *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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode.collect_partitions_DFAlgNode._prints.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode.collect_partitions_DFAlgNode._prints.pass", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 370, "span_ids": ["DFAlgNode.dump", "DFAlgNode.require_executed_base", "DFAlgNode.collect_frames", "DFAlgNode._append_partitions", "DFAlgNode.__repr__", "DFAlgNode.can_execute_arrow", "DFAlgNode.collect_partitions", "DFAlgNode.can_execute_hdk", "DFAlgNode.execute_arrow", "DFAlgNode._append_frames", "DFAlgNode._prints", "DFAlgNode.dumps"], "tokens": 721}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DFAlgNode(abc.ABC):\n\n def collect_partitions(self):\n \"\"\"\n Collect all partitions participating in a tree.\n\n Returns\n -------\n list\n A list of collected partitions.\n \"\"\"\n partitions = []\n self.walk_dfs(lambda a, b: a._append_partitions(b), partitions)\n return partitions\n\n def collect_frames(self):\n \"\"\"\n Collect all frames participating in a tree.\n\n Returns\n -------\n list\n A list of collected frames.\n \"\"\"\n frames = []\n self.walk_dfs(lambda a, b: a._append_frames(b), frames)\n return frames\n\n def require_executed_base(self) -> bool:\n \"\"\"\n Check if materialization of input frames is required.\n\n Returns\n -------\n bool\n \"\"\"\n return False\n\n def can_execute_hdk(self) -> bool:\n \"\"\"\n Check for possibility of HDK execution.\n\n Check if the computation can be executed using an HDK query.\n\n Returns\n -------\n bool\n \"\"\"\n return True\n\n def can_execute_arrow(self) -> bool:\n \"\"\"\n Check for possibility of Arrow execution.\n\n Check if the computation can be executed using\n the Arrow API instead of HDK query.\n\n Returns\n -------\n bool\n \"\"\"\n return False\n\n def execute_arrow(\n self, arrow_input: Union[None, pa.Table, List[pa.Table]]\n ) -> pa.Table:\n \"\"\"\n Compute the frame data using the Arrow API.\n\n Parameters\n ----------\n arrow_input : None, pa.Table or list of pa.Table\n The input, converted to arrow.\n\n Returns\n -------\n pyarrow.Table\n The resulting table.\n \"\"\"\n raise RuntimeError(f\"Arrow execution is not supported by {type(self)}\")\n\n def _append_partitions(self, partitions):\n \"\"\"\n Append all used by the node partitions to `partitions` list.\n\n The default implementation is no-op. This method should be\n overriden by all nodes referencing frame's partitions.\n\n Parameters\n ----------\n partitions : list\n Output list of partitions.\n \"\"\"\n pass\n\n def _append_frames(self, frames):\n \"\"\"\n Append all used by the node frames to `frames` list.\n\n The default implementation is no-op. This method should be\n overriden by all nodes referencing frames.\n\n Parameters\n ----------\n frames : list\n Output list of frames.\n \"\"\"\n pass\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the tree.\n\n Returns\n -------\n str\n \"\"\"\n return self.dumps()\n\n def dump(self, prefix=\"\"):\n \"\"\"\n Dump the tree.\n\n Parameters\n ----------\n prefix : str, default: ''\n A prefix to add at each string of the dump.\n \"\"\"\n print(self.dumps(prefix)) # noqa: T201\n\n def dumps(self, prefix=\"\"):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str, default: ''\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return self._prints(prefix)\n\n @abc.abstractmethod\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode._prints_input_DFAlgNode._prints_input.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_DFAlgNode._prints_input_DFAlgNode._prints_input.return.res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 372, "end_line": 394, "span_ids": ["DFAlgNode._prints_input"], "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 DFAlgNode(abc.ABC):\n\n def _prints_input(self, prefix):\n \"\"\"\n Return a string representation of node's operands.\n\n A helper method for `_prints` implementation in derived classes.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n res = \"\"\n if hasattr(self, \"input\"):\n for i, node in enumerate(self.input):\n if isinstance(node._op, FrameNode):\n res += f\"{prefix}input[{i}]: {node._op}\\n\"\n else:\n res += f\"{prefix}input[{i}]:\\n\" + node._op._prints(prefix + \" \")\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode.execute_arrow_FrameNode.execute_arrow.return.EMPTY_ARROW_TABLE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode.execute_arrow_FrameNode.execute_arrow.return.EMPTY_ARROW_TABLE", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 419, "end_line": 445, "span_ids": ["FrameNode.execute_arrow"], "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 FrameNode(DFAlgNode):\n\n def execute_arrow(self, ignore=None) -> Union[pa.Table, pandas.DataFrame]:\n \"\"\"\n Materialized frame.\n\n If `can_execute_arrow` returns True, this method returns an arrow table,\n otherwise - a pandas Dataframe.\n\n Parameters\n ----------\n ignore : None, pa.Table or list of pa.Table, default: None\n\n Returns\n -------\n pa.Table or pandas.Dataframe\n \"\"\"\n frame = self.modin_frame\n if frame._partitions is not None:\n return frame._partitions[0][0].get()\n if frame._has_unsupported_data:\n return pandas.DataFrame(\n index=frame._index_cache, columns=frame._columns_cache\n )\n if frame._index_cache or frame._columns_cache:\n return pa.Table.from_pandas(\n pandas.DataFrame(index=frame._index_cache, columns=frame._columns_cache)\n )\n return EMPTY_ARROW_TABLE", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode.copy_FrameNode._prints.return.f_prefix_self_modin_fra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode.copy_FrameNode._prints.return.f_prefix_self_modin_fra", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 450, "end_line": 495, "span_ids": ["FrameNode._append_frames", "FrameNode._append_partitions", "FrameNode._prints", "FrameNode.copy"], "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 FrameNode(DFAlgNode):\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n FrameNode\n \"\"\"\n return FrameNode(self.modin_frame)\n\n def _append_partitions(self, partitions):\n \"\"\"\n Append all partitions of the referenced frame to `partitions` list.\n\n Parameters\n ----------\n partitions : list\n Output list of partitions.\n \"\"\"\n partitions += self.modin_frame._partitions.flatten()\n\n def _append_frames(self, frames):\n \"\"\"\n Append the referenced frame to `frames` list.\n\n Parameters\n ----------\n frames : list\n Output list of frames.\n \"\"\"\n frames.append(self.modin_frame)\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return f\"{prefix}{self.modin_frame.id_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode_MaskNode.can_execute_arrow.return.self_row_labels_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode_MaskNode.can_execute_arrow.return.self_row_labels_is_None", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 498, "end_line": 537, "span_ids": ["MaskNode.__init__", "MaskNode.can_execute_arrow", "MaskNode.require_executed_base", "MaskNode"], "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 MaskNode(DFAlgNode):\n \"\"\"\n A filtering node which filters rows by index values or row id.\n\n Parameters\n ----------\n base : HdkOnNativeDataframe\n A filtered frame.\n row_labels : list, optional\n List of row labels to select.\n row_positions : list of int, optional\n List of rows ids to select.\n\n Attributes\n ----------\n input : list of HdkOnNativeDataframe\n Holds a single filtered frame.\n row_labels : list or None\n List of row labels to select.\n row_positions : list of int or None\n List of rows ids to select.\n \"\"\"\n\n def __init__(\n self,\n base: \"HdkOnNativeDataframe\",\n row_labels: List[str] = None,\n row_positions: List[int] = None,\n ):\n self.input = [base]\n self.row_labels = row_labels\n self.row_positions = row_positions\n\n @_inherit_docstrings(DFAlgNode.require_executed_base)\n def require_executed_base(self) -> bool:\n return True\n\n @_inherit_docstrings(DFAlgNode.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\n return self.row_labels is None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode.execute_arrow_MaskNode.execute_arrow.if_step_1_.else_.return.table_take_indices_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode.execute_arrow_MaskNode.execute_arrow.if_step_1_.else_.return.table_take_indices_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 539, "end_line": 572, "span_ids": ["MaskNode.execute_arrow"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MaskNode(DFAlgNode):\n\n def execute_arrow(self, table: pa.Table) -> pa.Table:\n \"\"\"\n Perform row selection on the frame using Arrow API.\n\n Parameters\n ----------\n table : pa.Table\n\n Returns\n -------\n pyarrow.Table\n The resulting table.\n \"\"\"\n row_positions = self.row_positions\n\n if not isinstance(row_positions, slice) and not is_range_like(row_positions):\n if not isinstance(row_positions, (pa.Array, np.ndarray, list)):\n row_positions = pa.array(row_positions)\n return table.take(row_positions)\n\n if isinstance(row_positions, slice):\n row_positions = range(*row_positions.indices(table.num_rows))\n\n start, stop, step = (\n row_positions.start,\n row_positions.stop,\n row_positions.step,\n )\n\n if step == 1:\n return table.slice(start, len(row_positions))\n else:\n indices = np.arange(start, stop, step)\n return table.take(indices)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode.copy_MaskNode._prints.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_MaskNode.copy_MaskNode._prints.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 574, "end_line": 602, "span_ids": ["MaskNode._prints", "MaskNode.copy"], "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 MaskNode(DFAlgNode):\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n MaskNode\n \"\"\"\n return MaskNode(self.input[0], self.row_labels, self.row_positions)\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return (\n f\"{prefix}MaskNode:\\n\"\n + f\"{prefix} row_labels: {self.row_labels}\\n\"\n + f\"{prefix} row_positions: {self.row_positions}\\n\"\n + self._prints_input(prefix + \" \")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_GroupbyAggNode_GroupbyAggNode.copy.return.GroupbyAggNode_self_input": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_GroupbyAggNode_GroupbyAggNode.copy.return.GroupbyAggNode_self_input", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 605, "end_line": 646, "span_ids": ["GroupbyAggNode", "GroupbyAggNode.copy", "GroupbyAggNode.__init__"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupbyAggNode(DFAlgNode):\n \"\"\"\n A node to represent a groupby aggregation operation.\n\n Parameters\n ----------\n base : DFAlgNode\n An aggregated frame.\n by : list of str\n A list of columns used for grouping.\n agg_exprs : dict\n Aggregates to compute.\n groupby_opts : dict\n Additional groupby parameters.\n\n Attributes\n ----------\n input : list of DFAlgNode\n Holds a single aggregated frame.\n by : list of str\n A list of columns used for grouping.\n agg_exprs : dict\n Aggregates to compute.\n groupby_opts : dict\n Additional groupby parameters.\n \"\"\"\n\n def __init__(self, base, by, agg_exprs, groupby_opts):\n self.by = by\n self.agg_exprs = agg_exprs\n self.groupby_opts = groupby_opts\n self.input = [base]\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n GroupbyAggNode\n \"\"\"\n return GroupbyAggNode(self.input[0], self.by, self.agg_exprs, self.groupby_opts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_GroupbyAggNode._prints_GroupbyAggNode._prints.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_GroupbyAggNode._prints_GroupbyAggNode._prints.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 648, "end_line": 667, "span_ids": ["GroupbyAggNode._prints"], "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 GroupbyAggNode(DFAlgNode):\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return (\n f\"{prefix}AggNode:\\n\"\n + f\"{prefix} by: {self.by}\\n\"\n + f\"{prefix} aggs: {self.agg_exprs}\\n\"\n + f\"{prefix} groupby_opts: {self.groupby_opts}\\n\"\n + self._prints_input(prefix + \" \")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_TransformNode_TransformNode._check_exprs.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_TransformNode_TransformNode._check_exprs.return.True", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 670, "end_line": 795, "span_ids": ["TransformNode.copy", "TransformNode.is_simple_select", "TransformNode", "TransformNode._check_exprs", "TransformNode.can_execute_hdk", "TransformNode.execute_arrow", "TransformNode.__init__", "TransformNode._prints", "TransformNode.can_execute_arrow"], "tokens": 753}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformNode(DFAlgNode):\n \"\"\"\n A node to represent a projection of a single frame.\n\n Provides expressions to compute each column of the projection.\n\n Parameters\n ----------\n base : HdkOnNativeDataframe\n A transformed frame.\n exprs : dict\n Expressions for frame's columns computation.\n fold : bool\n\n Attributes\n ----------\n input : list of HdkOnNativeDataframe\n Holds a single projected frame.\n exprs : dict\n Expressions used to compute frame's columns.\n \"\"\"\n\n def __init__(\n self,\n base: \"HdkOnNativeDataframe\",\n exprs: Dict[str, Union[InputRefExpr, LiteralExpr, OpExpr]],\n fold: bool = True,\n ):\n # If base of this node is another `TransformNode`, then translate all\n # expressions in `expr` to its base.\n if fold and isinstance(base._op, TransformNode):\n self.input = [base._op.input[0]]\n self.exprs = exprs = translate_exprs_to_base(exprs, self.input[0])\n for col, expr in exprs.items():\n exprs[col] = expr.fold()\n else:\n self.input = [base]\n self.exprs = exprs\n\n @_inherit_docstrings(DFAlgNode.can_execute_hdk)\n def can_execute_hdk(self) -> bool:\n return self._check_exprs(\"can_execute_hdk\")\n\n @_inherit_docstrings(DFAlgNode.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\n return self._check_exprs(\"can_execute_arrow\")\n\n def execute_arrow(self, table: pa.Table) -> pa.Table:\n \"\"\"\n Perform column selection on the frame using Arrow API.\n\n Parameters\n ----------\n table : pa.Table\n\n Returns\n -------\n pyarrow.Table\n The resulting table.\n \"\"\"\n cols = [expr.execute_arrow(table) for expr in self.exprs.values()]\n names = [ColNameCodec.encode(c) for c in self.exprs]\n return pa.table(cols, names)\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n TransformNode\n \"\"\"\n return TransformNode(self.input[0], self.exprs)\n\n def is_simple_select(self):\n \"\"\"\n Check if transform node is a simple selection.\n\n Simple selection can only use InputRefExpr expressions.\n\n Returns\n -------\n bool\n True for simple select and False otherwise.\n \"\"\"\n return all(isinstance(expr, InputRefExpr) for expr in self.exprs.values())\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n res = f\"{prefix}TransformNode:\\n\"\n for k, v in self.exprs.items():\n res += f\"{prefix} {k}: {v}\\n\"\n res += self._prints_input(prefix + \" \")\n return res\n\n def _check_exprs(self, attr) -> bool:\n \"\"\"\n Check if the specified attribute is True for all expressions.\n\n Parameters\n ----------\n attr : str\n\n Returns\n -------\n bool\n \"\"\"\n stack = list(self.exprs.values())\n while stack:\n expr = stack.pop()\n if not getattr(expr, attr)():\n return False\n if isinstance(expr, OpExpr):\n stack.extend(expr.operands)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_JoinNode_JoinNode.copy.return.JoinNode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_JoinNode_JoinNode.copy.return.JoinNode_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 798, "end_line": 855, "span_ids": ["JoinNode.copy", "JoinNode", "JoinNode.__init__"], "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 JoinNode(DFAlgNode):\n \"\"\"\n A node to represent a join of two frames.\n\n Parameters\n ----------\n left : DFAlgNode\n A left frame to join.\n right : DFAlgNode\n A right frame to join.\n how : str, default: \"inner\"\n A type of join.\n exprs : dict, default: None\n Expressions for the resulting frame's columns.\n condition : BaseExpr, default: None\n Join condition.\n\n Attributes\n ----------\n input : list of DFAlgNode\n Holds joined frames. The first frame in the list is considered as\n the left join operand.\n how : str\n A type of join.\n exprs : dict\n Expressions for the resulting frame's columns.\n condition : BaseExpr\n Join condition.\n \"\"\"\n\n def __init__(\n self,\n left,\n right,\n how=\"inner\",\n exprs=None,\n condition=None,\n ):\n self.input = [left, right]\n self.how = how\n self.exprs = exprs\n self.condition = condition\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n JoinNode\n \"\"\"\n return JoinNode(\n self.input[0],\n self.input[1],\n self.how,\n self.exprs,\n self.condition,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_JoinNode._prints_JoinNode._prints.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_JoinNode._prints_JoinNode._prints.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 857, "end_line": 880, "span_ids": ["JoinNode._prints"], "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 JoinNode(DFAlgNode):\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n exprs_str = \"\"\n for k, v in self.exprs.items():\n exprs_str += f\"{prefix} {k}: {v}\\n\"\n return (\n f\"{prefix}JoinNode:\\n\"\n + f\"{prefix} Fields:\\n\"\n + exprs_str\n + f\"{prefix} How: {self.how}\\n\"\n + f\"{prefix} Condition: {self.condition}\\n\"\n + self._prints_input(prefix + \" \")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode_UnionNode.require_executed_base.return.not_self_can_execute_hdk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode_UnionNode.require_executed_base.return.not_self_can_execute_hdk_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 883, "end_line": 913, "span_ids": ["UnionNode.require_executed_base", "UnionNode", "UnionNode.__init__"], "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 UnionNode(DFAlgNode):\n \"\"\"\n A node to represent rows union of input frames.\n\n Parameters\n ----------\n frames : list of HdkOnNativeDataframe\n Input frames.\n columns : dict\n Column names and dtypes.\n ignore_index : bool\n\n Attributes\n ----------\n input : list of HdkOnNativeDataframe\n Input frames.\n \"\"\"\n\n def __init__(\n self,\n frames: List[\"HdkOnNativeDataframe\"],\n columns: Dict[str, np.dtype],\n ignore_index: bool,\n ):\n self.input = frames\n self.columns = columns\n self.ignore_index = ignore_index\n\n @_inherit_docstrings(DFAlgNode.require_executed_base)\n def require_executed_base(self) -> bool:\n return not self.can_execute_hdk()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.can_execute_hdk_UnionNode.can_execute_arrow.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.can_execute_hdk_UnionNode.can_execute_arrow.return.True", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 915, "end_line": 937, "span_ids": ["UnionNode.can_execute_arrow", "UnionNode.can_execute_hdk"], "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 UnionNode(DFAlgNode):\n\n @_inherit_docstrings(DFAlgNode.can_execute_hdk)\n def can_execute_hdk(self) -> bool:\n # Hdk does not support union of more than 2 frames.\n if len(self.input) > 2:\n return False\n\n # Arrow execution is required for empty frames to preserve the index.\n if len(self.input) == 0 or len(self.columns) == 0:\n return False\n\n # Only numeric columns of the same type are supported by HDK.\n # See https://github.com/intel-ai/hdk/issues/182\n dtypes = self.input[0]._dtypes.to_dict()\n if any(is_string_dtype(t) for t in dtypes.values()) or any(\n f._dtypes.to_dict() != dtypes for f in self.input[1:]\n ):\n return False\n\n return True\n\n @_inherit_docstrings(DFAlgNode.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.execute_arrow_UnionNode.execute_arrow.try_.except_pa_lib_ArrowInvali.return.pa_concat_tables_tables_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.execute_arrow_UnionNode.execute_arrow.try_.except_pa_lib_ArrowInvali.return.pa_concat_tables_tables_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 939, "end_line": 991, "span_ids": ["UnionNode.execute_arrow"], "tokens": 453}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnionNode(DFAlgNode):\n\n def execute_arrow(self, tables: Union[pa.Table, List[pa.Table]]) -> pa.Table:\n \"\"\"\n Concat frames' rows using Arrow API.\n\n Parameters\n ----------\n tables : pa.Table or list of pa.Table\n\n Returns\n -------\n pyarrow.Table\n The resulting table.\n \"\"\"\n if len(self.columns) == 0:\n frames = self.input\n if len(frames) == 0:\n return EMPTY_ARROW_TABLE\n elif self.ignore_index:\n idx = pandas.RangeIndex(0, sum(len(frame.index) for frame in frames))\n else:\n idx = frames[0].index.append([f.index for f in frames[1:]])\n idx_cols = ColNameCodec.mangle_index_names(idx.names)\n idx_df = pandas.DataFrame(index=idx).reset_index()\n obj_cols = idx_df.select_dtypes(include=[\"object\"]).columns.tolist()\n if len(obj_cols) != 0:\n # PyArrow fails to convert object fields. Converting to str.\n idx_df[obj_cols] = idx_df[obj_cols].astype(str)\n idx_table = pa.Table.from_pandas(idx_df, preserve_index=False)\n return idx_table.rename_columns(idx_cols)\n\n if isinstance(tables, pa.Table):\n assert len(self.input) == 1\n return tables\n\n try:\n return pa.concat_tables(tables)\n except pa.lib.ArrowInvalid:\n # Probably, some tables have different column types.\n # Trying to find a common type and cast the columns.\n fields: typing.OrderedDict[str, pa.Field] = OrderedDict()\n for table in tables:\n for col_name in table.column_names:\n field = table.field(col_name)\n cur_field = fields.get(col_name, None)\n if cur_field is None or (\n cur_field.type\n != get_common_arrow_type(cur_field.type, field.type)\n ):\n fields[col_name] = field\n schema = pa.schema(list(fields.values()))\n for i, table in enumerate(tables):\n tables[i] = pa.table(table.columns, schema=schema)\n return pa.concat_tables(tables)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.copy_UnionNode._prints.return.f_prefix_UnionNode_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_UnionNode.copy_UnionNode._prints.return.f_prefix_UnionNode_n_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 993, "end_line": 1016, "span_ids": ["UnionNode._prints", "UnionNode.copy"], "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 UnionNode(DFAlgNode):\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n UnionNode\n \"\"\"\n return UnionNode(self.input, self.columns, self.ignore_index)\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return f\"{prefix}UnionNode:\\n\" + self._prints_input(prefix + \" \")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_SortNode_SortNode.copy.return.SortNode_self_input_0_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_SortNode_SortNode.copy.return.SortNode_self_input_0_s", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1019, "end_line": 1062, "span_ids": ["SortNode.__init__", "SortNode.copy", "SortNode"], "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 SortNode(DFAlgNode):\n \"\"\"\n A sort node to order frame's rows in a specified order.\n\n Parameters\n ----------\n frame : DFAlgNode\n Sorted frame.\n columns : list of str\n A list of key columns for a sort.\n ascending : list of bool\n Ascending or descending sort.\n na_position : {\"first\", \"last\"}\n \"first\" to put NULLs at the start of the result,\n \"last\" to put NULLs at the end of the result.\n\n Attributes\n ----------\n input : list of DFAlgNode\n Holds a single sorted frame.\n columns : list of str\n A list of key columns for a sort.\n ascending : list of bool\n Ascending or descending sort.\n na_position : {\"first\", \"last\"}\n \"first\" to put NULLs at the start of the result,\n \"last\" to put NULLs at the end of the result.\n \"\"\"\n\n def __init__(self, frame, columns, ascending, na_position):\n self.input = [frame]\n self.columns = columns\n self.ascending = ascending\n self.na_position = na_position\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n SortNode\n \"\"\"\n return SortNode(self.input[0], self.columns, self.ascending, self.na_position)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_SortNode._prints_SortNode._prints.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_SortNode._prints_SortNode._prints.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1064, "end_line": 1083, "span_ids": ["SortNode._prints"], "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 SortNode(DFAlgNode):\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return (\n f\"{prefix}SortNode:\\n\"\n + f\"{prefix} Columns: {self.columns}\\n\"\n + f\"{prefix} Ascending: {self.ascending}\\n\"\n + f\"{prefix} NULLs position: {self.na_position}\\n\"\n + self._prints_input(prefix + \" \")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FilterNode_FilterNode._prints.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FilterNode_FilterNode._prints.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1086, "end_line": 1138, "span_ids": ["FilterNode.copy", "FilterNode", "FilterNode._prints", "FilterNode.__init__"], "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 FilterNode(DFAlgNode):\n \"\"\"\n A node for generic rows filtering.\n\n For rows filter by row id a ``MaskNode`` should be preferred.\n\n Parameters\n ----------\n frame : DFAlgNode\n A filtered frame.\n condition : BaseExpr\n Filter condition.\n\n Attributes\n ----------\n input : list of DFAlgNode\n Holds a single filtered frame.\n condition : BaseExpr\n Filter condition.\n \"\"\"\n\n def __init__(self, frame, condition):\n self.input = [frame]\n self.condition = condition\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the node.\n\n Returns\n -------\n FilterNode\n \"\"\"\n return FilterNode(self.input[0], self.condition)\n\n def _prints(self, prefix):\n \"\"\"\n Return a string representation of the tree.\n\n Parameters\n ----------\n prefix : str\n A prefix to add at each string of the dump.\n\n Returns\n -------\n str\n \"\"\"\n return (\n f\"{prefix}FilterNode:\\n\"\n + f\"{prefix} Condition: {self.condition}\\n\"\n + self._prints_input(prefix + \" \")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_translate_exprs_to_base_translate_exprs_to_base.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_translate_exprs_to_base_translate_exprs_to_base.return.res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1141, "end_line": 1188, "span_ids": ["translate_exprs_to_base"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate_exprs_to_base(exprs, base):\n \"\"\"\n Fold expressions.\n\n Fold expressions with their input nodes until `base`\n frame is the only input frame.\n\n Parameters\n ----------\n exprs : dict\n Expressions to translate.\n base : HdkOnNativeDataframe\n Required input frame for translated expressions.\n\n Returns\n -------\n dict\n Translated expressions.\n \"\"\"\n new_exprs = dict(exprs)\n\n frames = set()\n for expr in new_exprs.values():\n expr.collect_frames(frames)\n frames.discard(base)\n\n while len(frames) > 0:\n mapper = InputMapper()\n new_frames = set()\n for frame in frames:\n frame_base = frame._op.input[0]\n if frame_base != base:\n new_frames.add(frame_base)\n assert isinstance(frame._op, TransformNode)\n mapper.add_mapper(frame, TransformMapper(frame._op))\n\n for k, v in new_exprs.items():\n new_expr = v.translate_input(mapper)\n new_expr.collect_frames(new_frames)\n new_exprs[k] = new_expr\n\n new_frames.discard(base)\n frames = new_frames\n\n res = OrderedDict()\n for col in exprs.keys():\n res[col] = new_exprs[col]\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_replace_frame_in_exprs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_replace_frame_in_exprs_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1191, "end_line": 1216, "span_ids": ["replace_frame_in_exprs"], "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 replace_frame_in_exprs(exprs, old_frame, new_frame):\n \"\"\"\n Translate input expression replacing an input frame in them.\n\n Parameters\n ----------\n exprs : dict\n Expressions to translate.\n old_frame : HdkOnNativeDataframe\n An input frame to replace.\n new_frame : HdkOnNativeDataframe\n A new input frame to use.\n\n Returns\n -------\n dict\n Translated expressions.\n \"\"\"\n mapper = InputMapper()\n mapper.add_mapper(old_frame, FrameMapper(new_frame))\n\n res = OrderedDict()\n for col in exprs.keys():\n res[col] = exprs[col].translate_input(mapper)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_abc_ColNameCodec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_abc_ColNameCodec", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 37, "span_ids": ["docstring"], "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": "import abc\nfrom typing import Union, Generator, Type\n\nimport numpy as np\nimport pyarrow as pa\nimport pyarrow.compute as pc\n\nimport pandas\nfrom pandas.core.dtypes.common import (\n is_list_like,\n get_dtype,\n is_float_dtype,\n is_integer_dtype,\n is_numeric_dtype,\n is_string_dtype,\n is_categorical_dtype,\n is_datetime64_any_dtype,\n is_bool_dtype,\n)\n\nfrom modin.utils import _inherit_docstrings\nfrom .dataframe.utils import ColNameCodec, to_arrow_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__get_common_dtype__get_common_dtype.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__get_common_dtype__get_common_dtype.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 70, "span_ids": ["_get_common_dtype"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_common_dtype(lhs_dtype, rhs_dtype):\n \"\"\"\n Get data type for a binary operation result.\n\n Parameters\n ----------\n lhs_dtype : dtype\n The type of the first operand.\n rhs_dtype : dtype\n The type of the second operand.\n\n Returns\n -------\n dtype\n The result data type.\n \"\"\"\n if lhs_dtype == rhs_dtype:\n return lhs_dtype\n if is_float_dtype(lhs_dtype) and (\n is_float_dtype(rhs_dtype) or is_integer_dtype(rhs_dtype)\n ):\n return get_dtype(float)\n if is_float_dtype(rhs_dtype) and (\n is_float_dtype(lhs_dtype) or is_integer_dtype(lhs_dtype)\n ):\n return get_dtype(float)\n if is_integer_dtype(lhs_dtype) and is_integer_dtype(rhs_dtype):\n return get_dtype(int)\n raise NotImplementedError(\n f\"Cannot perform operation on types: {lhs_dtype}, {rhs_dtype}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__aggs_preserving_numeric_type__agg_dtype.if_agg_in__aggs_preservin.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__aggs_preserving_numeric_type__agg_dtype.if_agg_in__aggs_preservin.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 101, "span_ids": ["_agg_dtype", "impl"], "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": "_aggs_preserving_numeric_type = {\"sum\", \"min\", \"max\"}\n_aggs_with_int_result = {\"count\", \"size\"}\n_aggs_with_float_result = {\"mean\", \"std\", \"skew\"}\n\n\ndef _agg_dtype(agg, dtype):\n \"\"\"\n Compute aggregate data type.\n\n Parameters\n ----------\n agg : str\n Aggregate name.\n dtype : dtype\n Operand data type.\n\n Returns\n -------\n dtype\n The aggregate data type.\n \"\"\"\n if agg in _aggs_preserving_numeric_type:\n return dtype\n elif agg in _aggs_with_int_result:\n return get_dtype(int)\n elif agg in _aggs_with_float_result:\n return get_dtype(float)\n else:\n raise NotImplementedError(f\"unsupported aggregate {agg}\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__cmp_ops_is_logical_op.return.op_in__logical_ops": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py__cmp_ops_is_logical_op.return.op_in__logical_ops", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 141, "span_ids": ["impl:9", "is_logical_op", "impl:7", "is_cmp_op"], "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": "_cmp_ops = {\"eq\", \"ge\", \"gt\", \"le\", \"lt\", \"ne\"}\n\n\ndef is_cmp_op(op):\n \"\"\"\n Check if operation is a comparison.\n\n Parameters\n ----------\n op : str\n Operation to check.\n\n Returns\n -------\n bool\n True for comparison operations and False otherwise.\n \"\"\"\n return op in _cmp_ops\n\n\n_logical_ops = {\"and\", \"or\"}\n\n\ndef is_logical_op(op):\n \"\"\"\n Check if operation is a logical one.\n\n Parameters\n ----------\n op : str\n Operation to check.\n\n Returns\n -------\n bool\n True for logical operations and False otherwise.\n \"\"\"\n return op in _logical_ops", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr_BaseExpr.cmp.return.OpExpr_op_self_other_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr_BaseExpr.cmp.return.OpExpr_op_self_other_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 247, "span_ids": ["BaseExpr.eq", "BaseExpr", "BaseExpr.le", "BaseExpr.cmp", "BaseExpr.ge"], "tokens": 546}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseExpr(abc.ABC):\n \"\"\"\n An abstract base class for expression tree node.\n\n An expression tree is used to describe how a single column of a dataframe\n is computed.\n\n Each node can belong to multiple trees and therefore should be immutable\n until proven to have no parent nodes (e.g. by making a copy).\n\n Attributes\n ----------\n operands : list of BaseExpr, optional\n Holds child nodes. Leaf nodes shouldn't have `operands` attribute.\n \"\"\"\n\n binary_operations = {\n \"add\": \"+\",\n \"sub\": \"-\",\n \"mul\": \"*\",\n \"mod\": \"MOD\",\n \"floordiv\": \"//\",\n \"truediv\": \"/\",\n \"pow\": \"POWER\",\n \"eq\": \"=\",\n \"ge\": \">=\",\n \"gt\": \">\",\n \"le\": \"<=\",\n \"lt\": \"<\",\n \"ne\": \"<>\",\n \"and\": \"AND\",\n \"or\": \"OR\",\n }\n\n preserve_dtype_math_ops = {\"add\", \"sub\", \"mul\", \"mod\", \"floordiv\", \"pow\"}\n promote_to_float_math_ops = {\"truediv\"}\n\n def eq(self, other):\n \"\"\"\n Build an equality comparison of `self` with `other`.\n\n Parameters\n ----------\n other : BaseExpr or scalar\n An operand to compare with.\n\n Returns\n -------\n BaseExpr\n The resulting comparison expression.\n \"\"\"\n return self.cmp(\"=\", other)\n\n def le(self, other):\n \"\"\"\n Build a less or equal comparison with `other`.\n\n Parameters\n ----------\n other : BaseExpr or scalar\n An operand to compare with.\n\n Returns\n -------\n BaseExpr\n The resulting comparison expression.\n \"\"\"\n return self.cmp(\"<=\", other)\n\n def ge(self, other):\n \"\"\"\n Build a greater or equal comparison with `other`.\n\n Parameters\n ----------\n other : BaseExpr or scalar\n An operand to compare with.\n\n Returns\n -------\n BaseExpr\n The resulting comparison expression.\n \"\"\"\n return self.cmp(\">=\", other)\n\n def cmp(self, op, other):\n \"\"\"\n Build a comparison expression with `other`.\n\n Parameters\n ----------\n op : str\n A comparison operation.\n other : BaseExpr or scalar\n An operand to compare with.\n\n Returns\n -------\n BaseExpr\n The resulting comparison expression.\n \"\"\"\n if not isinstance(other, BaseExpr):\n other = LiteralExpr(other)\n return OpExpr(op, [self, other], get_dtype(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.cast_BaseExpr.cast.return.new_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.cast_BaseExpr.cast.return.new_expr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 249, "end_line": 269, "span_ids": ["BaseExpr.cast"], "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 BaseExpr(abc.ABC):\n\n def cast(self, res_type):\n \"\"\"\n Build a cast expression.\n\n Parameters\n ----------\n res_type : dtype\n A data type to cast to.\n\n Returns\n -------\n BaseExpr\n The cast expression.\n \"\"\"\n # From float to int cast we expect truncate behavior but CAST\n # operation would give us round behavior.\n if is_float_dtype(self._dtype) and is_integer_dtype(res_type):\n return self.floor()\n\n new_expr = OpExpr(\"CAST\", [self], res_type)\n return new_expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.is_null_BaseExpr.is_not_null.return.new_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.is_null_BaseExpr.is_not_null.return.new_expr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 293, "span_ids": ["BaseExpr.is_null", "BaseExpr.is_not_null"], "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 BaseExpr(abc.ABC):\n\n def is_null(self):\n \"\"\"\n Build a NULL check expression.\n\n Returns\n -------\n BaseExpr\n The NULL check expression.\n \"\"\"\n new_expr = OpExpr(\"IS NULL\", [self], get_dtype(bool))\n return new_expr\n\n def is_not_null(self):\n \"\"\"\n Build a NOT NULL check expression.\n\n Returns\n -------\n BaseExpr\n The NOT NULL check expression.\n \"\"\"\n new_expr = OpExpr(\"IS NOT NULL\", [self], get_dtype(bool))\n return new_expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.bin_op_BaseExpr.bin_op.return.new_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.bin_op_BaseExpr.bin_op.return.new_expr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 295, "end_line": 326, "span_ids": ["BaseExpr.bin_op"], "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 BaseExpr(abc.ABC):\n\n def bin_op(self, other, op_name):\n \"\"\"\n Build a binary operation expression.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n op_name : str\n A binary operation name.\n\n Returns\n -------\n BaseExpr\n The resulting binary operation expression.\n \"\"\"\n if op_name not in self.binary_operations:\n raise NotImplementedError(f\"unsupported binary operation {op_name}\")\n\n if is_cmp_op(op_name):\n return self._cmp_op(other, op_name)\n\n # True division may require prior cast to float to avoid integer division\n if op_name == \"truediv\":\n if is_integer_dtype(self._dtype) and is_integer_dtype(other._dtype):\n other = other.cast(get_dtype(float))\n res_type = self._get_bin_op_res_type(op_name, self._dtype, other._dtype)\n new_expr = OpExpr(self.binary_operations[op_name], [self, other], res_type)\n # Floor division may require additional FLOOR expr.\n if op_name == \"floordiv\" and not is_integer_dtype(res_type):\n return new_expr.floor()\n return new_expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.add_BaseExpr.invert.return.OpExpr_self_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.add_BaseExpr.invert.return.OpExpr_self_self_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 464, "span_ids": ["BaseExpr.sub", "BaseExpr.floordiv", "BaseExpr.mod", "BaseExpr.mul", "BaseExpr.floor", "BaseExpr.add", "BaseExpr.invert", "BaseExpr.truediv", "BaseExpr.pow"], "tokens": 544}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseExpr(abc.ABC):\n\n def add(self, other):\n \"\"\"\n Build an add expression.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n\n Returns\n -------\n BaseExpr\n The resulting add expression.\n \"\"\"\n return self.bin_op(other, \"add\")\n\n def sub(self, other):\n \"\"\"\n Build a sub expression.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n\n Returns\n -------\n BaseExpr\n The resulting sub expression.\n \"\"\"\n return self.bin_op(other, \"sub\")\n\n def mul(self, other):\n \"\"\"\n Build a mul expression.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n\n Returns\n -------\n BaseExpr\n The resulting mul expression.\n \"\"\"\n return self.bin_op(other, \"mul\")\n\n def mod(self, other):\n \"\"\"\n Build a mod expression.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n\n Returns\n -------\n BaseExpr\n The resulting mod expression.\n \"\"\"\n return self.bin_op(other, \"mod\")\n\n def truediv(self, other):\n \"\"\"\n Build a truediv expression.\n\n The result always has float data type.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n\n Returns\n -------\n BaseExpr\n The resulting truediv expression.\n \"\"\"\n return self.bin_op(other, \"truediv\")\n\n def floordiv(self, other):\n \"\"\"\n Build a floordiv expression.\n\n The result always has an integer data type.\n\n Parameters\n ----------\n other : BaseExpr\n The second operand.\n\n Returns\n -------\n BaseExpr\n The resulting floordiv expression.\n \"\"\"\n return self.bin_op(other, \"floordiv\")\n\n def pow(self, other):\n \"\"\"\n Build a power expression.\n\n Parameters\n ----------\n other : BaseExpr\n The power operand.\n\n Returns\n -------\n BaseExpr\n The resulting power expression.\n \"\"\"\n return self.bin_op(other, \"pow\")\n\n def floor(self):\n \"\"\"\n Build a floor expression.\n\n Returns\n -------\n BaseExpr\n The resulting floor expression.\n \"\"\"\n return OpExpr(\"FLOOR\", [self], get_dtype(int))\n\n def invert(self) -> \"OpExpr\":\n \"\"\"\n Build a bitwise inverse expression.\n\n Returns\n -------\n OpExpr\n The resulting bitwise inverse expression.\n \"\"\"\n return OpExpr(\"~\", [self], self._dtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._cmp_op_BaseExpr._cmp_op.if_lhs_dtype_class_rhs.else_.return.build_if_then_else_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._cmp_op_BaseExpr._cmp_op.if_lhs_dtype_class_rhs.else_.return.build_if_then_else_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 501, "span_ids": ["BaseExpr._cmp_op"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseExpr(abc.ABC):\n\n def _cmp_op(self, other, op_name):\n \"\"\"\n Build a comparison expression.\n\n Parameters\n ----------\n other : BaseExpr\n A value to compare with.\n op_name : str\n The comparison operation name.\n\n Returns\n -------\n BaseExpr\n The resulting comparison expression.\n \"\"\"\n lhs_dtype_class = self._get_dtype_cmp_class(self._dtype)\n rhs_dtype_class = self._get_dtype_cmp_class(other._dtype)\n res_dtype = get_dtype(bool)\n # In HDK comparison with NULL always results in NULL,\n # but in pandas it is True for 'ne' comparison and False\n # for others.\n # Also pandas allows 'eq' and 'ne' comparison for values\n # of incompatible types which doesn't work in HDK.\n if lhs_dtype_class != rhs_dtype_class:\n if op_name == \"eq\" or op_name == \"ne\":\n return LiteralExpr(op_name == \"ne\")\n else:\n raise TypeError(\n f\"Invalid comparison between {self._dtype} and {other._dtype}\"\n )\n else:\n cmp = OpExpr(self.binary_operations[op_name], [self, other], res_dtype)\n return build_if_then_else(\n self.is_null(), LiteralExpr(op_name == \"ne\"), cmp, res_dtype\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._get_dtype_cmp_class_BaseExpr._get_dtype_cmp_class.return._other_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._get_dtype_cmp_class_BaseExpr._get_dtype_cmp_class.return._other_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 526, "span_ids": ["BaseExpr._get_dtype_cmp_class"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseExpr(abc.ABC):\n\n @staticmethod\n def _get_dtype_cmp_class(dtype):\n \"\"\"\n Get a comparison class name for specified data type.\n\n Values of different comparison classes cannot be compared.\n\n Parameters\n ----------\n dtype : dtype\n A data type of a compared value.\n\n Returns\n -------\n str\n The comparison class name.\n \"\"\"\n if is_numeric_dtype(dtype) or is_bool_dtype(dtype):\n return \"numeric\"\n if is_string_dtype(dtype) or is_categorical_dtype(dtype):\n return \"string\"\n if is_datetime64_any_dtype(dtype):\n return \"datetime\"\n return \"other\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._get_bin_op_res_type_BaseExpr._get_bin_op_res_type.if_op_name_in_self_preser.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._get_bin_op_res_type_BaseExpr._get_bin_op_res_type.if_op_name_in_self_preser.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 528, "end_line": 554, "span_ids": ["BaseExpr._get_bin_op_res_type"], "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 BaseExpr(abc.ABC):\n\n def _get_bin_op_res_type(self, op_name, lhs_dtype, rhs_dtype):\n \"\"\"\n Return the result data type for a binary operation.\n\n Parameters\n ----------\n op_name : str\n A binary operation name.\n lhs_dtype : dtype\n A left operand's type.\n rhs_dtype : dtype\n A right operand's type.\n\n Returns\n -------\n dtype\n \"\"\"\n if op_name in self.preserve_dtype_math_ops:\n return _get_common_dtype(lhs_dtype, rhs_dtype)\n elif op_name in self.promote_to_float_math_ops:\n return get_dtype(float)\n elif is_cmp_op(op_name):\n return get_dtype(bool)\n elif is_logical_op(op_name):\n return get_dtype(bool)\n else:\n raise NotImplementedError(f\"unsupported binary operation {op_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.copy_BaseExpr.nested_expressions.return.expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.copy_BaseExpr.nested_expressions.return.expr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 556, "end_line": 590, "span_ids": ["BaseExpr.copy", "BaseExpr.nested_expressions"], "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 BaseExpr(abc.ABC):\n\n @abc.abstractmethod\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n BaseExpr\n \"\"\"\n pass\n\n def nested_expressions(\n self,\n ) -> Generator[Type[\"BaseExpr\"], Type[\"BaseExpr\"], Type[\"BaseExpr\"]]:\n \"\"\"\n Return a generator that allows to iterate over and replace the nested expressions.\n\n If the generator receives a new expression, it creates a copy of `self` and\n replaces the expression in the copy. The copy is returned to the sender.\n\n Returns\n -------\n Generator\n \"\"\"\n expr = self\n if operands := getattr(self, \"operands\", None):\n for i, op in enumerate(operands):\n new_op = yield op\n if new_op is not None:\n if new_op is not op:\n if expr is self:\n expr = self.copy()\n expr.operands[i] = new_op\n yield expr\n return expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.collect_frames_BaseExpr._currently_we_translate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.collect_frames_BaseExpr._currently_we_translate_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 592, "end_line": 608, "span_ids": ["BaseExpr.collect_frames"], "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 BaseExpr(abc.ABC):\n\n def collect_frames(self, frames):\n \"\"\"\n Recursively collect all frames participating in the expression.\n\n Collected frames are put into the `frames` set. Default implementation\n collects frames from the operands of the expression. Derived classes\n directly holding frames should provide their own implementations.\n\n Parameters\n ----------\n frames : set\n Output set of collected frames.\n \"\"\"\n for expr in self.nested_expressions():\n expr.collect_frames(frames)\n\n # currently we translate only exprs with a single input frame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.translate_input_BaseExpr.translate_input.return.self__translate_input_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr.translate_input_BaseExpr.translate_input.return.self__translate_input_map", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 609, "end_line": 631, "span_ids": ["BaseExpr.translate_input"], "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 BaseExpr(abc.ABC):\n def translate_input(self, mapper):\n \"\"\"\n Make a deep copy of the expression translating input nodes using `mapper`.\n\n The default implementation builds a copy and recursively run\n translation for all its operands. For leaf expressions\n `_translate_input` is called.\n\n Parameters\n ----------\n mapper : InputMapper\n A mapper to use for input columns translation.\n\n Returns\n -------\n BaseExpr\n The expression copy with translated input columns.\n \"\"\"\n res = None\n gen = self.nested_expressions()\n for expr in gen:\n res = gen.send(expr.translate_input(mapper))\n return self._translate_input(mapper) if res is None else 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._translate_input_BaseExpr.execute_arrow.raise_RuntimeError_f_Arro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_BaseExpr._translate_input_BaseExpr.execute_arrow.raise_RuntimeError_f_Arro", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 633, "end_line": 705, "span_ids": ["BaseExpr.can_execute_hdk", "BaseExpr.fold", "BaseExpr.can_execute_arrow", "BaseExpr.execute_arrow", "BaseExpr._translate_input"], "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 BaseExpr(abc.ABC):\n\n def _translate_input(self, mapper):\n \"\"\"\n Make a deep copy of the expression translating input nodes using `mapper`.\n\n Called by default translator for leaf nodes. Method should be overriden\n by derived classes holding input references.\n\n Parameters\n ----------\n mapper : InputMapper\n A mapper to use for input columns translation.\n\n Returns\n -------\n BaseExpr\n The expression copy with translated input columns.\n \"\"\"\n return self\n\n def fold(self):\n \"\"\"\n Fold the operands.\n\n This operation is used by `TransformNode` when translating to base.\n\n Returns\n -------\n BaseExpr\n \"\"\"\n res = self\n gen = self.nested_expressions()\n for expr in gen:\n res = gen.send(expr.fold())\n return res\n\n def can_execute_hdk(self) -> bool:\n \"\"\"\n Check for possibility of HDK execution.\n\n Check if the computation can be executed using an HDK query.\n\n Returns\n -------\n bool\n \"\"\"\n return True\n\n def can_execute_arrow(self) -> bool:\n \"\"\"\n Check for possibility of Arrow execution.\n\n Check if the computation can be executed using\n the Arrow API instead of HDK query.\n\n Returns\n -------\n bool\n \"\"\"\n return False\n\n def execute_arrow(self, table: pa.Table) -> pa.ChunkedArray:\n \"\"\"\n Compute the column data using the Arrow API.\n\n Parameters\n ----------\n table : pa.Table\n\n Returns\n -------\n pa.ChunkedArray\n \"\"\"\n raise RuntimeError(f\"Arrow execution is not supported by {type(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_InputRefExpr_InputRefExpr.__repr__.return.f_self_modin_frame_id_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_InputRefExpr_InputRefExpr.__repr__.return.f_self_modin_frame_id_st", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 795, "span_ids": ["InputRefExpr.__repr__", "InputRefExpr._translate_input", "InputRefExpr", "InputRefExpr.collect_frames", "InputRefExpr.copy", "InputRefExpr.fold", "InputRefExpr.execute_arrow", "InputRefExpr.__init__", "InputRefExpr.can_execute_arrow"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class InputRefExpr(BaseExpr):\n \"\"\"\n An expression tree node to represent an input frame column.\n\n Parameters\n ----------\n frame : HdkOnNativeDataframe\n An input frame.\n col : str\n An input column name.\n dtype : dtype\n Input column data type.\n\n Attributes\n ----------\n modin_frame : HdkOnNativeDataframe\n An input frame.\n column : str\n An input column name.\n _dtype : dtype\n Input column data type.\n \"\"\"\n\n def __init__(self, frame, col, dtype):\n self.modin_frame = frame\n self.column = col\n self._dtype = dtype\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n InputRefExpr\n \"\"\"\n return InputRefExpr(self.modin_frame, self.column, self._dtype)\n\n def collect_frames(self, frames):\n \"\"\"\n Add referenced frame to the `frames` set.\n\n Parameters\n ----------\n frames : set\n Output set of collected frames.\n \"\"\"\n frames.add(self.modin_frame)\n\n def _translate_input(self, mapper):\n \"\"\"\n Translate the referenced column using `mapper`.\n\n Parameters\n ----------\n mapper : InputMapper\n A mapper to use for input column translation.\n\n Returns\n -------\n BaseExpr\n The translated expression.\n \"\"\"\n return mapper.translate(self)\n\n @_inherit_docstrings(BaseExpr.fold)\n def fold(self):\n return self\n\n @_inherit_docstrings(BaseExpr.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\n return True\n\n @_inherit_docstrings(BaseExpr.execute_arrow)\n def execute_arrow(self, table: pa.Table) -> pa.ChunkedArray:\n if self.column == ColNameCodec.ROWID_COL_NAME:\n return pa.chunked_array([range(len(table))], pa.int64())\n return table.column(ColNameCodec.encode(self.column))\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the expression.\n\n Returns\n -------\n str\n \"\"\"\n return f\"{self.modin_frame.id_str()}.{self.column}[{self._dtype}]\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_LiteralExpr_LiteralExpr.__eq__.return.isinstance_obj_LiteralEx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_LiteralExpr_LiteralExpr.__eq__.return.isinstance_obj_LiteralEx", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 798, "end_line": 901, "span_ids": ["LiteralExpr.cast", "LiteralExpr.__init__", "LiteralExpr.is_null", "LiteralExpr.is_not_null", "LiteralExpr.can_execute_arrow", "LiteralExpr.copy", "LiteralExpr", "LiteralExpr.__repr__", "LiteralExpr.__eq__", "LiteralExpr.execute_arrow", "LiteralExpr.fold"], "tokens": 569}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LiteralExpr(BaseExpr):\n \"\"\"\n An expression tree node to represent a literal value.\n\n Parameters\n ----------\n val : int, np.int, float, bool, str or None\n Literal value.\n dtype : None or dtype, default: None\n Value dtype.\n\n Attributes\n ----------\n val : int, np.int, float, bool, str or None\n Literal value.\n _dtype : dtype\n Literal data type.\n \"\"\"\n\n def __init__(self, val, dtype=None):\n if dtype is None:\n if val is not None and not isinstance(\n val,\n (\n int,\n float,\n bool,\n str,\n np.int8,\n np.int16,\n np.int32,\n np.int64,\n np.uint8,\n np.uint16,\n np.uint32,\n np.uint64,\n ),\n ):\n raise NotImplementedError(f\"Literal value {val} of type {type(val)}\")\n if val is None:\n dtype = get_dtype(float)\n else:\n dtype = get_dtype(type(val))\n self.val = val\n self._dtype = dtype\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n LiteralExpr\n \"\"\"\n return LiteralExpr(self.val)\n\n @_inherit_docstrings(BaseExpr.fold)\n def fold(self):\n return self\n\n @_inherit_docstrings(BaseExpr.cast)\n def cast(self, res_type):\n dtype = np.dtype(res_type)\n return LiteralExpr(dtype.type(self.val), dtype)\n\n @_inherit_docstrings(BaseExpr.is_null)\n def is_null(self):\n return LiteralExpr(pandas.isnull(self.val), np.dtype(bool))\n\n @_inherit_docstrings(BaseExpr.is_null)\n def is_not_null(self):\n return LiteralExpr(not pandas.isnull(self.val), np.dtype(bool))\n\n @_inherit_docstrings(BaseExpr.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\n return True\n\n @_inherit_docstrings(BaseExpr.execute_arrow)\n def execute_arrow(self, table: pa.Table) -> pa.ChunkedArray:\n return pa.chunked_array([[self.val] * len(table)], to_arrow_type(self._dtype))\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the expression.\n\n Returns\n -------\n str\n \"\"\"\n return f\"{self.val}[{self._dtype}]\"\n\n def __eq__(self, obj):\n \"\"\"\n Check if `obj` is a `LiteralExpr` with an equal value.\n\n Parameters\n ----------\n obj : Any object\n\n Returns\n -------\n bool\n \"\"\"\n return isinstance(obj, LiteralExpr) and self.val == obj.val", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr_OpExpr.__init__.self._dtype.dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr_OpExpr.__init__.self._dtype.dtype", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 904, "end_line": 972, "span_ids": ["OpExpr.__init__", "OpExpr"], "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 OpExpr(BaseExpr):\n \"\"\"\n A generic operation expression.\n\n Used for arithmetic, comparisons, conditional operations, etc.\n\n Parameters\n ----------\n op : str\n Operation name.\n operands : list of BaseExpr\n Operation operands.\n dtype : dtype\n Result data type.\n\n Attributes\n ----------\n op : str\n Operation name.\n operands : list of BaseExpr\n Operation operands.\n _dtype : dtype\n Result data type.\n partition_keys : list of BaseExpr, optional\n This attribute is used with window functions only and contains\n a list of column expressions to partition the result set.\n order_keys : list of dict, optional\n This attribute is used with window functions only and contains\n order clauses.\n lower_bound : dict, optional\n Lover bound for windowed aggregates.\n upper_bound : dict, optional\n Upper bound for windowed aggregates.\n \"\"\"\n\n _FOLD_OPS = {\n \"+\": lambda self: self._fold_arithm(\"__add__\"),\n \"-\": lambda self: self._fold_arithm(\"__sub__\"),\n \"*\": lambda self: self._fold_arithm(\"__mul__\"),\n \"POWER\": lambda self: self._fold_arithm(\"__pow__\"),\n \"/\": lambda self: self._fold_arithm(\"__truediv__\"),\n \"//\": lambda self: self._fold_arithm(\"__floordiv__\"),\n \"~\": lambda self: self._fold_invert(),\n \"CAST\": lambda self: self._fold_literal(\"cast\", self._dtype),\n \"IS NULL\": lambda self: self._fold_literal(\"is_null\"),\n \"IS NOT NULL\": lambda self: self._fold_literal(\"is_not_null\"),\n }\n\n _ARROW_EXEC = {\n \"+\": lambda self, table: self._pc(\"add\", table),\n \"-\": lambda self, table: self._pc(\"subtract\", table),\n \"*\": lambda self, table: self._pc(\"multiply\", table),\n \"POWER\": lambda self, table: self._pc(\"power\", table),\n \"/\": lambda self, table: self._pc(\"divide\", table),\n \"//\": lambda self, table: self._pc(\"divide\", table),\n \"~\": lambda self, table: self._invert(table),\n \"CAST\": lambda self, table: self._col(table).cast(to_arrow_type(self._dtype)),\n \"IS NULL\": lambda self, table: self._col(table).is_null(nan_is_null=True),\n \"IS NOT NULL\": lambda self, table: pc.invert(\n self._col(table).is_null(nan_is_null=True)\n ),\n }\n\n _UNSUPPORTED_HDK_OPS = {\"~\"}\n\n def __init__(self, op, operands, dtype):\n self.op = op\n self.operands = operands\n self._dtype = dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.set_window_opts_OpExpr.set_window_opts.self.upper_bound._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.set_window_opts_OpExpr.set_window_opts.self.upper_bound._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 974, "end_line": 1010, "span_ids": ["OpExpr.set_window_opts"], "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 OpExpr(BaseExpr):\n\n def set_window_opts(self, partition_keys, order_keys, order_ascending, na_pos):\n \"\"\"\n Set the window function options.\n\n Parameters\n ----------\n partition_keys : list of BaseExpr\n order_keys : list of BaseExpr\n order_ascending : list of bool\n na_pos : {\"FIRST\", \"LAST\"}\n \"\"\"\n self.is_rows = True\n self.partition_keys = partition_keys\n self.order_keys = []\n for key, asc in zip(order_keys, order_ascending):\n key = {\n \"field\": key,\n \"direction\": \"ASCENDING\" if asc else \"DESCENDING\",\n \"nulls\": na_pos,\n }\n self.order_keys.append(key)\n self.lower_bound = {\n \"unbounded\": True,\n \"preceding\": True,\n \"following\": False,\n \"is_current_row\": False,\n \"offset\": None,\n \"order_key\": 0,\n }\n self.upper_bound = {\n \"unbounded\": False,\n \"preceding\": False,\n \"following\": False,\n \"is_current_row\": True,\n \"offset\": None,\n \"order_key\": 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.copy_OpExpr.nested_expressions.return.expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.copy_OpExpr.nested_expressions.return.expr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1012, "end_line": 1052, "span_ids": ["OpExpr.copy", "OpExpr.nested_expressions"], "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 OpExpr(BaseExpr):\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n OpExpr\n \"\"\"\n op = OpExpr(self.op, self.operands.copy(), self._dtype)\n if pk := getattr(self, \"partition_keys\", None):\n op.partition_keys = pk\n op.is_rows = self.is_rows\n op.order_keys = self.order_keys\n op.lower_bound = self.lower_bound\n op.upper_bound = self.upper_bound\n return op\n\n @_inherit_docstrings(BaseExpr.nested_expressions)\n def nested_expressions(\n self,\n ) -> Generator[Type[\"BaseExpr\"], Type[\"BaseExpr\"], Type[\"BaseExpr\"]]:\n expr = yield from super().nested_expressions()\n if partition_keys := getattr(self, \"partition_keys\", None):\n for i, key in enumerate(partition_keys):\n new_key = yield key\n if new_key is not None:\n if new_key is not key:\n if expr is self:\n expr = self.copy()\n expr.partition_keys[i] = new_key\n yield expr\n for i, key in enumerate(self.order_keys):\n field = key[\"field\"]\n new_field = yield field\n if new_field is not None:\n if new_field is not field:\n if expr is self:\n expr = self.copy()\n expr.order_keys[i][\"field\"] = new_field\n yield expr\n return expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.fold_OpExpr._fold_arithm.return.operands_0_if_len_operan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr.fold_OpExpr._fold_arithm.return.operands_0_if_len_operan", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1054, "end_line": 1091, "span_ids": ["OpExpr.fold", "OpExpr._fold_arithm"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OpExpr(BaseExpr):\n\n @_inherit_docstrings(BaseExpr.fold)\n def fold(self):\n super().fold()\n return self if (op := self._FOLD_OPS.get(self.op, None)) is None else op(self)\n\n def _fold_arithm(self, op) -> Union[\"OpExpr\", LiteralExpr]:\n \"\"\"\n Fold arithmetic expressions.\n\n Parameters\n ----------\n op : str\n\n Returns\n -------\n OpExpr or LiteralExpr\n \"\"\"\n operands = self.operands\n i = 0\n while i < len(operands):\n if isinstance((o := operands[i]), OpExpr):\n if self.op == o.op:\n # Fold operands in case of the same operation\n operands[i : i + 1] = o.operands\n else:\n i += 1\n continue\n if i == 0:\n i += 1\n continue\n if isinstance(o, LiteralExpr) and isinstance(operands[i - 1], LiteralExpr):\n # Fold two sequential literal expressions\n val = getattr(operands[i - 1].val, op)(o.val)\n operands[i - 1] = LiteralExpr(val).cast(o._dtype)\n del operands[i]\n else:\n i += 1\n return operands[0] if len(operands) == 1 else 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._fold_invert_OpExpr._fold_invert.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._fold_invert_OpExpr._fold_invert.return.self", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1093, "end_line": 1110, "span_ids": ["OpExpr._fold_invert"], "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 OpExpr(BaseExpr):\n\n def _fold_invert(self) -> Union[\"OpExpr\", LiteralExpr]:\n \"\"\"\n Fold invert expression.\n\n Returns\n -------\n OpExpr or LiteralExpr\n \"\"\"\n assert len(self.operands) == 1\n op = self.operands[0]\n if isinstance(op, LiteralExpr):\n return LiteralExpr(~op.val, op._dtype)\n if isinstance(op, OpExpr):\n if op.op == \"IS NULL\":\n return OpExpr(\"IS NOT NULL\", op.operands, op._dtype)\n if op.op == \"IS NOT NULL\":\n return OpExpr(\"IS NULL\", op.operands, op._dtype)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._fold_literal_OpExpr._col.return.self_operands_0_execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._fold_literal_OpExpr._col.return.self_operands_0_execute_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1112, "end_line": 1167, "span_ids": ["OpExpr.execute_arrow", "OpExpr.can_execute_arrow", "OpExpr.__repr__", "OpExpr._fold_literal", "OpExpr._col", "OpExpr.can_execute_hdk"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OpExpr(BaseExpr):\n\n def _fold_literal(self, op, *args):\n \"\"\"\n Fold literal expressions.\n\n Parameters\n ----------\n op : str\n\n *args : list\n\n Returns\n -------\n OpExpr or LiteralExpr\n \"\"\"\n assert len(self.operands) == 1\n expr = self.operands[0]\n return getattr(expr, op)(*args) if isinstance(expr, LiteralExpr) else self\n\n @_inherit_docstrings(BaseExpr.can_execute_hdk)\n def can_execute_hdk(self) -> bool:\n return self.op not in self._UNSUPPORTED_HDK_OPS\n\n @_inherit_docstrings(BaseExpr.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\n return self.op in self._ARROW_EXEC\n\n @_inherit_docstrings(BaseExpr.execute_arrow)\n def execute_arrow(self, table: pa.Table) -> pa.ChunkedArray:\n return self._ARROW_EXEC[self.op](self, table)\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the expression.\n\n Returns\n -------\n str\n \"\"\"\n if pk := getattr(self, \"partition_keys\", None):\n return f\"({self.op} {self.operands} {pk} {self.order_keys} [{self._dtype}])\"\n return f\"({self.op} {self.operands} [{self._dtype}])\"\n\n def _col(self, table: pa.Table) -> pa.ChunkedArray:\n \"\"\"\n Return the column referenced by the `InputRefExpr` operand.\n\n Parameters\n ----------\n table : pa.Table\n\n Returns\n -------\n pa.ChunkedArray\n \"\"\"\n assert isinstance(self.operands[0], InputRefExpr)\n return self.operands[0].execute_arrow(table)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._pc_OpExpr._pc.return.val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._pc_OpExpr._pc.return.val", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1169, "end_line": 1190, "span_ids": ["OpExpr._pc"], "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 OpExpr(BaseExpr):\n\n def _pc(self, op: str, table: pa.Table) -> pa.ChunkedArray:\n \"\"\"\n Perform the specified pyarrow.compute operation on the operands.\n\n Parameters\n ----------\n op : str\n table : pyarrow.Table\n\n Returns\n -------\n pyarrow.ChunkedArray\n \"\"\"\n op = getattr(pc, op)\n val = self._op_value(0, table)\n for i in range(1, len(self.operands)):\n val = op(val, self._op_value(i, table))\n if not isinstance(val, pa.ChunkedArray):\n val = LiteralExpr(val).execute_arrow(table)\n if val.type != (at := to_arrow_type(self._dtype)):\n val = val.cast(at)\n return val", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._op_value_OpExpr._invert.try_.except_pa_ArrowNotImpleme.raise_TypeError_str_err_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_OpExpr._op_value_OpExpr._invert.try_.except_pa_ArrowNotImpleme.raise_TypeError_str_err_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1192, "end_line": 1226, "span_ids": ["OpExpr._invert", "OpExpr._op_value"], "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 OpExpr(BaseExpr):\n\n def _op_value(self, op_idx: int, table: pa.Table):\n \"\"\"\n Get the specified operand value.\n\n Parameters\n ----------\n op_idx : int\n table : pyarrow.Table\n\n Returns\n -------\n pyarrow.ChunkedArray or expr.val\n \"\"\"\n expr = self.operands[op_idx]\n return expr.val if isinstance(expr, LiteralExpr) else expr.execute_arrow(table)\n\n def _invert(self, table: pa.Table) -> pa.ChunkedArray:\n \"\"\"\n Bitwise inverse the column values.\n\n Parameters\n ----------\n table : pyarrow.Table\n\n Returns\n -------\n pyarrow.ChunkedArray\n \"\"\"\n if is_bool_dtype(self._dtype):\n return pc.invert(self._col(table))\n\n try:\n return pc.bit_wise_not(self._col(table))\n except pa.ArrowNotImplementedError as err:\n raise TypeError(str(err))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_AggregateExpr_AggregateExpr.__repr__.return.f_self_agg_self_operan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_AggregateExpr_AggregateExpr.__repr__.return.f_self_agg_self_operan", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1229, "end_line": 1289, "span_ids": ["AggregateExpr.copy", "AggregateExpr", "AggregateExpr.__init__", "AggregateExpr.__repr__"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AggregateExpr(BaseExpr):\n \"\"\"\n An aggregate operation expression.\n\n Parameters\n ----------\n agg : str\n Aggregate name.\n op : BaseExpr\n Aggregate operand.\n distinct : bool, default: False\n Distinct modifier for 'count' aggregate.\n dtype : dtype, optional\n Aggregate data type. Computed if not specified.\n\n Attributes\n ----------\n agg : str\n Aggregate name.\n operands : list of BaseExpr\n Aggregate operands. Always has a single operand.\n distinct : bool\n Distinct modifier for 'count' aggregate.\n _dtype : dtype\n Aggregate data type.\n \"\"\"\n\n def __init__(self, agg, op, distinct=False, dtype=None):\n if agg == \"nunique\":\n self.agg = \"count\"\n self.distinct = True\n else:\n self.agg = agg\n self.distinct = distinct\n self.operands = [op]\n self._dtype = (\n dtype if dtype else _agg_dtype(self.agg, op._dtype if op else None)\n )\n assert self._dtype is not None\n\n def copy(self):\n \"\"\"\n Make a shallow copy of the expression.\n\n Returns\n -------\n AggregateExpr\n \"\"\"\n return AggregateExpr(self.agg, self.operands[0], self.distinct, self._dtype)\n\n def __repr__(self):\n \"\"\"\n Return a string representation of the expression.\n\n Returns\n -------\n str\n \"\"\"\n if len(self.operands) == 1:\n return f\"{self.agg}({self.operands[0]})[{self._dtype}]\"\n return f\"{self.agg}({self.operands})[{self._dtype}]\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_build_row_idx_filter_expr_build_row_idx_filter_expr.return.OpExpr_OR_exprs_get_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_build_row_idx_filter_expr_build_row_idx_filter_expr.return.OpExpr_OR_exprs_get_d", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1292, "end_line": 1316, "span_ids": ["build_row_idx_filter_expr"], "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": "def build_row_idx_filter_expr(row_idx, row_col):\n \"\"\"\n Build an expression to filter rows by rowid.\n\n Parameters\n ----------\n row_idx : int or list of int\n The row numeric indices to select.\n row_col : InputRefExpr\n The rowid column reference expression.\n\n Returns\n -------\n BaseExpr\n The resulting filtering expression.\n \"\"\"\n if not is_list_like(row_idx):\n return row_col.eq(row_idx)\n\n if isinstance(row_idx, (pandas.RangeIndex, range)) and row_idx.step == 1:\n exprs = [row_col.ge(row_idx[0]), row_col.le(row_idx[-1])]\n return OpExpr(\"AND\", exprs, get_dtype(bool))\n\n exprs = [row_col.eq(idx) for idx in row_idx]\n return OpExpr(\"OR\", exprs, get_dtype(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_build_if_then_else_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py_build_if_then_else_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/expr.py", "file_name": "expr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1319, "end_line": 1363, "span_ids": ["build_if_then_else", "build_dt_expr"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_if_then_else(cond, then_val, else_val, res_type):\n \"\"\"\n Build a conditional operator expression.\n\n Parameters\n ----------\n cond : BaseExpr\n A condition to check.\n then_val : BaseExpr\n A value to use for passed condition.\n else_val : BaseExpr\n A value to use for failed condition.\n res_type : dtype\n The result data type.\n\n Returns\n -------\n BaseExpr\n The conditional operator expression.\n \"\"\"\n return OpExpr(\"CASE\", [cond, then_val, else_val], res_type)\n\n\ndef build_dt_expr(dt_operation, col_expr):\n \"\"\"\n Build a datetime extraction expression.\n\n Parameters\n ----------\n dt_operation : str\n Datetime field to extract.\n col_expr : BaseExpr\n An expression to extract from.\n\n Returns\n -------\n BaseExpr\n The extract expression.\n \"\"\"\n operation = LiteralExpr(dt_operation)\n\n res = OpExpr(\"PG_EXTRACT\", [operation, col_expr], get_dtype(\"int32\"))\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py_pyhdk_HdkWorker.setup_engine.if_cls__executor_is_None_.cls._executor.pyhdk_Executor_cls__data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py_pyhdk_HdkWorker.setup_engine.if_cls__executor_is_None_.cls._executor.pyhdk_Executor_cls__data_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py", "file_name": "hdk_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 48, "span_ids": ["HdkWorker", "HdkWorker.setup_engine", "docstring"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pyhdk\n\nfrom .base_worker import BaseDbWorker\n\nfrom modin.utils import _inherit_docstrings\nfrom modin.config import HdkLaunchParameters\n\n\n@_inherit_docstrings(BaseDbWorker)\nclass HdkWorker(BaseDbWorker):\n \"\"\"PyHDK based wrapper class for HDK storage format.\"\"\"\n\n _config = None\n _storage = None\n _data_mgr = None\n _calcite = None\n _executor = None\n\n @classmethod\n def setup_engine(cls):\n \"\"\"\n Initialize PyHDK.\n\n Do nothing if it is initiliazed already.\n \"\"\"\n if cls._executor is None:\n cls._config = pyhdk.buildConfig(**HdkLaunchParameters.get())\n cls._storage = pyhdk.storage.ArrowStorage(1)\n cls._data_mgr = pyhdk.storage.DataMgr(cls._config)\n cls._data_mgr.registerDataProvider(cls._storage)\n\n cls._calcite = pyhdk.sql.Calcite(cls._storage, cls._config)\n cls._executor = pyhdk.Executor(cls._data_mgr, cls._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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py_HdkWorker.__init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py_HdkWorker.__init___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/hdk_worker.py", "file_name": "hdk_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 106, "span_ids": ["HdkWorker.import_arrow_table", "HdkWorker.__init__", "HdkWorker._executeRelAlgJson", "HdkWorker.executeDML", "HdkWorker.executeRA", "HdkWorker.dropTable"], "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": "@_inherit_docstrings(BaseDbWorker)\nclass HdkWorker(BaseDbWorker):\n\n def __init__(self):\n \"\"\"Initialize HDK storage format.\"\"\"\n self.setup_engine()\n\n @classmethod\n def dropTable(cls, name):\n cls._storage.dropTable(name)\n\n @classmethod\n def _executeRelAlgJson(cls, ra):\n \"\"\"\n Execute RelAlg JSON query.\n\n Parameters\n ----------\n ra : str\n RelAlg JSON string.\n\n Returns\n -------\n pyarrow.Table\n Execution result.\n \"\"\"\n rel_alg_executor = pyhdk.sql.RelAlgExecutor(\n cls._executor, cls._storage, cls._data_mgr, ra\n )\n res = rel_alg_executor.execute()\n return res.to_arrow()\n\n @classmethod\n def executeDML(cls, query):\n ra = cls._calcite.process(query, db_name=\"hdk\")\n return cls._executeRelAlgJson(ra)\n\n @classmethod\n def executeRA(cls, query):\n if query.startswith(\"execute relalg\"):\n # 14 == len(\"execute relalg\")\n ra = query[14:]\n else:\n assert query.startswith(\"execute calcite\")\n ra = cls._calcite.process(query, db_name=\"hdk\")\n\n return cls._executeRelAlgJson(ra)\n\n @classmethod\n def import_arrow_table(cls, table, name=None):\n name = cls._genName(name)\n\n table = cls.cast_to_compatible_types(table)\n fragment_size = cls.compute_fragment_size(table)\n\n opt = pyhdk.storage.TableOptions(fragment_size)\n cls._storage.importArrowTable(table, name, opt)\n\n return 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/buffer.py_pa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/buffer.py_pa_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/buffer.py", "file_name": "buffer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 79, "span_ids": ["HdkProtocolBuffer.__dlpack_device__", "HdkProtocolBuffer.__init__", "HdkProtocolBuffer.bufsize", "HdkProtocolBuffer.__repr__", "HdkProtocolBuffer.ptr", "HdkProtocolBuffer.__dlpack__", "docstring", "HdkProtocolBuffer"], "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": "import pyarrow as pa\nfrom typing import Tuple, Optional\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.utils import (\n DlpackDeviceType,\n)\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolBuffer,\n)\nfrom modin.utils import _inherit_docstrings\n\n\n@_inherit_docstrings(ProtocolBuffer)\nclass HdkProtocolBuffer(ProtocolBuffer):\n \"\"\"\n Wrapper of the ``pyarrow.Buffer`` object representing a continuous segment of memory.\n\n Parameters\n ----------\n buff : pyarrow.Buffer\n Data to be held by ``Buffer``.\n size : int, optional\n Size of the buffer in bytes, if not specified use ``buff.size``.\n The parameter may be usefull for specifying the size of a virtual chunk.\n \"\"\"\n\n def __init__(self, buff: pa.Buffer, size: Optional[int] = None) -> None:\n self._buff = buff\n self._size = self._buff.size if size is None else size\n\n @property\n def bufsize(self) -> int:\n return self._size\n\n @property\n def ptr(self) -> int:\n return self._buff.address\n\n def __dlpack__(self):\n raise NotImplementedError(\"__dlpack__\")\n\n def __dlpack_device__(self) -> Tuple[DlpackDeviceType, int]:\n return (DlpackDeviceType.CPU, None)\n\n def __repr__(self) -> str:\n \"\"\"\n Produce string representation of the buffer.\n\n Returns\n -------\n str\n \"\"\"\n return (\n \"Buffer(\"\n + str(\n {\n \"bufsize\": self.bufsize,\n \"ptr\": self.ptr,\n \"device\": self.__dlpack_device__()[0].name,\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_pa_if_TYPE_CHECKING_.HdkProtocolDataframe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_pa_if_TYPE_CHECKING_.HdkProtocolDataframe", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 39, "span_ids": ["docstring"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pyarrow as pa\nimport pandas\nimport numpy as np\nfrom typing import Any, Optional, Tuple, Dict, Iterable, TYPE_CHECKING\nfrom math import ceil\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.utils import (\n DTypeKind,\n ColumnNullType,\n ArrowCTypes,\n Endianness,\n pandas_dtype_to_arrow_c,\n raise_copy_alert,\n)\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n CategoricalDescription,\n ProtocolColumn,\n)\nfrom modin.utils import _inherit_docstrings\nfrom .buffer import HdkProtocolBuffer\nfrom .utils import arrow_dtype_to_arrow_c, arrow_types_map\n\nif TYPE_CHECKING:\n from .dataframe import HdkProtocolDataframe", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn_HdkProtocolColumn.offset.return.self__pyarrow_table_colum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn_HdkProtocolColumn.offset.return.self__pyarrow_table_colum", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 78, "span_ids": ["HdkProtocolColumn", "HdkProtocolColumn.size", "HdkProtocolColumn.offset", "HdkProtocolColumn.__init__"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n \"\"\"\n Wrapper of ``HdkProtocolDataframe`` holding a single column.\n\n The Column object wraps a ``ProtocolDataframe`` to ease referencing original\n Modin DataFrame with no materialization of PyArrow table where possible.\n ``ProtocolDataframe`` also already implements methods like chunking and ``allow_copy``\n checks, so we can just forward calls for the methods to ``ProtocolDataFrame`` without\n reimplementing them.\n\n Parameters\n ----------\n column : HdkProtocolDataframe\n DataFrame protocol object holding a PyArrow table with a single column.\n\n Notes\n -----\n The object could be modified inplace due to either casting PyArrow buffers to a new dtype\n or combining physical chunks into a single congingous buffer:\n ``_propagate_dtype``, ``_cast_at``, ``_combine_chunks`` - the methods replace the wrapped\n ``HdkProtocolDataframe`` object with the new one holding the modified PyArrow table.\n \"\"\"\n\n def __init__(self, column: \"HdkProtocolDataframe\") -> None:\n self._col = column\n\n def size(self) -> int:\n return self._col.num_rows()\n\n @property\n def offset(self) -> int:\n # The offset may change if it would require to cast buffers as the casted ones\n # no longer depend on their parent tables. So materializing buffers\n # before returning the offset\n self._materialize_actual_buffers()\n return self._pyarrow_table.column(-1).chunks[0].offset", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.dtype_HdkProtocolColumn.dtype.if_pandas_api_types_is_bo.else_.return.self__dtype_from_primitiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.dtype_HdkProtocolColumn.dtype.if_pandas_api_types_is_bo.else_.return.self__dtype_from_primitiv", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 101, "span_ids": ["HdkProtocolColumn.dtype"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n @property\n def dtype(self) -> Tuple[DTypeKind, int, str, str]:\n dtype = self._pandas_dtype\n\n if pandas.api.types.is_bool_dtype(dtype):\n return (DTypeKind.BOOL, 1, ArrowCTypes.BOOL, Endianness.NATIVE)\n elif pandas.api.types.is_datetime64_dtype(\n dtype\n ) or pandas.api.types.is_categorical_dtype(dtype):\n # We can't fully describe an actual underlying type's metadata from pandas dtype,\n # use a `._arrow_dtype` for missing parts of information like datetime resulution,\n # dictionary metadata, etc?...\n return self._dtype_from_pyarrow(self._arrow_dtype)\n elif pandas.api.types.is_string_dtype(dtype):\n return (\n DTypeKind.STRING,\n 8,\n pandas_dtype_to_arrow_c(dtype),\n Endianness.NATIVE,\n )\n else:\n return self._dtype_from_primitive_numpy(dtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._dtype_from_pyarrow_HdkProtocolColumn._dtype_from_pyarrow.if_kind_is_not_None_.else_.return.self__dtype_from_primitiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._dtype_from_pyarrow_HdkProtocolColumn._dtype_from_pyarrow.if_kind_is_not_None_.else_.return.self__dtype_from_primitiv", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 137, "span_ids": ["HdkProtocolColumn._dtype_from_pyarrow"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _dtype_from_pyarrow(self, dtype):\n \"\"\"\n Build protocol dtype from PyArrow type.\n\n Parameters\n ----------\n dtype : pyarrow.DataType\n Data type to convert from.\n\n Returns\n -------\n tuple(DTypeKind, bitwidth: int, format_str: str, edianess: str)\n \"\"\"\n kind = None\n if (\n pa.types.is_timestamp(dtype)\n or pa.types.is_date(dtype)\n or pa.types.is_time(dtype)\n ):\n kind = DTypeKind.DATETIME\n bit_width = dtype.bit_width\n elif pa.types.is_dictionary(dtype):\n kind = DTypeKind.CATEGORICAL\n bit_width = dtype.bit_width\n elif pa.types.is_string(dtype):\n kind = DTypeKind.STRING\n bit_width = 8\n elif pa.types.is_boolean(dtype):\n kind = DTypeKind.BOOL\n bit_width = dtype.bit_width\n\n if kind is not None:\n return (kind, bit_width, arrow_dtype_to_arrow_c(dtype), Endianness.NATIVE)\n else:\n return self._dtype_from_primitive_numpy(np.dtype(dtype.to_pandas_dtype()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._dtype_from_primitive_numpy_HdkProtocolColumn._dtype_from_primitive_numpy.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._dtype_from_primitive_numpy_HdkProtocolColumn._dtype_from_primitive_numpy.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 170, "span_ids": ["HdkProtocolColumn._dtype_from_primitive_numpy"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _dtype_from_primitive_numpy(\n self, dtype: np.dtype\n ) -> Tuple[DTypeKind, int, str, str]:\n \"\"\"\n Build protocol dtype from primitive pandas dtype.\n\n Parameters\n ----------\n dtype : np.dtype\n Data type to convert from.\n\n Returns\n -------\n tuple(DTypeKind, bitwidth: int, format_str: str, edianess: str)\n \"\"\"\n np_kinds = {\n \"i\": DTypeKind.INT,\n \"u\": DTypeKind.UINT,\n \"f\": DTypeKind.FLOAT,\n \"b\": DTypeKind.BOOL,\n }\n kind = np_kinds.get(dtype.kind, None)\n if kind is None:\n raise NotImplementedError(\n f\"Data type {dtype} not supported by exchange protocol\"\n )\n return (\n kind,\n dtype.itemsize * 8,\n pandas_dtype_to_arrow_c(dtype),\n dtype.byteorder,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.describe_categorical_HdkProtocolColumn.describe_categorical.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.describe_categorical_HdkProtocolColumn.describe_categorical.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 215, "span_ids": ["HdkProtocolColumn.describe_categorical"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n @property\n def describe_categorical(self) -> CategoricalDescription:\n dtype = self._pandas_dtype\n\n if dtype != \"category\":\n raise TypeError(\n \"`describe_categorical only works on a column with \"\n + \"categorical dtype!\"\n )\n\n ordered = dtype.ordered\n\n # Category codes may change during materialization flow, so trigger\n # materialization before returning the codes\n self._materialize_actual_buffers()\n\n # Although we can retrieve codes from pandas dtype, they're unsynced with\n # the actual PyArrow data most of the time. So getting the mapping directly\n # from the materialized PyArrow table.\n col = self._pyarrow_table.column(-1)\n if len(col.chunks) > 1:\n if not self._col._allow_copy:\n raise_copy_alert(\n copy_reason=\"physical chunks combining due to contiguous buffer materialization\"\n )\n col = col.combine_chunks()\n\n from .dataframe import HdkOnNativeDataframe\n\n col = col.chunks[0]\n cat_frame = HdkOnNativeDataframe.from_arrow(\n pa.Table.from_pydict({next(iter(self._col.column_names())): col.dictionary})\n )\n from .dataframe import HdkProtocolDataframe\n\n return {\n \"is_ordered\": ordered,\n \"is_dictionary\": True,\n \"categories\": HdkProtocolColumn(\n HdkProtocolDataframe(\n cat_frame, self._col._nan_as_null, self._col._allow_copy\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.describe_null_HdkProtocolColumn.get_chunks.for_chunk_in_self__col_ge.yield_HdkProtocolColumn_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.describe_null_HdkProtocolColumn.get_chunks.for_chunk_in_self__col_ge.yield_HdkProtocolColumn_c", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 271, "span_ids": ["HdkProtocolColumn.metadata", "HdkProtocolColumn.num_chunks", "HdkProtocolColumn.null_count", "HdkProtocolColumn.describe_null", "HdkProtocolColumn._pandas_dtype", "HdkProtocolColumn._arrow_dtype", "HdkProtocolColumn.get_chunks", "HdkProtocolColumn._pyarrow_table"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n @property\n def describe_null(self) -> Tuple[ColumnNullType, Any]:\n null_buffer = self._pyarrow_table.column(-1).chunks[0].buffers()[0]\n if null_buffer is None:\n return (ColumnNullType.NON_NULLABLE, None)\n else:\n return (ColumnNullType.USE_BITMASK, 0)\n\n @property\n def null_count(self) -> int:\n return self._pyarrow_table.column(-1).null_count\n\n @property\n def metadata(self) -> Dict[str, Any]:\n return self._col.metadata\n\n @property\n def _pandas_dtype(self) -> np.dtype:\n \"\"\"\n Get column's dtype representation in Modin DataFrame.\n\n Returns\n -------\n numpy.dtype\n \"\"\"\n return self._col._df.dtypes.iloc[-1]\n\n @property\n def _arrow_dtype(self) -> pa.DataType:\n \"\"\"\n Get column's dtype representation in underlying PyArrow table.\n\n Returns\n -------\n pyarrow.DataType\n \"\"\"\n return self._pyarrow_table.column(-1).type\n\n @property\n def _pyarrow_table(self) -> pa.Table:\n \"\"\"\n Get PyArrow table representing the column.\n\n Returns\n -------\n pyarrow.Table\n \"\"\"\n return self._col._pyarrow_table\n\n def num_chunks(self) -> int:\n return self._col.num_chunks()\n\n def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable[ProtocolColumn]:\n for chunk in self._col.get_chunks(n_chunks):\n yield HdkProtocolColumn(chunk)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.get_buffers_HdkProtocolColumn.get_buffers.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn.get_buffers_HdkProtocolColumn.get_buffers.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 273, "end_line": 284, "span_ids": ["HdkProtocolColumn.get_buffers"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def get_buffers(self) -> Dict[str, Any]:\n self._materialize_actual_buffers()\n at = self._pyarrow_table\n # Get the last column since the first one could be the index\n pyarrow_array = at.column(-1).chunks[0]\n\n result = dict()\n result[\"data\"] = self._get_data_buffer(pyarrow_array)\n result[\"validity\"] = self._get_validity_buffer(pyarrow_array)\n result[\"offsets\"] = self._get_offsets_buffer(pyarrow_array)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._materialize_actual_buffers_HdkProtocolColumn._materialize_actual_buffers.if_external_dtype_0_i.self__propagate_dtype_ext": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._materialize_actual_buffers_HdkProtocolColumn._materialize_actual_buffers.if_external_dtype_0_i.self__propagate_dtype_ext", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 286, "end_line": 309, "span_ids": ["HdkProtocolColumn._materialize_actual_buffers"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _materialize_actual_buffers(self):\n \"\"\"\n Materialize PyArrow table's buffers that can be zero-copy returned to a consumer, if they aren't already materialized.\n\n Besides materializing PyArrow table itself (if there were some delayed computations)\n the function also may do the following if required:\n 1. Propagate external dtypes to the PyArrow table. For example,\n if ``self.dtype`` is a string kind, but internal PyArrow dtype is a dictionary\n (if the table were just exported from HDK), then the dictionary will be casted\n to string dtype.\n 2. Combine physical chunks of PyArrow table into a single contiguous buffer.\n \"\"\"\n if self.num_chunks() != 1:\n if not self._col._allow_copy:\n raise_copy_alert(\n copy_reason=\"physical chunks combining due to contiguous buffer materialization\"\n )\n self._combine_chunks()\n\n external_dtype = self.dtype\n internal_dtype = self._dtype_from_pyarrow(self._arrow_dtype)\n\n if external_dtype[0] != internal_dtype[0]:\n self._propagate_dtype(external_dtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_buffer_size_HdkProtocolColumn._get_buffer_size.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_buffer_size_HdkProtocolColumn._get_buffer_size.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 340, "span_ids": ["HdkProtocolColumn._get_buffer_size"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _get_buffer_size(self, bit_width: int, is_offset_buffer: bool = False) -> int:\n \"\"\"\n Compute buffer's size in bytes for the current chunk.\n\n Parameters\n ----------\n bit_width : int\n Bit width of the underlying data type.\n is_offset_buffer : bool, default: False\n Whether the buffer describes offsets.\n\n Returns\n -------\n int\n Number of bytes to read from the start of the buffer + offset to retrieve the whole chunk.\n \"\"\"\n # Offset buffer always has ``size + 1`` elements in it as it describes slices bounds\n elements_in_buffer = self.size() + 1 if is_offset_buffer else self.size()\n result = ceil((bit_width * elements_in_buffer) / 8)\n # For a bitmask, if the chunk started in the middle of the byte then we need to\n # read one extra byte from the buffer to retrieve the chunk's tail in the last byte. Example:\n # Bitmask of 3 bytes, the chunk offset is 3 elements and its size is 16\n # |* * * * * * * *|* * * * * * * *|* * * * * * * *|\n # ^- the chunk starts here ^- the chunk ends here\n # Although ``ceil(bit_width * elements_in_buffer / 8)`` gives us '2 bytes',\n # the chunk is located in 3 bytes, that's why we assume the chunk's buffer size\n # to be 'result += 1' in this case:\n if bit_width == 1 and self.offset % 8 + self.size() > result * 8:\n result += 1\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_data_buffer_HdkProtocolColumn._get_data_buffer.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_data_buffer_HdkProtocolColumn._get_data_buffer.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 342, "end_line": 377, "span_ids": ["HdkProtocolColumn._get_data_buffer"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _get_data_buffer(\n self, arr: pa.Array\n ) -> Tuple[HdkProtocolBuffer, Tuple[DTypeKind, int, str, str]]:\n \"\"\"\n Get column's data buffer.\n\n Parameters\n ----------\n arr : pa.Array\n PyArrow array holding column's data.\n\n Returns\n -------\n tuple\n Tuple of ``HdkProtocolBuffer`` and protocol dtype representation of the buffer's underlying data.\n \"\"\"\n if self.dtype[0] == DTypeKind.CATEGORICAL:\n # For dictionary data the buffer has to return categories codes\n arr = arr.indices\n\n arrow_type = self._dtype_from_pyarrow(arr.type)\n buff_size = (\n self._get_buffer_size(bit_width=arrow_type[1])\n if self.dtype[0] != DTypeKind.STRING\n # We don't chunk string buffers as it would require modifying offset values,\n # so just return the whole data buffer for every chunk.\n else None\n )\n\n return (\n # According to the Arrow's memory layout, the data buffer is always present\n # at the last position of `.buffers()`:\n # https://arrow.apache.org/docs/format/Columnar.html#buffer-listing-for-each-layout\n HdkProtocolBuffer(arr.buffers()[-1], buff_size),\n arrow_type,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_validity_buffer_HdkProtocolColumn._get_validity_buffer.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_validity_buffer_HdkProtocolColumn._get_validity_buffer.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 379, "end_line": 407, "span_ids": ["HdkProtocolColumn._get_validity_buffer"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _get_validity_buffer(\n self, arr: pa.Array\n ) -> Optional[Tuple[HdkProtocolBuffer, Tuple[DTypeKind, int, str, str]]]:\n \"\"\"\n Get column's validity buffer.\n\n Parameters\n ----------\n arr : pa.Array\n PyArrow array holding column's data.\n\n Returns\n -------\n tuple or None\n Tuple of ``HdkProtocolBuffer`` and protocol dtype representation of the buffer's underlying data.\n None if column is non-nullable (``self.describe_null == ColumnNullType.NON_NULLABLE``).\n \"\"\"\n # According to the Arrow's memory layout, the validity buffer is always present at zero position:\n # https://arrow.apache.org/docs/format/Columnar.html#buffer-listing-for-each-layout\n validity_buffer = arr.buffers()[0]\n if validity_buffer is None:\n return None\n\n # If exist, validity buffer is always a bit-mask.\n data_size = self._get_buffer_size(bit_width=1)\n return (\n HdkProtocolBuffer(validity_buffer, data_size),\n (DTypeKind.BOOL, 1, ArrowCTypes.BOOL, Endianness.NATIVE),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_offsets_buffer_HdkProtocolColumn._get_offsets_buffer.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._get_offsets_buffer_HdkProtocolColumn._get_offsets_buffer.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 444, "span_ids": ["HdkProtocolColumn._get_offsets_buffer"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _get_offsets_buffer(\n self, arr: pa.Array\n ) -> Optional[Tuple[HdkProtocolBuffer, Tuple[DTypeKind, int, str, str]]]:\n \"\"\"\n Get column's offsets buffer.\n\n Parameters\n ----------\n arr : pa.Array\n PyArrow array holding column's data.\n\n Returns\n -------\n tuple or None\n Tuple of ``HdkProtocolBuffer`` and protocol dtype representation of the buffer's underlying data.\n None if the column's dtype is fixed-size.\n \"\"\"\n buffs = arr.buffers()\n # According to the Arrow's memory layout, the offsets buffer is always at the second position\n # of `.buffers()` if present. Considering the support of only Primitive, Variable-length binary,\n # and Dict-encoded types from the layout table, we can assume that there's no offsets buffer\n # if there are fewer than 3 buffers available.\n # https://arrow.apache.org/docs/format/Columnar.html#buffer-listing-for-each-layout\n if len(buffs) < 3:\n return None\n\n offset_buff = buffs[1]\n # According to Arrow's data layout, the offset buffer type is \"int32\"\n dtype = self._dtype_from_primitive_numpy(np.dtype(\"int32\"))\n return (\n HdkProtocolBuffer(\n offset_buff,\n self._get_buffer_size(bit_width=dtype[1], is_offset_buffer=True),\n ),\n dtype,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._propagate_dtype_HdkProtocolColumn._propagate_dtype.self__cast_at_schema_to_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._propagate_dtype_HdkProtocolColumn._propagate_dtype.self__cast_at_schema_to_c", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 495, "span_ids": ["HdkProtocolColumn._propagate_dtype"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _propagate_dtype(self, dtype: Tuple[DTypeKind, int, str, str]):\n \"\"\"\n Propagate `dtype` to the underlying PyArrow table.\n\n Modifies the column object inplace by replacing underlying PyArrow table with\n the casted one.\n\n Parameters\n ----------\n dtype : tuple\n Data type conforming protocol dtypes format to cast underlying PyArrow table.\n \"\"\"\n if not self._col._allow_copy:\n raise_copy_alert(\n copy_reason=\"casting to align pandas and PyArrow data types\"\n )\n\n kind, bit_width, format_str, _ = dtype\n arrow_type = None\n\n if kind in arrow_types_map:\n arrow_type = arrow_types_map[kind].get(bit_width, None)\n elif kind == DTypeKind.DATETIME:\n arrow_type = pa.timestamp(\"ns\")\n elif kind == DTypeKind.CATEGORICAL:\n index_type = arrow_types_map[DTypeKind.INT].get(bit_width, None)\n if index_type is not None:\n arrow_type = pa.dictionary(\n index_type=index_type,\n # There is no way to deduce an actual value type, so casting to a string\n # as it's the most common one\n value_type=pa.string(),\n )\n\n if arrow_type is None:\n raise NotImplementedError(f\"Propagation for type {dtype} is not supported.\")\n\n at = self._pyarrow_table\n schema_to_cast = at.schema\n field = at.schema[-1]\n\n schema_to_cast = schema_to_cast.set(\n len(schema_to_cast) - 1, pa.field(field.name, arrow_type, field.nullable)\n )\n\n # TODO: currently, each column chunk casts its buffers independently which results\n # in an `N_CHUNKS - 1` amount of redundant casts. We can make the PyArrow table\n # being shared across all the chunks, so the cast being triggered in a single chunk\n # propagate to all of them.\n self._cast_at(schema_to_cast)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._cast_at_HdkProtocolColumn._cast_at.self._col.type_self__col_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._cast_at_HdkProtocolColumn._cast_at.self._col.type_self__col_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 516, "span_ids": ["HdkProtocolColumn._cast_at"], "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": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _cast_at(self, new_schema: pa.Schema):\n \"\"\"\n Cast underlying PyArrow table with the passed schema.\n\n Parameters\n ----------\n new_schema : pyarrow.Schema\n New schema to cast the table.\n\n Notes\n -----\n This method modifies the column inplace by replacing the wrapped ``HdkProtocolDataframe``\n with the new one holding the casted PyArrow table.\n \"\"\"\n casted_at = self._pyarrow_table.cast(new_schema)\n self._col = type(self._col)(\n self._col._df.from_arrow(casted_at),\n self._col._nan_as_null,\n self._col._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._combine_chunks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py_HdkProtocolColumn._combine_chunks_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/column.py", "file_name": "column.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 533, "span_ids": ["HdkProtocolColumn._combine_chunks"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolColumn)\nclass HdkProtocolColumn(ProtocolColumn):\n\n def _combine_chunks(self):\n \"\"\"\n Combine physical chunks of underlying PyArrow table.\n\n Notes\n -----\n This method modifies the column inplace by replacing the wrapped ``HdkProtocolDataframe``\n with the new one holding PyArrow table with the column's data placed in a single contingous buffer.\n \"\"\"\n contiguous_at = self._pyarrow_table.combine_chunks()\n self._col = type(self._col)(\n self._col._df.from_arrow(contiguous_at),\n self._col._nan_as_null,\n self._col._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_collections_raise_copy_alert_if_materialize": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_collections_raise_copy_alert_if_materialize", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 37, "span_ids": ["docstring"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import collections\nimport numpy as np\nimport pyarrow as pa\nfrom typing import Optional, Iterable, Sequence, Dict, Any\n\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.dataframe.dataframe import (\n HdkOnNativeDataframe,\n)\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import (\n ProtocolDataframe,\n)\nfrom modin.pandas.indexing import is_range_like\nfrom modin.utils import _inherit_docstrings\nfrom modin.error_message import ErrorMessage\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.df_algebra import (\n MaskNode,\n FrameNode,\n TransformNode,\n UnionNode,\n)\nfrom .column import HdkProtocolColumn\nfrom .utils import raise_copy_alert_if_materialize", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe_HdkProtocolDataframe.__chunk_slices.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe_HdkProtocolDataframe.__chunk_slices.None", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 97, "span_ids": ["HdkProtocolDataframe.__init__", "HdkProtocolDataframe.num_chunks", "HdkProtocolDataframe.num_rows", "HdkProtocolDataframe.metadata", "HdkProtocolDataframe:3", "HdkProtocolDataframe.num_columns", "HdkProtocolDataframe", "HdkProtocolDataframe.__dataframe__"], "tokens": 489}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n \"\"\"\n Implement the DataFrame exchange protocol class for ``HdkOnNative`` execution.\n\n Parameters\n ----------\n df : HdkOnNativeDataframe\n DataFrame object that holds the data.\n nan_as_null : bool, default: False\n Whether to overwrite null values in the data with ``NaN``.\n allow_copy : bool, default: True\n Whether allow to doing copy of the underlying data during export flow.\n If a copy or any kind of data transfer/materialization would be required raise ``RuntimeError``.\n \"\"\"\n\n def __init__(\n self,\n df: HdkOnNativeDataframe,\n nan_as_null: bool = False,\n allow_copy: bool = True,\n ) -> None:\n if nan_as_null:\n raise NotImplementedError(\n \"Proccessing of `nan_as_null=True` is not yet supported.\"\n )\n\n self._df = df\n self._nan_as_null = nan_as_null\n self._allow_copy = allow_copy\n\n def __dataframe__(self, nan_as_null: bool = False, allow_copy: bool = True):\n return HdkProtocolDataframe(\n self._df, nan_as_null=nan_as_null, allow_copy=allow_copy\n )\n\n @property\n @raise_copy_alert_if_materialize\n def metadata(self) -> Dict[str, Any]:\n # TODO: as the frame's index is stored as a separate column inside PyArrow table\n # we may want to return the column's name here instead of materialized index.\n # This will require the internal index column to be visible in the protocol's column\n # accessor methods.\n return {\"modin.index\": self._df.index}\n\n def num_columns(self) -> int:\n return len(self._df.columns)\n\n @raise_copy_alert_if_materialize\n def num_rows(self) -> int:\n return len(self._df.index)\n\n def num_chunks(self) -> int:\n # `._ chunk_slices` describe chunk offsets (start-stop indices of the chunks)\n # meaning that there are actually `len(self._chunk_slices) - 1` amount of chunks\n return len(self._chunk_slices) - 1\n\n __chunk_slices = 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._chunk_slices_HdkProtocolDataframe._chunk_slices.return.self___chunk_slices": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._chunk_slices_HdkProtocolDataframe._chunk_slices.return.self___chunk_slices", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 142, "span_ids": ["HdkProtocolDataframe._chunk_slices"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n @property\n def _chunk_slices(self) -> np.ndarray:\n \"\"\"\n Compute chunks start-stop indices in the underlying PyArrow table.\n\n Returns\n -------\n np.ndarray\n An array holding start-stop indices of the chunks, for ex. ``[0, 5, 10, 20]``\n describes 3 chunks bound by the following indices:\n chunk1: [0, 5),\n chunk2: [5, 10),\n chunk3: [10, 20).\n\n Notes\n -----\n Arrow table allows for the columns to be chunked independently, so in order to satisfy\n the protocol's requirement of equally chunked columns, we have to align column chunks\n with the minimal one. For example:\n Originally chunked table: Aligned table:\n |col0|col1| |col0|col1|\n | | | | | |\n |0 |a | |0 |a |\n |----|b | |----|----|\n |1 |----| |1 |b |\n |2 |c | |----|----|\n |3 |d | |2 |c |\n |----|----| |3 |d |\n |4 |e | |----|----|\n |4 |e |\n \"\"\"\n if self.__chunk_slices is None:\n at = self._pyarrow_table\n # What we need to do is to union offsets of all the columns\n col_slices = set({0})\n for col in at.columns:\n col_slices = col_slices.union(\n np.cumsum([len(chunk) for chunk in col.chunks])\n )\n self.__chunk_slices = np.sort(\n np.fromiter(col_slices, dtype=int, count=len(col_slices))\n )\n\n return self.__chunk_slices", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.__is_zero_copy_possible_HdkProtocolDataframe._is_zero_copy_possible.return.self___is_zero_copy_possi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.__is_zero_copy_possible_HdkProtocolDataframe._is_zero_copy_possible.return.self___is_zero_copy_possi", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 170, "span_ids": ["HdkProtocolDataframe._is_zero_copy_possible", "HdkProtocolDataframe:5"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n __is_zero_copy_possible = None\n\n @property\n def _is_zero_copy_possible(self) -> bool:\n \"\"\"\n Check whether it's possible to retrieve data from the DataFrame zero-copy.\n\n The 'zero-copy' term also means that no extra computations or data transers\n are needed to access the data.\n\n Returns\n -------\n bool\n \"\"\"\n if self.__is_zero_copy_possible is None:\n if self._df._has_arrow_table():\n # If PyArrow table is already materialized then we can\n # retrieve data zero-copy\n self.__is_zero_copy_possible = True\n elif not self._df._can_execute_arrow():\n # When not able to execute the plan via PyArrow means\n # that we have to involve HDK, so no zero-copy.\n self.__is_zero_copy_possible = False\n else:\n # Check whether the plan for PyArrow can be executed zero-copy\n self.__is_zero_copy_possible = self._is_zero_copy_arrow_op(self._df._op)\n return self.__is_zero_copy_possible", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._is_zero_copy_arrow_op_HdkProtocolDataframe._is_zero_copy_arrow_op.return.is_zero_copy_op_and_all_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._is_zero_copy_arrow_op_HdkProtocolDataframe._is_zero_copy_arrow_op.return.is_zero_copy_op_and_all_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 200, "span_ids": ["HdkProtocolDataframe._is_zero_copy_arrow_op"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n @classmethod\n def _is_zero_copy_arrow_op(cls, op) -> bool:\n \"\"\"\n Check whether the passed node of the delayed computation tree could be executed zero-copy via PyArrow execution.\n\n Parameters\n ----------\n op : DFAlgNode\n\n Returns\n -------\n bool\n \"\"\"\n is_zero_copy_op = False\n if isinstance(op, (FrameNode, TransformNode, UnionNode)):\n # - FrameNode: already materialized PyArrow table\n # - TransformNode: select certain columns of the table, implemented zero-copy\n # - UnionNode: concatenate PyArrow tables, implemented zero-copy\n is_zero_copy_op = True\n elif isinstance(op, MaskNode) and (\n isinstance(op.row_positions, slice) or is_range_like(op.row_positions)\n ):\n # Can select rows zero-copy if indexer is a slice-like\n is_zero_copy_op = True\n return is_zero_copy_op and all(\n # Walk the computation tree\n cls._is_zero_copy_arrow_op(_op)\n for _op in getattr(op, \"inputs\", [])\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._pyarrow_table_HdkProtocolDataframe.select_columns_by_name.return.HdkProtocolDataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._pyarrow_table_HdkProtocolDataframe.select_columns_by_name.return.HdkProtocolDataframe_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 263, "span_ids": ["HdkProtocolDataframe.get_column_by_name", "HdkProtocolDataframe.select_columns_by_name", "HdkProtocolDataframe.get_column", "HdkProtocolDataframe.select_columns", "HdkProtocolDataframe.column_names", "HdkProtocolDataframe._pyarrow_table", "HdkProtocolDataframe.get_columns"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n @property\n @raise_copy_alert_if_materialize\n def _pyarrow_table(self) -> pa.Table:\n \"\"\"\n Get PyArrow table representing the DataFrame.\n\n Returns\n -------\n pyarrow.Table\n \"\"\"\n at = self._df._execute()\n assert at is not None\n return at\n\n def column_names(self) -> Iterable[str]:\n return self._df.columns\n\n def get_column(self, i: int) -> HdkProtocolColumn:\n return HdkProtocolColumn(\n HdkProtocolDataframe(\n self._df.take_2d_labels_or_positional(col_positions=[i]),\n allow_copy=self._allow_copy,\n ),\n )\n\n def get_column_by_name(self, name: str) -> HdkProtocolColumn:\n return HdkProtocolColumn(\n HdkProtocolDataframe(\n self._df.take_2d_labels_or_positional(col_labels=[name]),\n allow_copy=self._allow_copy,\n ),\n )\n\n def get_columns(self) -> Iterable[HdkProtocolColumn]:\n for name in self._df.columns:\n yield HdkProtocolColumn(\n HdkProtocolDataframe(\n self._df.take_2d_labels_or_positional(col_labels=[name]),\n nan_as_null=self._nan_as_null,\n allow_copy=self._allow_copy,\n ),\n )\n\n def select_columns(self, indices: Sequence[int]) -> \"HdkProtocolDataframe\":\n if not isinstance(indices, collections.abc.Sequence):\n raise ValueError(\"`indices` is not a sequence\")\n\n return HdkProtocolDataframe(\n self._df.take_2d_labels_or_positional(col_positions=list(indices)),\n nan_as_null=self._nan_as_null,\n allow_copy=self._allow_copy,\n )\n\n def select_columns_by_name(self, names: Sequence[str]) -> \"HdkProtocolDataframe\":\n if not isinstance(names, collections.abc.Sequence):\n raise ValueError(\"`names` is not a sequence\")\n\n return HdkProtocolDataframe(\n self._df.take_2d_labels_or_positional(col_labels=list(names)),\n nan_as_null=self._nan_as_null,\n allow_copy=self._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.get_chunks_HdkProtocolDataframe.get_chunks.subdivided_slices_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.get_chunks_HdkProtocolDataframe.get_chunks.subdivided_slices_append_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 265, "end_line": 335, "span_ids": ["HdkProtocolDataframe.get_chunks"], "tokens": 731}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n def get_chunks(\n self, n_chunks: Optional[int] = None\n ) -> Iterable[\"HdkProtocolDataframe\"]:\n \"\"\"\n Return an iterator yielding the chunks.\n\n If `n_chunks` is not specified, yields the chunks that the data is stored underneath.\n If given, `n_chunks` must be a multiple of ``self.num_chunks()``, meaning that each physical\n chunk is going to be split into ``n_chunks // self.num_chunks()`` virtual chunks, that are\n backed by the same physical buffers but have different ``.offset`` values.\n\n Parameters\n ----------\n n_chunks : int, optional\n Number of chunks to yield.\n\n Returns\n -------\n Iterable[\"HdkProtocolDataframe\"]\n An iterator yielding ``HdkProtocolDataframe`` objects.\n\n Raises\n ------\n ``RuntimeError`` if ``n_chunks`` is not a multiple of ``self.num_chunks()`` or ``n_chunks``\n is greater than ``self.num_rows()``.\n\n Notes\n -----\n There is a special casing in handling variable-sized columns (i.e. strings) when virtually chunked.\n In order to make the offsets buffer be valid for each virtual chunk, the data buffer shouldn't be\n chunked at all, meaning that ``.get_buffers()[\"data\"]`` always returns a buffer owning the whole\n physical chunk and the consumer must always interpret it with zero offset (validity and offsets\n buffers have to be interpreted respecting the column's offset value).\n \"\"\"\n if n_chunks is None or n_chunks == self.num_chunks():\n return self._yield_chunks(self._chunk_slices)\n\n if n_chunks % self.num_chunks() != 0:\n raise RuntimeError(\n \"The passed `n_chunks` has to be a multiple of `num_chunks`.\"\n )\n\n if n_chunks > self.num_rows():\n raise RuntimeError(\n \"The passed `n_chunks` value is bigger than the amout of rows in the frame.\"\n )\n\n extra_chunks = 0\n to_subdivide = n_chunks // self.num_chunks()\n subdivided_slices = []\n\n # The loop subdivides each chunk into `to_subdivide` chunks if possible\n for i in range(len(self._chunk_slices) - 1):\n chunk_length = self._chunk_slices[i + 1] - self._chunk_slices[i]\n step = chunk_length // to_subdivide\n if step == 0:\n # Bad case: we're requested to subdivide a chunk in more pieces than it has rows in it.\n # This means that there is a bigger chunk that we can subdivide into more pieces to get\n # the required amount of chunks. For now, subdividing the current chunk into maximum possible\n # pieces (TODO: maybe we should subdivide it into `sqrt(chunk_length)` chunks to make\n # this more oprimal?), writing a number of missing pieces into `extra_chunks` variable\n # to extract them from bigger chunks later.\n step = 1\n extra_chunks += to_subdivide - chunk_length\n to_subdivide_chunk = chunk_length\n else:\n to_subdivide_chunk = to_subdivide\n\n for j in range(to_subdivide_chunk):\n subdivided_slices.append(self._chunk_slices[i] + step * j)\n subdivided_slices.append(self._chunk_slices[-1])\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.get_chunks.if_extra_chunks_0__HdkProtocolDataframe.get_chunks.return.self__yield_chunks_subdiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe.get_chunks.if_extra_chunks_0__HdkProtocolDataframe.get_chunks.return.self__yield_chunks_subdiv", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 362, "span_ids": ["HdkProtocolDataframe.get_chunks"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n def get_chunks(\n self, n_chunks: Optional[int] = None\n ) -> Iterable[\"HdkProtocolDataframe\"]:\n # ... other code\n\n if extra_chunks != 0:\n # Making more pieces from big chunks to get the required amount of `n_chunks`\n for _ in range(extra_chunks):\n # 1. Find the biggest chunk\n # 2. Split it in the middle\n biggest_chunk_idx = np.argmax(np.diff(subdivided_slices))\n new_chunk_offset = (\n subdivided_slices[biggest_chunk_idx + 1]\n - subdivided_slices[biggest_chunk_idx]\n ) // 2\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=new_chunk_offset == 0,\n extra_log=\"No more chunks to subdivide\",\n )\n subdivided_slices = np.insert(\n subdivided_slices,\n biggest_chunk_idx + 1,\n subdivided_slices[biggest_chunk_idx] + new_chunk_offset,\n )\n\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=len(subdivided_slices) != n_chunks + 1,\n extra_log=f\"Chunks were incorrectly split: {len(subdivided_slices)} != {n_chunks + 1}\",\n )\n\n return self._yield_chunks(subdivided_slices)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._yield_chunks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py_HdkProtocolDataframe._yield_chunks_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 364, "end_line": 385, "span_ids": ["HdkProtocolDataframe._yield_chunks"], "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": "@_inherit_docstrings(ProtocolDataframe)\nclass HdkProtocolDataframe(ProtocolDataframe):\n\n def _yield_chunks(self, chunk_slices) -> \"HdkProtocolDataframe\":\n \"\"\"\n Yield DataFrame chunks according to the passed offsets.\n\n Parameters\n ----------\n chunk_slices : list\n Chunking offsets.\n\n Yields\n ------\n HdkProtocolDataframe\n \"\"\"\n for i in range(len(chunk_slices) - 1):\n yield HdkProtocolDataframe(\n df=self._df.take_2d_labels_or_positional(\n row_positions=range(chunk_slices[i], chunk_slices[i + 1])\n ),\n nan_as_null=self._nan_as_null,\n allow_copy=self._allow_copy,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_pa_arrow_types_map._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_pa_arrow_types_map._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 44, "span_ids": ["docstring"], "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": "import pyarrow as pa\nimport numpy as np\nimport functools\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.utils import (\n ArrowCTypes,\n pandas_dtype_to_arrow_c,\n raise_copy_alert,\n DTypeKind,\n)\n\n\narrow_types_map = {\n DTypeKind.BOOL: {8: pa.bool_()},\n DTypeKind.INT: {\n 8: pa.int8(),\n 16: pa.int16(),\n 32: pa.int32(),\n 64: pa.int64(),\n },\n DTypeKind.UINT: {\n 8: pa.uint8(),\n 16: pa.uint16(),\n 32: pa.uint32(),\n 64: pa.uint64(),\n },\n DTypeKind.FLOAT: {16: pa.float16(), 32: pa.float32(), 64: pa.float64()},\n DTypeKind.STRING: {8: pa.string()},\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_arrow_dtype_to_arrow_c_arrow_dtype_to_arrow_c.if_pa_types_is_timestamp_.else_.return.pandas_dtype_to_arrow_c_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_arrow_dtype_to_arrow_c_arrow_dtype_to_arrow_c.if_pa_types_is_timestamp_.else_.return.pandas_dtype_to_arrow_c_n", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 75, "span_ids": ["arrow_dtype_to_arrow_c"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def arrow_dtype_to_arrow_c(dtype: pa.DataType) -> str:\n \"\"\"\n Represent PyArrow `dtype` as a format string in Apache Arrow C notation.\n\n Parameters\n ----------\n dtype : pa.DataType\n Datatype of PyArrow table to represent.\n\n Returns\n -------\n str\n Format string in Apache Arrow C notation of the given `dtype`.\n \"\"\"\n if pa.types.is_timestamp(dtype):\n return ArrowCTypes.TIMESTAMP.format(\n resolution=dtype.unit[:1], tz=dtype.tz or \"\"\n )\n elif pa.types.is_date(dtype):\n return getattr(ArrowCTypes, f\"DATE{dtype.bit_width}\", \"DATE64\")\n elif pa.types.is_time(dtype):\n # TODO: for some reason `time32` type doesn't have a `unit` attribute,\n # always return \"s\" for now.\n # return ArrowCTypes.TIME.format(resolution=dtype.unit[:1])\n return ArrowCTypes.TIME.format(resolution=getattr(dtype, \"unit\", \"s\")[:1])\n elif pa.types.is_dictionary(dtype):\n return arrow_dtype_to_arrow_c(dtype.index_type)\n else:\n return pandas_dtype_to_arrow_c(np.dtype(dtype.to_pandas_dtype()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_raise_copy_alert_if_materialize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py_raise_copy_alert_if_materialize_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/interchange/dataframe_protocol/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 99, "span_ids": ["raise_copy_alert_if_materialize"], "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 raise_copy_alert_if_materialize(fn):\n \"\"\"\n Decorate ``HdkProtocolDataframe`` method with a check raising a copy-alert if it's impossible to retrieve the data in zero-copy way.\n\n Parameters\n ----------\n fn : callable\n ``HdkProtocolDataframe`` method.\n\n Returns\n -------\n callable\n \"\"\"\n\n @functools.wraps(fn)\n def method(self, *args, **kwargs):\n if not self._allow_copy and not self._is_zero_copy_possible:\n raise_copy_alert()\n return fn(self, *args, **kwargs)\n\n return method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/__init__.py_HdkOnNativeIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/__init__.py_HdkOnNativeIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 21}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import HdkOnNativeIO\n\n__all__ = [\"HdkOnNativeIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_from_csv_import_Dialect_ArrowEngineException._Exception_raised_in_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_from_csv_import_Dialect_ArrowEngineException._Exception_raised_in_ca", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 63, "span_ids": ["ArrowEngineException", "docstring"], "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": "#\n\nfrom csv import Dialect\nfrom typing import Union, Sequence, Callable, Dict, Tuple\nimport functools\nimport inspect\nimport os\n\nfrom modin.experimental.core.storage_formats.hdk.query_compiler import (\n DFAlgQueryCompiler,\n)\nfrom modin.core.io import BaseIO\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.dataframe.dataframe import (\n HdkOnNativeDataframe,\n)\nfrom modin.error_message import ErrorMessage\nfrom modin.core.io.text.text_file_dispatcher import TextFileDispatcher\n\nfrom pyarrow.csv import read_csv, ParseOptions, ConvertOptions, ReadOptions\nimport pyarrow as pa\n\nimport pandas\nimport pandas._libs.lib as lib\nfrom pandas.core.dtypes.common import is_list_like\nfrom pandas.io.common import is_url, get_handle\n\nfrom modin.utils import _inherit_docstrings\n\nReadCsvKwargsType = Dict[\n str,\n Union[\n str,\n int,\n bool,\n dict,\n object,\n Sequence,\n Callable,\n Dialect,\n None,\n ],\n]\n\n\nclass ArrowEngineException(Exception):\n \"\"\"Exception raised in case of Arrow engine-specific incompatibilities are found.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO_HdkOnNativeIO.unsupported_args._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO_HdkOnNativeIO.unsupported_args._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 105, "span_ids": ["HdkOnNativeIO"], "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 HdkOnNativeIO(BaseIO, TextFileDispatcher):\n \"\"\"Class contains IO functions implementations with HDK storage format and Native engine.\"\"\"\n\n frame_cls = HdkOnNativeDataframe\n query_compiler_cls = DFAlgQueryCompiler\n\n unsupported_args = [\n \"decimal\",\n \"thousands\",\n \"index_col\",\n \"prefix\",\n \"converters\",\n \"skipfooter\",\n \"nrows\",\n \"skipinitialspace\",\n \"na_values\",\n \"keep_default_na\",\n \"na_filter\",\n \"verbose\",\n \"infer_datetime_format\",\n \"keep_date_col\",\n \"date_parser\",\n \"date_format\",\n \"dayfirst\",\n \"cache_dates\",\n \"iterator\",\n \"chunksize\",\n \"encoding\",\n \"encoding_errors\",\n \"lineterminator\",\n \"dialect\",\n \"quoting\",\n \"comment\",\n \"on_bad_lines\",\n \"low_memory\",\n \"memory_map\",\n \"float_precision\",\n \"storage_options\",\n \"dtype_backend\",\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.read_csv_HdkOnNativeIO.read_csv.try_.except_.return.super_read_csv_kwargs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.read_csv_HdkOnNativeIO.read_csv.try_.except_.return.super_read_csv_kwargs", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 273, "span_ids": ["HdkOnNativeIO.read_csv"], "tokens": 1288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n def read_csv(cls, **kwargs): # noqa: PR01\n \"\"\"\n Read csv data according to the passed `kwargs` parameters.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler with imported data for further processing.\n\n Notes\n -----\n Reading performed by using of `pyarrow.read_csv` function.\n \"\"\"\n if eng := kwargs[\"engine\"]:\n eng = eng.lower().strip()\n try:\n if eng in (\"pandas\", \"c\"):\n return super().read_csv(**kwargs)\n\n cls._validate_read_csv_kwargs(kwargs)\n use_modin_impl, error_message = cls._read_csv_check_support(\n kwargs,\n )\n if not use_modin_impl:\n raise ArrowEngineException(error_message)\n\n if (names := kwargs[\"names\"]) is lib.no_default:\n names = None\n skiprows = kwargs[\"skiprows\"]\n if names and kwargs[\"header\"] == 0:\n skiprows = skiprows + 1 if skiprows is not None else 1\n\n @functools.lru_cache(maxsize=None)\n def get_col_names():\n # Using pandas to read the column names\n return pandas.read_csv(\n kwargs[\"filepath_or_buffer\"], nrows=0, engine=\"c\"\n ).columns.tolist()\n\n if dtype := kwargs[\"dtype\"]:\n if isinstance(dtype, dict):\n column_types = {c: cls._dtype_to_arrow(t) for c, t in dtype.items()}\n else:\n dtype = cls._dtype_to_arrow(dtype)\n column_types = {name: dtype for name in get_col_names()}\n else:\n column_types = {}\n\n if parse_dates := kwargs[\"parse_dates\"]:\n # Either list of column names or list of column indices is supported.\n if isinstance(parse_dates, list) and (\n all(isinstance(col, str) for col in parse_dates)\n or all(isinstance(col, int) for col in parse_dates)\n ):\n # Pandas uses datetime64[ns] dtype for dates.\n timestamp_dt = pa.timestamp(\"ns\")\n if names and isinstance(parse_dates[0], str):\n # The `names` parameter could be used to override the\n # column names. If new names are specified in `parse_dates`\n # they should be replaced with the real names. Replacing\n # with the column indices first.\n parse_dates = [names.index(name) for name in parse_dates]\n if isinstance(parse_dates[0], int):\n # If column indices are specified, load the column names\n # with pandas and replace the indices with column names.\n column_names = get_col_names()\n parse_dates = [column_names[i] for i in parse_dates]\n for c in parse_dates:\n column_types[c] = timestamp_dt\n elif not isinstance(parse_dates, bool):\n raise NotImplementedError(\n f\"Argument parse_dates={parse_dates} is not supported\"\n )\n\n sep = kwargs[\"sep\"]\n delimiter = kwargs[\"delimiter\"]\n if delimiter is None and sep is not lib.no_default:\n delimiter = sep\n\n usecols_md = cls._prepare_pyarrow_usecols(kwargs)\n\n po = ParseOptions(\n delimiter=\"\\\\s+\" if kwargs[\"delim_whitespace\"] else delimiter,\n quote_char=kwargs[\"quotechar\"],\n double_quote=kwargs[\"doublequote\"],\n escape_char=kwargs[\"escapechar\"],\n newlines_in_values=False,\n ignore_empty_lines=kwargs[\"skip_blank_lines\"],\n )\n true_values = kwargs[\"true_values\"]\n false_values = kwargs[\"false_values\"]\n co = ConvertOptions(\n check_utf8=None,\n column_types=column_types,\n null_values=None,\n # we need to add default true/false_values like Pandas does\n true_values=true_values + [\"TRUE\", \"True\", \"true\"]\n if true_values is not None\n else true_values,\n false_values=false_values + [\"False\", \"FALSE\", \"false\"]\n if false_values is not None\n else false_values,\n # timestamp fields should be handled as strings if parse_dates\n # didn't passed explicitly as an array or a dict\n timestamp_parsers=[\"\"]\n if parse_dates is None or isinstance(parse_dates, bool)\n else None,\n strings_can_be_null=None,\n include_columns=usecols_md,\n include_missing_columns=None,\n auto_dict_encode=None,\n auto_dict_max_cardinality=None,\n )\n ro = ReadOptions(\n use_threads=True,\n block_size=None,\n skip_rows=skiprows,\n column_names=names if names is not lib.no_default else None,\n autogenerate_column_names=None,\n )\n\n at = read_csv(\n kwargs[\"filepath_or_buffer\"],\n read_options=ro,\n parse_options=po,\n convert_options=co,\n )\n\n if names:\n at = at.rename_columns(names)\n else:\n col_names = at.column_names\n col_counts = {}\n for name in col_names:\n col_counts[name] = 1 if name in col_counts else 0\n\n if len(col_names) != len(col_counts):\n for i, name in enumerate(col_names):\n count = col_counts[name]\n if count != 0:\n if count == 1:\n col_counts[name] = 2\n else:\n new_name = f\"{name}.{count - 1}\"\n while new_name in col_counts:\n new_name = f\"{name}.{count}\"\n count += 1\n col_counts[name] = count + 1\n col_names[i] = new_name\n at = at.rename_columns(col_names)\n\n return cls.from_arrow(at)\n except (\n pa.ArrowNotImplementedError,\n pa.ArrowInvalid,\n NotImplementedError,\n ArrowEngineException,\n ) as err:\n if eng in [\"arrow\"]:\n raise\n\n ErrorMessage.warn(\n f\"Failed to read csv {kwargs['filepath_or_buffer']} \"\n + f\"due to error: {err}. Defaulting to pandas.\"\n )\n return super().read_csv(**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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._dtype_to_arrow_HdkOnNativeIO._dtype_to_arrow.if_tname_category_.else_.return.pa_from_numpy_dtype_tname": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._dtype_to_arrow_HdkOnNativeIO._dtype_to_arrow.if_tname_category_.else_.return.pa_from_numpy_dtype_tname", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 275, "end_line": 298, "span_ids": ["HdkOnNativeIO._dtype_to_arrow"], "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 HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n def _dtype_to_arrow(cls, dtype):\n \"\"\"\n Convert `pandas.read_csv` `dtype` parameter into PyArrow compatible type.\n\n Parameters\n ----------\n dtype : str, pandas extension or NumPy dtype\n Data type for data or columns, `pandas.read_csv` `dtype` parameter.\n\n Returns\n -------\n pa.DataType or pa.DictionaryType\n PyArrow compatible type.\n \"\"\"\n if dtype is None:\n return None\n tname = dtype if isinstance(dtype, str) else dtype.name\n if tname == \"category\":\n return pa.dictionary(index_type=pa.int32(), value_type=pa.string())\n elif tname == \"string\":\n return pa.string()\n else:\n return pa.from_numpy_dtype(tname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._prepare_pyarrow_usecols_HdkOnNativeIO.for_k_v_in_inspect_signa.if_v_default_is_not_inspe.read_csv_unsup_defaults_k": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._prepare_pyarrow_usecols_HdkOnNativeIO.for_k_v_in_inspect_signa.if_v_default_is_not_inspe.read_csv_unsup_defaults_k", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 359, "span_ids": ["HdkOnNativeIO._prepare_pyarrow_usecols", "HdkOnNativeIO:9"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n def _prepare_pyarrow_usecols(cls, read_csv_kwargs):\n \"\"\"\n Define `usecols` parameter in the way PyArrow can process it.\n\n Parameters\n ----------\n read_csv_kwargs : dict\n Parameters of read_csv.\n\n Returns\n -------\n list\n Redefined `usecols` parameter.\n \"\"\"\n usecols = read_csv_kwargs[\"usecols\"]\n engine = read_csv_kwargs[\"engine\"]\n usecols_md, usecols_names_dtypes = cls._validate_usecols_arg(usecols)\n if usecols_md:\n empty_pd_df = pandas.read_csv(\n **dict(\n read_csv_kwargs,\n nrows=0,\n skipfooter=0,\n usecols=None,\n engine=None if engine == \"arrow\" else engine,\n )\n )\n column_names = empty_pd_df.columns\n if usecols_names_dtypes == \"string\":\n if usecols_md.issubset(set(column_names)):\n # columns should be sorted because pandas doesn't preserve columns order\n usecols_md = [\n col_name for col_name in column_names if col_name in usecols_md\n ]\n else:\n raise NotImplementedError(\n \"values passed in the `usecols` parameter don't match columns names\"\n )\n elif usecols_names_dtypes == \"integer\":\n # columns should be sorted because pandas doesn't preserve columns order\n usecols_md = sorted(usecols_md)\n if len(column_names) < usecols_md[-1]:\n raise NotImplementedError(\n \"max usecols value is higher than the number of columns\"\n )\n usecols_md = [column_names[i] for i in usecols_md]\n elif callable(usecols_md):\n usecols_md = [\n col_name for col_name in column_names if usecols_md(col_name)\n ]\n else:\n raise NotImplementedError(\"unsupported `usecols` parameter\")\n\n return usecols_md\n\n read_csv_unsup_defaults = {}\n for k, v in inspect.signature(pandas.read_csv).parameters.items():\n if v.default is not inspect.Parameter.empty and k in unsupported_args:\n read_csv_unsup_defaults[k] = v.default", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._read_csv_check_support_HdkOnNativeIO._read_csv_check_support.if_parse_dates_unsupporte.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._read_csv_check_support_HdkOnNativeIO._read_csv_check_support.if_parse_dates_unsupporte.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 442, "span_ids": ["HdkOnNativeIO._read_csv_check_support"], "tokens": 620}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n def _read_csv_check_support(\n cls,\n read_csv_kwargs: ReadCsvKwargsType,\n ) -> Tuple[bool, str]:\n \"\"\"\n Check if passed parameters are supported by current ``modin.pandas.read_csv`` implementation.\n\n Parameters\n ----------\n read_csv_kwargs : dict\n Parameters of read_csv function.\n\n Returns\n -------\n bool\n Whether passed parameters are supported or not.\n str\n Error message that should be raised if user explicitly set `engine=\"arrow\"`.\n \"\"\"\n filepath_or_buffer = read_csv_kwargs[\"filepath_or_buffer\"]\n header = read_csv_kwargs[\"header\"]\n names = read_csv_kwargs[\"names\"]\n engine = read_csv_kwargs[\"engine\"]\n skiprows = read_csv_kwargs[\"skiprows\"]\n delimiter = read_csv_kwargs[\"delimiter\"]\n parse_dates = read_csv_kwargs[\"parse_dates\"]\n\n if read_csv_kwargs[\"compression\"] != \"infer\":\n return (\n False,\n \"read_csv with 'arrow' engine doesn't support explicit compression parameter, compression\"\n + \" must be inferred automatically (supported compression types are gzip and bz2)\",\n )\n\n if isinstance(filepath_or_buffer, str):\n if not os.path.exists(filepath_or_buffer):\n if cls.file_exists(filepath_or_buffer) or is_url(filepath_or_buffer):\n return (\n False,\n \"read_csv with 'arrow' engine supports only local files\",\n )\n else:\n raise FileNotFoundError(\"No such file or directory\")\n elif not cls.pathlib_or_pypath(filepath_or_buffer):\n if hasattr(filepath_or_buffer, \"read\"):\n return (\n False,\n \"read_csv with 'arrow' engine doesn't support file-like objects\",\n )\n else:\n raise ValueError(\n f\"Invalid file path or buffer object type: {type(filepath_or_buffer)}\"\n )\n\n if read_csv_kwargs.get(\"skipfooter\") and read_csv_kwargs.get(\"nrows\"):\n return (False, \"Exception is raised by pandas itself\")\n\n for arg, def_value in cls.read_csv_unsup_defaults.items():\n if read_csv_kwargs[arg] != def_value:\n return (\n False,\n f\"read_csv with 'arrow' engine doesn't support {arg} parameter\",\n )\n if delimiter is not None and read_csv_kwargs[\"delim_whitespace\"]:\n raise ValueError(\n \"Specified a delimiter with both sep and delim_whitespace=True; you can only specify one.\"\n )\n\n parse_dates_unsupported = isinstance(parse_dates, dict) or (\n isinstance(parse_dates, list)\n and any(not isinstance(date, str) for date in parse_dates)\n )\n if parse_dates_unsupported:\n return (\n False,\n (\n \"read_csv with 'arrow' engine supports only bool and \"\n + \"flattened list of string column names for the \"\n + \"'parse_dates' parameter\"\n ),\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._read_csv_check_support.if_names_and_names_lib_HdkOnNativeIO._read_csv_check_support.return.True_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._read_csv_check_support.if_names_and_names_lib_HdkOnNativeIO._read_csv_check_support.return.True_None", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 443, "end_line": 509, "span_ids": ["HdkOnNativeIO._read_csv_check_support"], "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 HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n def _read_csv_check_support(\n cls,\n read_csv_kwargs: ReadCsvKwargsType,\n ) -> Tuple[bool, str]:\n # ... other code\n if names and names != lib.no_default:\n if header not in [None, 0, \"infer\"]:\n return (\n False,\n \"read_csv with 'arrow' engine and provided 'names' parameter supports only 0, None and \"\n + \"'infer' header values\",\n )\n if isinstance(parse_dates, list) and not set(parse_dates).issubset(names):\n raise ValueError(\"Missing column provided to 'parse_dates'\")\n\n empty_pandas_df = pandas.read_csv(\n **dict(\n read_csv_kwargs,\n nrows=0,\n skiprows=None,\n skipfooter=0,\n usecols=None,\n index_col=None,\n names=None,\n parse_dates=None,\n engine=None if engine == \"arrow\" else engine,\n ),\n )\n columns_number = len(empty_pandas_df.columns)\n if columns_number != len(names):\n return (\n False,\n \"read_csv with 'arrow' engine doesn't support names parameter, which length doesn't match \"\n + \"with actual number of columns\",\n )\n else:\n if header not in [0, \"infer\"]:\n return (\n False,\n \"read_csv with 'arrow' engine without 'names' parameter provided supports only 0 and 'infer' \"\n + \"header values\",\n )\n if isinstance(parse_dates, list):\n empty_pandas_df = pandas.read_csv(\n **dict(\n read_csv_kwargs,\n nrows=0,\n skiprows=None,\n skipfooter=0,\n usecols=None,\n index_col=None,\n engine=None if engine == \"arrow\" else engine,\n ),\n )\n if not set(parse_dates).issubset(empty_pandas_df.columns):\n raise ValueError(\"Missing column provided to 'parse_dates'\")\n\n if not read_csv_kwargs[\"skip_blank_lines\"]:\n # in some corner cases empty lines are handled as '',\n # while pandas handles it as NaNs - issue #3084\n return (\n False,\n \"read_csv with 'arrow' engine doesn't support skip_blank_lines = False parameter\",\n )\n\n if skiprows is not None and not isinstance(skiprows, int):\n return (\n False,\n \"read_csv with 'arrow' engine doesn't support non-integer skiprows parameter\",\n )\n\n return True, 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._validate_read_csv_kwargs_HdkOnNativeIO._validate_read_csv_kwargs.if_on_bad_lines_not_in_.raise_ValueError_f_Argume": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO._validate_read_csv_kwargs_HdkOnNativeIO._validate_read_csv_kwargs.if_on_bad_lines_not_in_.raise_ValueError_f_Argume", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 511, "end_line": 547, "span_ids": ["HdkOnNativeIO._validate_read_csv_kwargs"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n def _validate_read_csv_kwargs(\n cls,\n read_csv_kwargs: ReadCsvKwargsType,\n ):\n \"\"\"\n Validate `read_csv` keyword arguments.\n\n Should be done to mimic `pandas.read_csv` behavior.\n\n Parameters\n ----------\n read_csv_kwargs : dict\n Parameters of `read_csv` function.\n \"\"\"\n delimiter = read_csv_kwargs[\"delimiter\"]\n sep = read_csv_kwargs[\"sep\"]\n on_bad_lines = read_csv_kwargs[\"on_bad_lines\"]\n delim_whitespace = read_csv_kwargs[\"delim_whitespace\"]\n\n if delimiter and (sep is not lib.no_default):\n raise ValueError(\n \"Specified a sep and a delimiter; you can only specify one.\"\n )\n\n # Alias sep -> delimiter.\n if delimiter is None:\n delimiter = sep\n\n if delim_whitespace and (delimiter is not lib.no_default):\n raise ValueError(\n \"Specified a delimiter with both sep and \"\n + \"delim_whitespace=True; you can only specify one.\"\n )\n\n if on_bad_lines not in [\"error\", \"warn\", \"skip\", None]:\n raise ValueError(f\"Argument {on_bad_lines} is invalid for on_bad_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.to_csv_HdkOnNativeIO.to_csv.with_get_handle_.pa_csv_write_csv_at_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.to_csv_HdkOnNativeIO.to_csv.with_get_handle_.pa_csv_write_csv_at_out_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 549, "end_line": 649, "span_ids": ["HdkOnNativeIO.to_csv"], "tokens": 865}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n @_inherit_docstrings(BaseIO.to_csv, apilink=\"pandas.to_csv\")\n def to_csv(cls, qc, **kwargs):\n df = qc._modin_frame\n write_opts = pa.csv.WriteOptions(include_header=True, delimiter=\",\")\n for key, value in kwargs.items():\n if value is None:\n pass\n elif key == \"sep\":\n write_opts.delimiter = value\n elif key == \"chunksize\":\n write_opts.batch_size = value\n elif not (\n (key == \"na_rep\" and len(value) == 0)\n or (key == \"decimal\" and value == \".\")\n or (key == \"quotechar\" and value == '\"')\n or (key == \"doublequote\" and value is True)\n or (key == \"encoding\" and value == \"utf-8\")\n or (key == \"lineterminator\" and value == os.linesep)\n or key\n in (\n \"path_or_buf\",\n \"columns\",\n \"header\",\n \"index\",\n \"index_label\",\n \"mode\",\n \"compression\",\n \"errors\",\n \"storage_options\",\n )\n ):\n ErrorMessage.default_to_pandas(f\"Argument {key}={value}\")\n return df.to_pandas().to_csv(**kwargs)\n\n at = df._execute()\n if not isinstance(at, pa.Table):\n return df.to_pandas().to_csv(**kwargs)\n idx_names = df._index_cols\n\n if kwargs.get(\"index\", True):\n if idx_names is None: # Trivial index\n idx_col = pa.array(range(len(df.index)), type=pa.int64())\n at = at.add_column(0, \"\", idx_col)\n if (idx_names := kwargs.get(\"index_label\", None)) is None:\n idx_names = df.index.names\n elif idx_names is False:\n idx_names = [\"\"] * len(df.index.names)\n elif not is_list_like(idx_names):\n idx_names = [idx_names]\n idx_names = [\"\" if n is None else str(n) for n in idx_names]\n at = at.rename_columns(idx_names + df.columns.tolist())\n elif idx_names is not None:\n at = at.drop(idx_names)\n at = at.rename_columns(df.columns.tolist())\n idx_names = None\n else:\n at = at.rename_columns(df.columns.tolist())\n\n if (value := kwargs.get(\"columns\", None)) is not None:\n if idx_names is not None:\n value = idx_names + value\n at = at.select(value)\n\n if (value := kwargs.get(\"header\", None)) is False:\n write_opts.include_header = False\n elif isinstance(value, list):\n if idx_names is not None:\n value = idx_names + value\n at = at.rename_columns(value)\n\n def write_header(out):\n # Using pandas to write the header, because pyarrow\n # writes column names enclosed in double quotes.\n if write_opts.include_header:\n pdf = pandas.DataFrame(columns=at.column_names)\n pdf.to_csv(out, sep=write_opts.delimiter, index=False)\n write_opts.include_header = False\n\n if (path_or_buf := kwargs.get(\"path_or_buf\", None)) is None:\n out = pa.BufferOutputStream()\n write_header(out)\n pa.csv.write_csv(at, out, write_opts)\n return out.getvalue().to_pybytes().decode()\n\n # Pyarrow fails to write in text mode.\n mode = kwargs.get(\"mode\", \"w\").replace(\"t\", \"\")\n if \"b\" not in mode:\n mode += \"b\"\n\n with get_handle(\n path_or_buf=path_or_buf,\n mode=mode,\n errors=kwargs.get(\"errors\", \"strict\"),\n compression=kwargs.get(\"compression\", \"infer\"),\n storage_options=kwargs.get(\"storage_options\", None),\n is_text=False,\n ) as handles:\n out = handles.handle\n write_header(out)\n pa.csv.write_csv(at, out, write_opts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.read_sql_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py_HdkOnNativeIO.read_sql_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 651, "end_line": 663, "span_ids": ["HdkOnNativeIO.read_sql"], "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 HdkOnNativeIO(BaseIO, TextFileDispatcher):\n\n @classmethod\n @_inherit_docstrings(BaseIO.read_sql, apilink=\"pandas.read_sql\")\n def read_sql(cls, **kwargs):\n impl = super(HdkOnNativeIO, cls)\n varnames = impl.read_sql.__code__.co_varnames\n filtered = {k: v for k, v in kwargs.items() if k in varnames}\n if len(filtered) != len(kwargs):\n if unsupported := {\n k: v for k, v in kwargs.items() if k not in filtered and v is not None\n }:\n raise NotImplementedError(f\"Unsupported arguments: {unsupported}\")\n return impl.read_sql(**filtered)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_from_modin_error_message__re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_from_modin_error_message__re", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 32, "span_ids": ["docstring"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.error_message import ErrorMessage\nfrom modin.pandas.utils import is_scalar\nimport numpy as np\n\nfrom modin.core.dataframe.pandas.partitioning.partition_manager import (\n PandasDataframePartitionManager,\n)\nfrom ..dataframe.utils import ColNameCodec\nfrom ..partitioning.partition import HdkOnNativeDataframePartition\nfrom ..db_worker import DbWorker\nfrom ..calcite_builder import CalciteBuilder\nfrom ..calcite_serializer import CalciteSerializer\nfrom modin.config import DoUseCalcite\n\nimport pyarrow\nimport pandas\nimport re", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager.from_arrow_HdkOnNativeDataframePartitionManager.from_arrow.if_not_return_dims_.else_.return.np_array_parts_row_leng": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager.from_arrow_HdkOnNativeDataframePartitionManager.from_arrow.if_not_return_dims_.else_.return.np_array_parts_row_leng", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 128, "span_ids": ["HdkOnNativeDataframePartitionManager.from_arrow"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframePartitionManager(PandasDataframePartitionManager):\n\n @classmethod\n def from_arrow(\n cls, at, return_dims=False, unsupported_cols=None, encode_col_names=True\n ):\n \"\"\"\n Build partitions from a ``pyarrow.Table``.\n\n Parameters\n ----------\n at : pyarrow.Table\n Input table.\n return_dims : bool, default: False\n True to include dimensions into returned tuple.\n unsupported_cols : list of str, optional\n List of columns holding unsupported data. If None then\n check all columns to compute the list.\n encode_col_names : bool, default: True\n Encode column names.\n\n Returns\n -------\n tuple\n Tuple holding array of partitions, list of columns with unsupported\n data and optionally partitions' dimensions.\n \"\"\"\n if encode_col_names:\n encoded_names = [ColNameCodec.encode(n) for n in at.column_names]\n encoded_at = at\n if encoded_names != at.column_names:\n encoded_at = at.rename_columns(encoded_names)\n else:\n encoded_at = at\n\n parts = [[cls._partition_class(encoded_at)]]\n if unsupported_cols is None:\n _, unsupported_cols = cls._get_unsupported_cols(at)\n\n if not return_dims:\n return np.array(parts), unsupported_cols\n else:\n row_lengths = [at.num_rows]\n col_widths = [at.num_columns]\n return np.array(parts), row_lengths, col_widths, unsupported_cols", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._get_unsupported_cols_HdkOnNativeDataframePartitionManager._get_unsupported_cols.if_isinstance_obj_panda.try_.else_.obj.at": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._get_unsupported_cols_HdkOnNativeDataframePartitionManager._get_unsupported_cols.if_isinstance_obj_panda.try_.else_.obj.at", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 232, "span_ids": ["HdkOnNativeDataframePartitionManager._get_unsupported_cols"], "tokens": 589}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframePartitionManager(PandasDataframePartitionManager):\n\n @classmethod\n def _get_unsupported_cols(cls, obj):\n \"\"\"\n Return a list of columns with unsupported by HDK data types.\n\n Parameters\n ----------\n obj : pandas.DataFrame or pyarrow.Table\n Object to inspect on unsupported column types.\n\n Returns\n -------\n tuple\n Arrow representation of `obj` (for future using) and a list of\n unsupported columns.\n \"\"\"\n if isinstance(obj, (pandas.Series, pandas.DataFrame)):\n # picking first rows from cols with `dtype=\"object\"` to check its actual type,\n # in case of homogen columns that saves us unnecessary convertion to arrow table\n\n if obj.empty:\n unsupported_cols = []\n elif isinstance(obj.columns, pandas.MultiIndex):\n unsupported_cols = [str(c) for c in obj.columns]\n else:\n cols = [name for name, col in obj.dtypes.items() if col == \"object\"]\n type_samples = obj.iloc[0][cols]\n unsupported_cols = [\n name\n for name, col in type_samples.items()\n if not isinstance(col, str)\n and not (is_scalar(col) and pandas.isna(col))\n ]\n\n if len(unsupported_cols) > 0:\n return None, unsupported_cols\n\n try:\n at = pyarrow.Table.from_pandas(obj, preserve_index=False)\n except (\n pyarrow.lib.ArrowTypeError,\n pyarrow.lib.ArrowInvalid,\n ValueError,\n TypeError,\n ) as err:\n # The TypeError could be raised when converting a sparse data to\n # arrow table - https://github.com/apache/arrow/pull/4497. If this\n # is the case - fall back to pandas, otherwise - rethrow the error.\n if type(err) == TypeError:\n if any([isinstance(t, pandas.SparseDtype) for t in obj.dtypes]):\n ErrorMessage.single_warning(\n \"Sparse data is not currently supported!\"\n )\n else:\n raise err\n\n # The ValueError is raised by pyarrow in case of duplicate columns.\n # We catch and handle this error here. If there are no duplicates\n # (is_unique is True), then the error is caused by something different\n # and we just rethrow it.\n if (type(err) == ValueError) and obj.columns.is_unique:\n raise err\n\n regex = r\"Conversion failed for column ([^\\W]*)\"\n unsupported_cols = []\n for msg in err.args:\n match = re.findall(regex, msg)\n unsupported_cols.extend(match)\n\n if len(unsupported_cols) == 0:\n unsupported_cols = obj.columns\n return None, unsupported_cols\n else:\n obj = at\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._get_unsupported_cols.is_supported_dtype_HdkOnNativeDataframePartitionManager._get_unsupported_cols.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._get_unsupported_cols.is_supported_dtype_HdkOnNativeDataframePartitionManager._get_unsupported_cols.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 234, "end_line": 256, "span_ids": ["HdkOnNativeDataframePartitionManager._get_unsupported_cols"], "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 HdkOnNativeDataframePartitionManager(PandasDataframePartitionManager):\n\n @classmethod\n def _get_unsupported_cols(cls, obj):\n # ... other code\n\n def is_supported_dtype(dtype):\n \"\"\"Check whether the passed pyarrow `dtype` is supported by HDK.\"\"\"\n if (\n pyarrow.types.is_string(dtype)\n or pyarrow.types.is_time(dtype)\n or pyarrow.types.is_dictionary(dtype)\n or pyarrow.types.is_null(dtype)\n ):\n return True\n if isinstance(dtype, pyarrow.ExtensionType) or pyarrow.types.is_duration(\n dtype\n ):\n return False\n try:\n pandas_dtype = dtype.to_pandas_dtype()\n return pandas_dtype != np.dtype(\"O\")\n except NotImplementedError:\n return False\n\n return (\n obj,\n [field.name for field in obj.schema if not is_supported_dtype(field.type)],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager.run_exec_plan_HdkOnNativeDataframePartitionManager.run_exec_plan.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager.run_exec_plan_HdkOnNativeDataframePartitionManager.run_exec_plan.return.res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 291, "span_ids": ["HdkOnNativeDataframePartitionManager.run_exec_plan"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframePartitionManager(PandasDataframePartitionManager):\n\n @classmethod\n def run_exec_plan(cls, plan, columns):\n \"\"\"\n Run execution plan in HDK storage format to materialize frame.\n\n Parameters\n ----------\n plan : DFAlgNode\n A root of an execution plan tree.\n columns : list of str\n A frame column names.\n\n Returns\n -------\n np.array\n Created frame's partitions.\n \"\"\"\n omniSession = DbWorker()\n\n # First step is to make sure all partitions are in HDK.\n frames = plan.collect_frames()\n for frame in frames:\n for p in frame._partitions.flatten():\n if p.frame_id is None:\n obj = p.get()\n if isinstance(obj, (pandas.DataFrame, pandas.Series)):\n p.frame_id = omniSession.import_pandas_dataframe(obj)\n else:\n assert isinstance(obj, pyarrow.Table)\n if obj.num_columns == 0:\n # Tables without columns are not supported.\n # Creating an empty table with index columns only.\n idx_names = (\n frame.index.names\n if frame.has_materialized_index\n else [None]\n )\n idx_names = ColNameCodec.mangle_index_names(idx_names)\n obj = pyarrow.table(\n {n: [] for n in idx_names},\n schema=pyarrow.schema(\n {n: pyarrow.int64() for n in idx_names}\n ),\n )\n p.frame_id = omniSession.import_arrow_table(obj)\n\n calcite_plan = CalciteBuilder().build(plan)\n calcite_json = CalciteSerializer().serialize(calcite_plan)\n\n cmd_prefix = \"execute relalg \"\n\n if DoUseCalcite.get():\n cmd_prefix = \"execute calcite \"\n\n at = omniSession.executeRA(cmd_prefix + calcite_json)\n\n res = np.empty((1, 1), dtype=np.dtype(object))\n # workaround for https://github.com/modin-project/modin/issues/1851\n if DoUseCalcite.get():\n at = at.rename_columns([ColNameCodec.encode(c) for c in columns])\n res[0][0] = cls._partition_class(at)\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._names_from_index_cols_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager._names_from_index_cols_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 326, "end_line": 385, "span_ids": ["HdkOnNativeDataframePartitionManager._name_from_index_col", "HdkOnNativeDataframePartitionManager._names_from_index_cols", "HdkOnNativeDataframePartitionManager._maybe_scalar"], "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 HdkOnNativeDataframePartitionManager(PandasDataframePartitionManager):\n\n @classmethod\n def _names_from_index_cols(cls, cols):\n \"\"\"\n Get index labels.\n\n Deprecated.\n\n Parameters\n ----------\n cols : list of str\n Index columns.\n\n Returns\n -------\n list of str\n \"\"\"\n if len(cols) == 1:\n return cls._name_from_index_col(cols[0])\n return [cls._name_from_index_col(n) for n in cols]\n\n @classmethod\n def _name_from_index_col(cls, col):\n \"\"\"\n Get index label.\n\n Deprecated.\n\n Parameters\n ----------\n col : str\n Index column.\n\n Returns\n -------\n str\n \"\"\"\n if col.startswith(ColNameCodec.IDX_COL_NAME):\n return None\n return col\n\n @classmethod\n def _maybe_scalar(cls, lst):\n \"\"\"\n Transform list with a single element to scalar.\n\n Deprecated.\n\n Parameters\n ----------\n lst : list\n Input list.\n\n Returns\n -------\n Any\n \"\"\"\n if len(lst) == 1:\n return lst[0]\n return lst", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_os_pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_os_pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 64, "span_ids": ["docstring"], "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": "import os\nimport pandas\nimport numpy as np\nimport pyarrow\nimport pytest\nimport re\n\nfrom pandas._testing import ensure_clean\n\nfrom modin.config import StorageFormat, DoUseCalcite\nfrom modin.pandas.test.utils import (\n io_ops_bad_exc,\n default_to_pandas_ignore_string,\n random_state,\n test_data,\n)\nfrom modin.test.interchange.dataframe_protocol.hdk.utils import split_df_into_chunks\nfrom .utils import eval_io, ForceHdkImport, set_execution_mode, run_and_compare\nfrom pandas.core.dtypes.common import is_list_like\n\nStorageFormat.put(\"hdk\")\n\nimport modin.pandas as pd\nfrom modin.pandas.test.utils import (\n df_equals,\n bool_arg_values,\n to_pandas,\n test_data_values,\n test_data_keys,\n generate_multiindex,\n eval_general,\n df_equals_with_non_stable_indices,\n time_parsing_csv_path,\n)\nfrom modin.utils import try_cast_to_pandas\nfrom modin.pandas.utils import from_arrow\n\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.partitioning.partition_manager import (\n HdkOnNativeDataframePartitionManager,\n)\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.df_algebra import (\n FrameNode,\n)\n\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV_TestCSV.boston_housing_dtypes._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV_TestCSV.boston_housing_dtypes._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 108, "span_ids": ["TestCSV"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n from modin import __file__ as modin_root\n\n root = os.path.dirname(\n os.path.dirname(os.path.abspath(modin_root)) + \"..\"\n ) # root of modin repo\n\n boston_housing_names = [\n \"index\",\n \"CRIM\",\n \"ZN\",\n \"INDUS\",\n \"CHAS\",\n \"NOX\",\n \"RM\",\n \"AGE\",\n \"DIS\",\n \"RAD\",\n \"TAX\",\n \"PTRATIO\",\n \"B\",\n \"LSTAT\",\n \"PRICE\",\n ]\n boston_housing_dtypes = {\n \"index\": \"int64\",\n \"CRIM\": \"float64\",\n \"ZN\": \"float64\",\n \"INDUS\": \"float64\",\n \"CHAS\": \"float64\",\n \"NOX\": \"float64\",\n \"RM\": \"float64\",\n \"AGE\": \"float64\",\n \"DIS\": \"float64\",\n \"RAD\": \"float64\",\n \"TAX\": \"float64\",\n \"PTRATIO\": \"float64\",\n \"B\": \"float64\",\n \"LSTAT\": \"float64\",\n \"PRICE\": \"float64\",\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_usecols_csv_TestCSV.test_usecols_csv.for_kwargs_in_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_usecols_csv_TestCSV.test_usecols_csv.for_kwargs_in_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 110, "end_line": 127, "span_ids": ["TestCSV.test_usecols_csv"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n def test_usecols_csv(self):\n \"\"\"check with the following arguments: names, dtype, skiprows, delimiter\"\"\"\n csv_file = os.path.join(self.root, \"modin/pandas/test/data\", \"test_usecols.csv\")\n\n for kwargs in (\n {\"delimiter\": \",\"},\n {\"sep\": None},\n {\"skiprows\": 1, \"names\": [\"A\", \"B\", \"C\", \"D\", \"E\"]},\n {\"dtype\": {\"a\": \"int32\", \"e\": \"string\"}},\n {\"dtype\": {\"a\": np.dtype(\"int32\"), \"b\": np.dtype(\"int64\"), \"e\": \"string\"}},\n ):\n eval_io(\n fn_name=\"read_csv\",\n md_extra_kwargs={\"engine\": \"arrow\"},\n # read_csv kwargs\n filepath_or_buffer=csv_file,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_housing_csv_TestCSV.test_housing_csv.for_kwargs_in_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_housing_csv_TestCSV.test_housing_csv.for_kwargs_in_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 144, "span_ids": ["TestCSV.test_housing_csv"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n def test_housing_csv(self):\n csv_file = os.path.join(self.root, \"examples/data/boston_housing.csv\")\n for kwargs in (\n {\n \"skiprows\": 1,\n \"names\": self.boston_housing_names,\n \"dtype\": self.boston_housing_dtypes,\n },\n ):\n eval_io(\n fn_name=\"read_csv\",\n md_extra_kwargs={\"engine\": \"arrow\"},\n # read_csv kwargs\n filepath_or_buffer=csv_file,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_time_parsing_TestCSV.test_time_parsing.for_kwargs_in_.with_ForceHdkImport_rm_.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_time_parsing_TestCSV.test_time_parsing.for_kwargs_in_.with_ForceHdkImport_rm_.None_3", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 146, "end_line": 175, "span_ids": ["TestCSV.test_time_parsing"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n def test_time_parsing(self):\n csv_file = os.path.join(self.root, time_parsing_csv_path)\n for kwargs in (\n {\n \"skiprows\": 1,\n \"names\": [\n \"timestamp\",\n \"year\",\n \"month\",\n \"date\",\n \"symbol\",\n \"high\",\n \"low\",\n \"open\",\n \"close\",\n \"spread\",\n \"volume\",\n ],\n \"parse_dates\": [\"timestamp\"],\n \"dtype\": {\"symbol\": \"string\"},\n },\n ):\n rp = pandas.read_csv(csv_file, **kwargs)\n rm = pd.read_csv(csv_file, engine=\"arrow\", **kwargs)\n with ForceHdkImport(rm):\n rm = to_pandas(rm)\n df_equals(rm[\"timestamp\"].dt.year, rp[\"timestamp\"].dt.year)\n df_equals(rm[\"timestamp\"].dt.month, rp[\"timestamp\"].dt.month)\n df_equals(rm[\"timestamp\"].dt.day, rp[\"timestamp\"].dt.day)\n df_equals(rm[\"timestamp\"].dt.hour, rp[\"timestamp\"].dt.hour)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_csv_fillna_TestCSV.test_csv_fillna.for_kwargs_in_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_csv_fillna_TestCSV.test_csv_fillna.for_kwargs_in_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 195, "span_ids": ["TestCSV.test_csv_fillna"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n def test_csv_fillna(self):\n csv_file = os.path.join(self.root, \"examples/data/boston_housing.csv\")\n for kwargs in (\n {\n \"skiprows\": 1,\n \"names\": self.boston_housing_names,\n \"dtype\": self.boston_housing_dtypes,\n },\n ):\n eval_io(\n fn_name=\"read_csv\",\n md_extra_kwargs={\"engine\": \"arrow\"},\n comparator=lambda df1, df2: df_equals(\n df1[\"CRIM\"].fillna(1000), df2[\"CRIM\"].fillna(1000)\n ),\n # read_csv kwargs\n filepath_or_buffer=csv_file,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_null_col_TestCSV.test_null_col.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_null_col_TestCSV.test_null_col.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 197, "end_line": 228, "span_ids": ["TestCSV.test_null_col"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n @pytest.mark.parametrize(\"null_dtype\", [\"category\", \"float64\"])\n def test_null_col(self, null_dtype):\n csv_file = os.path.join(\n self.root, \"modin/pandas/test/data\", \"test_null_col.csv\"\n )\n ref = pandas.read_csv(\n csv_file,\n names=[\"a\", \"b\", \"c\"],\n dtype={\"a\": \"int64\", \"b\": \"int64\", \"c\": null_dtype},\n skiprows=1,\n )\n ref[\"a\"] = ref[\"a\"] + ref[\"b\"]\n\n exp = pd.read_csv(\n csv_file,\n names=[\"a\", \"b\", \"c\"],\n dtype={\"a\": \"int64\", \"b\": \"int64\", \"c\": null_dtype},\n skiprows=1,\n )\n exp[\"a\"] = exp[\"a\"] + exp[\"b\"]\n\n # df_equals cannot compare empty categories\n if null_dtype == \"category\":\n ref[\"c\"] = ref[\"c\"].astype(\"string\")\n with ForceHdkImport(exp):\n exp = to_pandas(exp)\n exp[\"c\"] = exp[\"c\"].astype(\"string\")\n # The arrow table contains empty strings, when reading as category.\n assert all(v == \"\" for v in exp[\"c\"])\n exp[\"c\"] = None\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_and_concat_TestCSV.test_read_and_concat.with_ForceHdkImport_exp_.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_and_concat_TestCSV.test_read_and_concat.with_ForceHdkImport_exp_.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 240, "span_ids": ["TestCSV.test_read_and_concat"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n def test_read_and_concat(self):\n csv_file = os.path.join(self.root, \"modin/pandas/test/data\", \"test_usecols.csv\")\n ref1 = pandas.read_csv(csv_file)\n ref2 = pandas.read_csv(csv_file)\n ref = pandas.concat([ref1, ref2])\n\n exp1 = pandas.read_csv(csv_file)\n exp2 = pandas.read_csv(csv_file)\n exp = pd.concat([exp1, exp2])\n with ForceHdkImport(exp):\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_from_csv_TestCSV.test_sep_delimiter.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_from_csv_TestCSV.test_sep_delimiter.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 262, "span_ids": ["TestCSV.test_from_csv", "TestCSV.test_sep_delimiter"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n @pytest.mark.parametrize(\"names\", [None, [\"a\", \"b\", \"c\", \"d\", \"e\"]])\n @pytest.mark.parametrize(\"header\", [None, 0])\n def test_from_csv(self, header, names):\n csv_file = os.path.join(self.root, \"modin/pandas/test/data\", \"test_usecols.csv\")\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=csv_file,\n header=header,\n names=names,\n )\n\n @pytest.mark.parametrize(\"kwargs\", [{\"sep\": \"|\"}, {\"delimiter\": \"|\"}])\n def test_sep_delimiter(self, kwargs):\n csv_file = os.path.join(self.root, \"modin/pandas/test/data\", \"test_delim.csv\")\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=csv_file,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_float32_TestCSV._Datetime_Handling_tests": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_float32_TestCSV._Datetime_Handling_tests", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 279, "span_ids": ["TestCSV.test_float32"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n @pytest.mark.skip(reason=\"https://github.com/modin-project/modin/issues/2174\")\n def test_float32(self):\n csv_file = os.path.join(self.root, \"modin/pandas/test/data\", \"test_usecols.csv\")\n kwargs = {\n \"dtype\": {\"a\": \"float32\", \"b\": \"float32\"},\n }\n\n pandas_df = pandas.read_csv(csv_file, **kwargs)\n pandas_df[\"a\"] = pandas_df[\"a\"] + pandas_df[\"b\"]\n\n modin_df = pd.read_csv(csv_file, **kwargs, engine=\"arrow\")\n modin_df[\"a\"] = modin_df[\"a\"] + modin_df[\"b\"]\n with ForceHdkImport(modin_df):\n df_equals(modin_df, pandas_df)\n\n # Datetime Handling 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_datetime_TestCSV.test_read_csv_datetime.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_datetime_TestCSV.test_read_csv_datetime.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 280, "end_line": 322, "span_ids": ["TestCSV.test_read_csv_datetime"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n @pytest.mark.parametrize(\"engine\", [None, \"arrow\"])\n @pytest.mark.parametrize(\n \"parse_dates\",\n [\n True,\n False,\n [\"col2\"],\n [\"c2\"],\n [[\"col2\", \"col3\"]],\n {\"col23\": [\"col2\", \"col3\"]},\n [],\n ],\n )\n @pytest.mark.parametrize(\"names\", [None, [f\"c{x}\" for x in range(1, 7)]])\n def test_read_csv_datetime(\n self,\n engine,\n parse_dates,\n names,\n ):\n parse_dates_unsupported = isinstance(parse_dates, dict) or (\n isinstance(parse_dates, list)\n and any(not isinstance(date, str) for date in parse_dates)\n )\n if parse_dates_unsupported and engine == \"arrow\" and not names:\n pytest.skip(\n \"In these cases Modin raises `ArrowEngineException` while pandas \"\n + \"doesn't raise any exceptions that causes tests fails\"\n )\n # In these cases Modin raises `ArrowEngineException` while pandas\n # raises `ValueError`, so skipping exception type checking\n skip_exc_type_check = parse_dates_unsupported and engine == \"arrow\"\n\n eval_io(\n fn_name=\"read_csv\",\n md_extra_kwargs={\"engine\": engine},\n check_exception_type=not skip_exc_type_check,\n raising_exceptions=None if skip_exc_type_check else io_ops_bad_exc,\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n parse_dates=parse_dates,\n names=names,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_datetime_tz_TestCSV.test_read_csv_datetime_tz.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_datetime_tz_TestCSV.test_read_csv_datetime_tz.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 324, "end_line": 336, "span_ids": ["TestCSV.test_read_csv_datetime_tz"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n @pytest.mark.parametrize(\"engine\", [None, \"arrow\"])\n @pytest.mark.parametrize(\"parse_dates\", [None, True, False])\n def test_read_csv_datetime_tz(self, engine, parse_dates):\n with ensure_clean(\".csv\") as file:\n with open(file, \"w\") as f:\n f.write(\"test\\n2023-01-01T00:00:00.000-07:00\")\n\n eval_io(\n fn_name=\"read_csv\",\n filepath_or_buffer=file,\n md_extra_kwargs={\"engine\": engine},\n parse_dates=parse_dates,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_col_handling_TestCSV.test_read_csv_col_handling.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_col_handling_TestCSV.test_read_csv_col_handling.eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 338, "end_line": 366, "span_ids": ["TestCSV.test_read_csv_col_handling"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n @pytest.mark.parametrize(\"engine\", [None, \"arrow\"])\n @pytest.mark.parametrize(\n \"usecols\",\n [\n None,\n [\"col1\"],\n [\"col1\", \"col1\"],\n [\"col1\", \"col2\", \"col6\"],\n [\"col6\", \"col2\", \"col1\"],\n [0],\n [0, 0],\n [0, 1, 5],\n [5, 1, 0],\n lambda x: x in [\"col1\", \"col2\"],\n ],\n )\n def test_read_csv_col_handling(\n self,\n engine,\n usecols,\n ):\n eval_io(\n fn_name=\"read_csv\",\n check_kwargs_callable=not callable(usecols),\n md_extra_kwargs={\"engine\": engine},\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n usecols=usecols,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_duplicate_cols_TestCSV.test_read_csv_duplicate_cols.run_and_compare_test_dat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCSV.test_read_csv_duplicate_cols_TestCSV.test_read_csv_duplicate_cols.run_and_compare_test_dat", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 368, "end_line": 392, "span_ids": ["TestCSV.test_read_csv_duplicate_cols"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\nclass TestCSV:\n\n @pytest.mark.parametrize(\n \"cols\",\n [\n \"c1,c2,c3\",\n \"c1,c1,c2\",\n \"c1,c1,c1.1,c1.2,c1\",\n \"c1,c1,c1,c1.1,c1.2,c1.3\",\n \"c1.1,c1.2,c1.3,c1,c1,c1\",\n \"c1.1,c1,c1.2,c1,c1.3,c1\",\n \"c1,c1.1,c1,c1.2,c1,c1.3\",\n \"c1,c1,c1.1,c1.1,c1.2,c2\",\n \"c1,c1,c1.1,c1.1,c1.2,c1.2,c2\",\n \"c1.1,c1.1,c1,c1,c1.2,c1.2,c2\",\n \"c1.1,c1,c1.1,c1,c1.1,c1.2,c1.2,c2\",\n ],\n )\n def test_read_csv_duplicate_cols(self, cols):\n def test(df, lib, **kwargs):\n data = f\"{cols}\\n\"\n with ensure_clean(\".csv\") as fname:\n with open(fname, \"w\") as f:\n f.write(data)\n return lib.read_csv(fname)\n\n run_and_compare(test, data={})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMasks_TestMasks.test_filter_str_categorical.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMasks_TestMasks.test_filter_str_categorical.None_1", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 395, "end_line": 473, "span_ids": ["TestMasks.test_drop_index", "TestMasks.test_filter_with_index", "TestMasks.test_filter", "TestMasks.test_filter_proj", "TestMasks.test_filter_str_categorical", "TestMasks.test_projection", "TestMasks", "TestMasks.test_filter_drop", "TestMasks.test_drop", "TestMasks.test_iloc", "TestMasks.test_empty"], "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": "class TestMasks:\n data = {\n \"a\": [1, 1, 2, 2, 3],\n \"b\": [None, None, 2, 1, 3],\n \"c\": [3, None, None, 2, 1],\n }\n cols_values = [\"a\", [\"a\", \"b\"], [\"a\", \"b\", \"c\"]]\n\n @pytest.mark.parametrize(\"cols\", cols_values)\n def test_projection(self, cols):\n def projection(df, cols, **kwargs):\n return df[cols]\n\n run_and_compare(projection, data=self.data, cols=cols)\n\n def test_drop(self):\n def drop(df, column_names, **kwargs):\n return df.drop(columns=column_names)\n\n run_and_compare(drop, data=self.data, column_names=\"a\")\n run_and_compare(drop, data=self.data, column_names=self.data.keys())\n\n def test_drop_index(self):\n def drop(df, **kwargs):\n return df.drop(df.index[0])\n\n idx = list(map(str, self.data[\"a\"]))\n run_and_compare(\n drop, data=self.data, constructor_kwargs={\"index\": idx}, force_lazy=False\n )\n\n def test_iloc(self):\n def mask(df, **kwargs):\n return df.iloc[[0, 1]]\n\n run_and_compare(mask, data=self.data, allow_subqueries=True)\n\n def test_empty(self):\n def empty(df, **kwargs):\n return df\n\n run_and_compare(empty, data=None)\n\n def test_filter(self):\n def filter(df, **kwargs):\n return df[df[\"a\"] == 1]\n\n run_and_compare(filter, data=self.data)\n\n def test_filter_with_index(self):\n def filter(df, **kwargs):\n df = df.groupby(\"a\").sum()\n return df[df[\"b\"] > 1]\n\n run_and_compare(filter, data=self.data)\n\n def test_filter_proj(self):\n def filter(df, **kwargs):\n df1 = df + 2\n return df1[(df[\"a\"] + df1[\"b\"]) > 1]\n\n run_and_compare(filter, data=self.data)\n\n def test_filter_drop(self):\n def filter(df, **kwargs):\n df = df[[\"a\", \"b\"]]\n df = df[df[\"a\"] != 1]\n df[\"a\"] = df[\"a\"] * df[\"b\"]\n return df\n\n run_and_compare(filter, data=self.data)\n\n def test_filter_str_categorical(self):\n def filter(df, **kwargs):\n return df[df[\"A\"] != \"\"]\n\n data = {\"A\": [\"A\", \"B\", \"C\"]}\n run_and_compare(filter, data=data)\n run_and_compare(filter, data=data, constructor_kwargs={\"dtype\": \"category\"})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex_TestMultiIndex.test_dup_names.df_equals_pandas_df_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex_TestMultiIndex.test_dup_names.df_equals_pandas_df_modi", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 476, "end_line": 488, "span_ids": ["TestMultiIndex.test_dup_names", "TestMultiIndex"], "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 TestMultiIndex:\n data = {\"a\": np.arange(24), \"b\": np.arange(24)}\n\n @pytest.mark.parametrize(\"names\", [None, [\"\", \"\"], [\"name\", \"name\"]])\n def test_dup_names(self, names):\n index = pandas.MultiIndex.from_tuples(\n [(i, j) for i in range(3) for j in range(8)], names=names\n )\n\n pandas_df = pandas.DataFrame(self.data, index=index) + 1\n modin_df = pd.DataFrame(self.data, index=index) + 1\n\n df_equals(pandas_df, modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_reset_index_TestMultiIndex.test_reset_index.eval_general_pd_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_reset_index_TestMultiIndex.test_reset_index.eval_general_pd_pandas_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 490, "end_line": 510, "span_ids": ["TestMultiIndex.test_reset_index"], "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 TestMultiIndex:\n\n @pytest.mark.parametrize(\n \"names\",\n [\n None,\n [None, \"s\", None],\n [\"i1\", \"i2\", \"i3\"],\n [\"i1\", \"i1\", \"i3\"],\n [\"i1\", \"i2\", \"a\"],\n ],\n )\n def test_reset_index(self, names):\n index = pandas.MultiIndex.from_tuples(\n [(i, j, k) for i in range(2) for j in range(3) for k in range(4)],\n names=names,\n )\n\n def applier(lib):\n df = lib.DataFrame(self.data, index=index) + 1\n return df.reset_index()\n\n eval_general(pd, pandas, applier)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_reset_index_multicolumns_TestMultiIndex.test_reset_index_multicolumns.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_reset_index_multicolumns_TestMultiIndex.test_reset_index_multicolumns.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 512, "end_line": 532, "span_ids": ["TestMultiIndex.test_reset_index_multicolumns"], "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 TestMultiIndex:\n\n @pytest.mark.parametrize(\"is_multiindex\", [True, False])\n def test_reset_index_multicolumns(self, is_multiindex):\n index = (\n pandas.MultiIndex.from_tuples(\n [(i, j, k) for i in range(2) for j in range(3) for k in range(4)],\n names=[\"l1\", \"l2\", \"l3\"],\n )\n if is_multiindex\n else pandas.Index(np.arange(1, len(self.data[\"a\"]) + 1), name=\"index\")\n )\n data = np.array(list(self.data.values())).T\n\n def applier(df, **kwargs):\n df = df + 1\n return df.reset_index(drop=False)\n\n run_and_compare(\n fn=applier,\n data=data,\n constructor_kwargs={\"index\": index},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_set_index_name_TestMultiIndex.test_set_index_names.df_equals_pandas_df_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_set_index_name_TestMultiIndex.test_set_index_names.df_equals_pandas_df_modi", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 534, "end_line": 556, "span_ids": ["TestMultiIndex.test_set_index_names", "TestMultiIndex.test_set_index_name"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMultiIndex:\n\n def test_set_index_name(self):\n index = pandas.Index.__new__(pandas.Index, data=[i for i in range(24)])\n\n pandas_df = pandas.DataFrame(self.data, index=index)\n pandas_df.index.name = \"new_name\"\n modin_df = pd.DataFrame(self.data, index=index)\n modin_df._query_compiler.set_index_name(\"new_name\")\n\n df_equals(pandas_df, modin_df)\n\n def test_set_index_names(self):\n index = pandas.MultiIndex.from_tuples(\n [(i, j, k) for i in range(2) for j in range(3) for k in range(4)]\n )\n\n pandas_df = pandas.DataFrame(self.data, index=index)\n pandas_df.index.names = [\"new_name1\", \"new_name2\", \"new_name3\"]\n modin_df = pd.DataFrame(self.data, index=index)\n modin_df._query_compiler.set_index_names(\n [\"new_name1\", \"new_name2\", \"new_name3\"]\n )\n\n df_equals(pandas_df, modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_rename_TestMultiIndex.test_rename.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMultiIndex.test_rename_TestMultiIndex.test_rename.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 558, "end_line": 577, "span_ids": ["TestMultiIndex.test_rename"], "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 TestMultiIndex:\n\n def test_rename(self):\n index = pandas.MultiIndex.from_tuples(\n [(\"foo1\", \"bar1\"), (\"foo2\", \"bar2\")], names=[\"foo\", \"bar\"]\n )\n columns = pandas.MultiIndex.from_tuples(\n [(\"fizz1\", \"buzz1\"), (\"fizz2\", \"buzz2\")], names=[\"fizz\", \"buzz\"]\n )\n\n def rename(df, **kwargs):\n return df.rename(\n index={\"foo1\": \"foo3\", \"bar2\": \"bar3\"},\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"},\n )\n\n run_and_compare(\n fn=rename,\n data=[(0, 0), (1, 1)],\n constructor_kwargs={\"index\": index, \"columns\": columns},\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestFillna_TestFillna.test_fillna_bool.run_and_compare_fillna_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestFillna_TestFillna.test_fillna_bool.run_and_compare_fillna_d", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 580, "end_line": 597, "span_ids": ["TestFillna.test_fillna_all", "TestFillna", "TestFillna.test_fillna_bool"], "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 TestFillna:\n data = {\"a\": [1, 1, None], \"b\": [None, None, 2], \"c\": [3, None, None]}\n values = [1, {\"a\": 1, \"c\": 3}, {\"a\": 1, \"b\": 2, \"c\": 3}]\n\n @pytest.mark.parametrize(\"value\", values)\n def test_fillna_all(self, value):\n def fillna(df, value, **kwargs):\n return df.fillna(value)\n\n run_and_compare(fillna, data=self.data, value=value)\n\n def test_fillna_bool(self):\n def fillna(df, **kwargs):\n df[\"a\"] = df[\"a\"] == 1\n df[\"a\"] = df[\"a\"].fillna(False)\n return df\n\n run_and_compare(fillna, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat_TestConcat.data3._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat_TestConcat.data3._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 600, "end_line": 617, "span_ids": ["TestConcat"], "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 TestConcat:\n data = {\n \"a\": [1, 2, 3],\n \"b\": [10, 20, 30],\n \"d\": [1000, 2000, 3000],\n \"e\": [11, 22, 33],\n }\n data2 = {\n \"a\": [4, 5, 6],\n \"c\": [400, 500, 600],\n \"b\": [40, 50, 60],\n \"f\": [444, 555, 666],\n }\n data3 = {\n \"f\": [2, 3, 4],\n \"g\": [400, 500, 600],\n \"h\": [20, 30, 40],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_TestConcat.test_concat_with_same_df.run_and_compare_concat_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_TestConcat.test_concat_with_same_df.run_and_compare_concat_d", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 619, "end_line": 642, "span_ids": ["TestConcat.test_concat", "TestConcat.test_concat_with_same_df"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestConcat:\n\n @pytest.mark.parametrize(\"join\", [\"inner\", \"outer\"])\n @pytest.mark.parametrize(\"sort\", bool_arg_values)\n @pytest.mark.parametrize(\"ignore_index\", bool_arg_values)\n def test_concat(self, join, sort, ignore_index):\n def concat(lib, df1, df2, join, sort, ignore_index):\n return lib.concat(\n [df1, df2], join=join, sort=sort, ignore_index=ignore_index\n )\n\n run_and_compare(\n concat,\n data=self.data,\n data2=self.data2,\n join=join,\n sort=sort,\n ignore_index=ignore_index,\n )\n\n def test_concat_with_same_df(self):\n def concat(df, **kwargs):\n df[\"f\"] = df[\"a\"]\n return df\n\n run_and_compare(concat, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_setitem_lazy_TestConcat.test_setitem_lazy.run_and_compare_applier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_setitem_lazy_TestConcat.test_setitem_lazy.run_and_compare_applier_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 644, "end_line": 658, "span_ids": ["TestConcat.test_setitem_lazy"], "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 TestConcat:\n\n def test_setitem_lazy(self):\n def applier(df, **kwargs):\n df = df + 1\n df[\"a\"] = df[\"a\"] + 1\n df[\"e\"] = df[\"a\"] + 1\n df[\"new_int8\"] = np.int8(10)\n df[\"new_int16\"] = np.int16(10)\n df[\"new_int32\"] = np.int32(10)\n df[\"new_int64\"] = np.int64(10)\n df[\"new_int\"] = 10\n df[\"new_float\"] = 5.5\n df[\"new_float64\"] = np.float64(10.1)\n return df\n\n run_and_compare(applier, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_setitem_default_TestConcat.test_insert_default.run_and_compare_applier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_setitem_default_TestConcat.test_insert_default.run_and_compare_applier_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 660, "end_line": 686, "span_ids": ["TestConcat.test_insert_default", "TestConcat.test_insert_lazy", "TestConcat.test_setitem_default"], "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 TestConcat:\n\n def test_setitem_default(self):\n def applier(df, lib, **kwargs):\n df = df + 1\n df[\"a\"] = np.arange(3)\n df[\"b\"] = lib.Series(np.arange(3))\n return df\n\n run_and_compare(applier, data=self.data, force_lazy=False)\n\n def test_insert_lazy(self):\n def applier(df, **kwargs):\n df = df + 1\n df.insert(2, \"new_int\", 10)\n df.insert(1, \"new_float\", 5.5)\n df.insert(0, \"new_a\", df[\"a\"] + 1)\n return df\n\n run_and_compare(applier, data=self.data)\n\n def test_insert_default(self):\n def applier(df, lib, **kwargs):\n df = df + 1\n df.insert(1, \"new_range\", np.arange(3))\n df.insert(1, \"new_series\", lib.Series(np.arange(3)))\n return df\n\n run_and_compare(applier, data=self.data, force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_many_TestConcat.test_concat_many.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_many_TestConcat.test_concat_many.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 688, "end_line": 708, "span_ids": ["TestConcat.test_concat_many"], "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 TestConcat:\n\n def test_concat_many(self):\n def concat(df1, df2, lib, **kwargs):\n df3 = df1.copy()\n df4 = df2.copy()\n return lib.concat([df1, df2, df3, df4])\n\n def sort_comparator(df1, df2):\n \"\"\"Sort and verify equality of the passed frames.\"\"\"\n # We sort values because order of rows in the 'union all' result is inconsistent in HDK\n df1, df2 = (\n try_cast_to_pandas(df).sort_values(df.columns[0]) for df in (df1, df2)\n )\n return df_equals(df1, df2)\n\n run_and_compare(\n concat,\n data=self.data,\n data2=self.data2,\n comparator=sort_comparator,\n allow_subqueries=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_agg_TestConcat.test_concat_agg.run_and_compare_concat_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_agg_TestConcat.test_concat_agg.run_and_compare_concat_d", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 710, "end_line": 720, "span_ids": ["TestConcat.test_concat_agg"], "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 TestConcat:\n\n def test_concat_agg(self):\n def concat(lib, df1, df2):\n df1 = df1.groupby(\"a\", as_index=False).agg(\n {\"b\": \"sum\", \"d\": \"sum\", \"e\": \"sum\"}\n )\n df2 = df2.groupby(\"a\", as_index=False).agg(\n {\"c\": \"sum\", \"b\": \"sum\", \"f\": \"sum\"}\n )\n return lib.concat([df1, df2])\n\n run_and_compare(concat, data=self.data, data2=self.data2, allow_subqueries=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_single_TestConcat.test_groupby_concat_single.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_single_TestConcat.test_groupby_concat_single.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 722, "end_line": 745, "span_ids": ["TestConcat.test_concat_single", "TestConcat.test_groupby_concat_single"], "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 TestConcat:\n\n @pytest.mark.parametrize(\"join\", [\"inner\", \"outer\"])\n @pytest.mark.parametrize(\"sort\", bool_arg_values)\n @pytest.mark.parametrize(\"ignore_index\", bool_arg_values)\n def test_concat_single(self, join, sort, ignore_index):\n def concat(lib, df, join, sort, ignore_index):\n return lib.concat([df], join=join, sort=sort, ignore_index=ignore_index)\n\n run_and_compare(\n concat,\n data=self.data,\n join=join,\n sort=sort,\n ignore_index=ignore_index,\n )\n\n def test_groupby_concat_single(self):\n def concat(lib, df):\n df = lib.concat([df])\n return df.groupby(\"a\").agg({\"b\": \"min\"})\n\n run_and_compare(\n concat,\n data=self.data,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_join_TestConcat.test_concat_join.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_join_TestConcat.test_concat_join.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 747, "end_line": 763, "span_ids": ["TestConcat.test_concat_join"], "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 TestConcat:\n\n @pytest.mark.parametrize(\"join\", [\"inner\"])\n @pytest.mark.parametrize(\"sort\", bool_arg_values)\n @pytest.mark.parametrize(\"ignore_index\", bool_arg_values)\n def test_concat_join(self, join, sort, ignore_index):\n def concat(lib, df1, df2, join, sort, ignore_index, **kwargs):\n return lib.concat(\n [df1, df2], axis=1, join=join, sort=sort, ignore_index=ignore_index\n )\n\n run_and_compare(\n concat,\n data=self.data,\n data2=self.data3,\n join=join,\n sort=sort,\n ignore_index=ignore_index,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_index_name_TestConcat.test_concat_index_name.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_index_name_TestConcat.test_concat_index_name.None_1", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 765, "end_line": 780, "span_ids": ["TestConcat.test_concat_index_name"], "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 TestConcat:\n\n def test_concat_index_name(self):\n df1 = pandas.DataFrame(self.data)\n df1 = df1.set_index(\"a\")\n df2 = pandas.DataFrame(self.data3)\n df2 = df2.set_index(\"f\")\n\n ref = pandas.concat([df1, df2], axis=1, join=\"inner\")\n exp = pd.concat([df1, df2], axis=1, join=\"inner\")\n\n df_equals(ref, exp)\n\n df2.index.name = \"a\"\n ref = pandas.concat([df1, df2], axis=1, join=\"inner\")\n exp = pd.concat([df1, df2], axis=1, join=\"inner\")\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_index_names_TestConcat.test_concat_str.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_concat_index_names_TestConcat.test_concat_str.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 782, "end_line": 808, "span_ids": ["TestConcat.test_concat_str", "TestConcat.test_concat_index_names"], "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 TestConcat:\n\n def test_concat_index_names(self):\n df1 = pandas.DataFrame(self.data)\n df1 = df1.set_index([\"a\", \"b\"])\n df2 = pandas.DataFrame(self.data3)\n df2 = df2.set_index([\"f\", \"h\"])\n\n ref = pandas.concat([df1, df2], axis=1, join=\"inner\")\n exp = pd.concat([df1, df2], axis=1, join=\"inner\")\n\n df_equals(ref, exp)\n\n df2.index.names = [\"a\", \"b\"]\n ref = pandas.concat([df1, df2], axis=1, join=\"inner\")\n exp = pd.concat([df1, df2], axis=1, join=\"inner\")\n\n df_equals(ref, exp)\n\n def test_concat_str(self):\n def concat(df1, df2, lib, **kwargs):\n return lib.concat([df1.dropna(), df2.dropna()]).astype(str)\n\n run_and_compare(\n concat,\n data={\"a\": [\"1\", \"2\", \"3\"]},\n data2={\"a\": [\"4\", \"5\", \"6\"]},\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_issue_5889_TestConcat.test_issue_5889.with_ensure_clean_csv_.run_and_compare_test_conc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConcat.test_issue_5889_TestConcat.test_issue_5889.with_ensure_clean_csv_.run_and_compare_test_conc", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 810, "end_line": 836, "span_ids": ["TestConcat.test_issue_5889"], "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 TestConcat:\n\n @pytest.mark.parametrize(\"transform\", [True, False])\n @pytest.mark.parametrize(\"sort_last\", [True, False])\n # RecursionError in case of concatenation of big number of frames\n def test_issue_5889(self, transform, sort_last):\n with ensure_clean(\".csv\") as file:\n data = {\"a\": [1, 2, 3], \"b\": [1, 2, 3]} if transform else {\"a\": [1, 2, 3]}\n pandas.DataFrame(data).to_csv(file, index=False)\n\n def test_concat(lib, **kwargs):\n if transform:\n\n def read_csv():\n return lib.read_csv(file)[\"b\"]\n\n else:\n\n def read_csv():\n return lib.read_csv(file)\n\n df = read_csv()\n for _ in range(100):\n df = lib.concat([df, read_csv()])\n if sort_last:\n df = lib.concat([df, read_csv()], sort=True)\n return df\n\n run_and_compare(test_concat, data={})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby_TestGroupby.test_groupby_lazy_multiindex.run_and_compare_groupby_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby_TestGroupby.test_groupby_lazy_multiindex.run_and_compare_groupby_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 839, "end_line": 914, "span_ids": ["TestGroupby.test_groupby_proj_sum", "TestGroupby.test_groupby_sum", "TestGroupby.test_groupby_lazy_multiindex", "TestGroupby.test_groupby_agg_mean", "TestGroupby.test_groupby_mean", "TestGroupby.test_groupby_agg_default_to_pandas", "TestGroupby.test_groupby_agg", "TestGroupby.test_groupby_count", "TestGroupby"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGroupby:\n data = {\n \"a\": [1, 1, 2, 2, 2, 1],\n \"b\": [11, 21, 12, 22, 32, 11],\n \"c\": [101, 201, 202, 202, 302, 302],\n }\n cols_value = [\"a\", [\"a\", \"b\"]]\n\n @pytest.mark.parametrize(\"cols\", cols_value)\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_groupby_sum(self, cols, as_index):\n def groupby_sum(df, cols, as_index, **kwargs):\n return df.groupby(cols, as_index=as_index).sum()\n\n run_and_compare(groupby_sum, data=self.data, cols=cols, as_index=as_index)\n\n @pytest.mark.parametrize(\"cols\", cols_value)\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_groupby_count(self, cols, as_index):\n def groupby_count(df, cols, as_index, **kwargs):\n return df.groupby(cols, as_index=as_index).count()\n\n run_and_compare(groupby_count, data=self.data, cols=cols, as_index=as_index)\n\n @pytest.mark.parametrize(\"cols\", cols_value)\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_groupby_mean(self, cols, as_index):\n def groupby_mean(df, cols, as_index, **kwargs):\n return df.groupby(cols, as_index=as_index).mean()\n\n run_and_compare(groupby_mean, data=self.data, cols=cols, as_index=as_index)\n\n @pytest.mark.parametrize(\"cols\", cols_value)\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_groupby_proj_sum(self, cols, as_index):\n def groupby_sum(df, cols, as_index, **kwargs):\n return df.groupby(cols, as_index=as_index).c.sum()\n\n run_and_compare(\n groupby_sum, data=self.data, cols=cols, as_index=as_index, force_lazy=False\n )\n\n @pytest.mark.parametrize(\"agg\", [\"count\", \"size\", \"nunique\"])\n def test_groupby_agg(self, agg):\n def groupby(df, agg, **kwargs):\n return df.groupby(\"a\").agg({\"b\": agg})\n\n run_and_compare(groupby, data=self.data, agg=agg)\n\n def test_groupby_agg_default_to_pandas(self):\n def lambda_func(df, **kwargs):\n return df.groupby(\"a\").agg(lambda df: (df.mean() - df.sum()) // 2)\n\n run_and_compare(lambda_func, data=self.data, force_lazy=False)\n\n def not_implemented_func(df, **kwargs):\n return df.groupby(\"a\").agg(\"cumprod\")\n\n run_and_compare(lambda_func, data=self.data, force_lazy=False)\n\n @pytest.mark.parametrize(\"cols\", cols_value)\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_groupby_agg_mean(self, cols, as_index):\n def groupby_mean(df, cols, as_index, **kwargs):\n return df.groupby(cols, as_index=as_index).agg(\"mean\")\n\n run_and_compare(groupby_mean, data=self.data, cols=cols, as_index=as_index)\n\n def test_groupby_lazy_multiindex(self):\n index = generate_multiindex(len(self.data[\"a\"]))\n\n def groupby(df, *args, **kwargs):\n df = df + 1\n return df.groupby(\"a\").agg({\"b\": \"size\"})\n\n run_and_compare(groupby, data=self.data, constructor_kwargs={\"index\": index})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_lazy_squeeze_TestGroupby.test_groupby_size.run_and_compare_groupby_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_lazy_squeeze_TestGroupby.test_groupby_size.run_and_compare_groupby_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 916, "end_line": 939, "span_ids": ["TestGroupby.test_groupby_lazy_squeeze", "TestGroupby.test_groupby_size", "TestGroupby.test_groupby_series"], "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 TestGroupby:\n\n def test_groupby_lazy_squeeze(self):\n def applier(df, **kwargs):\n return df.groupby(\"a\").sum().squeeze(axis=1)\n\n run_and_compare(\n applier,\n data=self.data,\n constructor_kwargs={\"columns\": [\"a\", \"b\"]},\n force_lazy=True,\n )\n\n @pytest.mark.parametrize(\"method\", [\"sum\", \"size\"])\n def test_groupby_series(self, method):\n def groupby(df, **kwargs):\n ser = df[df.columns[0]]\n return getattr(ser.groupby(ser), method)()\n\n run_and_compare(groupby, data=self.data)\n\n def test_groupby_size(self):\n def groupby(df, **kwargs):\n return df.groupby(\"a\").size()\n\n run_and_compare(groupby, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_agg_by_col_TestGroupby._modin_issue_3461": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_agg_by_col_TestGroupby._modin_issue_3461", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 941, "end_line": 960, "span_ids": ["TestGroupby.test_groupby_agg_by_col"], "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 TestGroupby:\n\n @pytest.mark.parametrize(\"by\", [[\"a\"], [\"a\", \"b\", \"c\"]])\n @pytest.mark.parametrize(\"agg\", [\"sum\", \"size\", \"mean\"])\n @pytest.mark.parametrize(\"as_index\", [True, False])\n def test_groupby_agg_by_col(self, by, agg, as_index):\n def simple_agg(df, **kwargs):\n return df.groupby(by, as_index=as_index).agg(agg)\n\n run_and_compare(simple_agg, data=self.data)\n\n def dict_agg(df, **kwargs):\n return df.groupby(by, as_index=as_index).agg({by[0]: agg})\n\n run_and_compare(dict_agg, data=self.data)\n\n def dict_agg_all_cols(df, **kwargs):\n return df.groupby(by, as_index=as_index).agg({col: agg for col in by})\n\n run_and_compare(dict_agg_all_cols, data=self.data)\n\n # modin-issue#3461", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_pure_by_TestGroupby.test_groupby_pure_by.df_equals_md_res_pd_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_pure_by_TestGroupby.test_groupby_pure_by.df_equals_md_res_pd_res_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 961, "end_line": 979, "span_ids": ["TestGroupby.test_groupby_pure_by"], "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 TestGroupby:\n def test_groupby_pure_by(self):\n data = [1, 1, 2, 2]\n # Test when 'by' is a 'TransformNode'\n run_and_compare(lambda df: df.groupby(df).sum(), data=data, force_lazy=True)\n\n # Test when 'by' is a 'FrameNode'\n md_ser, pd_ser = pd.Series(data), pandas.Series(data)\n\n md_ser._query_compiler._modin_frame._execute()\n assert isinstance(\n md_ser._query_compiler._modin_frame._op, FrameNode\n ), \"Triggering execution of the Modin frame supposed to set 'FrameNode' as a frame's op\"\n\n set_execution_mode(md_ser, \"lazy\")\n md_res = md_ser.groupby(md_ser).sum()\n set_execution_mode(md_res, None)\n\n pd_res = pd_ser.groupby(pd_ser).sum()\n df_equals(md_res, pd_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.taxi_data_TestGroupby.test_taxi_q3.run_and_compare_taxi_q3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.taxi_data_TestGroupby.test_taxi_q3.run_and_compare_taxi_q3_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 981, "end_line": 1014, "span_ids": ["TestGroupby:6", "TestGroupby.test_taxi_q3", "TestGroupby.test_taxi_q1", "TestGroupby.test_taxi_q2"], "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 TestGroupby:\n\n taxi_data = {\n \"a\": [1, 1, 2, 2],\n \"b\": [11, 21, 12, 11],\n \"c\": pandas.to_datetime(\n [\"20190902\", \"20180913\", \"20190921\", \"20180903\"], format=\"%Y%m%d\"\n ),\n \"d\": [11.5, 21.2, 12.8, 13.4],\n }\n\n # TODO: emulate taxi queries with group by category types when we have loading\n # using arrow\n # Another way of doing taxi q1 is\n # res = df.groupby(\"cab_type\").size() - this should be tested later as well\n def test_taxi_q1(self):\n def taxi_q1(df, **kwargs):\n return df.groupby(\"a\").size()\n\n run_and_compare(taxi_q1, data=self.taxi_data)\n\n def test_taxi_q2(self):\n def taxi_q2(df, **kwargs):\n return df.groupby(\"a\").agg({\"b\": \"mean\"})\n\n run_and_compare(taxi_q2, data=self.taxi_data)\n\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_taxi_q3(self, as_index):\n def taxi_q3(df, as_index, **kwargs):\n # TODO: remove 'astype' temp fix\n return df.groupby(\n [\"b\", df[\"c\"].dt.year.astype(\"int32\")], as_index=as_index\n ).size()\n\n run_and_compare(taxi_q3, data=self.taxi_data, as_index=as_index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_expr_col_TestGroupby.test_groupby_expr_col.run_and_compare_groupby_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_groupby_expr_col_TestGroupby.test_groupby_expr_col.run_and_compare_groupby_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1016, "end_line": 1026, "span_ids": ["TestGroupby.test_groupby_expr_col"], "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 TestGroupby:\n\n def test_groupby_expr_col(self):\n def groupby(df, **kwargs):\n df = df.loc[:, [\"b\", \"c\"]]\n df[\"year\"] = df[\"c\"].dt.year\n df[\"month\"] = df[\"c\"].dt.month\n df[\"id1\"] = df[\"year\"] * 12 + df[\"month\"]\n df[\"id2\"] = (df[\"id1\"] - 24000) // 12\n df = df.groupby([\"id1\", \"id2\"], as_index=False).agg({\"b\": \"max\"})\n return df\n\n run_and_compare(groupby, data=self.taxi_data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_series_astype_TestGroupby.test_df_indexed_astype.run_and_compare_df_astype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_series_astype_TestGroupby.test_df_indexed_astype.run_and_compare_df_astype", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1028, "end_line": 1045, "span_ids": ["TestGroupby.test_df_indexed_astype", "TestGroupby.test_series_astype", "TestGroupby.test_df_astype"], "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 TestGroupby:\n\n def test_series_astype(self):\n def series_astype(df, **kwargs):\n return df[\"d\"].astype(\"int\")\n\n run_and_compare(series_astype, data=self.taxi_data)\n\n def test_df_astype(self):\n def df_astype(df, **kwargs):\n return df.astype({\"b\": \"float\", \"d\": \"int\"})\n\n run_and_compare(df_astype, data=self.taxi_data)\n\n def test_df_indexed_astype(self):\n def df_astype(df, **kwargs):\n df = df.groupby(\"a\").agg({\"b\": \"sum\"})\n return df.astype({\"b\": \"float\"})\n\n run_and_compare(df_astype, data=self.taxi_data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_taxi_q4_TestGroupby.test_taxi_q4.run_and_compare_taxi_q4_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_taxi_q4_TestGroupby.test_taxi_q4.run_and_compare_taxi_q4_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1047, "end_line": 1061, "span_ids": ["TestGroupby.test_taxi_q4"], "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 TestGroupby:\n\n @pytest.mark.parametrize(\"as_index\", bool_arg_values)\n def test_taxi_q4(self, as_index):\n def taxi_q4(df, **kwargs):\n df[\"c\"] = df[\"c\"].dt.year\n df[\"d\"] = df[\"d\"].astype(\"int64\")\n df = df.groupby([\"b\", \"c\", \"d\"], sort=True, as_index=as_index).size()\n if as_index:\n df = df.reset_index()\n return df.sort_values(\n by=[\"c\", 0 if as_index else \"size\"],\n ignore_index=True,\n ascending=[True, False],\n )\n\n run_and_compare(taxi_q4, data=self.taxi_data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.h2o_data_TestGroupby._get_h2o_df.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.h2o_data_TestGroupby._get_h2o_df.return.df", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1063, "end_line": 1080, "span_ids": ["TestGroupby:8", "TestGroupby._get_h2o_df"], "tokens": 451}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGroupby:\n\n h2o_data = {\n \"id1\": [\"id1\", \"id2\", \"id3\", \"id1\", \"id2\", \"id3\", \"id1\", \"id2\", \"id3\", \"id1\"],\n \"id2\": [\"id1\", \"id2\", \"id1\", \"id2\", \"id1\", \"id2\", \"id1\", \"id2\", \"id1\", \"id2\"],\n \"id3\": [\"id4\", \"id5\", \"id6\", \"id4\", \"id5\", \"id6\", \"id4\", \"id5\", \"id6\", \"id4\"],\n \"id4\": [4, 5, 4, 5, 4, 5, 4, 5, 4, 5],\n \"id5\": [7, 8, 9, 7, 8, 9, 7, 8, 9, 7],\n \"id6\": [7, 8, 7, 8, 7, 8, 7, 8, 7, 8],\n \"v1\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n \"v2\": [1, 3, 5, 7, 9, 10, 8, 6, 4, 2],\n \"v3\": [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.0],\n }\n\n def _get_h2o_df(self):\n df = pandas.DataFrame(self.h2o_data)\n df[\"id1\"] = df[\"id1\"].astype(\"category\")\n df[\"id2\"] = df[\"id2\"].astype(\"category\")\n df[\"id3\"] = df[\"id3\"].astype(\"category\")\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q1_TestGroupby.test_h2o_q1.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q1_TestGroupby.test_h2o_q1.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1082, "end_line": 1098, "span_ids": ["TestGroupby.test_h2o_q1"], "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 TestGroupby:\n\n def test_h2o_q1(self):\n df = self._get_h2o_df()\n\n ref = df.groupby([\"id1\"], observed=True).agg({\"v1\": \"sum\"})\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n set_execution_mode(modin_df, \"lazy\")\n modin_df = modin_df.groupby([\"id1\"], observed=True, as_index=False).agg(\n {\"v1\": \"sum\"}\n )\n set_execution_mode(modin_df, None)\n\n exp = to_pandas(modin_df)\n exp[\"id1\"] = exp[\"id1\"].astype(\"category\")\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q2_TestGroupby.test_h2o_q2.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q2_TestGroupby.test_h2o_q2.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1100, "end_line": 1117, "span_ids": ["TestGroupby.test_h2o_q2"], "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 TestGroupby:\n\n def test_h2o_q2(self):\n df = self._get_h2o_df()\n\n ref = df.groupby([\"id1\", \"id2\"], observed=True).agg({\"v1\": \"sum\"})\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n set_execution_mode(modin_df, \"lazy\")\n modin_df = modin_df.groupby([\"id1\", \"id2\"], observed=True, as_index=False).agg(\n {\"v1\": \"sum\"}\n )\n set_execution_mode(modin_df, None)\n\n exp = to_pandas(modin_df)\n exp[\"id1\"] = exp[\"id1\"].astype(\"category\")\n exp[\"id2\"] = exp[\"id2\"].astype(\"category\")\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q3_TestGroupby.test_h2o_q3.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q3_TestGroupby.test_h2o_q3.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1119, "end_line": 1135, "span_ids": ["TestGroupby.test_h2o_q3"], "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 TestGroupby:\n\n def test_h2o_q3(self):\n df = self._get_h2o_df()\n\n ref = df.groupby([\"id3\"], observed=True).agg({\"v1\": \"sum\", \"v3\": \"mean\"})\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n set_execution_mode(modin_df, \"lazy\")\n modin_df = modin_df.groupby([\"id3\"], observed=True, as_index=False).agg(\n {\"v1\": \"sum\", \"v3\": \"mean\"}\n )\n set_execution_mode(modin_df, None)\n\n exp = to_pandas(modin_df)\n exp[\"id3\"] = exp[\"id3\"].astype(\"category\")\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q4_TestGroupby.test_h2o_q4.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q4_TestGroupby.test_h2o_q4.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1137, "end_line": 1154, "span_ids": ["TestGroupby.test_h2o_q4"], "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 TestGroupby:\n\n def test_h2o_q4(self):\n df = self._get_h2o_df()\n\n ref = df.groupby([\"id4\"], observed=True).agg(\n {\"v1\": \"mean\", \"v2\": \"mean\", \"v3\": \"mean\"}\n )\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n set_execution_mode(modin_df, \"lazy\")\n modin_df = modin_df.groupby([\"id4\"], observed=True, as_index=False).agg(\n {\"v1\": \"mean\", \"v2\": \"mean\", \"v3\": \"mean\"}\n )\n set_execution_mode(modin_df, None)\n\n exp = to_pandas(modin_df)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q5_TestGroupby.test_h2o_q5.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q5_TestGroupby.test_h2o_q5.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1156, "end_line": 1173, "span_ids": ["TestGroupby.test_h2o_q5"], "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 TestGroupby:\n\n def test_h2o_q5(self):\n df = self._get_h2o_df()\n\n ref = df.groupby([\"id6\"], observed=True).agg(\n {\"v1\": \"sum\", \"v2\": \"sum\", \"v3\": \"sum\"}\n )\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n set_execution_mode(modin_df, \"lazy\")\n modin_df = modin_df.groupby([\"id6\"], observed=True, as_index=False).agg(\n {\"v1\": \"sum\", \"v2\": \"sum\", \"v3\": \"sum\"}\n )\n set_execution_mode(modin_df, None)\n\n exp = to_pandas(modin_df)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q7_TestGroupby.test_h2o_q7.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q7_TestGroupby.test_h2o_q7.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1175, "end_line": 1198, "span_ids": ["TestGroupby.test_h2o_q7"], "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 TestGroupby:\n\n def test_h2o_q7(self):\n df = self._get_h2o_df()\n\n ref = (\n df.groupby([\"id3\"], observed=True)\n .agg({\"v1\": \"max\", \"v2\": \"min\"})\n .assign(range_v1_v2=lambda x: x[\"v1\"] - x[\"v2\"])[[\"range_v1_v2\"]]\n )\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n set_execution_mode(modin_df, \"lazy\")\n modin_df = modin_df.groupby([\"id3\"], observed=True).agg(\n {\"v1\": \"max\", \"v2\": \"min\"}\n )\n modin_df[\"range_v1_v2\"] = modin_df[\"v1\"] - modin_df[\"v2\"]\n modin_df = modin_df[[\"range_v1_v2\"]]\n modin_df.reset_index(inplace=True)\n set_execution_mode(modin_df, None)\n\n exp = to_pandas(modin_df)\n exp[\"id3\"] = exp[\"id3\"].astype(\"category\")\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q10_TestGroupby.test_h2o_q10.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_h2o_q10_TestGroupby.test_h2o_q10.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1200, "end_line": 1219, "span_ids": ["TestGroupby.test_h2o_q10"], "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 TestGroupby:\n\n def test_h2o_q10(self):\n df = self._get_h2o_df()\n\n ref = df.groupby([\"id1\", \"id2\", \"id3\", \"id4\", \"id5\", \"id6\"], observed=True).agg(\n {\"v3\": \"sum\", \"v1\": \"count\"}\n )\n ref.reset_index(inplace=True)\n\n modin_df = pd.DataFrame(df)\n modin_df = modin_df.groupby(\n [\"id1\", \"id2\", \"id3\", \"id4\", \"id5\", \"id6\"], observed=True\n ).agg({\"v3\": \"sum\", \"v1\": \"count\"})\n modin_df.reset_index(inplace=True)\n\n exp = to_pandas(modin_df)\n exp[\"id1\"] = exp[\"id1\"].astype(\"category\")\n exp[\"id2\"] = exp[\"id2\"].astype(\"category\")\n exp[\"id3\"] = exp[\"id3\"].astype(\"category\")\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.std_data_TestGroupby.std_data._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.std_data_TestGroupby.std_data._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1221, "end_line": 1225, "span_ids": ["TestGroupby:10"], "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 TestGroupby:\n\n std_data = {\n \"a\": [1, 2, 1, 1, 1, 2, 2, 2, 1, 2],\n \"b\": [4, 3, 1, 6, 9, 8, 0, 9, 5, 13],\n \"c\": [12.8, 45.6, 23.5, 12.4, 11.2, None, 56.4, 12.5, 1, 55],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_agg_std_TestGroupby.test_agg_std.run_and_compare_std_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_agg_std_TestGroupby.test_agg_std.run_and_compare_std_data", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1227, "end_line": 1236, "span_ids": ["TestGroupby.test_agg_std"], "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 TestGroupby:\n\n def test_agg_std(self):\n def std(df, **kwargs):\n df = df.groupby(\"a\").agg({\"b\": \"std\", \"c\": \"std\"})\n if not isinstance(df, pandas.DataFrame):\n df = to_pandas(df)\n df[\"b\"] = df[\"b\"].apply(lambda x: round(x, 10))\n df[\"c\"] = df[\"c\"].apply(lambda x: round(x, 10))\n return df\n\n run_and_compare(std, data=self.std_data, force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.skew_data_TestGroupby.skew_data._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.skew_data_TestGroupby.skew_data._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1238, "end_line": 1242, "span_ids": ["TestGroupby:12"], "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 TestGroupby:\n\n skew_data = {\n \"a\": [1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 3, 4, 4],\n \"b\": [4, 3, 1, 6, 9, 8, 0, 9, 5, 13, 12, 44, 6],\n \"c\": [12.8, 45.6, 23.5, 12.4, 11.2, None, 56.4, 12.5, 1, 55, 4.5, 7.8, 9.4],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_agg_skew_TestGroupby.test_multilevel.run_and_compare_groupby_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_agg_skew_TestGroupby.test_multilevel.run_and_compare_groupby_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1244, "end_line": 1259, "span_ids": ["TestGroupby.test_agg_skew", "TestGroupby.test_multilevel"], "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 TestGroupby:\n\n def test_agg_skew(self):\n def std(df, **kwargs):\n df = df.groupby(\"a\").agg({\"b\": \"skew\", \"c\": \"skew\"})\n if not isinstance(df, pandas.DataFrame):\n df = to_pandas(df)\n df[\"b\"] = df[\"b\"].apply(lambda x: round(x, 10))\n df[\"c\"] = df[\"c\"].apply(lambda x: round(x, 10))\n return df\n\n run_and_compare(std, data=self.skew_data, force_lazy=False)\n\n def test_multilevel(self):\n def groupby(df, **kwargs):\n return df.groupby(\"a\").agg({\"b\": \"min\", \"c\": [\"min\", \"max\", \"sum\", \"skew\"]})\n\n run_and_compare(groupby, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_head_tail_TestGroupby.test_head_tail.try_.finally_.DoUseCalcite._value.orig_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestGroupby.test_head_tail_TestGroupby.test_head_tail.try_.finally_.DoUseCalcite._value.orig_value", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1261, "end_line": 1296, "span_ids": ["TestGroupby.test_head_tail"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGroupby:\n\n @pytest.mark.parametrize(\"op\", [\"head\", \"tail\"])\n @pytest.mark.parametrize(\"n\", [10, -10])\n @pytest.mark.parametrize(\"invert\", [True, False])\n @pytest.mark.parametrize(\"select\", [True, False])\n @pytest.mark.parametrize(\"ascending\", [None, True, False])\n @pytest.mark.parametrize(\n \"use_calcite\",\n [\n False,\n pytest.param(\n True,\n marks=pytest.mark.xfail(\n reason=\"Function ROW_NUMBER() is not yet supported by Calcite\"\n ),\n ),\n ],\n )\n def test_head_tail(self, op, n, invert, select, ascending, use_calcite):\n def head(df, **kwargs):\n if invert:\n df = df[~df[\"col3\"].isna()]\n if select:\n df = df[[\"col1\", \"col10\", \"col2\", \"col20\"]]\n if ascending is not None:\n df = df.sort_values([\"col2\", \"col10\"], ascending=ascending)\n df = df.groupby([\"col1\", \"col20\"])\n df = getattr(df, op)(n)\n return df.sort_values(list(df.columns))\n\n orig_value = DoUseCalcite.get()\n DoUseCalcite._value = use_calcite\n try:\n # When invert is false, the rowid column is materialized.\n run_and_compare(head, data=test_data[\"int_data\"], force_lazy=invert)\n finally:\n DoUseCalcite._value = orig_value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg_TestAgg.test_count_agg.run_and_compare_apply_da": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg_TestAgg.test_count_agg.run_and_compare_apply_da", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1299, "end_line": 1320, "span_ids": ["TestAgg.test_simple_agg", "TestAgg.test_count_agg", "TestAgg"], "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 TestAgg:\n data = {\n \"a\": [1, 2, None, None, 1, None],\n \"b\": [10, 20, None, 20, 10, None],\n \"c\": [None, 200, None, 400, 500, 600],\n \"d\": [11, 22, 33, 22, 33, 22],\n }\n int_data = pandas.DataFrame(data).fillna(0).astype(\"int\").to_dict()\n\n @pytest.mark.parametrize(\"agg\", [\"max\", \"min\", \"sum\", \"mean\"])\n @pytest.mark.parametrize(\"skipna\", bool_arg_values)\n def test_simple_agg(self, agg, skipna):\n def apply(df, agg, skipna, **kwargs):\n return getattr(df, agg)(skipna=skipna)\n\n run_and_compare(apply, data=self.data, agg=agg, skipna=skipna, force_lazy=False)\n\n def test_count_agg(self):\n def apply(df, **kwargs):\n return df.count()\n\n run_and_compare(apply, data=self.data, force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg.test_value_counts_TestAgg.test_value_counts.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg.test_value_counts_TestAgg.test_value_counts.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1322, "end_line": 1351, "span_ids": ["TestAgg.test_value_counts"], "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 TestAgg:\n\n @pytest.mark.parametrize(\"data\", [data, int_data], ids=[\"nan_data\", \"int_data\"])\n @pytest.mark.parametrize(\"cols\", [\"a\", \"d\", [\"a\", \"d\"]])\n @pytest.mark.parametrize(\"dropna\", [True, False])\n @pytest.mark.parametrize(\"sort\", [True])\n @pytest.mark.parametrize(\"ascending\", [True, False])\n def test_value_counts(self, data, cols, dropna, sort, ascending):\n def value_counts(df, cols, dropna, sort, ascending, **kwargs):\n return df[cols].value_counts(dropna=dropna, sort=sort, ascending=ascending)\n\n if dropna and pandas.DataFrame(\n data, columns=cols if is_list_like(cols) else [cols]\n ).isna().any(axis=None):\n pytest.xfail(\n reason=\"'dropna' parameter is forcibly disabled in HDK's GroupBy\"\n + \"due to performance issues, you can track this problem at:\"\n + \"https://github.com/modin-project/modin/issues/2896\"\n )\n\n # Custom comparator is required because pandas is inconsistent about\n # the order of equal values, we can't match this behavior. For more details:\n # https://github.com/modin-project/modin/issues/1650\n run_and_compare(\n value_counts,\n data=data,\n cols=cols,\n dropna=dropna,\n sort=sort,\n ascending=ascending,\n comparator=df_equals_with_non_stable_indices,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg.test_simple_agg_no_default_TestAgg.test_nunique.run_and_compare_applier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestAgg.test_simple_agg_no_default_TestAgg.test_nunique.run_and_compare_applier_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1353, "end_line": 1383, "span_ids": ["TestAgg.test_simple_agg_no_default", "TestAgg.test_nunique"], "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 TestAgg:\n\n @pytest.mark.parametrize(\n \"method\", [\"sum\", \"mean\", \"max\", \"min\", \"count\", \"nunique\"]\n )\n def test_simple_agg_no_default(self, method):\n def applier(df, **kwargs):\n if isinstance(df, pd.DataFrame):\n # At the end of reduce function it does inevitable `transpose`, which\n # is defaulting to pandas. The following logic check that `transpose` is the only\n # function that falling back to pandas in the reduce operation flow.\n with pytest.warns(UserWarning) as warns:\n res = getattr(df, method)()\n assert (\n len(warns) == 1\n ), f\"More than one warning was arisen: len(warns) != 1 ({len(warns)} != 1)\"\n message = warns[0].message.args[0]\n assert (\n re.match(r\".*transpose.*defaulting to pandas\", message) is not None\n ), f\"Expected DataFrame.transpose defaulting to pandas warning, got: {message}\"\n else:\n res = getattr(df, method)()\n return res\n\n run_and_compare(applier, data=self.data, force_lazy=False)\n\n @pytest.mark.parametrize(\"data\", [data, int_data])\n @pytest.mark.parametrize(\"dropna\", bool_arg_values)\n def test_nunique(self, data, dropna):\n def applier(df, **kwargs):\n return df.nunique(dropna=dropna)\n\n run_and_compare(applier, data=data, force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge_TestMerge.how_values._inner_left_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge_TestMerge.how_values._inner_left_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1386, "end_line": 1398, "span_ids": ["TestMerge"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMerge:\n data = {\n \"a\": [1, 2, 3, 6, 5, 4],\n \"b\": [10, 20, 30, 60, 50, 40],\n \"e\": [11, 22, 33, 66, 55, 44],\n }\n data2 = {\n \"a\": [4, 2, 3, 7, 1, 5],\n \"b\": [40, 20, 30, 70, 10, 50],\n \"d\": [4000, 2000, 3000, 7000, 1000, 5000],\n }\n on_values = [\"a\", [\"a\"], [\"a\", \"b\"], [\"b\", \"a\"], None]\n how_values = [\"inner\", \"left\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_TestMerge.test_merge.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_TestMerge.test_merge.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1400, "end_line": 1409, "span_ids": ["TestMerge.test_merge"], "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 TestMerge:\n\n @pytest.mark.parametrize(\"on\", on_values)\n @pytest.mark.parametrize(\"how\", how_values)\n @pytest.mark.parametrize(\"sort\", [True, False])\n def test_merge(self, on, how, sort):\n def merge(lib, df1, df2, on, how, sort, **kwargs):\n return df1.merge(df2, on=on, how=how, sort=sort)\n\n run_and_compare(\n merge, data=self.data, data2=self.data2, on=on, how=how, sort=sort\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_non_str_column_name_TestMerge._casted_to_category_and_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_non_str_column_name_TestMerge._casted_to_category_and_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1411, "end_line": 1466, "span_ids": ["TestMerge._get_h2o_df", "TestMerge.test_merge_non_str_column_name", "TestMerge:10"], "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": "class TestMerge:\n\n def test_merge_non_str_column_name(self):\n def merge(lib, df1, df2, on, **kwargs):\n return df1.merge(df2, on=on, how=\"inner\")\n\n run_and_compare(merge, data=[[1, 2], [3, 4]], data2=[[1, 2], [3, 4]], on=1)\n\n h2o_data = {\n \"id1\": [\"id1\", \"id10\", \"id100\", \"id1000\"],\n \"id2\": [\"id2\", \"id20\", \"id200\", \"id2000\"],\n \"id3\": [\"id3\", \"id30\", \"id300\", \"id3000\"],\n \"id4\": [4, 40, 400, 4000],\n \"id5\": [5, 50, 500, 5000],\n \"id6\": [6, 60, 600, 6000],\n \"v1\": [3.3, 4.4, 7.7, 8.8],\n }\n\n h2o_data_small = {\n \"id1\": [\"id10\", \"id100\", \"id1000\", \"id10000\"],\n \"id4\": [40, 400, 4000, 40000],\n \"v2\": [30.3, 40.4, 70.7, 80.8],\n }\n\n h2o_data_medium = {\n \"id1\": [\"id10\", \"id100\", \"id1000\", \"id10000\"],\n \"id2\": [\"id20\", \"id200\", \"id2000\", \"id20000\"],\n \"id4\": [40, 400, 4000, 40000],\n \"id5\": [50, 500, 5000, 50000],\n \"v2\": [30.3, 40.4, 70.7, 80.8],\n }\n\n h2o_data_big = {\n \"id1\": [\"id10\", \"id100\", \"id1000\", \"id10000\"],\n \"id2\": [\"id20\", \"id200\", \"id2000\", \"id20000\"],\n \"id3\": [\"id30\", \"id300\", \"id3000\", \"id30000\"],\n \"id4\": [40, 400, 4000, 40000],\n \"id5\": [50, 500, 5000, 50000],\n \"id6\": [60, 600, 6000, 60000],\n \"v2\": [30.3, 40.4, 70.7, 80.8],\n }\n\n def _get_h2o_df(self, data):\n df = pandas.DataFrame(data)\n if \"id1\" in data:\n df[\"id1\"] = df[\"id1\"].astype(\"category\")\n if \"id2\" in data:\n df[\"id2\"] = df[\"id2\"].astype(\"category\")\n if \"id3\" in data:\n df[\"id3\"] = df[\"id3\"].astype(\"category\")\n return df\n\n # Currently HDK returns category as string columns\n # and therefore casted to category it would only have\n # values from actual data. In Pandas category would\n # have old values as well. Simply casting category\n # to string for somparison doesn't work because None\n # casted to category and back to strting becomes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge._nan_So_we_cast_every_TestMerge._fix_category_cols.if_id3_in_df_columns_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge._nan_So_we_cast_every_TestMerge._fix_category_cols.if_id3_in_df_columns_.None_1", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1467, "end_line": 1490, "span_ids": ["TestMerge._get_h2o_df", "TestMerge._fix_category_cols"], "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 TestMerge:\n # \"nan\". So we cast everything to category and then\n # to string.\n def _fix_category_cols(self, df):\n if \"id1\" in df.columns:\n df[\"id1\"] = df[\"id1\"].astype(\"category\")\n df[\"id1\"] = df[\"id1\"].astype(str)\n if \"id1_x\" in df.columns:\n df[\"id1_x\"] = df[\"id1_x\"].astype(\"category\")\n df[\"id1_x\"] = df[\"id1_x\"].astype(str)\n if \"id1_y\" in df.columns:\n df[\"id1_y\"] = df[\"id1_y\"].astype(\"category\")\n df[\"id1_y\"] = df[\"id1_y\"].astype(str)\n if \"id2\" in df.columns:\n df[\"id2\"] = df[\"id2\"].astype(\"category\")\n df[\"id2\"] = df[\"id2\"].astype(str)\n if \"id2_x\" in df.columns:\n df[\"id2_x\"] = df[\"id2_x\"].astype(\"category\")\n df[\"id2_x\"] = df[\"id2_x\"].astype(str)\n if \"id2_y\" in df.columns:\n df[\"id2_y\"] = df[\"id2_y\"].astype(\"category\")\n df[\"id2_y\"] = df[\"id2_y\"].astype(str)\n if \"id3\" in df.columns:\n df[\"id3\"] = df[\"id3\"].astype(\"category\")\n df[\"id3\"] = df[\"id3\"].astype(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q1_TestMerge.test_h2o_q1.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q1_TestMerge.test_h2o_q1.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1492, "end_line": 1506, "span_ids": ["TestMerge.test_h2o_q1"], "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 TestMerge:\n\n def test_h2o_q1(self):\n lhs = self._get_h2o_df(self.h2o_data)\n rhs = self._get_h2o_df(self.h2o_data_small)\n\n ref = lhs.merge(rhs, on=\"id1\")\n self._fix_category_cols(ref)\n\n modin_lhs = pd.DataFrame(lhs)\n modin_rhs = pd.DataFrame(rhs)\n modin_res = modin_lhs.merge(modin_rhs, on=\"id1\")\n\n exp = to_pandas(modin_res)\n self._fix_category_cols(exp)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q2_TestMerge.test_h2o_q2.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q2_TestMerge.test_h2o_q2.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1508, "end_line": 1522, "span_ids": ["TestMerge.test_h2o_q2"], "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 TestMerge:\n\n def test_h2o_q2(self):\n lhs = self._get_h2o_df(self.h2o_data)\n rhs = self._get_h2o_df(self.h2o_data_medium)\n\n ref = lhs.merge(rhs, on=\"id2\")\n self._fix_category_cols(ref)\n\n modin_lhs = pd.DataFrame(lhs)\n modin_rhs = pd.DataFrame(rhs)\n modin_res = modin_lhs.merge(modin_rhs, on=\"id2\")\n\n exp = to_pandas(modin_res)\n self._fix_category_cols(exp)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q3_TestMerge.test_h2o_q3.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q3_TestMerge.test_h2o_q3.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1524, "end_line": 1538, "span_ids": ["TestMerge.test_h2o_q3"], "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 TestMerge:\n\n def test_h2o_q3(self):\n lhs = self._get_h2o_df(self.h2o_data)\n rhs = self._get_h2o_df(self.h2o_data_medium)\n\n ref = lhs.merge(rhs, how=\"left\", on=\"id2\")\n self._fix_category_cols(ref)\n\n modin_lhs = pd.DataFrame(lhs)\n modin_rhs = pd.DataFrame(rhs)\n modin_res = modin_lhs.merge(modin_rhs, how=\"left\", on=\"id2\")\n\n exp = to_pandas(modin_res)\n self._fix_category_cols(exp)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q4_TestMerge.test_h2o_q4.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q4_TestMerge.test_h2o_q4.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1540, "end_line": 1554, "span_ids": ["TestMerge.test_h2o_q4"], "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 TestMerge:\n\n def test_h2o_q4(self):\n lhs = self._get_h2o_df(self.h2o_data)\n rhs = self._get_h2o_df(self.h2o_data_medium)\n\n ref = lhs.merge(rhs, on=\"id5\")\n self._fix_category_cols(ref)\n\n modin_lhs = pd.DataFrame(lhs)\n modin_rhs = pd.DataFrame(rhs)\n modin_res = modin_lhs.merge(modin_rhs, on=\"id5\")\n\n exp = to_pandas(modin_res)\n self._fix_category_cols(exp)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q5_TestMerge.test_h2o_q5.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_h2o_q5_TestMerge.test_h2o_q5.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1556, "end_line": 1570, "span_ids": ["TestMerge.test_h2o_q5"], "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 TestMerge:\n\n def test_h2o_q5(self):\n lhs = self._get_h2o_df(self.h2o_data)\n rhs = self._get_h2o_df(self.h2o_data_big)\n\n ref = lhs.merge(rhs, on=\"id3\")\n self._fix_category_cols(ref)\n\n modin_lhs = pd.DataFrame(lhs)\n modin_rhs = pd.DataFrame(rhs)\n modin_res = modin_lhs.merge(modin_rhs, on=\"id3\")\n\n exp = to_pandas(modin_res)\n self._fix_category_cols(exp)\n\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.dt_data1_TestMerge.right_data._c_1_2_3_4_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.dt_data1_TestMerge.right_data._c_1_2_3_4_b_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1572, "end_line": 1588, "span_ids": ["TestMerge.test_merge_dt", "TestMerge:22", "TestMerge:18"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMerge:\n\n dt_data1 = {\n \"id\": [1, 2],\n \"timestamp\": pandas.to_datetime([\"20000101\", \"20000201\"], format=\"%Y%m%d\"),\n }\n dt_data2 = {\"id\": [1, 2], \"timestamp_year\": [2000, 2000]}\n\n def test_merge_dt(self):\n def merge(df1, df2, **kwargs):\n df1[\"timestamp_year\"] = df1[\"timestamp\"].dt.year\n res = df1.merge(df2, how=\"left\", on=[\"id\", \"timestamp_year\"])\n res[\"timestamp_year\"] = res[\"timestamp_year\"].fillna(np.int64(-1))\n return res\n\n run_and_compare(merge, data=self.dt_data1, data2=self.dt_data2)\n\n left_data = {\"a\": [1, 2, 3, 4], \"b\": [10, 20, 30, 40], \"c\": [11, 12, 13, 14]}\n right_data = {\"c\": [1, 2, 3, 4], \"b\": [10, 20, 30, 40], \"d\": [100, 200, 300, 400]}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp_TestBinaryOp.test_add_list.run_and_compare_add_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp_TestBinaryOp.test_add_list.run_and_compare_add_data", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1629, "end_line": 1663, "span_ids": ["TestBinaryOp.test_binary_level", "TestBinaryOp.test_add_list", "TestBinaryOp", "TestBinaryOp.test_add_cst"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBinaryOp:\n data = {\n \"a\": [1, 1, 1, 1, 1],\n \"b\": [10, 10, 10, 10, 10],\n \"c\": [100, 100, 100, 100, 100],\n \"d\": [1000, 1000, 1000, 1000, 1000],\n }\n data2 = {\n \"a\": [1, 1, 1, 1, 1],\n \"f\": [2, 2, 2, 2, 2],\n \"b\": [3, 3, 3, 3, 3],\n \"d\": [4, 4, 4, 4, 4],\n }\n fill_values = [None, 1]\n\n def test_binary_level(self):\n def applier(df1, df2, **kwargs):\n df2.index = generate_multiindex(len(df2))\n return df1.add(df2, level=1)\n\n # setting `force_lazy=False`, because we're expecting to fallback\n # to pandas in that case, which is not supported in lazy mode\n run_and_compare(applier, data=self.data, data2=self.data, force_lazy=False)\n\n def test_add_cst(self):\n def add(df, **kwargs):\n return df + 1\n\n run_and_compare(add, data=self.data)\n\n def test_add_list(self):\n def add(df, **kwargs):\n return df + [1, 2, 3, 4]\n\n run_and_compare(add, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_add_method_columns_TestBinaryOp.test_add_method_columns.run_and_compare_add2_dat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_add_method_columns_TestBinaryOp.test_add_method_columns.run_and_compare_add2_dat", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1665, "end_line": 1674, "span_ids": ["TestBinaryOp.test_add_method_columns"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"fill_value\", fill_values)\n def test_add_method_columns(self, fill_value):\n def add1(df, fill_value, **kwargs):\n return df[\"a\"].add(df[\"b\"], fill_value=fill_value)\n\n def add2(df, fill_value, **kwargs):\n return df[[\"a\", \"c\"]].add(df[[\"b\", \"a\"]], fill_value=fill_value)\n\n run_and_compare(add1, data=self.data, fill_value=fill_value)\n run_and_compare(add2, data=self.data, fill_value=fill_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_add_columns_TestBinaryOp.test_mul_list.run_and_compare_mul_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_add_columns_TestBinaryOp.test_mul_list.run_and_compare_mul_data", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1676, "end_line": 1710, "span_ids": ["TestBinaryOp.test_add_columns_and_assign", "TestBinaryOp.test_mul_list", "TestBinaryOp.test_mul_cst", "TestBinaryOp.test_add_columns", "TestBinaryOp.test_add_columns_and_assign_to_existing"], "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 TestBinaryOp:\n\n def test_add_columns(self):\n def add1(df, **kwargs):\n return df[\"a\"] + df[\"b\"]\n\n def add2(df, **kwargs):\n return df[[\"a\", \"c\"]] + df[[\"b\", \"a\"]]\n\n run_and_compare(add1, data=self.data)\n run_and_compare(add2, data=self.data)\n\n def test_add_columns_and_assign(self):\n def add(df, **kwargs):\n df[\"sum\"] = df[\"a\"] + df[\"b\"]\n return df\n\n run_and_compare(add, data=self.data)\n\n def test_add_columns_and_assign_to_existing(self):\n def add(df, **kwargs):\n df[\"a\"] = df[\"a\"] + df[\"b\"]\n return df\n\n run_and_compare(add, data=self.data)\n\n def test_mul_cst(self):\n def mul(df, **kwargs):\n return df * 2\n\n run_and_compare(mul, data=self.data)\n\n def test_mul_list(self):\n def mul(df, **kwargs):\n return df * [2, 3, 4, 5]\n\n run_and_compare(mul, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mul_method_columns_TestBinaryOp.test_mul_method_columns.run_and_compare_mul2_dat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mul_method_columns_TestBinaryOp.test_mul_method_columns.run_and_compare_mul2_dat", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1712, "end_line": 1721, "span_ids": ["TestBinaryOp.test_mul_method_columns"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"fill_value\", fill_values)\n def test_mul_method_columns(self, fill_value):\n def mul1(df, fill_value, **kwargs):\n return df[\"a\"].mul(df[\"b\"], fill_value=fill_value)\n\n def mul2(df, fill_value, **kwargs):\n return df[[\"a\", \"c\"]].mul(df[[\"b\", \"a\"]], fill_value=fill_value)\n\n run_and_compare(mul1, data=self.data, fill_value=fill_value)\n run_and_compare(mul2, data=self.data, fill_value=fill_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mul_columns_TestBinaryOp.test_mod_list.run_and_compare_mod_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mul_columns_TestBinaryOp.test_mod_list.run_and_compare_mod_data", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1723, "end_line": 1743, "span_ids": ["TestBinaryOp.test_mod_cst", "TestBinaryOp.test_mod_list", "TestBinaryOp.test_mul_columns"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBinaryOp:\n\n def test_mul_columns(self):\n def mul1(df, **kwargs):\n return df[\"a\"] * df[\"b\"]\n\n def mul2(df, **kwargs):\n return df[[\"a\", \"c\"]] * df[[\"b\", \"a\"]]\n\n run_and_compare(mul1, data=self.data)\n run_and_compare(mul2, data=self.data)\n\n def test_mod_cst(self):\n def mod(df, **kwargs):\n return df % 2\n\n run_and_compare(mod, data=self.data)\n\n def test_mod_list(self):\n def mod(df, **kwargs):\n return df % [2, 3, 4, 5]\n\n run_and_compare(mod, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mod_method_columns_TestBinaryOp.test_mod_method_columns.run_and_compare_mod2_dat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mod_method_columns_TestBinaryOp.test_mod_method_columns.run_and_compare_mod2_dat", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1745, "end_line": 1754, "span_ids": ["TestBinaryOp.test_mod_method_columns"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"fill_value\", fill_values)\n def test_mod_method_columns(self, fill_value):\n def mod1(df, fill_value, **kwargs):\n return df[\"a\"].mod(df[\"b\"], fill_value=fill_value)\n\n def mod2(df, fill_value, **kwargs):\n return df[[\"a\", \"c\"]].mod(df[[\"b\", \"a\"]], fill_value=fill_value)\n\n run_and_compare(mod1, data=self.data, fill_value=fill_value)\n run_and_compare(mod2, data=self.data, fill_value=fill_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mod_columns_TestBinaryOp.test_truediv_list.run_and_compare_truediv_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_mod_columns_TestBinaryOp.test_truediv_list.run_and_compare_truediv_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1756, "end_line": 1776, "span_ids": ["TestBinaryOp.test_mod_columns", "TestBinaryOp.test_truediv_list", "TestBinaryOp.test_truediv_cst"], "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 TestBinaryOp:\n\n def test_mod_columns(self):\n def mod1(df, **kwargs):\n return df[\"a\"] % df[\"b\"]\n\n def mod2(df, **kwargs):\n return df[[\"a\", \"c\"]] % df[[\"b\", \"a\"]]\n\n run_and_compare(mod1, data=self.data)\n run_and_compare(mod2, data=self.data)\n\n def test_truediv_cst(self):\n def truediv(df, **kwargs):\n return df / 2\n\n run_and_compare(truediv, data=self.data)\n\n def test_truediv_list(self):\n def truediv(df, **kwargs):\n return df / [1, 0.5, 0.2, 2.0]\n\n run_and_compare(truediv, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_truediv_method_columns_TestBinaryOp.test_truediv_method_columns.run_and_compare_truediv2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_truediv_method_columns_TestBinaryOp.test_truediv_method_columns.run_and_compare_truediv2_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1778, "end_line": 1787, "span_ids": ["TestBinaryOp.test_truediv_method_columns"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"fill_value\", fill_values)\n def test_truediv_method_columns(self, fill_value):\n def truediv1(df, fill_value, **kwargs):\n return df[\"a\"].truediv(df[\"b\"], fill_value=fill_value)\n\n def truediv2(df, fill_value, **kwargs):\n return df[[\"a\", \"c\"]].truediv(df[[\"b\", \"a\"]], fill_value=fill_value)\n\n run_and_compare(truediv1, data=self.data, fill_value=fill_value)\n run_and_compare(truediv2, data=self.data, fill_value=fill_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_truediv_columns_TestBinaryOp.test_floordiv_list.run_and_compare_floordiv_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_truediv_columns_TestBinaryOp.test_floordiv_list.run_and_compare_floordiv_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1789, "end_line": 1809, "span_ids": ["TestBinaryOp.test_floordiv_list", "TestBinaryOp.test_truediv_columns", "TestBinaryOp.test_floordiv_cst"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBinaryOp:\n\n def test_truediv_columns(self):\n def truediv1(df, **kwargs):\n return df[\"a\"] / df[\"b\"]\n\n def truediv2(df, **kwargs):\n return df[[\"a\", \"c\"]] / df[[\"b\", \"a\"]]\n\n run_and_compare(truediv1, data=self.data)\n run_and_compare(truediv2, data=self.data)\n\n def test_floordiv_cst(self):\n def floordiv(df, **kwargs):\n return df // 2\n\n run_and_compare(floordiv, data=self.data)\n\n def test_floordiv_list(self):\n def floordiv(df, **kwargs):\n return df // [1, 0.54, 0.24, 2.01]\n\n run_and_compare(floordiv, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_floordiv_method_columns_TestBinaryOp.test_floordiv_method_columns.run_and_compare_floordiv2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_floordiv_method_columns_TestBinaryOp.test_floordiv_method_columns.run_and_compare_floordiv2", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1811, "end_line": 1820, "span_ids": ["TestBinaryOp.test_floordiv_method_columns"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"fill_value\", fill_values)\n def test_floordiv_method_columns(self, fill_value):\n def floordiv1(df, fill_value, **kwargs):\n return df[\"a\"].floordiv(df[\"b\"], fill_value=fill_value)\n\n def floordiv2(df, fill_value, **kwargs):\n return df[[\"a\", \"c\"]].floordiv(df[[\"b\", \"a\"]], fill_value=fill_value)\n\n run_and_compare(floordiv1, data=self.data, fill_value=fill_value)\n run_and_compare(floordiv2, data=self.data, fill_value=fill_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_floordiv_columns_TestBinaryOp.test_cmp_list.run_and_compare_cmp_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_floordiv_columns_TestBinaryOp.test_cmp_list.run_and_compare_cmp_data", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1822, "end_line": 1855, "span_ids": ["TestBinaryOp.test_cmp_cst", "TestBinaryOp:8", "TestBinaryOp.test_cmp_list", "TestBinaryOp.test_floordiv_columns"], "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 TestBinaryOp:\n\n def test_floordiv_columns(self):\n def floordiv1(df, **kwargs):\n return df[\"a\"] // df[\"b\"]\n\n def floordiv2(df, **kwargs):\n return df[[\"a\", \"c\"]] // df[[\"b\", \"a\"]]\n\n run_and_compare(floordiv1, data=self.data)\n run_and_compare(floordiv2, data=self.data)\n\n cmp_data = {\n \"a\": [1, 2, 3, 4, 5],\n \"b\": [10, 20, 30, 40, 50],\n \"c\": [50.0, 40.0, 30.1, 20.0, 10.0],\n }\n cmp_fn_values = [\"eq\", \"ne\", \"le\", \"lt\", \"ge\", \"gt\"]\n\n @pytest.mark.parametrize(\"cmp_fn\", cmp_fn_values)\n def test_cmp_cst(self, cmp_fn):\n def cmp1(df, cmp_fn, **kwargs):\n return getattr(df[\"a\"], cmp_fn)(3)\n\n def cmp2(df, cmp_fn, **kwargs):\n return getattr(df, cmp_fn)(30)\n\n run_and_compare(cmp1, data=self.cmp_data, cmp_fn=cmp_fn)\n run_and_compare(cmp2, data=self.cmp_data, cmp_fn=cmp_fn)\n\n @pytest.mark.parametrize(\"cmp_fn\", cmp_fn_values)\n def test_cmp_list(self, cmp_fn):\n def cmp(df, cmp_fn, **kwargs):\n return getattr(df, cmp_fn)([3, 30, 30.1])\n\n run_and_compare(cmp, data=self.cmp_data, cmp_fn=cmp_fn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_cmp_cols_TestBinaryOp.test_cmp_cols.run_and_compare_cmp2_dat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_cmp_cols_TestBinaryOp.test_cmp_cols.run_and_compare_cmp2_dat", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1857, "end_line": 1866, "span_ids": ["TestBinaryOp.test_cmp_cols"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"cmp_fn\", cmp_fn_values)\n def test_cmp_cols(self, cmp_fn):\n def cmp1(df, cmp_fn, **kwargs):\n return getattr(df[\"b\"], cmp_fn)(df[\"c\"])\n\n def cmp2(df, cmp_fn, **kwargs):\n return getattr(df[[\"b\", \"c\"]], cmp_fn)(df[[\"a\", \"b\"]])\n\n run_and_compare(cmp1, data=self.cmp_data, cmp_fn=cmp_fn)\n run_and_compare(cmp2, data=self.cmp_data, cmp_fn=cmp_fn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_cmp_mixed_types_TestBinaryOp.test_cmp_mixed_types.run_and_compare_cmp_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_cmp_mixed_types_TestBinaryOp.test_cmp_mixed_types.run_and_compare_cmp_data", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1868, "end_line": 1875, "span_ids": ["TestBinaryOp.test_cmp_mixed_types"], "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": "class TestBinaryOp:\n\n @pytest.mark.parametrize(\"cmp_fn\", cmp_fn_values)\n @pytest.mark.parametrize(\"value\", [2, 2.2, \"a\"])\n @pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n def test_cmp_mixed_types(self, cmp_fn, value, data):\n def cmp(df, cmp_fn, value, **kwargs):\n return getattr(df, cmp_fn)(value)\n\n run_and_compare(cmp, data=data, cmp_fn=cmp_fn, value=value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_filter_dtypes_TestBinaryOp.test_complex_filter.run_and_compare_filter_or": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_filter_dtypes_TestBinaryOp.test_complex_filter.run_and_compare_filter_or", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1877, "end_line": 1897, "span_ids": ["TestBinaryOp.test_complex_filter", "TestBinaryOp.test_filter_dtypes", "TestBinaryOp.test_filter_empty_result"], "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 TestBinaryOp:\n\n def test_filter_dtypes(self):\n def filter(df, **kwargs):\n return df[df.a < 4].dtypes\n\n run_and_compare(filter, data=self.cmp_data)\n\n def test_filter_empty_result(self):\n def filter(df, **kwargs):\n return df[df.a < 0]\n\n run_and_compare(filter, data=self.cmp_data)\n\n def test_complex_filter(self):\n def filter_and(df, **kwargs):\n return df[(df.a < 5) & (df.b > 20)]\n\n def filter_or(df, **kwargs):\n return df[(df.a < 3) | (df.b > 40)]\n\n run_and_compare(filter_and, data=self.cmp_data)\n run_and_compare(filter_or, data=self.cmp_data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_string_bin_op_TestBinaryOp.test_string_bin_op.for_op_arg_in_bin_ops_it.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_string_bin_op_TestBinaryOp.test_string_bin_op.for_op_arg_in_bin_ops_it.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1899, "end_line": 1912, "span_ids": ["TestBinaryOp.test_string_bin_op"], "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 TestBinaryOp:\n\n def test_string_bin_op(self):\n def test_bin_op(df, op_name, op_arg, **kwargs):\n return getattr(df, op_name)(op_arg)\n\n bin_ops = {\n \"__add__\": \"_sfx\",\n \"__radd__\": \"pref_\",\n \"__mul__\": 10,\n }\n\n for op, arg in bin_ops.items():\n run_and_compare(\n test_bin_op, data={\"a\": [\"a\"]}, op_name=op, op_arg=arg, force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_arithmetic_ops_TestBinaryOp.test_arithmetic_ops.for_op_in_.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_arithmetic_ops_TestBinaryOp.test_arithmetic_ops.for_op_in_.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1914, "end_line": 1933, "span_ids": ["TestBinaryOp.test_arithmetic_ops"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\"force_hdk\", [False, True])\n def test_arithmetic_ops(self, force_hdk):\n def compute(df, operation, **kwargs):\n df = getattr(df, operation)(3)\n return df\n\n for op in (\n \"__add__\",\n \"__sub__\",\n \"__mul__\",\n \"__pow__\",\n \"__truediv__\",\n \"__floordiv__\",\n ):\n run_and_compare(\n compute,\n {\"A\": [1, 2, 3, 4, 5]},\n operation=op,\n force_hdk_execute=force_hdk,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_invert_op_TestBinaryOp.test_invert_op.run_and_compare_invert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBinaryOp.test_invert_op_TestBinaryOp.test_invert_op.run_and_compare_invert_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1935, "end_line": 1949, "span_ids": ["TestBinaryOp.test_invert_op"], "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 TestBinaryOp:\n\n @pytest.mark.parametrize(\n \"force_hdk\",\n [\n False,\n pytest.param(\n True,\n marks=pytest.mark.xfail(reason=\"Invert is not yet supported by HDK\"),\n ),\n ],\n )\n def test_invert_op(self, force_hdk):\n def invert(df, **kwargs):\n return ~df\n\n run_and_compare(invert, {\"A\": [1, 2, 3, 4, 5]}, force_hdk_execute=force_hdk)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDateTime_TestDateTime.test_dt_hour.run_and_compare_dt_hour_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDateTime_TestDateTime.test_dt_hour.run_and_compare_dt_hour_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1952, "end_line": 1992, "span_ids": ["TestDateTime.test_dt_month", "TestDateTime.test_dt_hour", "TestDateTime", "TestDateTime.test_dt_day", "TestDateTime.test_dt_year"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDateTime:\n datetime_data = {\n \"a\": [1, 1, 2, 2],\n \"b\": [11, 21, 12, 11],\n \"c\": pandas.to_datetime(\n [\"20190902\", \"20180913\", \"20190921\", \"20180903\"], format=\"%Y%m%d\"\n ),\n \"d\": pandas.to_datetime(\n [\n \"2018-10-26 12:00\",\n \"2018-10-26 13:00:15\",\n \"2020-10-26 04:00:15\",\n \"2020-10-26\",\n ],\n format=\"mixed\",\n ),\n }\n\n def test_dt_year(self):\n def dt_year(df, **kwargs):\n return df[\"c\"].dt.year\n\n run_and_compare(dt_year, data=self.datetime_data)\n\n def test_dt_month(self):\n def dt_month(df, **kwargs):\n return df[\"c\"].dt.month\n\n run_and_compare(dt_month, data=self.datetime_data)\n\n def test_dt_day(self):\n def dt_day(df, **kwargs):\n return df[\"c\"].dt.day\n\n run_and_compare(dt_day, data=self.datetime_data)\n\n def test_dt_hour(self):\n def dt_hour(df, **kwargs):\n return df[\"d\"].dt.hour\n\n run_and_compare(dt_hour, data=self.datetime_data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCategory_TestCategory.test_cat_codes.df_equals_pandas_df_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCategory_TestCategory.test_cat_codes.df_equals_pandas_df_exp_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1995, "end_line": 2011, "span_ids": ["TestCategory.test_cat_codes", "TestCategory"], "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 TestCategory:\n data = {\n \"a\": [\"str1\", \"str2\", \"str1\", \"str3\", \"str2\", None],\n }\n\n def test_cat_codes(self):\n pandas_df = pandas.DataFrame(self.data)\n pandas_df[\"a\"] = pandas_df[\"a\"].astype(\"category\")\n\n modin_df = pd.DataFrame(pandas_df)\n\n modin_df[\"a\"] = modin_df[\"a\"].cat.codes\n exp = to_pandas(modin_df)\n\n pandas_df[\"a\"] = pandas_df[\"a\"].cat.codes\n\n df_equals(pandas_df, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort_TestSort.na_position_values._first_last_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort_TestSort.na_position_values._first_last_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2014, "end_line": 2035, "span_ids": ["TestSort"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSort:\n data = {\n \"a\": [1, 2, 5, 2, 5, 4, 4, 5, 2],\n \"b\": [1, 2, 3, 6, 5, 1, 4, 5, 3],\n \"c\": [5, 4, 2, 3, 1, 1, 4, 5, 6],\n \"d\": [\"1\", \"4\", \"3\", \"2\", \"1\", \"6\", \"7\", \"5\", \"0\"],\n }\n data_nulls = {\n \"a\": [1, 2, 5, 2, 5, 4, 4, None, 2],\n \"b\": [1, 2, 3, 6, 5, None, 4, 5, 3],\n \"c\": [None, 4, 2, 3, 1, 1, 4, 5, 6],\n }\n data_multiple_nulls = {\n \"a\": [1, 2, None, 2, 5, 4, 4, None, 2],\n \"b\": [1, 2, 3, 6, 5, None, 4, 5, None],\n \"c\": [None, 4, 2, None, 1, 1, 4, 5, 6],\n }\n cols_values = [\"a\", [\"a\", \"b\"], [\"b\", \"a\"], [\"c\", \"a\", \"b\"]]\n index_cols_values = [None, \"a\", [\"a\", \"b\"]]\n ascending_values = [True, False]\n ascending_list_values = [[True, False], [False, True]]\n na_position_values = [\"first\", \"last\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_TestSort.test_sort_cols.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_TestSort.test_sort_cols.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2037, "end_line": 2057, "span_ids": ["TestSort.test_sort_cols"], "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 TestSort:\n\n @pytest.mark.parametrize(\"cols\", cols_values)\n @pytest.mark.parametrize(\"ignore_index\", bool_arg_values)\n @pytest.mark.parametrize(\"ascending\", ascending_values)\n @pytest.mark.parametrize(\"index_cols\", index_cols_values)\n def test_sort_cols(self, cols, ignore_index, index_cols, ascending):\n def sort(df, cols, ignore_index, index_cols, ascending, **kwargs):\n if index_cols:\n df = df.set_index(index_cols)\n return df.sort_values(cols, ignore_index=ignore_index, ascending=ascending)\n\n run_and_compare(\n sort,\n data=self.data,\n cols=cols,\n ignore_index=ignore_index,\n index_cols=index_cols,\n ascending=ascending,\n # we're expecting to fallback to pandas in that case,\n # which is not supported in lazy mode\n force_lazy=(index_cols is None),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_asc_list_TestSort.test_sort_cols_str.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_asc_list_TestSort.test_sort_cols_str.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2059, "end_line": 2079, "span_ids": ["TestSort.test_sort_cols_str", "TestSort.test_sort_cols_asc_list"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSort:\n\n @pytest.mark.parametrize(\"ascending\", ascending_list_values)\n def test_sort_cols_asc_list(self, ascending):\n def sort(df, ascending, **kwargs):\n return df.sort_values([\"a\", \"b\"], ascending=ascending)\n\n run_and_compare(\n sort,\n data=self.data,\n ascending=ascending,\n )\n\n @pytest.mark.parametrize(\"ascending\", ascending_values)\n def test_sort_cols_str(self, ascending):\n def sort(df, ascending, **kwargs):\n return df.sort_values(\"d\", ascending=ascending)\n\n run_and_compare(\n sort,\n data=self.data,\n ascending=ascending,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_nulls_TestSort.test_sort_cols_nulls.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort.test_sort_cols_nulls_TestSort.test_sort_cols_nulls.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2081, "end_line": 2094, "span_ids": ["TestSort.test_sort_cols_nulls"], "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 TestSort:\n\n @pytest.mark.parametrize(\"cols\", cols_values)\n @pytest.mark.parametrize(\"ascending\", ascending_values)\n @pytest.mark.parametrize(\"na_position\", na_position_values)\n def test_sort_cols_nulls(self, cols, ascending, na_position):\n def sort(df, cols, ascending, na_position, **kwargs):\n return df.sort_values(cols, ascending=ascending, na_position=na_position)\n\n run_and_compare(\n sort,\n data=self.data_nulls,\n cols=cols,\n ascending=ascending,\n na_position=na_position,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort._Issue_1767_rows_orde_TestSort.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSort._Issue_1767_rows_orde_TestSort.None_14", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2096, "end_line": 2110, "span_ids": ["TestSort.test_sort_cols_nulls"], "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 TestSort:\n\n # Issue #1767 - rows order is not preserved for NULL keys\n # @pytest.mark.parametrize(\"cols\", cols_values)\n # @pytest.mark.parametrize(\"ascending\", ascending_values)\n # @pytest.mark.parametrize(\"na_position\", na_position_values)\n # def test_sort_cols_multiple_nulls(self, cols, ascending, na_position):\n # def sort(df, cols, ascending, na_position, **kwargs):\n # return df.sort_values(cols, ascending=ascending, na_position=na_position)\n #\n # run_and_compare(\n # sort,\n # data=self.data_multiple_nulls,\n # cols=cols,\n # ascending=ascending,\n # na_position=na_position,\n # )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData_TestBadData.test_heterogenous_fillna.run_and_compare_fillna_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData_TestBadData.test_heterogenous_fillna.run_and_compare_fillna_d", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2113, "end_line": 2166, "span_ids": ["TestBadData.test_with_normal_frame", "TestBadData", "TestBadData.test_from_arrow", "TestBadData.test_methods", "TestBadData._get_pyarrow_table", "TestBadData.test_construct", "TestBadData.test_heterogenous_fillna"], "tokens": 468}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBadData:\n bad_for_arrow = {\n \"a\": [\"a\", [[1, 2], [3]], [3, 4]],\n \"b\": [\"b\", [1, 2], [3, 4]],\n \"c\": [\"1\", \"2\", 3],\n }\n bad_for_hdk = {\n \"b\": [[1, 2], [3, 4], [5, 6]],\n \"c\": [\"1\", \"2\", \"3\"],\n }\n ok_data = {\"d\": np.arange(3), \"e\": np.arange(3), \"f\": np.arange(3)}\n\n def _get_pyarrow_table(self, obj):\n if not isinstance(obj, (pandas.DataFrame, pandas.Series)):\n obj = pandas.DataFrame(obj)\n\n return pyarrow.Table.from_pandas(obj)\n\n @pytest.mark.parametrize(\"data\", [bad_for_arrow, bad_for_hdk])\n def test_construct(self, data):\n def applier(df, *args, **kwargs):\n return repr(df)\n\n run_and_compare(applier, data=data, force_lazy=False)\n\n def test_from_arrow(self):\n at = self._get_pyarrow_table(self.bad_for_hdk)\n pd_df = pandas.DataFrame(self.bad_for_hdk)\n md_df = pd.utils.from_arrow(at)\n\n # force materialization\n repr(md_df)\n df_equals(md_df, pd_df)\n\n @pytest.mark.parametrize(\"data\", [bad_for_arrow, bad_for_hdk])\n def test_methods(self, data):\n def applier(df, *args, **kwargs):\n return df.T.drop(columns=[0])\n\n run_and_compare(applier, data=data, force_lazy=False)\n\n def test_with_normal_frame(self):\n def applier(df1, df2, *args, **kwargs):\n return df2.join(df1)\n\n run_and_compare(\n applier, data=self.bad_for_hdk, data2=self.ok_data, force_lazy=False\n )\n\n def test_heterogenous_fillna(self):\n def fillna(df, **kwargs):\n return df[\"d\"].fillna(\"a\")\n\n run_and_compare(fillna, data=self.ok_data, force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_TestBadData.test_uint.with_ForceHdkImport_md_df.np_testing_assert_array_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_TestBadData.test_uint.with_ForceHdkImport_md_df.np_testing_assert_array_e", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2168, "end_line": 2208, "span_ids": ["TestBadData.test_uint"], "tokens": 443}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBadData:\n\n @pytest.mark.parametrize(\n \"md_df_constructor\",\n [\n pytest.param(pd.DataFrame, id=\"from_pandas_dataframe\"),\n pytest.param(\n lambda pd_df: from_arrow(pyarrow.Table.from_pandas(pd_df)),\n id=\"from_pyarrow_table\",\n ),\n ],\n )\n def test_uint(self, md_df_constructor):\n \"\"\"\n Verify that unsigned integer data could be imported-exported via HDK with no errors.\n\n Originally, HDK does not support unsigned integers, there's a logic in Modin that\n upcasts unsigned types to the compatible ones prior importing to HDK.\n \"\"\"\n pd_df = pandas.DataFrame(\n {\n \"uint8_in_int_bounds\": np.array([1, 2, 3], dtype=\"uint8\"),\n \"uint8_out-of_int_bounds\": np.array(\n [(2**8) - 1, (2**8) - 2, (2**8) - 3], dtype=\"uint8\"\n ),\n \"uint16_in_int_bounds\": np.array([1, 2, 3], dtype=\"uint16\"),\n \"uint16_out-of_int_bounds\": np.array(\n [(2**16) - 1, (2**16) - 2, (2**16) - 3], dtype=\"uint16\"\n ),\n \"uint32_in_int_bounds\": np.array([1, 2, 3], dtype=\"uint32\"),\n \"uint32_out-of_int_bounds\": np.array(\n [(2**32) - 1, (2**32) - 2, (2**32) - 3], dtype=\"uint32\"\n ),\n \"uint64_in_int_bounds\": np.array([1, 2, 3], dtype=\"uint64\"),\n }\n )\n md_df = md_df_constructor(pd_df)\n\n with ForceHdkImport(md_df) as instance:\n md_df_exported = instance.export_frames()[0]\n result = md_df_exported.values\n reference = pd_df.values\n np.testing.assert_array_equal(result, reference)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_overflow_TestBadData.test_uint_overflow.with_pytest_raises_Overfl.with_ForceHdkImport_md_df.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_overflow_TestBadData.test_uint_overflow.with_pytest_raises_Overfl.with_ForceHdkImport_md_df.pass", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2210, "end_line": 2240, "span_ids": ["TestBadData.test_uint_overflow"], "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 TestBadData:\n\n @pytest.mark.parametrize(\n \"md_df_constructor\",\n [\n pytest.param(pd.DataFrame, id=\"from_pandas_dataframe\"),\n pytest.param(\n lambda pd_df: from_arrow(pyarrow.Table.from_pandas(pd_df)),\n id=\"from_pyarrow_table\",\n ),\n ],\n )\n def test_uint_overflow(self, md_df_constructor):\n \"\"\"\n Verify that the exception is arisen when overflow occurs due to 'uint -> int' compatibility conversion.\n\n Originally, HDK does not support unsigned integers, there's a logic in Modin that upcasts\n unsigned types to the compatible ones prior importing to HDK. This test ensures that the\n error is arisen when such conversion causes a data loss.\n \"\"\"\n md_df = md_df_constructor(\n pandas.DataFrame(\n {\n \"col\": np.array(\n [(2**64) - 1, (2**64) - 2, (2**64) - 3], dtype=\"uint64\"\n )\n }\n )\n )\n\n with pytest.raises(OverflowError):\n with ForceHdkImport(md_df):\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_serialization_TestBadData.test_uint_serialization.assert_df_astype_np_uint6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_uint_serialization_TestBadData.test_uint_serialization.assert_df_astype_np_uint6", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2242, "end_line": 2274, "span_ids": ["TestBadData.test_uint_serialization"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBadData:\n\n def test_uint_serialization(self):\n # Tests for CalciteSerializer.serialize_literal()\n df = pd.DataFrame({\"A\": [np.nan, 1]})\n assert (\n df.fillna(np.uint8(np.iinfo(np.uint8).max)).sum()[0]\n == np.iinfo(np.uint8).max + 1\n )\n assert (\n df.fillna(np.uint16(np.iinfo(np.uint16).max)).sum()[0]\n == np.iinfo(np.uint16).max + 1\n )\n assert (\n df.fillna(np.uint32(np.iinfo(np.uint32).max)).sum()[0]\n == np.iinfo(np.uint32).max + 1\n )\n # HDK represents 'uint64' as 'int64' internally due to a lack of support\n # for unsigned ints, that's why using 'int64.max' here\n assert (\n df.fillna(np.uint64(np.iinfo(np.int64).max - 1)).sum()[0]\n == np.iinfo(np.int64).max\n )\n\n # Tests for CalciteSerializer.serialize_dtype()\n df = pd.DataFrame({\"A\": [np.iinfo(np.uint8).max, 1]})\n assert df.astype(np.uint8).sum()[0] == np.iinfo(np.uint8).max + 1\n df = pd.DataFrame({\"A\": [np.iinfo(np.uint16).max, 1]})\n assert df.astype(np.uint16).sum()[0] == np.iinfo(np.uint16).max + 1\n df = pd.DataFrame({\"A\": [np.iinfo(np.uint32).max, 1]})\n assert df.astype(np.uint32).sum()[0] == np.iinfo(np.uint32).max + 1\n # HDK represents 'uint64' as 'int64' internally due to a lack of support\n # for unsigned ints, that's why using 'int64.max' here\n df = pd.DataFrame({\"A\": [np.iinfo(np.int64).max - 1, 1]})\n assert df.astype(np.uint64).sum()[0] == np.iinfo(np.int64).max", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_mean_sum_TestBadData.test_mean_sum.for_c_in_supported_codes_.for_op_in_sum_mean_.run_and_compare_test_dat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestBadData.test_mean_sum_TestBadData.test_mean_sum.for_c_in_supported_codes_.for_op_in_sum_mean_.run_and_compare_test_dat", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2276, "end_line": 2287, "span_ids": ["TestBadData.test_mean_sum"], "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 TestBadData:\n\n def test_mean_sum(self):\n all_codes = np.typecodes[\"All\"]\n exclude_codes = np.typecodes[\"Datetime\"] + np.typecodes[\"Complex\"] + \"gSUVO\"\n supported_codes = set(all_codes) - set(exclude_codes)\n\n def test(df, dtype_code, operation, **kwargs):\n df = type(df)({\"A\": [0, 1], \"B\": [1, 0]}, dtype=np.dtype(dtype_code))\n return getattr(df, operation)()\n\n for c in supported_codes:\n for op in (\"sum\", \"mean\"):\n run_and_compare(test, data={}, dtype_code=c, operation=op)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna_TestDropna.test_dropna.run_and_compare_applier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna_TestDropna.test_dropna.run_and_compare_applier_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2290, "end_line": 2304, "span_ids": ["TestDropna.test_dropna", "TestDropna"], "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 TestDropna:\n data = {\n \"col1\": [1, 2, None, 2, 1],\n \"col2\": [None, 3, None, 2, 1],\n \"col3\": [2, 3, 4, None, 5],\n \"col4\": [1, 2, 3, 4, 5],\n }\n\n @pytest.mark.parametrize(\"subset\", [None, [\"col1\", \"col2\"]])\n @pytest.mark.parametrize(\"how\", [\"all\", \"any\"])\n def test_dropna(self, subset, how):\n def applier(df, *args, **kwargs):\n return df.dropna(subset=subset, how=how)\n\n run_and_compare(applier, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna.test_dropna_multiindex_TestDropna.test_dropna_multiindex.df_equals_md_res_pd_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna.test_dropna_multiindex_TestDropna.test_dropna_multiindex.df_equals_md_res_pd_res_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2306, "end_line": 2321, "span_ids": ["TestDropna.test_dropna_multiindex"], "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 TestDropna:\n\n def test_dropna_multiindex(self):\n index = generate_multiindex(len(self.data[\"col1\"]))\n\n md_df = pd.DataFrame(self.data, index=index)\n pd_df = pandas.DataFrame(self.data, index=index)\n\n md_res = md_df.dropna()._to_pandas()\n pd_res = pd_df.dropna()\n\n # HACK: all strings in HDK considered to be categories, that breaks\n # checks for equality with pandas, this line discards category dtype\n md_res.index = pandas.MultiIndex.from_tuples(\n md_res.index.values, names=md_res.index.names\n )\n\n df_equals(md_res, pd_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna.test_dropna_groupby_TestDropna.test_dropna_groupby.run_and_compare_applier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDropna.test_dropna_groupby_TestDropna.test_dropna_groupby.run_and_compare_applier_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2323, "end_line": 2333, "span_ids": ["TestDropna.test_dropna_groupby"], "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 TestDropna:\n\n @pytest.mark.skip(\"Dropna logic for GroupBy is disabled for now\")\n @pytest.mark.parametrize(\"by\", [\"col1\", [\"col1\", \"col2\"], [\"col1\", \"col4\"]])\n @pytest.mark.parametrize(\"dropna\", [True, False])\n def test_dropna_groupby(self, by, dropna):\n def applier(df, *args, **kwargs):\n # HDK engine preserves NaNs at the result of groupby,\n # so replacing NaNs with '0' to match with Pandas.\n # https://github.com/modin-project/modin/issues/2878\n return df.groupby(by=by, dropna=dropna).sum().fillna(0)\n\n run_and_compare(applier, data=self.data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestUnsupportedColumns_TestUnsupportedColumns.test_unsupported_columns.if_is_good_.else_.assert_not_obj_and_bad_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestUnsupportedColumns_TestUnsupportedColumns.test_unsupported_columns.if_is_good_.else_.assert_not_obj_and_bad_co", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2336, "end_line": 2354, "span_ids": ["TestUnsupportedColumns", "TestUnsupportedColumns.test_unsupported_columns"], "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 TestUnsupportedColumns:\n @pytest.mark.parametrize(\n \"data,is_good\",\n [\n [[\"1\", \"2\", None, \"2\", \"1\"], True],\n [[None, \"3\", None, \"2\", \"1\"], True],\n [[1, \"2\", None, \"2\", \"1\"], False],\n [[None, 3, None, \"2\", \"1\"], False],\n ],\n )\n def test_unsupported_columns(self, data, is_good):\n pandas_df = pandas.DataFrame({\"col\": data})\n obj, bad_cols = HdkOnNativeDataframePartitionManager._get_unsupported_cols(\n pandas_df\n )\n if is_good:\n assert obj and not bad_cols\n else:\n assert not obj and bad_cols == [\"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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor_TestConstructor.test_shape_hint_detection.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor_TestConstructor.test_shape_hint_detection.None_3", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2357, "end_line": 2378, "span_ids": ["TestConstructor.test_shape_hint_detection", "TestConstructor"], "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 TestConstructor:\n @pytest.mark.parametrize(\n \"index\",\n [\n None,\n pandas.Index([1, 2, 3]),\n pandas.MultiIndex.from_tuples([(1, 1), (2, 2), (3, 3)]),\n ],\n )\n def test_shape_hint_detection(self, index):\n df = pd.DataFrame({\"a\": [1, 2, 3]}, index=index)\n assert df._query_compiler._shape_hint == \"column\"\n\n transposed_data = df._to_pandas().T.to_dict()\n df = pd.DataFrame(transposed_data)\n assert df._query_compiler._shape_hint == \"row\"\n\n df = pd.DataFrame({\"a\": [1, 2, 3], \"b\": [1, 2, 3]}, index=index)\n assert df._query_compiler._shape_hint is None\n\n df = pd.DataFrame({\"a\": [1]}, index=None if index is None else index[:1])\n assert df._query_compiler._shape_hint == \"column\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor.test_shape_hint_detection_from_arrow_TestConstructor.test_shape_hint_detection_from_arrow.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor.test_shape_hint_detection_from_arrow_TestConstructor.test_shape_hint_detection_from_arrow.None_3", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2380, "end_line": 2395, "span_ids": ["TestConstructor.test_shape_hint_detection_from_arrow"], "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 TestConstructor:\n\n def test_shape_hint_detection_from_arrow(self):\n at = pyarrow.Table.from_pydict({\"a\": [1, 2, 3]})\n df = pd.utils.from_arrow(at)\n assert df._query_compiler._shape_hint == \"column\"\n\n at = pyarrow.Table.from_pydict({\"a\": [1], \"b\": [2], \"c\": [3]})\n df = pd.utils.from_arrow(at)\n assert df._query_compiler._shape_hint == \"row\"\n\n at = pyarrow.Table.from_pydict({\"a\": [1, 2, 3], \"b\": [1, 2, 3]})\n df = pd.utils.from_arrow(at)\n assert df._query_compiler._shape_hint is None\n\n at = pyarrow.Table.from_pydict({\"a\": [1]})\n df = pd.utils.from_arrow(at)\n assert df._query_compiler._shape_hint == \"column\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor.test_constructor_from_modin_series_TestConstructor.test_constructor_from_modin_series.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestConstructor.test_constructor_from_modin_series_TestConstructor.test_constructor_from_modin_series.None_2", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2397, "end_line": 2432, "span_ids": ["TestConstructor.test_constructor_from_modin_series"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestConstructor:\n\n def test_constructor_from_modin_series(self):\n def construct_has_common_projection(lib, df, **kwargs):\n return lib.DataFrame({\"col1\": df.iloc[:, 0], \"col2\": df.iloc[:, 1]})\n\n def construct_no_common_projection(lib, df1, df2, **kwargs):\n return lib.DataFrame(\n {\"col1\": df1.iloc[:, 0], \"col2\": df2.iloc[:, 0], \"col3\": df1.iloc[:, 1]}\n )\n\n def construct_mixed_data(lib, df1, df2, **kwargs):\n return lib.DataFrame(\n {\n \"col1\": df1.iloc[:, 0],\n \"col2\": df2.iloc[:, 0],\n \"col3\": df1.iloc[:, 1],\n \"col4\": np.arange(len(df1)),\n }\n )\n\n run_and_compare(\n construct_has_common_projection, data={\"a\": [1, 2, 3, 4], \"b\": [3, 4, 5, 6]}\n )\n run_and_compare(\n construct_no_common_projection,\n data={\"a\": [1, 2, 3, 4], \"b\": [3, 4, 5, 6]},\n data2={\"a\": [10, 20, 30, 40]},\n # HDK doesn't support concatenation of frames that has no common projection\n force_lazy=False,\n )\n run_and_compare(\n construct_mixed_data,\n data={\"a\": [1, 2, 3, 4], \"b\": [3, 4, 5, 6]},\n data2={\"a\": [10, 20, 30, 40]},\n # HDK doesn't support concatenation of frames that has no common projection\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution_TestArrowExecution.data3._a_4_5_6_b_6_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution_TestArrowExecution.data3._a_4_5_6_b_6_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2435, "end_line": 2438, "span_ids": ["TestArrowExecution"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestArrowExecution:\n data1 = {\"a\": [1, 2, 3], \"b\": [3, 4, 5], \"c\": [6, 7, 8]}\n data2 = {\"a\": [1, 2, 3], \"d\": [3, 4, 5], \"e\": [6, 7, 8]}\n data3 = {\"a\": [4, 5, 6], \"b\": [6, 7, 8], \"c\": [9, 10, 11]}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution.test_drop_rename_concat_TestArrowExecution.test_drop_rename_concat.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution.test_drop_rename_concat_TestArrowExecution.test_drop_rename_concat.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2440, "end_line": 2454, "span_ids": ["TestArrowExecution.test_drop_rename_concat"], "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 TestArrowExecution:\n\n def test_drop_rename_concat(self):\n def drop_rename_concat(df1, df2, lib, **kwargs):\n df1 = df1.rename(columns={\"a\": \"new_a\", \"c\": \"new_b\"})\n df1 = df1.drop(columns=\"b\")\n df2 = df2.rename(columns={\"a\": \"new_a\", \"d\": \"new_b\"})\n df2 = df2.drop(columns=\"e\")\n return lib.concat([df1, df2], ignore_index=True)\n\n run_and_compare(\n drop_rename_concat,\n data=self.data1,\n data2=self.data2,\n force_lazy=False,\n force_arrow_execute=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution.test_drop_row_TestArrowExecution.test_append.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestArrowExecution.test_drop_row_TestArrowExecution.test_append.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2456, "end_line": 2491, "span_ids": ["TestArrowExecution.test_append", "TestArrowExecution.test_series_pop", "TestArrowExecution.test_drop_row", "TestArrowExecution.test_empty_transform"], "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 TestArrowExecution:\n\n def test_drop_row(self):\n def drop_row(df, **kwargs):\n return df.drop(labels=1)\n\n run_and_compare(\n drop_row,\n data=self.data1,\n force_lazy=False,\n )\n\n def test_series_pop(self):\n def pop(df, **kwargs):\n col = df[\"a\"]\n col.pop(0)\n return col\n\n run_and_compare(\n pop,\n data=self.data1,\n force_lazy=False,\n )\n\n def test_empty_transform(self):\n def apply(df, **kwargs):\n return df + 1\n\n run_and_compare(apply, data={}, force_arrow_execute=True)\n\n def test_append(self):\n def apply(df1, df2, **kwargs):\n tmp = df1.append(df2)\n return tmp\n\n run_and_compare(\n apply, data=self.data1, data2=self.data3, force_arrow_execute=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestNonStrCols_TestNonStrCols.test_set_index.df__query_compiler__modin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestNonStrCols_TestNonStrCols.test_set_index.df__query_compiler__modin", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2494, "end_line": 2504, "span_ids": ["TestNonStrCols", "TestNonStrCols.test_sum", "TestNonStrCols.test_set_index"], "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 TestNonStrCols:\n data = {0: [1, 2, 3], \"1\": [3, 4, 5], 2: [6, 7, 8]}\n\n def test_sum(self):\n mdf = pd.DataFrame(self.data).sum()\n pdf = pandas.DataFrame(self.data).sum()\n df_equals(mdf, pdf)\n\n def test_set_index(self):\n df = pd.DataFrame(self.data)\n df._query_compiler._modin_frame._set_index(pd.Index([1, 2, 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestLoc_TestLoc.test_iloc_bool.df_equals_mdf_pdf_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestLoc_TestLoc.test_iloc_bool.df_equals_mdf_pdf_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2507, "end_line": 2522, "span_ids": ["TestLoc.test_loc", "TestLoc.test_iloc_bool", "TestLoc"], "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 TestLoc:\n def test_loc(self):\n data = [1, 2, 3, 4, 5, 6]\n idx = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n key = [\"b\", \"c\", \"d\", \"e\"]\n mdf = pd.DataFrame(data, index=idx).loc[key]\n pdf = pandas.DataFrame(data, index=idx).loc[key]\n df_equals(mdf, pdf)\n\n def test_iloc_bool(self):\n data = [1, 2, 3, 4, 5, 6]\n idx = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n key = [False, True, True, True, True, False]\n mdf = pd.DataFrame(data, index=idx).iloc[key]\n pdf = pandas.DataFrame(data, index=idx).iloc[key]\n df_equals(mdf, pdf)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestLoc.test_iloc_int_TestLoc.test_iloc_issue_6037.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestLoc.test_iloc_int_TestLoc.test_iloc_issue_6037.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2524, "end_line": 2548, "span_ids": ["TestLoc.test_iloc_issue_6037", "TestLoc.test_iloc_int"], "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 TestLoc:\n\n def test_iloc_int(self):\n data = range(11, 265)\n key = list(range(0, 11)) + list(range(243, 254))\n mdf = pd.DataFrame(data).iloc[key]\n pdf = pandas.DataFrame(data).iloc[key]\n df_equals(mdf, pdf)\n\n mdf = pd.DataFrame(data).iloc[range(10, 100)]\n pdf = pandas.DataFrame(data).iloc[range(10, 100)]\n df_equals(mdf, pdf)\n\n data = test_data_values[0]\n mds = pd.Series(data[next(iter(data.keys()))]).iloc[1:]\n pds = pandas.Series(data[next(iter(data.keys()))]).iloc[1:]\n df_equals(mds, pds)\n\n def test_iloc_issue_6037(self):\n def iloc(df, **kwargs):\n return df.iloc[:-1].dropna()\n\n run_and_compare(\n fn=iloc,\n data={\"A\": range(1000000)},\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestStr_TestStr.test_no_cols.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestStr_TestStr.test_no_cols.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2551, "end_line": 2571, "span_ids": ["TestStr", "TestStr.test_no_cols", "TestStr.test_str"], "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 TestStr:\n def test_str(self):\n data = test_data_values[0]\n mdf = pd.DataFrame(data[next(iter(data.keys()))])\n pdf = pandas.DataFrame(data[next(iter(data.keys()))])\n df_equals(mdf, pdf)\n\n mds = pd.Series(data[next(iter(data.keys()))])\n pds = pandas.Series(data[next(iter(data.keys()))])\n assert str(mds) == str(pds)\n\n def test_no_cols(self):\n def run_cols(df, **kwargs):\n return df.loc[1]\n\n run_and_compare(\n fn=run_cols,\n data=None,\n constructor_kwargs={\"index\": range(5)},\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCompare_TestCompare.test_compare_float.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestCompare_TestCompare.test_compare_float.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2574, "end_line": 2589, "span_ids": ["TestCompare", "TestCompare.test_compare_float"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCompare:\n def test_compare_float(self):\n def run_compare(df1, df2, **kwargs):\n return df1.compare(df2, align_axis=\"columns\", keep_shape=False)\n\n data1 = random_state.randn(100, 10)\n data2 = random_state.randn(100, 10)\n columns = list(\"abcdefghij\")\n\n run_and_compare(\n run_compare,\n data=data1,\n data2=data2,\n constructor_kwargs={\"columns\": columns},\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns_TestDuplicateColumns.test_init.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns_TestDuplicateColumns.test_init.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2592, "end_line": 2610, "span_ids": ["TestDuplicateColumns.test_init", "TestDuplicateColumns"], "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 TestDuplicateColumns:\n def test_init(self):\n def init(df, **kwargs):\n return df\n\n data = [\n [1, 2, 3, 4],\n [5, 6, 7, 8],\n [9, 10, 11, 12],\n [13, 14, 15, 16],\n [17, 18, 19, 20],\n ]\n columns = [\"c1\", \"c2\", \"c1\", \"c3\"]\n run_and_compare(\n fn=init,\n data=data,\n force_lazy=False,\n constructor_kwargs={\"columns\": columns},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns.test_loc_TestDuplicateColumns.test_set_columns.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns.test_loc_TestDuplicateColumns.test_set_columns.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2612, "end_line": 2631, "span_ids": ["TestDuplicateColumns.test_loc", "TestDuplicateColumns.test_set_columns"], "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 TestDuplicateColumns:\n\n def test_loc(self):\n def loc(df, **kwargs):\n return df.loc[:, [\"col1\", \"col3\", \"col3\"]]\n\n run_and_compare(\n fn=loc,\n data=test_data_values[0],\n force_lazy=False,\n )\n\n def test_set_columns(self):\n def set_cols(df, **kwargs):\n df.columns = [\"col1\", \"col3\", \"col3\"]\n return df\n\n run_and_compare(\n fn=set_cols,\n data=[[1, 2, 3], [4, 5, 6], [7, 8, 9]],\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns.test_set_axis_TestDuplicateColumns.test_set_axis.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestDuplicateColumns.test_set_axis_TestDuplicateColumns.test_set_axis.None_1", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2633, "end_line": 2652, "span_ids": ["TestDuplicateColumns.test_set_axis"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDuplicateColumns:\n\n def test_set_axis(self):\n def set_axis(df, **kwargs):\n sort_index = df.axes[1]\n labels = [\n np.nan if i % 2 == 0 else sort_index[i] for i in range(len(sort_index))\n ]\n return df.set_axis(labels, axis=1, copy=kwargs[\"copy\"])\n\n run_and_compare(\n fn=set_axis,\n data=test_data[\"float_nan_data\"],\n force_lazy=False,\n copy=True,\n )\n run_and_compare(\n fn=set_axis,\n data=test_data[\"float_nan_data\"],\n force_lazy=False,\n copy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestFromArrow_TestFromArrow.test_dict.None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestFromArrow_TestFromArrow.test_dict.None_13", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2655, "end_line": 2697, "span_ids": ["TestFromArrow", "TestFromArrow.test_dict"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFromArrow:\n def test_dict(self):\n indices = pyarrow.array([0, 1, 0, 1, 2, 0, None, 2])\n dictionary = pyarrow.array([\"first\", \"second\", \"third\"])\n dict_array = pyarrow.DictionaryArray.from_arrays(indices, dictionary)\n at = pyarrow.table(\n {\"col1\": dict_array, \"col2\": [1, 2, 3, 4, 5, 6, 7, 8], \"col3\": dict_array}\n )\n pdf = at.to_pandas()\n nchunks = 3\n chunks = split_df_into_chunks(pdf, nchunks)\n at = pyarrow.concat_tables([pyarrow.Table.from_pandas(c) for c in chunks])\n mdf = from_arrow(at)\n at = mdf._query_compiler._modin_frame._partitions[0][0].get()\n assert len(at.column(0).chunks) == nchunks\n\n mdt = mdf.dtypes[0]\n pdt = pdf.dtypes[0]\n assert mdt == \"category\"\n assert isinstance(mdt, pandas.CategoricalDtype)\n assert pandas.api.types.is_categorical_dtype(mdt)\n assert str(mdt) == str(pdt)\n\n # Make sure the lazy proxy dtype is not materialized yet.\n assert type(mdt) != pandas.CategoricalDtype\n assert mdt._parent is not None\n assert mdt._update_proxy(at, at.column(0)._name) is mdt\n assert mdt._update_proxy(at, at.column(2)._name) is not mdt\n assert (\n type(mdt._update_proxy(at, at.column(2)._name)) != pandas.CategoricalDtype\n )\n\n assert mdt == pdt\n assert pdt == mdt\n assert repr(mdt) == repr(pdt)\n\n # `df_equals` triggers categories materialization and thus\n # has to be called after all checks for laziness\n df_equals(mdf, pdf)\n # Should be materialized now\n assert (\n type(mdt._update_proxy(at, at.column(2)._name)) == pandas.CategoricalDtype\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSparseArray_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestSparseArray_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 2700, "end_line": 2740, "span_ids": ["TestEmpty.test_series_to_pandas", "TestSparseArray", "impl:4", "TestSparseArray.test_sparse_series", "TestEmpty.test_frame_insert", "TestEmpty.test_series_getitem", "TestEmpty"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSparseArray:\n def test_sparse_series(self):\n data = pandas.arrays.SparseArray(np.array([3, 1, 2, 3, 4, np.nan]))\n mds = pd.Series(data)\n pds = pandas.Series(data)\n df_equals(mds, pds)\n\n\nclass TestEmpty:\n def test_frame_insert(self):\n def insert(df, **kwargs):\n df[\"a\"] = [1, 2, 3, 4, 5]\n return df\n\n run_and_compare(\n insert,\n data=None,\n )\n run_and_compare(\n insert,\n data=None,\n constructor_kwargs={\"index\": [\"a\", \"b\", \"c\", \"d\", \"e\"]},\n )\n run_and_compare(\n insert,\n data=None,\n constructor_kwargs={\"columns\": [\"a\", \"b\", \"c\", \"d\", \"e\"]},\n # Do not force lazy since setitem() defaults to pandas\n force_lazy=False,\n )\n\n def test_series_getitem(self):\n df_equals(pd.Series([])[:30], pandas.Series([])[:30])\n\n def test_series_to_pandas(self):\n df_equals(pd.Series([])._to_pandas(), pandas.Series([]))\n\n\nif __name__ == \"__main__\":\n pytest.main([\"-v\", __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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_init.py_TestInit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_init.py_TestInit_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_init.py", "file_name": "test_init.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 29, "span_ids": ["TestInit", "TestInit.test_num_threads"], "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": "class TestInit:\n def test_num_threads(self):\n import os\n import modin.pandas as pd\n\n assert \"OMP_NUM_THREADS\" not in os.environ\n\n import modin.config as cfg\n\n cfg.IsExperimental.put(True)\n cfg.Engine.put(\"Native\")\n cfg.StorageFormat.put(\"Hdk\")\n pd.DataFrame()\n assert os.environ[\"OMP_NUM_THREADS\"] == str(cfg.CpuCount.get())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_sys_UNICODE_ALPHABET._chr_c_for_r_in_UNICODE_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_sys_UNICODE_ALPHABET._chr_c_for_r_in_UNICODE_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 34, "span_ids": ["docstring"], "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": "import sys\nimport pandas\nimport pytz\nimport timeit\nfrom random import randint, uniform, choice\n\nfrom ..dataframe.utils import ColNameCodec\n\nUNICODE_RANGES = [\n (0x0020, 0x007F), # Basic Latin\n (0x00A0, 0x00FF), # Latin-1 Supplement\n (0x0100, 0x017F), # Latin Extended-A\n (0x0180, 0x024F), # Latin Extended-B\n (0x0250, 0x02AF), # IPA Extensions\n (0x02B0, 0x02FF), # Spacing Modifier Letters\n (0x0300, 0x036F), # Combining Diacritical Marks\n (0x0370, 0x03FF), # Greek and Coptic\n (0x10330, 0x1034F), # Gothic\n (0xE0000, 0xE007F), # Tags\n]\nUNICODE_ALPHABET = [chr(c) for r in UNICODE_RANGES for c in range(r[0], r[1] + 1)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_test_encode_col_name_rnd_unicode.return._join_choice_UNICODE_AL": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_test_encode_col_name_rnd_unicode.return._join_choice_UNICODE_AL", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 60, "span_ids": ["rnd_unicode", "test_encode_col_name"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_encode_col_name():\n def test(name):\n encoded = ColNameCodec.encode(name)\n assert ColNameCodec.decode(encoded) == name\n\n test(\"\")\n test(None)\n test((\"\", \"\"))\n\n for i in range(0, 1000):\n test(randint(-sys.maxsize, sys.maxsize))\n for i in range(0, 1000):\n test(uniform(-sys.maxsize, sys.maxsize))\n for i in range(0, 1000):\n test(rnd_unicode(randint(0, 100)))\n for i in range(0, 1000):\n test((rnd_unicode(randint(0, 100)), rnd_unicode(randint(0, 100))))\n for i in range(0, 1000):\n tz = choice(pytz.all_timezones)\n test(pandas.Timestamp(randint(0, 0xFFFFFFFF), unit=\"s\", tz=tz))\n\n\ndef rnd_unicode(length):\n return \"\".join(choice(UNICODE_ALPHABET) for _ in range(length))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_test_time_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py_test_time_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 95, "span_ids": ["test_time"], "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 test_time():\n ranges = [\n (0x0041, 0x005A), # Alpha chars\n (0x0020, 0x007F), # Basic Latin\n (0x00A0, 0x00FF), # Latin-1 Supplement\n ]\n repeat = 10\n text_len = 100000\n\n for r in ranges:\n alphabet = \"\".join([chr(c) for c in range(r[0], r[1] + 1)])\n text = (\n alphabet * int(text_len / len(alphabet))\n + alphabet[0 : divmod(text_len, len(alphabet))[1]]\n )\n encoded_text = ColNameCodec.encode(text)\n assert text == ColNameCodec.decode(encoded_text)\n print(f\"Alphabet: {alphabet}\") # noqa: T201\n print(f\"Text len: {len(text)}\") # noqa: T201\n print(f\"Encoded text len: {len(encoded_text)}\") # noqa: T201\n\n def test_encode():\n ColNameCodec.encode(text)\n\n def test_decode():\n ColNameCodec.decode(encoded_text)\n\n time = timeit.timeit(stmt=test_encode, number=repeat)\n print(f\"Encode time: {time/repeat} seconds\") # noqa: T201\n time = timeit.timeit(stmt=test_decode, number=repeat)\n print(f\"Decode time: {time/repeat} seconds\") # noqa: T201\n print(\"--------------------------------------\") # noqa: T201", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_pytest_from_modin_experimental_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_pytest_from_modin_experimental_c", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 32, "span_ids": ["docstring"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport modin.pandas as pd\nfrom modin.utils import try_cast_to_pandas\nimport pandas\nimport datetime\nimport numpy as np\nfrom pandas.api.types import is_datetime64_any_dtype\nimport pyarrow as pa\n\nfrom modin.pandas.test.utils import (\n df_equals,\n io_ops_bad_exc,\n eval_io as general_eval_io,\n)\nfrom ..df_algebra import FrameNode\n\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import (\n DbWorker,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_eval_io_eval_io.general_eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_eval_io_eval_io.general_eval_io_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 74, "span_ids": ["eval_io"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_io(\n fn_name,\n comparator=df_equals,\n cast_to_str=False,\n check_exception_type=True,\n raising_exceptions=io_ops_bad_exc,\n check_kwargs_callable=True,\n modin_warning=None,\n md_extra_kwargs=None,\n *args,\n **kwargs,\n):\n \"\"\"\n Evaluate I/O operation and do equality check after importing Modin's data to HDK.\n\n Notes\n -----\n For parameters description please refer to ``modin.pandas.test.utils.eval_io``.\n \"\"\"\n\n def hdk_comparator(df1, df2, **kwargs):\n \"\"\"Evaluate equality comparison of the passed frames after importing the Modin's one to HDK.\"\"\"\n with ForceHdkImport(df1, df2):\n # Aligning DateTime dtypes because of the bug related to the `parse_dates` parameter:\n # https://github.com/modin-project/modin/issues/3485\n df1, df2 = align_datetime_dtypes(df1, df2)\n comparator(df1, df2, **kwargs)\n\n general_eval_io(\n fn_name,\n comparator=hdk_comparator,\n cast_to_str=cast_to_str,\n check_exception_type=check_exception_type,\n raising_exceptions=raising_exceptions,\n check_kwargs_callable=check_kwargs_callable,\n modin_warning=modin_warning,\n md_extra_kwargs=md_extra_kwargs,\n *args,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_align_datetime_dtypes_align_datetime_dtypes.return.casted_dfs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_align_datetime_dtypes_align_datetime_dtypes.return.casted_dfs", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 141, "span_ids": ["align_datetime_dtypes"], "tokens": 494}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def align_datetime_dtypes(*dfs):\n \"\"\"\n Make all of the passed frames have DateTime dtype for the same columns.\n\n Cast column type of the certain frame to the DateTime type if any frame in\n the `dfs` sequence has DateTime type for this column.\n\n Parameters\n ----------\n *dfs : iterable of DataFrames\n DataFrames to align DateTime dtypes.\n\n Notes\n -----\n Passed Modin frames may be casted to pandas in the result.\n \"\"\"\n datetime_cols = {}\n time_cols = set()\n for df in dfs:\n for col, dtype in df.dtypes.items():\n # If we already decided to cast this column to DateTime no more actions are needed\n if col not in datetime_cols and is_datetime64_any_dtype(dtype):\n datetime_cols[col] = dtype\n # datetime.time is considered to be an 'object' dtype in pandas that's why\n # we have to explicitly check the values type in the column\n elif (\n dtype == np.dtype(\"O\")\n and col not in time_cols\n # HDK has difficulties with empty frames, so explicitly skip them\n # https://github.com/modin-project/modin/issues/3428\n and len(df) > 0\n and all(\n isinstance(val, datetime.time) or pandas.isna(val)\n for val in df[col]\n )\n ):\n time_cols.add(col)\n\n if len(datetime_cols) == 0 and len(time_cols) == 0:\n return dfs\n\n def convert_to_time(value):\n \"\"\"Convert passed value to `datetime.time`.\"\"\"\n if isinstance(value, datetime.time):\n return value\n elif isinstance(value, str):\n return datetime.time.fromisoformat(value)\n else:\n return datetime.time(value)\n\n time_cols_list = list(time_cols)\n casted_dfs = []\n for df in dfs:\n # HDK has difficulties with casting to certain dtypes (i.e. datetime64),\n # so casting it to pandas\n pandas_df = try_cast_to_pandas(df)\n if datetime_cols:\n pandas_df = pandas_df.astype(datetime_cols)\n if time_cols:\n pandas_df[time_cols_list] = pandas_df[time_cols_list].applymap(\n convert_to_time\n )\n casted_dfs.append(pandas_df)\n\n return casted_dfs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_ForceHdkImport_ForceHdkImport.__enter__.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_ForceHdkImport_ForceHdkImport.__enter__.return.self", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 184, "span_ids": ["ForceHdkImport.__enter__", "ForceHdkImport", "ForceHdkImport.__init__"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForceHdkImport:\n \"\"\"\n Trigger import execution for Modin DataFrames obtained by HDK engine if already not.\n\n When using as a context class also cleans up imported tables at the end of the context.\n\n Parameters\n ----------\n *dfs : iterable\n DataFrames to trigger import.\n \"\"\"\n\n def __init__(self, *dfs):\n self._imported_frames = []\n for df in dfs:\n if not isinstance(df, (pd.DataFrame, pd.Series)):\n continue\n df.shape # to trigger real execution\n if df.empty:\n continue\n modin_frame = df._query_compiler._modin_frame\n partition = modin_frame._partitions[0][0]\n if partition.frame_id is not None:\n continue\n frame = partition.get()\n if isinstance(frame, (pandas.DataFrame, pandas.Series)):\n frame = pa.Table.from_pandas(frame)\n if isinstance(frame, pa.Table):\n _, cols = modin_frame._partition_mgr_cls._get_unsupported_cols(frame)\n if len(cols) != 0:\n continue\n frame_id = DbWorker().import_arrow_table(frame)\n else:\n raise TypeError(\n f\"Unexpected storage format, expected pandas.DataFrame or pyarrow.Table, got: {type(frame)}.\"\n )\n partition.frame_id = frame_id\n self._imported_frames.append((df, frame_id))\n\n def __enter__(self):\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_ForceHdkImport.export_frames_ForceHdkImport.__exit__.self._imported_frames._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_ForceHdkImport.export_frames_ForceHdkImport.__exit__.self._imported_frames._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 186, "end_line": 218, "span_ids": ["ForceHdkImport.export_frames", "ForceHdkImport.__exit__"], "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 ForceHdkImport:\n\n def export_frames(self):\n \"\"\"\n Export tables from HDK that was imported by this instance.\n\n Returns\n -------\n list\n A list of Modin DataFrames whose payload is ``pyarrow.Table``\n that was just exported from HDK.\n \"\"\"\n result = []\n for df, frame_id in self._imported_frames:\n # Append `TransformNode`` selecting all the columns (SELECT * FROM frame_id)\n df = df[df.columns.tolist()]\n modin_frame = df._query_compiler._modin_frame\n # Forcibly executing plan via HDK. We can't use `modin_frame._execute()` here\n # as it has a chance of running via pyarrow bypassing HDK\n new_partitions = modin_frame._partition_mgr_cls.run_exec_plan(\n modin_frame._op,\n modin_frame._table_cols,\n )\n modin_frame._partitions = new_partitions\n modin_frame._op = FrameNode(modin_frame)\n result.append(df)\n return result\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n for df, frame_id in self._imported_frames:\n actual_frame_id = df._query_compiler._modin_frame._partitions[0][0].frame_id\n DbWorker().dropTable(frame_id)\n if actual_frame_id == frame_id:\n df._query_compiler._modin_frame._partitions[0][0].frame_id = None\n self._imported_frames = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_set_execution_mode_set_execution_mode.if_recursive_and_hasattr_.for_child_in_frame__op_in.set_execution_mode_child_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_set_execution_mode_set_execution_mode.if_recursive_and_hasattr_.for_child_in_frame__op_in.set_execution_mode_child_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 221, "end_line": 246, "span_ids": ["set_execution_mode"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_execution_mode(frame, mode, recursive=False):\n \"\"\"\n Enable execution mode assertions for the passed frame.\n\n Enabled execution mode checks mean, that the frame raises an AssertionError\n if the execution flow is out of the scope of the selected mode.\n\n Parameters\n ----------\n frame : DataFrame or Series\n Modin frame to set execution mode at.\n mode : {None, \"lazy\", \"arrow\"}\n Execution mode to set:\n - \"lazy\": only delayed computations.\n - \"arrow\": only computations via Pyarrow.\n - None: allow any type of computations.\n recursive : bool, default: False\n Whether to set the specified execution mode for every frame\n in the delayed computation tree.\n \"\"\"\n if isinstance(frame, (pd.Series, pd.DataFrame)):\n frame = frame._query_compiler._modin_frame\n frame._force_execution_mode = mode\n if recursive and hasattr(frame._op, \"input\"):\n for child in frame._op.input:\n set_execution_mode(child, mode, 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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_run_and_compare_run_and_compare.run_modin.return.exp_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_run_and_compare_run_and_compare.run_modin.return.exp_res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 249, "end_line": 296, "span_ids": ["run_and_compare"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_and_compare(\n fn,\n data,\n data2=None,\n force_lazy=True,\n force_hdk_execute=False,\n force_arrow_execute=False,\n allow_subqueries=False,\n comparator=df_equals,\n **kwargs,\n):\n \"\"\"Verify equality of the results of the passed function executed against pandas and modin frame.\"\"\"\n\n def run_modin(\n fn,\n data,\n data2,\n force_lazy,\n force_hdk_execute,\n force_arrow_execute,\n allow_subqueries,\n constructor_kwargs,\n **kwargs,\n ):\n kwargs[\"df1\"] = pd.DataFrame(data, **constructor_kwargs)\n kwargs[\"df2\"] = pd.DataFrame(data2, **constructor_kwargs)\n kwargs[\"df\"] = kwargs[\"df1\"]\n\n if force_hdk_execute:\n set_execution_mode(kwargs[\"df1\"], \"hdk\")\n set_execution_mode(kwargs[\"df2\"], \"hdk\")\n elif force_arrow_execute:\n set_execution_mode(kwargs[\"df1\"], \"arrow\")\n set_execution_mode(kwargs[\"df2\"], \"arrow\")\n elif force_lazy:\n set_execution_mode(kwargs[\"df1\"], \"lazy\")\n set_execution_mode(kwargs[\"df2\"], \"lazy\")\n\n exp_res = fn(lib=pd, **kwargs)\n\n if force_hdk_execute:\n set_execution_mode(exp_res, \"hdk\", allow_subqueries)\n elif force_arrow_execute:\n set_execution_mode(exp_res, \"arrow\", allow_subqueries)\n elif force_lazy:\n set_execution_mode(exp_res, None, allow_subqueries)\n\n return exp_res\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_run_and_compare.constructor_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py_run_and_compare.constructor_kwargs_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 298, "end_line": 331, "span_ids": ["run_and_compare"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_and_compare(\n fn,\n data,\n data2=None,\n force_lazy=True,\n force_hdk_execute=False,\n force_arrow_execute=False,\n allow_subqueries=False,\n comparator=df_equals,\n **kwargs,\n):\n # ... other code\n\n constructor_kwargs = kwargs.pop(\"constructor_kwargs\", {})\n try:\n kwargs[\"df1\"] = pandas.DataFrame(data, **constructor_kwargs)\n kwargs[\"df2\"] = pandas.DataFrame(data2, **constructor_kwargs)\n kwargs[\"df\"] = kwargs[\"df1\"]\n ref_res = fn(lib=pandas, **kwargs)\n except Exception as err:\n with pytest.raises(type(err)):\n exp_res = run_modin(\n fn=fn,\n data=data,\n data2=data2,\n force_lazy=force_lazy,\n force_hdk_execute=force_hdk_execute,\n force_arrow_execute=force_arrow_execute,\n allow_subqueries=allow_subqueries,\n constructor_kwargs=constructor_kwargs,\n **kwargs,\n )\n _ = exp_res.index\n else:\n exp_res = run_modin(\n fn=fn,\n data=data,\n data2=data2,\n force_lazy=force_lazy,\n force_hdk_execute=force_hdk_execute,\n force_arrow_execute=force_arrow_execute,\n allow_subqueries=allow_subqueries,\n constructor_kwargs=constructor_kwargs,\n **kwargs,\n )\n comparator(ref_res, exp_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_modin-project__modin/modin/experimental/core/execution/ray/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/ray/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pandas_on_ray/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/__init__.py_ExperimentalPandasOnRayIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/__init__.py_ExperimentalPandasOnRayIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "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 .io import ExperimentalPandasOnRayIO\n\n__all__ = [\"ExperimentalPandasOnRayIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py_from_modin_core_storage_f_None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py_from_modin_core_storage_f_None_6", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 40, "span_ids": ["docstring"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.storage_formats.pandas.parsers import (\n PandasCSVGlobParser,\n ExperimentalPandasPickleParser,\n ExperimentalCustomTextParser,\n)\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.ray.implementations.pandas_on_ray.io import PandasOnRayIO\nfrom modin.experimental.core.io import (\n ExperimentalCSVGlobDispatcher,\n ExperimentalSQLDispatcher,\n ExperimentalPickleDispatcher,\n ExperimentalCustomTextDispatcher,\n)\nfrom modin.core.execution.ray.implementations.pandas_on_ray.dataframe import (\n PandasOnRayDataframe,\n)\nfrom modin.core.execution.ray.implementations.pandas_on_ray.partitioning import (\n PandasOnRayDataframePartition,\n)\nfrom modin.core.execution.ray.common import RayWrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py_ExperimentalPandasOnRayIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py_ExperimentalPandasOnRayIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pandas_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 78, "span_ids": ["ExperimentalPandasOnRayIO", "ExperimentalPandasOnRayIO:5", "ExperimentalPandasOnRayIO.__make_read", "ExperimentalPandasOnRayIO.__make_write"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalPandasOnRayIO(PandasOnRayIO):\n \"\"\"\n Class for handling experimental IO functionality with pandas storage format and Ray engine.\n\n ``ExperimentalPandasOnRayIO`` inherits some util functions and unmodified IO functions\n from ``PandasOnRayIO`` class.\n \"\"\"\n\n build_args = dict(\n frame_partition_cls=PandasOnRayDataframePartition,\n query_compiler_cls=PandasQueryCompiler,\n frame_cls=PandasOnRayDataframe,\n base_io=PandasOnRayIO,\n )\n\n def __make_read(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (RayWrapper, *classes), build_args).read\n\n def __make_write(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (RayWrapper, *classes), build_args).write\n\n read_csv_glob = __make_read(PandasCSVGlobParser, ExperimentalCSVGlobDispatcher)\n read_pickle_distributed = __make_read(\n ExperimentalPandasPickleParser, ExperimentalPickleDispatcher\n )\n to_pickle_distributed = __make_write(ExperimentalPickleDispatcher)\n read_custom_text = __make_read(\n ExperimentalCustomTextParser, ExperimentalCustomTextDispatcher\n )\n read_sql = __make_read(ExperimentalSQLDispatcher)\n\n del __make_read # to not pollute class namespace\n del __make_write # to not pollute class namespace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/dataframe.py_PyarrowOnRayDataframePartitionManager_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/dataframe.py_PyarrowOnRayDataframePartitionManager_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 74, "span_ids": ["PyarrowOnRayDataframe.synchronize_labels", "PyarrowOnRayDataframe", "PyarrowOnRayDataframe.to_pandas", "docstring"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from ..partitioning.partition_manager import PyarrowOnRayDataframePartitionManager\nfrom modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe\n\n\nclass PyarrowOnRayDataframe(PandasDataframe):\n \"\"\"\n Class for dataframes with PyArrow storage format and Ray engine.\n\n ``PyarrowOnRayDataframe`` implements interfaces specific for PyArrow and Ray,\n other functionality is inherited from the ``PandasDataframe`` class.\n\n Parameters\n ----------\n partitions : np.ndarray\n A 2D NumPy array of partitions.\n index : sequence\n The index for the dataframe. Converted to a ``pandas.Index``.\n columns : sequence\n The columns object for the dataframe. Converted to a ``pandas.Index``.\n row_lengths : list, optional\n The length of each partition in the rows. The \"height\" of\n each of the block partitions. Is computed if not provided.\n column_widths : list, optional\n The width of each partition in the columns. The \"width\" of\n each of the block partitions. Is computed if not provided.\n dtypes : pandas.Series, optional\n The data types for the dataframe columns.\n \"\"\"\n\n _partition_mgr_cls = PyarrowOnRayDataframePartitionManager\n\n def synchronize_labels(self, axis=None):\n \"\"\"\n Synchronize labels by applying the index object (Index or Columns) to the partitions lazily.\n\n Parameters\n ----------\n axis : {0, 1}, optional\n Parameter is deprecated and affects nothing.\n \"\"\"\n self._filter_empties()\n\n def to_pandas(self):\n \"\"\"\n Convert frame object to a ``pandas.DataFrame``.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n df = super(PyarrowOnRayDataframe, self).to_pandas()\n df.index = self.index\n df.columns = self.columns\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/__init__.py_PyarrowOnRayIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/__init__.py_PyarrowOnRayIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 21}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import PyarrowOnRayIO\n\n__all__ = [\"PyarrowOnRayIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/io.py_from_modin_experimental_c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/io.py_from_modin_experimental_c_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 51, "span_ids": ["PyarrowOnRayCSVDispatcher", "PyarrowOnRayIO", "docstring"], "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": "from modin.experimental.core.storage_formats.pyarrow import (\n PyarrowQueryCompiler,\n PyarrowCSVParser,\n)\nfrom modin.core.execution.ray.generic.io import RayIO\nfrom modin.experimental.core.execution.ray.implementations.pyarrow_on_ray.dataframe.dataframe import (\n PyarrowOnRayDataframe,\n)\nfrom modin.experimental.core.execution.ray.implementations.pyarrow_on_ray.partitioning.partition import (\n PyarrowOnRayDataframePartition,\n)\nfrom modin.core.execution.ray.common import RayWrapper\nfrom modin.core.io import CSVDispatcher\n\n\nclass PyarrowOnRayCSVDispatcher(RayWrapper, PyarrowCSVParser, CSVDispatcher):\n \"\"\"Class handles utils for reading `.csv` files with PyArrow storage format and Ray engine.\"\"\"\n\n frame_cls = PyarrowOnRayDataframe\n frame_partition_cls = PyarrowOnRayDataframePartition\n query_compiler_cls = PyarrowQueryCompiler\n\n\nclass PyarrowOnRayIO(RayIO):\n \"\"\"Class for storing IO functions operated on PyArrow storage format and Ray engine.\"\"\"\n\n frame_cls = PyarrowOnRayDataframe\n frame_partition_cls = PyarrowOnRayDataframePartition\n query_compiler_cls = PyarrowQueryCompiler\n csv_reader = PyarrowOnRayCSVDispatcher\n\n read_parquet_remote_task = None\n read_hdf_remote_task = None\n read_feather_remote_task = None\n read_sql_remote_task = 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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_from_modin_core_dataframe_PyarrowOnRayDataframeAxisPartition.__init__.self.list_of_blocks._obj_list_of_blocks_0_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_from_modin_core_dataframe_PyarrowOnRayDataframeAxisPartition.__init__.self.list_of_blocks._obj_list_of_blocks_0_fo", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 42, "span_ids": ["PyarrowOnRayDataframeAxisPartition.__init__", "PyarrowOnRayDataframeAxisPartition", "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": "from modin.core.dataframe.pandas.partitioning.axis_partition import (\n BaseDataframeAxisPartition,\n)\nfrom .partition import PyarrowOnRayDataframePartition\n\nimport ray\nimport pyarrow\n\n\nclass PyarrowOnRayDataframeAxisPartition(BaseDataframeAxisPartition):\n \"\"\"\n Class defines axis partition interface with PyArrow storage format and Ray engine.\n\n Inherits functionality from ``BaseDataframeAxisPartition`` class.\n\n Parameters\n ----------\n list_of_blocks : list\n List with partition objects to create common axis partition for.\n \"\"\"\n\n def __init__(self, list_of_blocks):\n assert all(\n [len(partition.list_of_blocks) == 1 for partition in list_of_blocks]\n ), \"Implementation assumes that each partition contains a signle block.\"\n # Unwrap from PandasDataframePartition object for ease of use\n self.list_of_blocks = [obj.list_of_blocks[0] for obj in list_of_blocks]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_PyarrowOnRayDataframeAxisPartition.apply_PyarrowOnRayDataframeAxisPartition.apply.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_PyarrowOnRayDataframeAxisPartition.apply_PyarrowOnRayDataframeAxisPartition.apply.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 100, "span_ids": ["PyarrowOnRayDataframeAxisPartition.apply"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PyarrowOnRayDataframeAxisPartition(BaseDataframeAxisPartition):\n\n def apply(self, func, *args, num_splits=None, other_axis_partition=None, **kwargs):\n \"\"\"\n Apply func to the object in the Plasma store.\n\n Parameters\n ----------\n func : callable or ray.ObjectRef\n The function to apply.\n *args : iterable\n Positional arguments to pass with `func`.\n num_splits : int, optional\n The number of times to split the resulting object.\n other_axis_partition : PyarrowOnRayDataframeAxisPartition, optional\n Another ``PyarrowOnRayDataframeAxisPartition`` object to apply to\n `func` with this one.\n **kwargs : dict\n Additional keyward arguments to pass with `func`.\n\n Returns\n -------\n list\n List with ``PyarrowOnRayDataframePartition`` objects.\n\n Notes\n -----\n See notes in Parent class about this method.\n \"\"\"\n if num_splits is None:\n num_splits = len(self.list_of_blocks)\n\n if other_axis_partition is not None:\n return [\n PyarrowOnRayDataframePartition(obj)\n for obj in deploy_ray_func_between_two_axis_partitions.options(\n num_returns=num_splits\n ).remote(\n self.axis,\n func,\n args,\n kwargs,\n num_splits,\n len(self.list_of_blocks),\n *(self.list_of_blocks + other_axis_partition.list_of_blocks),\n )\n ]\n\n return [\n PyarrowOnRayDataframePartition(obj)\n for obj in deploy_ray_axis_func.options(num_returns=num_splits).remote(\n self.axis,\n func,\n args,\n kwargs,\n num_splits,\n *self.list_of_blocks,\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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_PyarrowOnRayDataframeColumnPartition_PyarrowOnRayDataframeRowPartition.axis.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_PyarrowOnRayDataframeColumnPartition_PyarrowOnRayDataframeRowPartition.axis.1", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 132, "span_ids": ["PyarrowOnRayDataframeRowPartition", "PyarrowOnRayDataframeColumnPartition"], "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 PyarrowOnRayDataframeColumnPartition(PyarrowOnRayDataframeAxisPartition):\n \"\"\"\n The column partition implementation for PyArrow storage format and Ray engine.\n\n All of the implementation for this class is in the ``PyarrowOnRayDataframeAxisPartition``\n parent class, and this class defines the axis to perform the computation over.\n\n Parameters\n ----------\n list_of_blocks : list\n List with partition objects to create common axis partition.\n \"\"\"\n\n axis = 0\n\n\nclass PyarrowOnRayDataframeRowPartition(PyarrowOnRayDataframeAxisPartition):\n \"\"\"\n The row partition implementation for PyArrow storage format and Ray engine.\n\n All of the implementation for this class is in the ``PyarrowOnRayDataframeAxisPartition``\n parent class, and this class defines the axis to perform the computation over.\n\n Parameters\n ----------\n list_of_blocks : list\n List with partition objects to create common axis partition.\n \"\"\"\n\n axis = 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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_concat_arrow_table_partitions_concat_arrow_table_partitions.return.table": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_concat_arrow_table_partitions_concat_arrow_table_partitions.return.table", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 164, "span_ids": ["concat_arrow_table_partitions"], "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 concat_arrow_table_partitions(axis, partitions):\n \"\"\"\n Concatenate given `partitions` in a single table.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to concatenate over.\n partitions : array-like\n Array with partitions for concatenating.\n\n Returns\n -------\n pyarrow.Table\n ``pyarrow.Table`` constructed from the passed partitions.\n \"\"\"\n if axis == 0:\n table = pyarrow.Table.from_batches(\n [part.to_batches(part.num_rows)[0] for part in partitions]\n )\n else:\n table = partitions[0].drop([partitions[0].columns[-1].name])\n for obj in partitions[1:]:\n i = 0\n for col in obj.itercolumns():\n if i < obj.num_columns - 1:\n table = table.append_column(col)\n i += 1\n table = table.append_column(partitions[0].columns[-1])\n return table", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_split_arrow_table_result_split_arrow_table_result.if_axis_0_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_split_arrow_table_result_split_arrow_table_result.if_axis_0_.else_.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 218, "span_ids": ["split_arrow_table_result"], "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 split_arrow_table_result(axis, result, num_partitions, num_splits, metadata):\n \"\"\"\n Split ``pyarrow.Table`` according to the passed parameters.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n result : pyarrow.Table\n Resulting table to split.\n num_partitions : int\n Number of partitions that `result` was constructed from.\n num_splits : int\n The number of splits to return.\n metadata : dict\n Dictionary with ``pyarrow.Table`` metadata.\n\n Returns\n -------\n list\n List of PyArrow Tables.\n \"\"\"\n chunksize = (\n num_splits // num_partitions\n if num_splits % num_partitions == 0\n else num_splits // num_partitions + 1\n )\n if axis == 0:\n return [\n pyarrow.Table.from_batches([part]) for part in result.to_batches(chunksize)\n ]\n else:\n return [\n result.drop(\n [\n result.columns[i].name\n for i in range(result.num_columns)\n if i >= n * chunksize or i < (n - 1) * chunksize\n ]\n )\n .append_column(result.columns[-1])\n .replace_schema_metadata(metadata=metadata)\n for n in range(1, num_splits)\n ] + [\n result.drop(\n [\n result.columns[i].name\n for i in range(result.num_columns)\n if i < (num_splits - 1) * chunksize\n ]\n ).replace_schema_metadata(metadata=metadata)\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_deploy_ray_axis_func_deploy_ray_axis_func.return.split_arrow_table_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_deploy_ray_axis_func_deploy_ray_axis_func.return.split_arrow_table_result_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 221, "end_line": 253, "span_ids": ["deploy_ray_axis_func"], "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": "@ray.remote\ndef deploy_ray_axis_func(axis, func, f_args, f_kwargs, num_splits, *partitions):\n \"\"\"\n Deploy a function along a full axis in Ray.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return.\n *partitions : array-like\n All partitions that make up the full axis (row or column).\n\n Returns\n -------\n list\n List of PyArrow Tables.\n \"\"\"\n table = concat_arrow_table_partitions(axis, partitions)\n try:\n result = func(table, *f_args, **f_kwargs)\n except Exception:\n result = pyarrow.Table.from_pandas(func(table.to_pandas(), *f_args, **f_kwargs))\n return split_arrow_table_result(\n axis, result, len(partitions), num_splits, table.schema.metadata\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_deploy_ray_func_between_two_axis_partitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py_deploy_ray_func_between_two_axis_partitions_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/axis_partition.py", "file_name": "axis_partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 305, "span_ids": ["deploy_ray_func_between_two_axis_partitions"], "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": "@ray.remote\ndef deploy_ray_func_between_two_axis_partitions(\n axis,\n func,\n f_args,\n f_kwargs,\n num_splits,\n len_of_left,\n *partitions,\n):\n \"\"\"\n Deploy a function along a full axis between two data sets in Ray.\n\n Parameters\n ----------\n axis : {0, 1}\n The axis to perform the function along.\n func : callable\n The function to perform.\n f_args : list or tuple\n Positional arguments to pass to ``func``.\n f_kwargs : dict\n Keyword arguments to pass to ``func``.\n num_splits : int\n The number of splits to return.\n len_of_left : int\n The number of values in `partitions` that belong to the left data set.\n *partitions : array-like\n All partitions that make up the full axis (row or column)\n for both data sets.\n\n Returns\n -------\n list\n List of PyArrow Tables.\n \"\"\"\n lt_table = concat_arrow_table_partitions(axis, partitions[:len_of_left])\n rt_table = concat_arrow_table_partitions(axis, partitions[len_of_left:])\n try:\n result = func(lt_table, rt_table, *f_args, **f_kwargs)\n except Exception:\n lt_frame = lt_table.from_pandas()\n rt_frame = rt_table.from_pandas()\n result = pyarrow.Table.from_pandas(\n func(lt_frame, rt_frame, *f_args, **f_kwargs)\n )\n return split_arrow_table_result(\n axis, result, len(result.num_rows), num_splits, result.schema.metadata\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition.py_pyarrow_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition.py_pyarrow_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 84, "span_ids": ["PyarrowOnRayDataframePartition._length_extraction_fn", "PyarrowOnRayDataframePartition.put", "docstring", "PyarrowOnRayDataframePartition._width_extraction_fn", "PyarrowOnRayDataframePartition"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pyarrow\n\nfrom modin.core.execution.ray.implementations.pandas_on_ray.partitioning import (\n PandasOnRayDataframePartition,\n)\nfrom modin.core.execution.ray.common import RayWrapper\n\n\nclass PyarrowOnRayDataframePartition(PandasOnRayDataframePartition):\n \"\"\"\n Class provides partition interface specific for PyArrow storage format and Ray engine.\n\n Inherits functionality from the ``PandasOnRayDataframePartition`` class.\n\n Parameters\n ----------\n data : ray.ObjectRef\n A reference to ``pyarrow.Table`` that needs to be wrapped with this class.\n length : ray.ObjectRef or int, optional\n Length or reference to it of wrapped ``pyarrow.Table``.\n width : ray.ObjectRef or int, optional\n Width or reference to it of wrapped ``pyarrow.Table``.\n ip : ray.ObjectRef or str, optional\n Node IP address or reference to it that holds wrapped ``pyarrow.Table``.\n call_queue : list, optional\n Call queue that needs to be executed on wrapped ``pyarrow.Table``.\n \"\"\"\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Put an object in the Plasma store and wrap it in this object.\n\n Parameters\n ----------\n obj : object\n The object to be put.\n\n Returns\n -------\n PyarrowOnRayDataframePartition\n A ``PyarrowOnRayDataframePartition`` object.\n \"\"\"\n return PyarrowOnRayDataframePartition(\n RayWrapper.put(pyarrow.Table.from_pandas(obj))\n )\n\n @classmethod\n def _length_extraction_fn(cls):\n \"\"\"\n Return the callable that extracts the number of rows from the given ``pyarrow.Table``.\n\n Returns\n -------\n callable\n \"\"\"\n return lambda table: table.num_rows\n\n @classmethod\n def _width_extraction_fn(cls):\n \"\"\"\n Return the callable that extracts the number of columns from the given ``pyarrow.Table``.\n\n Returns\n -------\n callable\n \"\"\"\n return lambda table: table.num_columns - (1 if \"index\" in table.columns else 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_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition_manager.py_from_modin_core_execution_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition_manager.py_from_modin_core_execution_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/ray/implementations/pyarrow_on_ray/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 38, "span_ids": ["PyarrowOnRayDataframePartitionManager", "docstring"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.core.execution.ray.generic.partitioning import (\n GenericRayDataframePartitionManager,\n)\nfrom .axis_partition import (\n PyarrowOnRayDataframeColumnPartition,\n PyarrowOnRayDataframeRowPartition,\n)\nfrom .partition import PyarrowOnRayDataframePartition\n\n\nclass PyarrowOnRayDataframePartitionManager(GenericRayDataframePartitionManager):\n \"\"\"\n Class for tracking partitions with PyArrow storage format and Ray engine.\n\n Inherits all functionality from ``GenericRayDataframePartitionManager`` and ``PandasDataframePartitionManager`` base\n classes.\n \"\"\"\n\n # This object uses PyarrowOnRayDataframePartition objects as the underlying store.\n _partition_class = PyarrowOnRayDataframePartition\n _column_partitions_class = PyarrowOnRayDataframeColumnPartition\n _row_partition_class = PyarrowOnRayDataframeRowPartition", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/unidist/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/unidist/implementations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/unidist/implementations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py_ExperimentalPandasOnUnidistIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py_ExperimentalPandasOnUnidistIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 27}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .io import ExperimentalPandasOnUnidistIO\n\n__all__ = [\"ExperimentalPandasOnUnidistIO\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_from_modin_core_storage_f_None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_from_modin_core_storage_f_None_6", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 42, "span_ids": ["docstring"], "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": "from modin.core.storage_formats.pandas.parsers import (\n PandasCSVGlobParser,\n ExperimentalPandasPickleParser,\n ExperimentalCustomTextParser,\n)\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.core.execution.unidist.implementations.pandas_on_unidist.io import (\n PandasOnUnidistIO,\n)\nfrom modin.experimental.core.io import (\n ExperimentalCSVGlobDispatcher,\n ExperimentalSQLDispatcher,\n ExperimentalPickleDispatcher,\n ExperimentalCustomTextDispatcher,\n)\nfrom modin.core.execution.unidist.implementations.pandas_on_unidist.dataframe import (\n PandasOnUnidistDataframe,\n)\nfrom modin.core.execution.unidist.implementations.pandas_on_unidist.partitioning import (\n PandasOnUnidistDataframePartition,\n)\nfrom modin.core.execution.unidist.common import UnidistWrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_ExperimentalPandasOnUnidistIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py_ExperimentalPandasOnUnidistIO_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/unidist/implementations/pandas_on_unidist/io/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 80, "span_ids": ["ExperimentalPandasOnUnidistIO.__make_write", "ExperimentalPandasOnUnidistIO.__make_read", "ExperimentalPandasOnUnidistIO", "ExperimentalPandasOnUnidistIO:5"], "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 ExperimentalPandasOnUnidistIO(PandasOnUnidistIO):\n \"\"\"\n Class for handling experimental IO functionality with pandas storage format and unidist engine.\n\n ``ExperimentalPandasOnUnidistIO`` inherits some util functions and unmodified IO functions\n from ``PandasOnUnidistIO`` class.\n \"\"\"\n\n build_args = dict(\n frame_partition_cls=PandasOnUnidistDataframePartition,\n query_compiler_cls=PandasQueryCompiler,\n frame_cls=PandasOnUnidistDataframe,\n base_io=PandasOnUnidistIO,\n )\n\n def __make_read(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (UnidistWrapper, *classes), build_args).read\n\n def __make_write(*classes, build_args=build_args):\n # used to reduce code duplication\n return type(\"\", (UnidistWrapper, *classes), build_args).write\n\n read_csv_glob = __make_read(PandasCSVGlobParser, ExperimentalCSVGlobDispatcher)\n read_pickle_distributed = __make_read(\n ExperimentalPandasPickleParser, ExperimentalPickleDispatcher\n )\n to_pickle_distributed = __make_write(ExperimentalPickleDispatcher)\n read_custom_text = __make_read(\n ExperimentalCustomTextParser, ExperimentalCustomTextDispatcher\n )\n read_sql = __make_read(ExperimentalSQLDispatcher)\n\n del __make_read # to not pollute class namespace\n del __make_write # to not pollute class namespace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/__init__.py_ExperimentalCSVGlobDispatcher_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/__init__.py_ExperimentalCSVGlobDispatcher_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 27, "span_ids": ["docstring"], "tokens": 80}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .text.csv_glob_dispatcher import ExperimentalCSVGlobDispatcher\nfrom .sql.sql_dispatcher import ExperimentalSQLDispatcher\nfrom .pickle.pickle_dispatcher import ExperimentalPickleDispatcher\nfrom .text.custom_text_dispatcher import ExperimentalCustomTextDispatcher\n\n__all__ = [\n \"ExperimentalCSVGlobDispatcher\",\n \"ExperimentalSQLDispatcher\",\n \"ExperimentalPickleDispatcher\",\n \"ExperimentalCustomTextDispatcher\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/pickle/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_glob_ExperimentalPickleDispatcher._read.return.cls_query_compiler_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_glob_ExperimentalPickleDispatcher._read.return.cls_query_compiler_cls_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/pickle/pickle_dispatcher.py", "file_name": "pickle_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 94, "span_ids": ["ExperimentalPickleDispatcher._read", "ExperimentalPickleDispatcher", "docstring"], "tokens": 559}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import glob\nimport warnings\n\nimport pandas\n\nfrom modin.core.io.file_dispatcher import FileDispatcher\nfrom modin.config import NPartitions\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\n\n\nclass ExperimentalPickleDispatcher(FileDispatcher):\n \"\"\"Class handles utils for reading pickle files.\"\"\"\n\n @classmethod\n def _read(cls, filepath_or_buffer, **kwargs):\n \"\"\"\n Read data from `filepath_or_buffer` according to `kwargs` parameters.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of `read_pickle` function.\n **kwargs : dict\n Parameters of `read_pickle` function.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n\n Notes\n -----\n In experimental mode, we can use `*` in the filename.\n\n The number of partitions is equal to the number of input files.\n \"\"\"\n if not (isinstance(filepath_or_buffer, str) and \"*\" in filepath_or_buffer):\n return cls.single_worker_read(\n filepath_or_buffer,\n single_worker_read=True,\n reason=\"Buffers and single files are not supported\",\n **kwargs,\n )\n filepath_or_buffer = sorted(glob.glob(filepath_or_buffer))\n\n if len(filepath_or_buffer) == 0:\n raise ValueError(\n f\"There are no files matching the pattern: {filepath_or_buffer}\"\n )\n\n partition_ids = [None] * len(filepath_or_buffer)\n lengths_ids = [None] * len(filepath_or_buffer)\n widths_ids = [None] * len(filepath_or_buffer)\n\n if len(filepath_or_buffer) != NPartitions.get():\n # do we need to do a repartitioning?\n warnings.warn(\"can be inefficient partitioning\")\n\n for idx, file_name in enumerate(filepath_or_buffer):\n *partition_ids[idx], lengths_ids[idx], widths_ids[idx] = cls.deploy(\n func=cls.parse,\n f_kwargs={\n \"fname\": file_name,\n **kwargs,\n },\n num_returns=3,\n )\n lengths = cls.materialize(lengths_ids)\n widths = cls.materialize(widths_ids)\n\n # while num_splits is 1, need only one value\n partition_ids = cls.build_partition(partition_ids, lengths, [widths[0]])\n\n new_index, _ = cls.frame_cls._partition_mgr_cls.get_indices(0, partition_ids)\n new_columns, _ = cls.frame_cls._partition_mgr_cls.get_indices(1, partition_ids)\n\n return cls.query_compiler_cls(\n cls.frame_cls(partition_ids, new_index, new_columns)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_ExperimentalPickleDispatcher.write_ExperimentalPickleDispatcher.write.if_not_.return": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_ExperimentalPickleDispatcher.write_ExperimentalPickleDispatcher.write.if_not_.return", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/pickle/pickle_dispatcher.py", "file_name": "pickle_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 122, "span_ids": ["ExperimentalPickleDispatcher.write"], "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 ExperimentalPickleDispatcher(FileDispatcher):\n\n @classmethod\n def write(cls, qc, **kwargs):\n \"\"\"\n When `*` is in the filename, all partitions are written to their own separate file.\n\n The filenames is determined as follows:\n - if `*` is in the filename, then it will be replaced by the ascending sequence 0, 1, 2, \u2026\n - if `*` is not in the filename, then the default implementation will be used.\n\n Example: 4 partitions and input filename=\"partition*.pkl.gz\", then filenames will be:\n `partition0.pkl.gz`, `partition1.pkl.gz`, `partition2.pkl.gz`, `partition3.pkl.gz`.\n\n Parameters\n ----------\n qc : BaseQueryCompiler\n The query compiler of the Modin dataframe that we want\n to run ``to_pickle_distributed`` on.\n **kwargs : dict\n Parameters for ``pandas.to_pickle(**kwargs)``.\n \"\"\"\n if not (\n isinstance(kwargs[\"filepath_or_buffer\"], str)\n and \"*\" in kwargs[\"filepath_or_buffer\"]\n ) or not isinstance(qc, PandasQueryCompiler):\n warnings.warn(\"Defaulting to Modin core implementation\")\n cls.base_io.to_pickle(qc, **kwargs)\n return\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_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_ExperimentalPickleDispatcher.write.func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/pickle/pickle_dispatcher.py_ExperimentalPickleDispatcher.write.func_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/pickle/pickle_dispatcher.py", "file_name": "pickle_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 143, "span_ids": ["ExperimentalPickleDispatcher.write"], "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 ExperimentalPickleDispatcher(FileDispatcher):\n\n @classmethod\n def write(cls, qc, **kwargs):\n # ... other code\n\n def func(df, **kw): # pragma: no cover\n idx = str(kw[\"partition_idx\"])\n # dask doesn't make a copy of kwargs on serialization;\n # so take a copy ourselves, otherwise the error is:\n # kwargs[\"path\"] = kwargs.pop(\"filepath_or_buffer\").replace(\"*\", idx)\n # KeyError: 'filepath_or_buffer'\n dask_kwargs = dict(kwargs)\n dask_kwargs[\"path\"] = dask_kwargs.pop(\"filepath_or_buffer\").replace(\n \"*\", idx\n )\n df.to_pickle(**dask_kwargs)\n return pandas.DataFrame()\n\n result = qc._modin_frame.apply_full_axis(\n 1, func, new_index=[], new_columns=[], enumerate_partitions=True\n )\n cls.materialize(\n [part.list_of_blocks[0] for row in result._partitions for part in row]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/io/sql/sql_dispatcher.py_warnings_ExperimentalSQLDispatcher.preprocess_func.return.cls___read_sql_with_offse": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/sql_dispatcher.py_warnings_ExperimentalSQLDispatcher.preprocess_func.return.cls___read_sql_with_offse", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/sql_dispatcher.py", "file_name": "sql_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 38, "span_ids": ["ExperimentalSQLDispatcher", "ExperimentalSQLDispatcher.preprocess_func", "docstring"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import warnings\n\nimport pandas\nimport numpy as np\n\nfrom modin.core.io import SQLDispatcher\nfrom modin.config import NPartitions\n\n\nclass ExperimentalSQLDispatcher(SQLDispatcher):\n \"\"\"Class handles experimental utils for reading SQL queries or database tables.\"\"\"\n\n __read_sql_with_offset = None\n\n @classmethod\n def preprocess_func(cls): # noqa: RT01\n \"\"\"Prepare a function for transmission to remote workers.\"\"\"\n if cls.__read_sql_with_offset is None:\n # sql deps are optional, so import only when needed\n from modin.experimental.core.io.sql.utils import read_sql_with_offset\n\n cls.__read_sql_with_offset = cls.put(read_sql_with_offset)\n return cls.__read_sql_with_offset", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/sql_dispatcher.py_ExperimentalSQLDispatcher._read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/sql_dispatcher.py_ExperimentalSQLDispatcher._read_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/sql_dispatcher.py", "file_name": "sql_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 139, "span_ids": ["ExperimentalSQLDispatcher._read"], "tokens": 620}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalSQLDispatcher(SQLDispatcher):\n\n @classmethod\n def _read(\n cls,\n sql,\n con,\n index_col,\n coerce_float,\n params,\n parse_dates,\n columns,\n chunksize,\n dtype_backend,\n dtype,\n partition_column,\n lower_bound,\n upper_bound,\n max_sessions,\n ): # noqa: PR01\n \"\"\"\n Read SQL query or database table into a DataFrame.\n\n Documentation for parameters can be found at `modin.read_sql`.\n\n Returns\n -------\n BaseQueryCompiler\n A new query compiler with imported data for further processing.\n \"\"\"\n # sql deps are optional, so import only when needed\n from modin.experimental.core.io.sql.utils import (\n is_distributed,\n get_query_info,\n )\n\n if not is_distributed(partition_column, lower_bound, upper_bound):\n message = \"Defaulting to Modin core implementation; \\\n 'partition_column', 'lower_bound', 'upper_bound' must be different from None\"\n warnings.warn(message)\n return cls.base_io.read_sql(\n sql,\n con,\n index_col,\n coerce_float=coerce_float,\n params=params,\n parse_dates=parse_dates,\n columns=columns,\n chunksize=chunksize,\n dtype_backend=dtype_backend,\n dtype=dtype,\n )\n # starts the distributed alternative\n cols_names, query = get_query_info(sql, con, partition_column)\n num_parts = min(NPartitions.get(), max_sessions if max_sessions else 1)\n num_splits = min(len(cols_names), num_parts)\n diff = (upper_bound - lower_bound) + 1\n min_size = diff // num_parts\n rest = diff % num_parts\n partition_ids = []\n index_ids = []\n end = lower_bound - 1\n func = cls.preprocess_func()\n for part in range(num_parts):\n if rest:\n size = min_size + 1\n rest -= 1\n else:\n size = min_size\n start = end + 1\n end = start + size - 1\n partition_id = cls.deploy(\n func,\n f_args=(\n partition_column,\n start,\n end,\n num_splits,\n query,\n con,\n index_col,\n coerce_float,\n params,\n parse_dates,\n columns,\n chunksize,\n dtype_backend,\n dtype,\n ),\n num_returns=num_splits + 1,\n )\n partition_ids.append(\n [cls.frame_partition_cls(obj) for obj in partition_id[:-1]]\n )\n index_ids.append(partition_id[-1])\n new_index = pandas.RangeIndex(sum(cls.materialize(index_ids)))\n new_query_compiler = cls.query_compiler_cls(\n cls.frame_cls(np.array(partition_ids), new_index, cols_names)\n )\n new_query_compiler._modin_frame.synchronize_labels(axis=0)\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_from_collections_import_O_is_distributed.if_.else_.raise_InvalidArguments_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_from_collections_import_O_is_distributed.if_.else_.raise_InvalidArguments_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 57, "span_ids": ["is_distributed", "docstring"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import OrderedDict\n\nfrom sqlalchemy import MetaData, Table, create_engine, inspect\nimport pandas\nimport pandas._libs.lib as lib\n\nfrom modin.core.storage_formats.pandas.parsers import _split_result_for_readers\n\n\ndef is_distributed(partition_column, lower_bound, upper_bound):\n \"\"\"\n Check if is possible to distribute a query with the given args.\n\n Parameters\n ----------\n partition_column : str\n Column name used for data partitioning between the workers.\n lower_bound : int\n The minimum value to be requested from the `partition_column`.\n upper_bound : int\n The maximum value to be requested from the `partition_column`.\n\n Returns\n -------\n bool\n Whether the given query is distributable or not.\n \"\"\"\n if (\n (partition_column is not None)\n and (lower_bound is not None)\n and (upper_bound is not None)\n ):\n if upper_bound > lower_bound:\n return True\n raise InvalidArguments(\"upper_bound must be greater than lower_bound.\")\n elif (partition_column is None) and (lower_bound is None) and (upper_bound is None):\n return False\n else:\n raise InvalidArguments(\n \"Invalid combination of partition_column, lower_bound, upper_bound.\"\n + \"All these arguments should be passed (distributed) or none of them (standard pandas).\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_is_table_check_query.if_from_not_in_q_.raise_InvalidQuery_FROM_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_is_table_check_query.if_from_not_in_q_.raise_InvalidQuery_FROM_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 152, "span_ids": ["is_table", "check_query", "get_table_columns", "get_table_metadata", "build_query_from_table"], "tokens": 430}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_table(engine, sql):\n \"\"\"\n Check if given `sql` parameter is a table name.\n\n Parameters\n ----------\n engine : sqlalchemy.engine.base.Engine\n SQLAlchemy connection engine.\n sql : str\n SQL query to be executed or a table name.\n\n Returns\n -------\n bool\n Whether `sql` a table name or not.\n \"\"\"\n return inspect(engine).has_table(sql)\n\n\ndef get_table_metadata(engine, table):\n \"\"\"\n Extract all useful data from the given table.\n\n Parameters\n ----------\n engine : sqlalchemy.engine.base.Engine\n SQLAlchemy connection engine.\n table : str\n Table name.\n\n Returns\n -------\n sqlalchemy.sql.schema.Table\n Extracted metadata.\n \"\"\"\n metadata = MetaData()\n metadata.reflect(bind=engine, only=[table])\n table_metadata = Table(table, metadata, autoload=True)\n return table_metadata\n\n\ndef get_table_columns(metadata):\n \"\"\"\n Extract columns names and python types from the `metadata`.\n\n Parameters\n ----------\n metadata : sqlalchemy.sql.schema.Table\n Table metadata.\n\n Returns\n -------\n OrderedDict\n Dictionary with columns names and python types.\n \"\"\"\n cols = OrderedDict()\n for col in metadata.c:\n name = str(col).rpartition(\".\")[2]\n cols[name] = col.type.python_type.__name__\n return cols\n\n\ndef build_query_from_table(name):\n \"\"\"\n Create a query from the given table name.\n\n Parameters\n ----------\n name : str\n Table name.\n\n Returns\n -------\n str\n Query string.\n \"\"\"\n return \"SELECT * FROM {0}\".format(name)\n\n\ndef check_query(query):\n \"\"\"\n Check query sanity.\n\n Parameters\n ----------\n query : str\n Query string.\n \"\"\"\n q = query.lower()\n if \"select \" not in q:\n raise InvalidQuery(\"SELECT word not found in the query: {0}\".format(query))\n if \" from \" not in q:\n raise InvalidQuery(\"FROM word not found in the query: {0}\".format(query))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_get_query_columns_get_query_columns.return.cols": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_get_query_columns_get_query_columns.return.cols", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 178, "span_ids": ["get_query_columns"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_query_columns(engine, query):\n \"\"\"\n Extract columns names and python types from the `query`.\n\n Parameters\n ----------\n engine : sqlalchemy.engine.base.Engine\n SQLAlchemy connection engine.\n query : str\n SQL query.\n\n Returns\n -------\n OrderedDict\n Dictionary with columns names and python types.\n \"\"\"\n con = engine.connect()\n result = con.execute(query).fetchone()\n values = list(result)\n cols_names = list(result.keys())\n cols = OrderedDict()\n for i in range(len(cols_names)):\n cols[cols_names[i]] = type(values[i]).__name__\n return cols", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_check_partition_column_check_partition_column.raise_InvalidPartitionCol": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_check_partition_column_check_partition_column.raise_InvalidPartitionCol", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 199, "span_ids": ["check_partition_column"], "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 check_partition_column(partition_column, cols):\n \"\"\"\n Check `partition_column` existence and it's type.\n\n Parameters\n ----------\n partition_column : str\n Column name used for data partitioning between the workers.\n cols : OrderedDict/dict\n Dictionary with columns names and python types.\n \"\"\"\n for k, v in cols.items():\n if k == partition_column:\n if v == \"int\":\n return\n raise InvalidPartitionColumn(f\"partition_column must be int, and not {v}\")\n raise InvalidPartitionColumn(\n f\"partition_column {partition_column} not found in the query\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_get_query_info_get_query_info.return.list_cols_keys_query": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_get_query_info_get_query_info.return.list_cols_keys_query", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 234, "span_ids": ["get_query_info"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_query_info(sql, con, partition_column):\n \"\"\"\n Compute metadata needed for query distribution.\n\n Parameters\n ----------\n sql : str\n SQL query to be executed or a table name.\n con : SQLAlchemy connectable or str\n Database connection or url string.\n partition_column : str\n Column name used for data partitioning between the workers.\n\n Returns\n -------\n list\n Columns names list.\n str\n Query string.\n \"\"\"\n engine = create_engine(con)\n if is_table(engine, sql):\n table_metadata = get_table_metadata(engine, sql)\n query = build_query_from_table(sql)\n cols = get_table_columns(table_metadata)\n else:\n check_query(sql)\n query = sql.replace(\";\", \"\")\n cols = get_query_columns(engine, query)\n # TODO allow validation that takes into account edge cases of pandas e.g. \"[index]\"\n # check_partition_column(partition_column, cols)\n # TODO partition_column isn't used; we need to use it;\n return list(cols.keys()), query", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_query_put_bounders_InvalidPartitionColumn._Exception_that_should_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_query_put_bounders_InvalidPartitionColumn._Exception_that_should_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 273, "span_ids": ["query_put_bounders", "InvalidPartitionColumn", "InvalidArguments", "InvalidQuery"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def query_put_bounders(query, partition_column, start, end): # pragma: no cover\n \"\"\"\n Put partition boundaries into the query.\n\n Parameters\n ----------\n query : str\n SQL query string.\n partition_column : str\n Column name used for data partitioning between the workers.\n start : int\n Lowest value to request from the `partition_column`.\n end : int\n Highest value to request from the `partition_column`.\n\n Returns\n -------\n str\n Query string with boundaries.\n \"\"\"\n where = \" WHERE TMP_TABLE.{0} >= {1} AND TMP_TABLE.{0} <= {2}\".format(\n partition_column, start, end\n )\n query_with_bounders = \"SELECT * FROM ({0}) AS TMP_TABLE {1}\".format(query, where)\n return query_with_bounders\n\n\nclass InvalidArguments(Exception):\n \"\"\"Exception that should be raised if invalid arguments combination was found.\"\"\"\n\n\nclass InvalidQuery(Exception):\n \"\"\"Exception that should be raised if invalid query statement was found.\"\"\"\n\n\nclass InvalidPartitionColumn(Exception):\n \"\"\"Exception that should be raised if `partition_column` doesn't satisfy predefined requirements.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_read_sql_with_offset_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/sql/utils.py_read_sql_with_offset_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/sql/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 276, "end_line": 364, "span_ids": ["read_sql_with_offset"], "tokens": 819}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_sql_with_offset(\n partition_column,\n start,\n end,\n num_splits,\n sql,\n con,\n index_col=None,\n coerce_float=True,\n params=None,\n parse_dates=None,\n columns=None,\n chunksize=None,\n dtype_backend=lib.no_default,\n dtype=None,\n): # pragma: no cover\n \"\"\"\n Read a chunk of SQL query or table into a pandas DataFrame.\n\n Parameters\n ----------\n partition_column : str\n Column name used for data partitioning between the workers.\n start : int\n Lowest value to request from the `partition_column`.\n end : int\n Highest value to request from the `partition_column`.\n num_splits : int\n The number of partitions to split the column into.\n sql : str or SQLAlchemy Selectable (select or text object)\n SQL query to be executed or a table name.\n con : SQLAlchemy connectable or str\n Connection to database (sqlite3 connections are not supported).\n index_col : str or list of str, optional\n Column(s) to set as index(MultiIndex).\n coerce_float : bool, default: True\n Attempts to convert values of non-string, non-numeric objects\n (like decimal.Decimal) to floating point, useful for SQL result sets.\n params : list, tuple or dict, optional\n List of parameters to pass to ``execute`` method. The syntax used\n to pass parameters is database driver dependent. Check your\n database driver documentation for which of the five syntax styles,\n described in PEP 249's paramstyle, is supported.\n parse_dates : list or dict, optional\n The behavior is as follows:\n\n - List of column names to parse as dates.\n - Dict of `{column_name: format string}` where format string is\n strftime compatible in case of parsing string times, or is one of\n (D, s, ns, ms, us) in case of parsing integer timestamps.\n - Dict of `{column_name: arg dict}`, where the arg dict corresponds\n to the keyword arguments of ``pandas.to_datetime``\n Especially useful with databases without native Datetime support,\n such as SQLite.\n columns : list, optional\n List of column names to select from SQL table (only used when reading a\n table).\n chunksize : int, optional\n If specified, return an iterator where `chunksize` is the number of rows\n to include in each chunk.\n dtype_backend : {\"numpy_nullable\", \"pyarrow\"}, default: NumPy backed DataFrames\n Which dtype_backend to use, e.g. whether a DataFrame should have NumPy arrays,\n nullable dtypes are used for all dtypes that have a nullable implementation when\n \"numpy_nullable\" is set, PyArrow is used for all dtypes if \"pyarrow\" is set.\n The dtype_backends are still experimential.\n dtype : Type name or dict of columns, optional\n Data type for data or columns. E.g. np.float64 or {'a': np.float64, 'b': np.int32, 'c': 'Int64'}. The argument is ignored if a table is passed instead of a query.\n\n Returns\n -------\n list\n List with split read results and it's metadata (index, dtypes, etc.).\n \"\"\"\n query_with_bounders = query_put_bounders(sql, partition_column, start, end)\n pandas_df = pandas.read_sql(\n query_with_bounders,\n con,\n index_col=index_col,\n coerce_float=coerce_float,\n params=params,\n parse_dates=parse_dates,\n columns=columns,\n chunksize=chunksize,\n dtype_backend=dtype_backend,\n dtype=dtype,\n )\n index = len(pandas_df)\n return _split_result_for_readers(1, num_splits, pandas_df) + [index]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_from_contextlib_import_Ex_ExperimentalCSVGlobDispatcher._read.encoding.kwargs_get_encoding_No": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_from_contextlib_import_Ex_ExperimentalCSVGlobDispatcher._read.encoding.kwargs_get_encoding_No", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 108, "span_ids": ["ExperimentalCSVGlobDispatcher._read", "ExperimentalCSVGlobDispatcher", "docstring"], "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": "from contextlib import ExitStack\nimport csv\nimport glob\nimport os\nfrom typing import List, Tuple\nimport warnings\nimport fsspec\n\nimport pandas\nimport pandas._libs.lib as lib\nfrom pandas.io.common import is_url, is_fsspec_url, stringify_path\n\nfrom modin.config import NPartitions\nfrom modin.core.io.file_dispatcher import OpenFile\nfrom modin.core.io.text.csv_dispatcher import CSVDispatcher\n\n\nclass ExperimentalCSVGlobDispatcher(CSVDispatcher):\n \"\"\"Class contains utils for reading multiple `.csv` files simultaneously.\"\"\"\n\n @classmethod\n def _read(cls, filepath_or_buffer, **kwargs):\n \"\"\"\n Read data from multiple `.csv` files passed with `filepath_or_buffer` simultaneously.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of ``read_csv`` function.\n **kwargs : dict\n Parameters of ``read_csv`` function.\n\n Returns\n -------\n new_query_compiler : BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n # Ensures that the file is a string file path. Otherwise, default to pandas.\n filepath_or_buffer = cls.get_path_or_buffer(stringify_path(filepath_or_buffer))\n if isinstance(filepath_or_buffer, str):\n # os.altsep == None on Linux\n is_folder = any(\n filepath_or_buffer.endswith(sep) for sep in (os.sep, os.altsep) if sep\n )\n if \"*\" not in filepath_or_buffer and not is_folder:\n warnings.warn(\n \"Shell-style wildcard '*' must be in the filename pattern in order to read multiple \"\n + f\"files at once. Did you forget it? Passed filename: '{filepath_or_buffer}'\"\n )\n if not cls.file_exists(filepath_or_buffer, kwargs.get(\"storage_options\")):\n return cls.single_worker_read(\n filepath_or_buffer,\n reason=cls._file_not_found_msg(filepath_or_buffer),\n **kwargs,\n )\n filepath_or_buffer = cls.get_path(filepath_or_buffer)\n elif not cls.pathlib_or_pypath(filepath_or_buffer):\n return cls.single_worker_read(\n filepath_or_buffer,\n reason=cls.BUFFER_UNSUPPORTED_MSG,\n **kwargs,\n )\n\n # We read multiple csv files when the file path is a list of absolute file paths. We assume that all of the files will be essentially replicas of the\n # first file but with different data values.\n glob_filepaths = filepath_or_buffer\n filepath_or_buffer = filepath_or_buffer[0]\n\n compression_type = cls.infer_compression(\n filepath_or_buffer, kwargs.get(\"compression\")\n )\n\n chunksize = kwargs.get(\"chunksize\")\n if chunksize is not None:\n return cls.single_worker_read(\n filepath_or_buffer,\n reason=\"`chunksize` parameter is not supported\",\n **kwargs,\n )\n\n skiprows = kwargs.get(\"skiprows\")\n if skiprows is not None and not isinstance(skiprows, int):\n return cls.single_worker_read(\n filepath_or_buffer,\n reason=\"Non-integer `skiprows` value not supported\",\n **kwargs,\n )\n\n nrows = kwargs.pop(\"nrows\", None)\n names = kwargs.get(\"names\", lib.no_default)\n index_col = kwargs.get(\"index_col\", None)\n usecols = kwargs.get(\"usecols\", None)\n encoding = kwargs.get(\"encoding\", None)\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_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher._read.if_names_in_lib_no_defau_ExperimentalCSVGlobDispatcher._read.is_quoting.kwargs_get_quoting_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher._read.if_names_in_lib_no_defau_ExperimentalCSVGlobDispatcher._read.is_quoting.kwargs_get_quoting_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 158, "span_ids": ["ExperimentalCSVGlobDispatcher._read"], "tokens": 544}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalCSVGlobDispatcher(CSVDispatcher):\n\n @classmethod\n def _read(cls, filepath_or_buffer, **kwargs):\n # ... other code\n if names in [lib.no_default, None]:\n # For the sake of the empty df, we assume no `index_col` to get the correct\n # column names before we build the index. Because we pass `names` in, this\n # step has to happen without removing the `index_col` otherwise it will not\n # be assigned correctly.\n names = pandas.read_csv(\n filepath_or_buffer,\n **dict(kwargs, usecols=None, nrows=0, skipfooter=0, index_col=None),\n ).columns\n elif index_col is None and not usecols:\n # When names is set to some list that is smaller than the number of columns\n # in the file, the first columns are built as a hierarchical index.\n empty_pd_df = pandas.read_csv(\n filepath_or_buffer, nrows=0, encoding=encoding\n )\n num_cols = len(empty_pd_df.columns)\n if num_cols > len(names):\n index_col = list(range(num_cols - len(names)))\n if len(index_col) == 1:\n index_col = index_col[0]\n kwargs[\"index_col\"] = index_col\n pd_df_metadata = pandas.read_csv(\n filepath_or_buffer, **dict(kwargs, nrows=1, skipfooter=0)\n )\n column_names = pd_df_metadata.columns\n skipfooter = kwargs.get(\"skipfooter\", None)\n skiprows = kwargs.pop(\"skiprows\", None)\n usecols_md = cls._validate_usecols_arg(usecols)\n if usecols is not None and usecols_md[1] != \"integer\":\n del kwargs[\"usecols\"]\n all_cols = pandas.read_csv(\n filepath_or_buffer,\n **dict(kwargs, nrows=0, skipfooter=0),\n ).columns\n usecols = all_cols.get_indexer_for(list(usecols_md[0]))\n parse_dates = kwargs.pop(\"parse_dates\", False)\n partition_kwargs = dict(\n kwargs,\n header=None,\n names=names,\n skipfooter=0,\n skiprows=None,\n parse_dates=parse_dates,\n usecols=usecols,\n )\n encoding = kwargs.get(\"encoding\", None)\n quotechar = kwargs.get(\"quotechar\", '\"').encode(\n encoding if encoding is not None else \"UTF-8\"\n )\n is_quoting = kwargs.get(\"quoting\", \"\") != csv.QUOTE_NONE\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_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher._read.with_ExitStack_as_stack_ExperimentalCSVGlobDispatcher._read.return.new_query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher._read.with_ExitStack_as_stack_ExperimentalCSVGlobDispatcher._read.return.new_query_compiler", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 260, "span_ids": ["ExperimentalCSVGlobDispatcher._read"], "tokens": 826}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalCSVGlobDispatcher(CSVDispatcher):\n\n @classmethod\n def _read(cls, filepath_or_buffer, **kwargs):\n # ... other code\n\n with ExitStack() as stack:\n files = [\n stack.enter_context(\n OpenFile(\n fname,\n \"rb\",\n compression_type,\n **(kwargs.get(\"storage_options\", None) or {}),\n )\n )\n for fname in glob_filepaths\n ]\n\n # Skip the header since we already have the header information and skip the\n # rows we are told to skip.\n if isinstance(skiprows, int) or skiprows is None:\n if skiprows is None:\n skiprows = 0\n header = kwargs.get(\"header\", \"infer\")\n if header == \"infer\" and kwargs.get(\"names\", lib.no_default) in [\n lib.no_default,\n None,\n ]:\n skip_header = 1\n elif isinstance(header, int):\n skip_header = header + 1\n elif hasattr(header, \"__iter__\") and not isinstance(header, str):\n skip_header = max(header) + 1\n else:\n skip_header = 0\n if kwargs.get(\"encoding\", None) is not None:\n partition_kwargs[\"skiprows\"] = 1\n # Launch tasks to read partitions\n column_widths, num_splits = cls._define_metadata(\n pd_df_metadata, column_names\n )\n\n args = {\n \"num_splits\": num_splits,\n **partition_kwargs,\n }\n\n splits = cls.partitioned_file(\n files,\n glob_filepaths,\n num_partitions=NPartitions.get(),\n nrows=nrows,\n skiprows=skiprows,\n skip_header=skip_header,\n quotechar=quotechar,\n is_quoting=is_quoting,\n )\n partition_ids = [None] * len(splits)\n index_ids = [None] * len(splits)\n dtypes_ids = [None] * len(splits)\n for idx, chunks in enumerate(splits):\n args.update({\"chunks\": chunks})\n *partition_ids[idx], index_ids[idx], dtypes_ids[idx] = cls.deploy(\n func=cls.parse,\n f_kwargs=args,\n num_returns=num_splits + 2,\n )\n\n # Compute the index based on a sum of the lengths of each partition (by default)\n # or based on the column(s) that were requested.\n if index_col is None:\n row_lengths = cls.materialize(index_ids)\n new_index = pandas.RangeIndex(sum(row_lengths))\n else:\n index_objs = cls.materialize(index_ids)\n row_lengths = [len(o) for o in index_objs]\n new_index = index_objs[0].append(index_objs[1:])\n new_index.name = pd_df_metadata.index.name\n\n partition_ids = cls.build_partition(partition_ids, row_lengths, column_widths)\n\n # Compute dtypes by getting collecting and combining all of the partitions. The\n # reported dtypes from differing rows can be different based on the inference in\n # the limited data seen by each worker. We use pandas to compute the exact dtype\n # over the whole column for each column. The index is set below.\n dtypes = cls.get_dtypes(dtypes_ids, column_names)\n\n new_frame = cls.frame_cls(\n partition_ids,\n new_index,\n column_names,\n row_lengths,\n column_widths,\n dtypes=dtypes,\n )\n new_query_compiler = cls.query_compiler_cls(new_frame)\n\n if skipfooter:\n new_query_compiler = new_query_compiler.drop(\n new_query_compiler.index[-skipfooter:]\n )\n if kwargs.get(\"squeeze\", False) and len(new_query_compiler.columns) == 1:\n return new_query_compiler[new_query_compiler.columns[0]]\n if index_col is None:\n new_query_compiler._modin_frame.synchronize_labels(axis=0)\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.file_exists_ExperimentalCSVGlobDispatcher.file_exists.return.exists_or_len_fs_glob_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.file_exists_ExperimentalCSVGlobDispatcher.file_exists.return.exists_or_len_fs_glob_fil", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 309, "span_ids": ["ExperimentalCSVGlobDispatcher.file_exists"], "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 ExperimentalCSVGlobDispatcher(CSVDispatcher):\n\n @classmethod\n def file_exists(cls, file_path: str, storage_options=None) -> bool:\n \"\"\"\n Check if the `file_path` is valid.\n\n Parameters\n ----------\n file_path : str\n String representing a path.\n storage_options : dict, optional\n Keyword from `read_*` functions.\n\n Returns\n -------\n bool\n True if the path is valid.\n \"\"\"\n if is_url(file_path):\n raise NotImplementedError(\"`read_csv_glob` does not support urllib paths.\")\n\n if not is_fsspec_url(file_path):\n return len(glob.glob(file_path)) > 0\n\n from botocore.exceptions import (\n NoCredentialsError,\n EndpointConnectionError,\n ConnectTimeoutError,\n )\n\n if storage_options is not None:\n new_storage_options = dict(storage_options)\n new_storage_options.pop(\"anon\", None)\n else:\n new_storage_options = {}\n\n fs, _ = fsspec.core.url_to_fs(file_path, **new_storage_options)\n exists = False\n try:\n exists = fs.exists(file_path)\n except (\n NoCredentialsError,\n PermissionError,\n EndpointConnectionError,\n ConnectTimeoutError,\n ):\n fs, _ = fsspec.core.url_to_fs(file_path, anon=True, **new_storage_options)\n exists = fs.exists(file_path)\n return exists or len(fs.glob(file_path)) > 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_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.get_path_ExperimentalCSVGlobDispatcher.get_path.return.get_file_path_fs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.get_path_ExperimentalCSVGlobDispatcher.get_path.return.get_file_path_fs_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 354, "span_ids": ["ExperimentalCSVGlobDispatcher.get_path"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalCSVGlobDispatcher(CSVDispatcher):\n\n @classmethod\n def get_path(cls, file_path: str) -> list:\n \"\"\"\n Return the path of the file(s).\n\n Parameters\n ----------\n file_path : str\n String representing a path.\n\n Returns\n -------\n list\n List of strings of absolute file paths.\n \"\"\"\n if not is_fsspec_url(file_path) and not is_url(file_path):\n relative_paths = glob.glob(file_path)\n abs_paths = [os.path.abspath(path) for path in relative_paths]\n return abs_paths\n\n from botocore.exceptions import (\n NoCredentialsError,\n EndpointConnectionError,\n ConnectTimeoutError,\n )\n\n def get_file_path(fs_handle) -> List[str]:\n file_paths = fs_handle.glob(file_path)\n if len(file_paths) == 0 and not fs_handle.exists(file_path):\n raise FileNotFoundError(f\"Path <{file_path}> isn't available.\")\n fs_addresses = [fs_handle.unstrip_protocol(path) for path in file_paths]\n return fs_addresses\n\n fs, _ = fsspec.core.url_to_fs(file_path)\n try:\n return get_file_path(fs)\n except (\n NoCredentialsError,\n PermissionError,\n EndpointConnectionError,\n ConnectTimeoutError,\n ):\n fs, _ = fsspec.core.url_to_fs(file_path, anon=True)\n return get_file_path(fs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.partitioned_file_ExperimentalCSVGlobDispatcher.partitioned_file.read_rows_counter.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.partitioned_file_ExperimentalCSVGlobDispatcher.partitioned_file.read_rows_counter.0", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 356, "end_line": 416, "span_ids": ["ExperimentalCSVGlobDispatcher.partitioned_file"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalCSVGlobDispatcher(CSVDispatcher):\n\n @classmethod\n def partitioned_file(\n cls,\n files,\n fnames: List[str],\n num_partitions: int = None,\n nrows: int = None,\n skiprows: int = None,\n skip_header: int = None,\n quotechar: bytes = b'\"',\n is_quoting: bool = True,\n ) -> List[List[Tuple[str, int, int]]]:\n \"\"\"\n Compute chunk sizes in bytes for every partition.\n\n Parameters\n ----------\n files : file or list of files\n File(s) to be partitioned.\n fnames : str or list of str\n File name(s) to be partitioned.\n num_partitions : int, optional\n For what number of partitions split a file.\n If not specified grabs the value from `modin.config.NPartitions.get()`.\n nrows : int, optional\n Number of rows of file to read.\n skiprows : int, optional\n Specifies rows to skip.\n skip_header : int, optional\n Specifies header rows to skip.\n quotechar : bytes, default: b'\"'\n Indicate quote in a file.\n is_quoting : bool, default: True\n Whether or not to consider quotes.\n\n Returns\n -------\n list\n List, where each element of the list is a list of tuples. The inner lists\n of tuples contains the data file name of the chunk, chunk start offset, and\n chunk end offsets for its corresponding file.\n\n Notes\n -----\n The logic gets really complicated if we try to use the `TextFileDispatcher.partitioned_file`.\n \"\"\"\n if type(files) != list:\n files = [files]\n\n if num_partitions is None:\n num_partitions = NPartitions.get()\n\n file_sizes = [cls.file_size(f) for f in files]\n partition_size = max(\n 1, num_partitions, (nrows if nrows else sum(file_sizes)) // num_partitions\n )\n\n result = []\n split_result = []\n split_size = 0\n read_rows_counter = 0\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_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.partitioned_file.for_f_fname_f_size_in_z_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/csv_glob_dispatcher.py_ExperimentalCSVGlobDispatcher.partitioned_file.for_f_fname_f_size_in_z_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/csv_glob_dispatcher.py", "file_name": "csv_glob_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 417, "end_line": 489, "span_ids": ["ExperimentalCSVGlobDispatcher.partitioned_file"], "tokens": 618}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExperimentalCSVGlobDispatcher(CSVDispatcher):\n\n @classmethod\n def partitioned_file(\n cls,\n files,\n fnames: List[str],\n num_partitions: int = None,\n nrows: int = None,\n skiprows: int = None,\n skip_header: int = None,\n quotechar: bytes = b'\"',\n is_quoting: bool = True,\n ) -> List[List[Tuple[str, int, int]]]:\n # ... other code\n for f, fname, f_size in zip(files, fnames, file_sizes):\n if skiprows or skip_header:\n skip_amount = (skiprows if skiprows else 0) + (\n skip_header if skip_header else 0\n )\n\n # TODO(williamma12): Handle when skiprows > number of rows in file. Currently returns empty df.\n outside_quotes, read_rows = cls._read_rows(\n f,\n nrows=skip_amount,\n quotechar=quotechar,\n is_quoting=is_quoting,\n )\n if skiprows:\n skiprows -= read_rows\n if skiprows > 0:\n # We have more rows to skip than the amount read in the file.\n continue\n\n start = f.tell()\n\n while f.tell() < f_size:\n if split_size >= partition_size:\n # Create a new split when the split has reached partition_size.\n # This is mainly used when we are reading row-wise partitioned files.\n result.append(split_result)\n split_result = []\n split_size = 0\n\n # We calculate the amount that we need to read based off of how much of the split we have already read.\n read_size = partition_size - split_size\n\n if nrows:\n if read_rows_counter >= nrows:\n # # Finish when we have read enough rows.\n if len(split_result) > 0:\n # Add last split into the result.\n result.append(split_result)\n return result\n elif read_rows_counter + read_size > nrows:\n # Ensure that we will not read more than nrows.\n read_size = nrows - read_rows_counter\n\n outside_quotes, read_rows = cls._read_rows(\n f,\n nrows=read_size,\n quotechar=quotechar,\n is_quoting=is_quoting,\n )\n split_size += read_rows\n read_rows_counter += read_rows\n else:\n outside_quotes = cls.offset(\n f,\n offset_size=read_size,\n quotechar=quotechar,\n is_quoting=is_quoting,\n )\n\n split_result.append((fname, start, f.tell()))\n split_size += f.tell() - start\n start = f.tell()\n\n # Add outside_quotes.\n if is_quoting and not outside_quotes:\n warnings.warn(\"File has mismatched quotes\")\n\n # Add last split into the result.\n if len(split_result) > 0:\n result.append(split_result)\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_modin-project__modin/modin/experimental/core/io/text/custom_text_dispatcher.py_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/io/text/custom_text_dispatcher.py_pandas_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/io/text/custom_text_dispatcher.py", "file_name": "custom_text_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 100, "span_ids": ["ExperimentalCustomTextDispatcher", "ExperimentalCustomTextDispatcher._read", "docstring"], "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": "import pandas\n\nfrom modin.core.io.file_dispatcher import OpenFile\nfrom modin.core.io.text.text_file_dispatcher import TextFileDispatcher\nfrom modin.config import NPartitions\n\n\nclass ExperimentalCustomTextDispatcher(TextFileDispatcher):\n \"\"\"Class handles utils for reading custom text files.\"\"\"\n\n @classmethod\n def _read(cls, filepath_or_buffer, columns, custom_parser, **kwargs):\n r\"\"\"\n Read data from `filepath_or_buffer` according to the passed `read_custom_text` `kwargs` parameters.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n `filepath_or_buffer` parameter of `read_custom_text` function.\n columns : list or callable(file-like object, \\*\\*kwargs -> list\n Column names of list type or callable that create column names from opened file\n and passed `kwargs`.\n custom_parser : callable(file-like object, \\*\\*kwargs -> pandas.DataFrame\n Function that takes as input a part of the `filepath_or_buffer` file loaded into\n memory in file-like object form.\n **kwargs : dict\n Parameters of `read_custom_text` function.\n\n Returns\n -------\n BaseQueryCompiler\n Query compiler with imported data for further processing.\n \"\"\"\n filepath_or_buffer_md = (\n cls.get_path(filepath_or_buffer)\n if isinstance(filepath_or_buffer, str)\n else cls.get_path_or_buffer(filepath_or_buffer)\n )\n compression_infered = cls.infer_compression(\n filepath_or_buffer, kwargs[\"compression\"]\n )\n\n with OpenFile(filepath_or_buffer_md, \"rb\", compression_infered) as f:\n splits, _ = cls.partitioned_file(\n f,\n num_partitions=NPartitions.get(),\n is_quoting=kwargs.pop(\"is_quoting\"),\n nrows=kwargs[\"nrows\"],\n )\n\n if callable(columns):\n with OpenFile(filepath_or_buffer_md, \"rb\", compression_infered) as f:\n columns = columns(f, **kwargs)\n if not isinstance(columns, pandas.Index):\n columns = pandas.Index(columns)\n\n empty_pd_df = pandas.DataFrame(columns=columns)\n index_name = empty_pd_df.index.name\n column_widths, num_splits = cls._define_metadata(empty_pd_df, columns)\n\n # kwargs that will be passed to the workers\n partition_kwargs = dict(\n kwargs,\n fname=filepath_or_buffer_md,\n num_splits=num_splits,\n nrows=None,\n compression=compression_infered,\n )\n\n partition_ids, index_ids, dtypes_ids = cls._launch_tasks(\n splits, callback=custom_parser, **partition_kwargs\n )\n\n new_query_compiler = cls._get_new_qc(\n partition_ids=partition_ids,\n index_ids=index_ids,\n dtypes_ids=dtypes_ids,\n index_col=None,\n index_name=index_name,\n column_widths=column_widths,\n column_names=columns,\n nrows=kwargs[\"nrows\"],\n )\n return new_query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/core/storage_formats/hdk/__init__.py_DFAlgQueryCompiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/__init__.py_DFAlgQueryCompiler_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 20}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .query_compiler import DFAlgQueryCompiler\n\n__all__ = [\"DFAlgQueryCompiler\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_from_modin_core_storage_f_np": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_from_modin_core_storage_f_np", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 35, "span_ids": ["docstring"], "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 modin.core.storage_formats.base.query_compiler import (\n BaseQueryCompiler,\n _set_axis as default_axis_setter,\n _get_axis as default_axis_getter,\n)\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.utils import _inherit_docstrings, MODIN_UNNAMED_SERIES_LABEL\nfrom modin.error_message import ErrorMessage\n\nimport pandas\nfrom pandas._libs.lib import no_default\nfrom pandas.core.common import is_bool_indexer\nfrom pandas.core.dtypes.common import is_list_like, is_bool_dtype, is_integer_dtype\nfrom functools import wraps\n\nimport numpy as np", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_is_inoperable_is_inoperable.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_is_inoperable_is_inoperable.return.False", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 62, "span_ids": ["is_inoperable"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_inoperable(value):\n \"\"\"\n Check if value cannot be processed by HDK engine.\n\n Parameters\n ----------\n value : any\n A value to check.\n\n Returns\n -------\n bool\n \"\"\"\n if isinstance(value, (tuple, list)):\n result = False\n for val in value:\n result = result or is_inoperable(val)\n return result\n elif isinstance(value, dict):\n return is_inoperable(list(value.values()))\n else:\n value = getattr(value, \"_query_compiler\", value)\n if hasattr(value, \"_modin_frame\"):\n return value._modin_frame._has_unsupported_data\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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_build_method_wrapper_build_method_wrapper.return.method_wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_build_method_wrapper_build_method_wrapper.return.method_wrapper", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 105, "span_ids": ["build_method_wrapper"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_method_wrapper(name, method):\n \"\"\"\n Build method wrapper to handle inoperable data types.\n\n Wrapper calls the original method if all its arguments can be processed\n by HDK engine and fallback to parent's method otherwise.\n\n Parameters\n ----------\n name : str\n Parent's method name to fallback to.\n method : callable\n A method to wrap.\n\n Returns\n -------\n callable\n \"\"\"\n\n @wraps(method)\n def method_wrapper(self, *args, **kwargs):\n # If the method wasn't found in the parent query compiler that means,\n # that we're calling one that is HDK-specific, if we intend\n # to fallback to pandas on 'NotImplementedError' then the call of this\n # private method is caused by some public QC method, so we catch\n # the exception here and do fallback properly\n default_method = getattr(super(type(self), self), name, None)\n if is_inoperable([self, args, kwargs]):\n if default_method is None:\n raise NotImplementedError(\"Frame contains data of unsupported types.\")\n return default_method(*args, **kwargs)\n try:\n return method(self, *args, **kwargs)\n # Defaulting to pandas if `NotImplementedError` was arisen\n except NotImplementedError as err:\n if default_method is None:\n raise err\n ErrorMessage.default_to_pandas(message=str(err))\n return default_method(*args, **kwargs)\n\n return method_wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_bind_wrappers_bind_wrappers.return.cls": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_bind_wrappers_bind_wrappers.return.cls", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 143, "span_ids": ["bind_wrappers"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bind_wrappers(cls):\n \"\"\"\n Wrap class methods.\n\n Decorator allows to fallback to the parent query compiler methods when unsupported\n data types are used in a frame.\n\n Returns\n -------\n class\n \"\"\"\n exclude = set(\n [\n \"__init__\",\n \"to_pandas\",\n \"from_pandas\",\n \"from_arrow\",\n \"default_to_pandas\",\n \"_get_index\",\n \"_set_index\",\n \"_get_columns\",\n \"_set_columns\",\n ]\n )\n for name, method in cls.__dict__.items():\n if name in exclude:\n continue\n\n if callable(method):\n setattr(\n cls,\n name,\n build_method_wrapper(name, method),\n )\n\n return cls", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.getitem_array_DFAlgQueryCompiler._Merge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.getitem_array_DFAlgQueryCompiler._Merge", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 253, "span_ids": ["DFAlgQueryCompiler.getitem_array"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def getitem_array(self, key):\n if isinstance(key, type(self)):\n new_modin_frame = self._modin_frame.filter(key._modin_frame)\n return self.__constructor__(new_modin_frame, self._shape_hint)\n\n if is_bool_indexer(key):\n return self.default_to_pandas(lambda df: df[key])\n\n if any(k not in self.columns for k in key):\n raise KeyError(\n \"{} not index\".format(\n str([k for k in key if k not in self.columns]).replace(\",\", \"\")\n )\n )\n return self.getitem_column_array(key)\n\n # Merge", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.merge_DFAlgQueryCompiler.merge.if_left_index_is_False_an.else_.return.self_default_to_pandas_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.merge_DFAlgQueryCompiler.merge.if_left_index_is_False_an.else_.return.self_default_to_pandas_pa", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 288, "span_ids": ["DFAlgQueryCompiler.merge"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def merge(self, right, **kwargs):\n on = kwargs.get(\"on\", None)\n left_on = kwargs.get(\"left_on\", None)\n right_on = kwargs.get(\"right_on\", None)\n left_index = kwargs.get(\"left_index\", False)\n right_index = kwargs.get(\"right_index\", False)\n \"\"\"Only non-index joins with explicit 'on' are supported\"\"\"\n if left_index is False and right_index is False:\n if left_on is None and right_on is None:\n if on is None:\n on = [c for c in self.columns if c in right.columns]\n left_on = on\n right_on = on\n\n if not isinstance(left_on, list):\n left_on = [left_on]\n if not isinstance(right_on, list):\n right_on = [right_on]\n\n how = kwargs.get(\"how\", \"inner\")\n sort = kwargs.get(\"sort\", False)\n suffixes = kwargs.get(\"suffixes\", None)\n return self.__constructor__(\n self._modin_frame.join(\n right._modin_frame,\n how=how,\n left_on=left_on,\n right_on=right_on,\n sort=sort,\n suffixes=suffixes,\n )\n )\n else:\n return self.default_to_pandas(pandas.DataFrame.merge, right, **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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.take_2d_positional_DFAlgQueryCompiler.groupby_size.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.take_2d_positional_DFAlgQueryCompiler.groupby_size.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 331, "span_ids": ["DFAlgQueryCompiler.groupby_size", "DFAlgQueryCompiler.take_2d_positional"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def take_2d_positional(self, index=None, columns=None):\n return self.__constructor__(\n self._modin_frame.take_2d_labels_or_positional(\n row_positions=index, col_positions=columns\n )\n )\n\n def groupby_size(\n self,\n by,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n ):\n # Grouping on empty frame or on index level.\n if len(self.columns) == 0:\n raise NotImplementedError(\n \"Grouping on empty frame or on index level is not yet implemented.\"\n )\n\n groupby_kwargs = groupby_kwargs.copy()\n as_index = groupby_kwargs.get(\"as_index\", True)\n # Setting 'as_index' to True to avoid 'by' and 'agg' columns naming conflict\n groupby_kwargs[\"as_index\"] = True\n new_frame = self._modin_frame.groupby_agg(\n by,\n axis,\n {self._modin_frame.columns[0]: \"size\"},\n groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n if as_index:\n shape_hint = \"column\"\n new_frame = new_frame._set_columns([MODIN_UNNAMED_SERIES_LABEL])\n else:\n shape_hint = None\n new_frame = new_frame._set_columns([\"size\"]).reset_index(drop=False)\n return self.__constructor__(new_frame, shape_hint=shape_hint)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.groupby_sum_DFAlgQueryCompiler.groupby_count.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.groupby_sum_DFAlgQueryCompiler.groupby_count.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 355, "span_ids": ["DFAlgQueryCompiler.groupby_sum", "DFAlgQueryCompiler.groupby_count"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def groupby_sum(self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False):\n new_frame = self._modin_frame.groupby_agg(\n by,\n axis,\n \"sum\",\n groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n return self.__constructor__(new_frame)\n\n def groupby_count(self, by, axis, groupby_kwargs, agg_args, agg_kwargs, drop=False):\n new_frame = self._modin_frame.groupby_agg(\n by,\n axis,\n \"count\",\n groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n return self.__constructor__(new_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.groupby_agg_DFAlgQueryCompiler.groupby_agg.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.groupby_agg_DFAlgQueryCompiler.groupby_agg.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 357, "end_line": 387, "span_ids": ["DFAlgQueryCompiler.groupby_agg"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def groupby_agg(\n self,\n by,\n agg_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n how=\"axis_wise\",\n drop=False,\n ):\n # TODO: handle `drop` args\n if callable(agg_func):\n raise NotImplementedError(\n \"Python callable is not a valid aggregation function for HDK storage format.\"\n )\n if how != \"axis_wise\":\n raise NotImplementedError(\n f\"'{how}' type of groupby-aggregation functions is not supported for HDK storage format.\"\n )\n\n new_frame = self._modin_frame.groupby_agg(\n by,\n axis,\n agg_func,\n groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n )\n return self.__constructor__(new_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.count_DFAlgQueryCompiler.nunique.return.self__agg_nunique_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.count_DFAlgQueryCompiler.nunique.return.self__agg_nunique_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 416, "span_ids": ["DFAlgQueryCompiler.max", "DFAlgQueryCompiler.min", "DFAlgQueryCompiler.count", "DFAlgQueryCompiler.mean", "DFAlgQueryCompiler.sum", "DFAlgQueryCompiler.nunique"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def count(self, **kwargs):\n return self._agg(\"count\", **kwargs)\n\n def max(self, **kwargs):\n return self._agg(\"max\", **kwargs)\n\n def min(self, **kwargs):\n return self._agg(\"min\", **kwargs)\n\n def sum(self, **kwargs):\n min_count = kwargs.pop(\"min_count\")\n if min_count != 0:\n raise NotImplementedError(\n f\"HDK's sum does not support such set of parameters: min_count={min_count}.\"\n )\n _check_int_or_float(\"sum\", self.dtypes)\n return self._agg(\"sum\", **kwargs)\n\n def mean(self, **kwargs):\n _check_int_or_float(\"mean\", self.dtypes)\n return self._agg(\"mean\", **kwargs)\n\n def nunique(self, axis=0, dropna=True):\n if axis != 0 or not dropna:\n raise NotImplementedError(\n f\"HDK's nunique does not support such set of parameters: axis={axis}, dropna={dropna}.\"\n )\n return self._agg(\"nunique\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._agg_DFAlgQueryCompiler._agg.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._agg_DFAlgQueryCompiler._agg.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 418, "end_line": 463, "span_ids": ["DFAlgQueryCompiler._agg"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def _agg(self, agg, axis=0, level=None, **kwargs):\n \"\"\"\n Perform specified aggregation along rows/columns.\n\n Parameters\n ----------\n agg : str\n Name of the aggregation function to perform.\n axis : {0, 1}, default: 0\n Axis to perform aggregation along. 0 is to apply function against each column,\n all the columns will be reduced into a single scalar. 1 is to aggregate\n across rows.\n *Note:* HDK storage format supports aggregation for 0 axis only, aggregation\n along rows will be defaulted to pandas.\n level : None, default: None\n Serves the compatibility purpose, always have to be None.\n **kwargs : dict\n Additional parameters to pass to the aggregation function.\n\n Returns\n -------\n DFAlgQueryCompiler\n New single-column (``axis=1``) or single-row (``axis=0``) query compiler containing\n the result of aggregation.\n \"\"\"\n if level is not None or axis != 0:\n raise NotImplementedError(\n \"HDK's aggregation functions does not support 'level' and 'axis' parameters.\"\n )\n\n # TODO: Do filtering on numeric columns if `numeric_only=True`\n if not kwargs.get(\"skipna\", True) or kwargs.get(\"numeric_only\"):\n raise NotImplementedError(\n \"HDK's aggregation functions does not support 'skipna' and 'numeric_only' parameters.\"\n )\n # Processed above, so can be omitted\n kwargs.pop(\"skipna\", None)\n kwargs.pop(\"numeric_only\", None)\n\n new_frame = self._modin_frame.agg(agg)\n new_frame = new_frame._set_index(\n pandas.Index.__new__(\n pandas.Index, data=[MODIN_UNNAMED_SERIES_LABEL], dtype=\"O\"\n )\n )\n return self.__constructor__(new_frame, shape_hint=\"row\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._get_index_DFAlgQueryCompiler._set_columns.if_self__modin_frame__has.else_.try_.except_NotImplementedErro.self._modin_frame._has_unsupported_data.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._get_index_DFAlgQueryCompiler._set_columns.if_self__modin_frame__has.else_.try_.except_NotImplementedErro.self._modin_frame._has_unsupported_data.True", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 465, "end_line": 517, "span_ids": ["DFAlgQueryCompiler._set_columns", "DFAlgQueryCompiler._set_index", "DFAlgQueryCompiler._get_index", "DFAlgQueryCompiler._get_columns"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def _get_index(self):\n \"\"\"\n Return frame's index.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n if self._modin_frame._has_unsupported_data:\n return default_axis_getter(0)(self)\n return self._modin_frame.index\n\n def _set_index(self, index):\n \"\"\"\n Set new index.\n\n Parameters\n ----------\n index : pandas.Index\n A new index.\n \"\"\"\n # NotImplementedError: HdkOnNativeDataframe._set_index is not yet suported\n default_axis_setter(0)(self, index)\n\n def _get_columns(self):\n \"\"\"\n Return frame's columns.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n if self._modin_frame._has_unsupported_data:\n return default_axis_getter(1)(self)\n return self._modin_frame.columns\n\n def _set_columns(self, columns):\n \"\"\"\n Set new columns.\n\n Parameters\n ----------\n columns : list-like\n New columns.\n \"\"\"\n if self._modin_frame._has_unsupported_data:\n default_axis_setter(1)(self, columns)\n else:\n try:\n self._modin_frame = self._modin_frame._set_columns(columns)\n except NotImplementedError:\n default_axis_setter(1)(self, columns)\n self._modin_frame._has_unsupported_data = 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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.fillna_DFAlgQueryCompiler.fillna.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.fillna_DFAlgQueryCompiler.fillna.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 519, "end_line": 546, "span_ids": ["DFAlgQueryCompiler.fillna"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def fillna(\n self,\n squeeze_self=False,\n squeeze_value=False,\n value=None,\n method=None,\n axis=None,\n inplace=False,\n limit=None,\n downcast=None,\n ):\n assert not inplace, \"inplace=True should be handled on upper level\"\n\n if (\n isinstance(value, dict)\n and len(self._modin_frame.columns) == 1\n and self._modin_frame.columns[0] == MODIN_UNNAMED_SERIES_LABEL\n ):\n raise NotImplementedError(\"Series fillna with dict value\")\n\n new_frame = self._modin_frame.fillna(\n value=value,\n method=method,\n axis=axis,\n limit=limit,\n downcast=downcast,\n )\n return self.__constructor__(new_frame, self._shape_hint)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.concat_DFAlgQueryCompiler.concat.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.concat_DFAlgQueryCompiler.concat.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 548, "end_line": 566, "span_ids": ["DFAlgQueryCompiler.concat"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def concat(self, axis, other, **kwargs):\n if not isinstance(other, list):\n other = [other]\n assert all(\n isinstance(o, type(self)) for o in other\n ), \"Different Manager objects are being used. This is not allowed\"\n sort = kwargs.get(\"sort\", False)\n if sort is None:\n raise ValueError(\n \"The 'sort' keyword only accepts boolean values; None was passed.\"\n )\n join = kwargs.get(\"join\", \"outer\")\n ignore_index = kwargs.get(\"ignore_index\", False)\n other_modin_frames = [o._modin_frame for o in other]\n\n new_modin_frame = self._modin_frame.concat(\n axis, other_modin_frames, join=join, sort=sort, ignore_index=ignore_index\n )\n return self.__constructor__(new_modin_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.drop_DFAlgQueryCompiler.drop.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.drop_DFAlgQueryCompiler.drop.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 568, "end_line": 590, "span_ids": ["DFAlgQueryCompiler.drop"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def drop(self, index=None, columns=None, errors: str = \"raise\"):\n if index is not None:\n # Only column drop is supported by the HDK engine\n raise NotImplementedError(\"Row drop\")\n if errors != \"raise\":\n raise NotImplementedError(\n \"This lazy query compiler will always \"\n + \"raise an error on invalid columns.\"\n )\n\n columns = self.columns.drop(columns)\n new_frame = self._modin_frame.take_2d_labels_or_positional(\n row_labels=index, col_labels=columns\n )\n\n # If all columns are dropped and the index is trivial, we are\n # not able to restore it, since we don't know the number of rows.\n # In this case, we copy the index from the current frame.\n if len(columns) == 0 and new_frame._index_cols is None:\n assert index is None, \"Can't copy old indexes as there was a row drop\"\n new_frame.set_index_cache(self._modin_frame.index.copy())\n\n return self.__constructor__(new_frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.dropna_DFAlgQueryCompiler.dropna.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.dropna_DFAlgQueryCompiler.dropna.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 592, "end_line": 605, "span_ids": ["DFAlgQueryCompiler.dropna"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def dropna(self, axis=0, how=no_default, thresh=no_default, subset=None):\n if thresh is not no_default or axis != 0:\n raise NotImplementedError(\n \"HDK's dropna does not support 'thresh' and 'axis' parameters.\"\n )\n\n if subset is None:\n subset = self.columns\n if how is no_default:\n how = \"any\"\n return self.__constructor__(\n self._modin_frame.dropna(subset=subset, how=how),\n shape_hint=self._shape_hint,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.isna_DFAlgQueryCompiler.dt_hour.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.isna_DFAlgQueryCompiler.dt_hour.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 607, "end_line": 634, "span_ids": ["DFAlgQueryCompiler.dt_day", "DFAlgQueryCompiler.dt_month", "DFAlgQueryCompiler.dt_hour", "DFAlgQueryCompiler.dt_year", "DFAlgQueryCompiler.notna", "DFAlgQueryCompiler.invert", "DFAlgQueryCompiler.isna"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def isna(self):\n return self.__constructor__(self._modin_frame.isna(invert=False))\n\n def notna(self):\n return self.__constructor__(self._modin_frame.isna(invert=True))\n\n def invert(self):\n return self.__constructor__(self._modin_frame.invert())\n\n def dt_year(self):\n return self.__constructor__(\n self._modin_frame.dt_extract(\"year\"), self._shape_hint\n )\n\n def dt_month(self):\n return self.__constructor__(\n self._modin_frame.dt_extract(\"month\"), self._shape_hint\n )\n\n def dt_day(self):\n return self.__constructor__(\n self._modin_frame.dt_extract(\"day\"), self._shape_hint\n )\n\n def dt_hour(self):\n return self.__constructor__(\n self._modin_frame.dt_extract(\"hour\"), self._shape_hint\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._bin_op_DFAlgQueryCompiler._bin_op.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._bin_op_DFAlgQueryCompiler._bin_op.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 636, "end_line": 667, "span_ids": ["DFAlgQueryCompiler._bin_op"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def _bin_op(self, other, op_name, **kwargs):\n \"\"\"\n Perform a binary operation on a frame.\n\n Parameters\n ----------\n other : any\n The second operand.\n op_name : str\n Operation name.\n **kwargs : dict\n Keyword args.\n\n Returns\n -------\n DFAlgQueryCompiler\n A new query compiler.\n \"\"\"\n level = kwargs.get(\"level\", None)\n if level is not None:\n return getattr(super(), op_name)(other=other, op_name=op_name, **kwargs)\n\n if isinstance(other, DFAlgQueryCompiler):\n shape_hint = (\n self._shape_hint if self._shape_hint == other._shape_hint else None\n )\n other = other._modin_frame\n else:\n shape_hint = self._shape_hint\n\n new_modin_frame = self._modin_frame.bin_op(other, op_name, **kwargs)\n return self.__constructor__(new_modin_frame, shape_hint)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.add_DFAlgQueryCompiler.mod.return.self__bin_op_other_mod_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.add_DFAlgQueryCompiler.mod.return.self__bin_op_other_mod_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 669, "end_line": 694, "span_ids": ["DFAlgQueryCompiler.pow", "DFAlgQueryCompiler.mul", "DFAlgQueryCompiler.add", "DFAlgQueryCompiler.sub", "DFAlgQueryCompiler.mod"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def add(self, other, **kwargs):\n return self._bin_op(other, \"add\", **kwargs)\n\n def sub(self, other, **kwargs):\n return self._bin_op(other, \"sub\", **kwargs)\n\n def mul(self, other, **kwargs):\n return self._bin_op(other, \"mul\", **kwargs)\n\n def pow(self, other, **kwargs):\n return self._bin_op(other, \"pow\", **kwargs)\n\n def mod(self, other, **kwargs):\n def check_int(obj):\n if isinstance(obj, DFAlgQueryCompiler):\n cond = all(is_integer_dtype(t) for t in obj._modin_frame.dtypes)\n elif isinstance(obj, list):\n cond = all(isinstance(i, int) for i in obj)\n else:\n cond = isinstance(obj, int)\n if not cond:\n raise NotImplementedError(\"Non-integer operands in modulo operation\")\n\n check_int(self)\n check_int(other)\n return self._bin_op(other, \"mod\", **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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.floordiv_DFAlgQueryCompiler.__or__.return.self__bool_op_other_or_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.floordiv_DFAlgQueryCompiler.__or__.return.self__bool_op_other_or_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 696, "end_line": 724, "span_ids": ["DFAlgQueryCompiler.eq", "DFAlgQueryCompiler.gt", "DFAlgQueryCompiler.le", "DFAlgQueryCompiler.truediv", "DFAlgQueryCompiler.ne", "DFAlgQueryCompiler.__and__", "DFAlgQueryCompiler.__or__", "DFAlgQueryCompiler.ge", "DFAlgQueryCompiler.lt", "DFAlgQueryCompiler.floordiv"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def floordiv(self, other, **kwargs):\n return self._bin_op(other, \"floordiv\", **kwargs)\n\n def truediv(self, other, **kwargs):\n return self._bin_op(other, \"truediv\", **kwargs)\n\n def eq(self, other, **kwargs):\n return self._bin_op(other, \"eq\", **kwargs)\n\n def ge(self, other, **kwargs):\n return self._bin_op(other, \"ge\", **kwargs)\n\n def gt(self, other, **kwargs):\n return self._bin_op(other, \"gt\", **kwargs)\n\n def le(self, other, **kwargs):\n return self._bin_op(other, \"le\", **kwargs)\n\n def lt(self, other, **kwargs):\n return self._bin_op(other, \"lt\", **kwargs)\n\n def ne(self, other, **kwargs):\n return self._bin_op(other, \"ne\", **kwargs)\n\n def __and__(self, other, **kwargs):\n return self._bool_op(other, \"and\", **kwargs)\n\n def __or__(self, other, **kwargs):\n return self._bool_op(other, \"or\", **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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._bool_op_DFAlgQueryCompiler._bool_op.return.self__bin_op_other_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler._bool_op_DFAlgQueryCompiler._bool_op.return.self__bin_op_other_op_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 726, "end_line": 739, "span_ids": ["DFAlgQueryCompiler._bool_op"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def _bool_op(self, other, op, **kwargs): # noqa: GL08\n def check_bool(obj):\n if isinstance(obj, DFAlgQueryCompiler):\n cond = all(is_bool_dtype(t) for t in obj._modin_frame.dtypes)\n elif isinstance(obj, list):\n cond = all(isinstance(i, bool) for i in obj)\n else:\n cond = isinstance(obj, bool)\n if not cond:\n raise NotImplementedError(\"Non-boolean operands in logic operation\")\n\n check_bool(self)\n check_bool(other)\n return self._bin_op(other, op, **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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.reset_index_DFAlgQueryCompiler.sort_rows_by_column_values.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.reset_index_DFAlgQueryCompiler.sort_rows_by_column_values.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 741, "end_line": 794, "span_ids": ["DFAlgQueryCompiler.astype", "DFAlgQueryCompiler.setitem", "DFAlgQueryCompiler.insert", "DFAlgQueryCompiler.reset_index", "DFAlgQueryCompiler.sort_rows_by_column_values", "DFAlgQueryCompiler:7"], "tokens": 451}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def reset_index(self, **kwargs):\n level = kwargs.get(\"level\", None)\n if level is not None:\n raise NotImplementedError(\n \"HDK's reset_index does not support 'level' parameter.\"\n )\n\n drop = kwargs.get(\"drop\", False)\n shape_hint = self._shape_hint if drop else None\n\n return self.__constructor__(\n self._modin_frame.reset_index(drop), shape_hint=shape_hint\n )\n\n def astype(self, col_dtypes, errors: str = \"raise\"):\n if errors != \"raise\":\n raise NotImplementedError(\n \"This lazy query compiler will always \"\n + \"raise an error on invalid type keys.\"\n )\n return self.__constructor__(\n self._modin_frame.astype(col_dtypes),\n self._shape_hint,\n )\n\n def setitem(self, axis, key, value):\n if axis == 1 or not isinstance(value, type(self)):\n raise NotImplementedError(\n f\"HDK's setitem does not support such set of parameters: axis={axis}, value={value}.\"\n )\n return self._setitem(axis, key, value)\n\n _setitem = PandasQueryCompiler._setitem\n\n def insert(self, loc, column, value):\n if isinstance(value, type(self)):\n value.columns = [column]\n return self.insert_item(axis=1, loc=loc, value=value)\n\n if is_list_like(value):\n raise NotImplementedError(\"HDK's insert does not support list-like values.\")\n\n return self.__constructor__(self._modin_frame.insert(loc, column, value))\n\n def sort_rows_by_column_values(self, columns, ascending=True, **kwargs):\n if kwargs.get(\"key\", None) is not None:\n raise NotImplementedError(\"Sort with key function\")\n\n ignore_index = kwargs.get(\"ignore_index\", False)\n na_position = kwargs.get(\"na_position\", \"last\")\n return self.__constructor__(\n self._modin_frame.sort_rows(columns, ascending, ignore_index, na_position),\n self._shape_hint,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.columnarize_DFAlgQueryCompiler.columnarize.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.columnarize_DFAlgQueryCompiler.columnarize.return.self", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 796, "end_line": 815, "span_ids": ["DFAlgQueryCompiler.columnarize"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def columnarize(self):\n if self._shape_hint == \"column\":\n assert len(self.columns) == 1, \"wrong shape hint\"\n return self\n\n if self._shape_hint == \"row\":\n # It is OK to trigger execution here because we cannot\n # transpose in HDK anyway.\n assert len(self.index) == 1, \"wrong shape hint\"\n return self.transpose()\n\n if len(self.columns) != 1 or (\n len(self.index) == 1 and self.index[0] == MODIN_UNNAMED_SERIES_LABEL\n ):\n res = self.transpose()\n res._shape_hint = \"column\"\n return res\n\n self._shape_hint = \"column\"\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_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.is_series_like_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.is_series_like_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 817, "end_line": 869, "span_ids": ["DFAlgQueryCompiler.has_multiindex", "DFAlgQueryCompiler:9", "DFAlgQueryCompiler.get_index_name", "impl", "DFAlgQueryCompiler.set_index_name", "_check_int_or_float", "DFAlgQueryCompiler.free", "DFAlgQueryCompiler.cat_codes", "DFAlgQueryCompiler.get_index_names", "DFAlgQueryCompiler.dtypes", "DFAlgQueryCompiler.set_index_names", "DFAlgQueryCompiler.is_series_like"], "tokens": 422}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def is_series_like(self):\n if self._shape_hint is not None:\n return True\n return len(self.columns) == 1 or len(self.index) == 1\n\n def cat_codes(self):\n return self.__constructor__(self._modin_frame.cat_codes(), self._shape_hint)\n\n def has_multiindex(self, axis=0):\n if axis == 0:\n return self._modin_frame.has_multiindex()\n assert axis == 1\n return isinstance(self.columns, pandas.MultiIndex)\n\n def get_index_name(self, axis=0):\n return self.columns.name if axis else self._modin_frame.get_index_name()\n\n def set_index_name(self, name, axis=0):\n if axis == 0:\n self._modin_frame = self._modin_frame.set_index_name(name)\n else:\n self.columns.name = name\n\n def get_index_names(self, axis=0):\n return self.columns.names if axis else self._modin_frame.get_index_names()\n\n def set_index_names(self, names=None, axis=0):\n if axis == 0:\n self._modin_frame = self._modin_frame.set_index_names(names)\n else:\n self.columns.names = names\n\n def free(self):\n return\n\n index = property(_get_index, _set_index)\n columns = property(_get_columns, _set_columns)\n\n @property\n def dtypes(self):\n return self._modin_frame.dtypes\n\n\n_SUPPORTED_NUM_TYPE_CODES = set(np.typecodes[\"AllInteger\"] + np.typecodes[\"Float\"]) - {\n np.dtype(np.float16).char\n}\n\n\ndef _check_int_or_float(op, dtypes): # noqa: GL08\n for t in dtypes:\n if t.char not in _SUPPORTED_NUM_TYPE_CODES:\n raise NotImplementedError(f\"Operation '{op}' on type '{t.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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/__init__.py_PyarrowQueryCompiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/__init__.py_PyarrowQueryCompiler_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 20, "span_ids": ["docstring"], "tokens": 35}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .query_compiler import PyarrowQueryCompiler\nfrom .parsers import PyarrowCSVParser\n\n__all__ = [\"PyarrowQueryCompiler\", \"PyarrowCSVParser\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/parsers.py_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/parsers.py_pandas_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/parsers.py", "file_name": "parsers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 77, "span_ids": ["PyarrowCSVParser", "PyarrowCSVParser.parse", "docstring"], "tokens": 439}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nfrom io import BytesIO\n\nfrom modin.core.storage_formats.pandas.utils import compute_chunksize\n\n\nclass PyarrowCSVParser:\n \"\"\"Class for handling CSV files on the workers using PyArrow storage format.\"\"\"\n\n def parse(self, fname, num_splits, start, end, header, **kwargs):\n \"\"\"\n Parse CSV file into PyArrow tables.\n\n Parameters\n ----------\n fname : str\n Name of the CSV file to parse.\n num_splits : int\n Number of partitions to split the resulted PyArrow table into.\n start : int\n Position in the specified file to start parsing from.\n end : int\n Position in the specified file to end parsing at.\n header : str\n Header line that will be interpret as the first line of the parsed CSV file.\n **kwargs : kwargs\n Serves the compatibility purpose. Does not affect the result.\n\n Returns\n -------\n list\n List with split parse results and it's metadata:\n\n - First `num_split` elements are PyArrow tables, representing the corresponding chunk.\n - Next element is the number of rows in the parsed table.\n - Last element is the pandas Series, containing the data-types for each column of the parsed table.\n \"\"\"\n import pyarrow as pa\n import pyarrow.csv as csv\n\n with open(fname, \"rb\") as bio:\n # The header line for the CSV file\n first_line = bio.readline()\n bio.seek(start)\n to_read = header + first_line + bio.read(end - start)\n\n table = csv.read_csv(\n BytesIO(to_read), parse_options=csv.ParseOptions(header_rows=1)\n )\n chunksize = compute_chunksize(table.num_columns, num_splits)\n chunks = [\n pa.Table.from_arrays(table.columns[chunksize * i : chunksize * (i + 1)])\n for i in range(num_splits)\n ]\n return chunks + [\n table.num_rows,\n pandas.Series(\n [t.to_pandas_dtype() for t in table.schema.types],\n index=table.schema.names,\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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_pandas_FakeSeries.__init__.self.dtype.dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_pandas_FakeSeries.__init__.self.dtype.dtype", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 42, "span_ids": ["FakeSeries", "FakeSeries.__init__", "docstring"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport pyarrow as pa\n\nfrom modin.core.storage_formats.pandas.query_compiler import PandasQueryCompiler\nfrom modin.utils import _inherit_docstrings\nfrom pandas.core.computation.expr import Expr\nfrom pandas.core.computation.scope import Scope\nfrom pandas.core.computation.ops import UnaryOp, BinOp, Term, MathCall, Constant\n\n\nclass FakeSeries:\n \"\"\"\n Series metadata class.\n\n Parameters\n ----------\n dtype : dtype\n Data-type of the represented Series.\n \"\"\"\n\n def __init__(self, dtype):\n self.dtype = dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler_PyarrowQueryCompiler._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler_PyarrowQueryCompiler._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 60, "span_ids": ["PyarrowQueryCompiler"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n \"\"\"\n Query compiler for the PyArrow storage format.\n\n This class translates common query compiler API into the DataFrame Algebra\n queries, that is supposed to be executed by\n :py:class:`~modin.experimental.core.execution.ray.implementations.pyarrow_on_ray.dataframe.dataframe.PyarrowOnRayDataframe`.\n\n Parameters\n ----------\n modin_frame : PyarrowOnRayDataframe\n Modin Frame to query with the compiled queries.\n shape_hint : {\"row\", \"column\", None}, default: None\n Shape hint for frames known to be a column or a row, otherwise None.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query_PyarrowQueryCompiler.query.gen_table_expr.return.Expr_expr_expr_env_scope": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query_PyarrowQueryCompiler.query.gen_table_expr.return.Expr_expr_expr_env_scope", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 83, "span_ids": ["PyarrowQueryCompiler.query"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def query(self, expr, **kwargs):\n def gen_table_expr(table, expr):\n \"\"\"\n Build pandas expression for the specified query.\n\n Parameters\n ----------\n table : pyarrow.Table\n Table to evaluate expression on.\n expr : str\n Query string to evaluate on the `table` columns.\n\n Returns\n -------\n pandas.core.computation.expr.Expr\n \"\"\"\n resolver = {\n name: FakeSeries(dtype.to_pandas_dtype())\n for name, dtype in zip(table.schema.names, table.schema.types)\n }\n scope = Scope(level=0, resolvers=(resolver,))\n return Expr(expr=expr, env=scope)\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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.unary_ops_PyarrowQueryCompiler.query.cmp_ops._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.unary_ops_PyarrowQueryCompiler.query.cmp_ops._", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 102, "span_ids": ["PyarrowQueryCompiler.query"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def query(self, expr, **kwargs):\n # ... other code\n\n unary_ops = {\"~\": \"not\"}\n math_calls = {\"log\": \"log\", \"exp\": \"exp\", \"log10\": \"log10\", \"cbrt\": \"cbrt\"}\n bin_ops = {\n \"+\": \"add\",\n \"-\": \"subtract\",\n \"*\": \"multiply\",\n \"/\": \"divide\",\n \"**\": \"power\",\n }\n cmp_ops = {\n \"==\": \"equal\",\n \"!=\": \"not_equal\",\n \"<\": \"less_than\",\n \"<=\": \"less_than_or_equal_to\",\n \">\": \"greater_than\",\n \">=\": \"greater_than_or_equal_to\",\n \"like\": \"like\",\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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.build_node_PyarrowQueryCompiler.query.build_node.raise_TypeError_Unsuppor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.build_node_PyarrowQueryCompiler.query.build_node.raise_TypeError_Unsuppor", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 165, "span_ids": ["PyarrowQueryCompiler.query"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def query(self, expr, **kwargs):\n # ... other code\n\n def build_node(table, terms, builder):\n \"\"\"\n Build expression Node in Gandiva notation for the specified pandas expression.\n\n Parameters\n ----------\n table : pyarrow.Table\n Table to evaluate expression on.\n terms : pandas.core.computation.expr.Term\n Pandas expression to evaluate.\n builder : pyarrow.gandiva.TreeExprBuilder\n Pyarrow node builder.\n\n Returns\n -------\n pyarrow.gandiva.Node\n \"\"\"\n if isinstance(terms, Constant):\n return builder.make_literal(\n terms.value, (pa.from_numpy_dtype(terms.return_type))\n )\n\n if isinstance(terms, Term):\n return builder.make_field(table.schema.field_by_name(terms.name))\n\n if isinstance(terms, BinOp):\n lnode = build_node(table, terms.lhs, builder)\n rnode = build_node(table, terms.rhs, builder)\n return_type = pa.from_numpy_dtype(terms.return_type)\n\n if terms.op == \"&\":\n return builder.make_and([lnode, rnode])\n if terms.op == \"|\":\n return builder.make_or([lnode, rnode])\n if terms.op in cmp_ops:\n assert return_type == pa.bool_()\n return builder.make_function(\n cmp_ops[terms.op], [lnode, rnode], return_type\n )\n if terms.op in bin_ops:\n return builder.make_function(\n bin_ops[terms.op], [lnode, rnode], return_type\n )\n\n if isinstance(terms, UnaryOp):\n return_type = pa.from_numpy_dtype(terms.return_type)\n return builder.make_function(\n unary_ops[terms.op],\n [build_node(table, terms.operand, builder)],\n return_type,\n )\n\n if isinstance(terms, MathCall):\n return_type = pa.from_numpy_dtype(terms.return_type)\n childern = [\n build_node(table, child, builder) for child in terms.operands\n ]\n return builder.make_function(\n math_calls[terms.op], childern, return_type\n )\n\n raise TypeError(\"Unsupported term type: %s\" % terms)\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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.can_be_condition_PyarrowQueryCompiler.query.filter_with_selection_vector.return.pa_Table_from_arrays_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.can_be_condition_PyarrowQueryCompiler.query.filter_with_selection_vector.return.pa_Table_from_arrays_new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 205, "span_ids": ["PyarrowQueryCompiler.query"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def query(self, expr, **kwargs):\n # ... other code\n\n def can_be_condition(expr):\n \"\"\"\n Check whether the passed expression is a conditional operation.\n\n Parameters\n ----------\n expr : pandas.core.computation.expr.Expr\n\n Returns\n -------\n bool\n \"\"\"\n if isinstance(expr.terms, BinOp):\n if expr.terms.op in cmp_ops or expr.terms.op in (\"&\", \"|\"):\n return True\n elif isinstance(expr.terms, UnaryOp):\n if expr.terms.op == \"~\":\n return True\n return False\n\n def filter_with_selection_vector(table, s):\n \"\"\"\n Filter passed pyarrow table with the specified filter.\n\n Parameters\n ----------\n table : pyarrow.Table\n s : pyarrow.gandiva.SelectionVector\n\n Returns\n -------\n pyarrow.Table\n \"\"\"\n record_batch = table.to_batches()[0]\n indices = s.to_array() # .to_numpy()\n new_columns = [\n pa.array(c.to_numpy()[indices]) for c in record_batch.columns\n ]\n return pa.Table.from_arrays(new_columns, record_batch.schema.names)\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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.gandiva_query_PyarrowQueryCompiler.query.gandiva_query.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.gandiva_query_PyarrowQueryCompiler.query.gandiva_query.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 236, "span_ids": ["PyarrowQueryCompiler.query"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def query(self, expr, **kwargs):\n # ... other code\n\n def gandiva_query(table, query):\n \"\"\"\n Evaluate string query on the passed table.\n\n Parameters\n ----------\n table : pyarrow.Table\n Table to evaluate query on.\n query : str\n Query string to evaluate on the `table` columns.\n\n Returns\n -------\n pyarrow.Table\n \"\"\"\n expr = gen_table_expr(table, query)\n if not can_be_condition(expr):\n raise ValueError(\"Root operation should be a filter.\")\n\n # We use this import here because of https://github.com/modin-project/modin/issues/3849,\n # after the issue is fixed we should put the import at the top of this file\n import pyarrow.gandiva as gandiva\n\n builder = gandiva.TreeExprBuilder()\n root = build_node(table, expr.terms, builder)\n cond = builder.make_condition(root)\n filt = gandiva.make_filter(table.schema, cond)\n sel_vec = filt.evaluate(table.to_batches()[0], pa.default_memory_pool())\n result = filter_with_selection_vector(table, sel_vec)\n return result\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_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.query_builder_PyarrowQueryCompiler.query.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler.query.query_builder_PyarrowQueryCompiler.query.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 253, "span_ids": ["PyarrowQueryCompiler.query"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def query(self, expr, **kwargs):\n # ... other code\n\n def query_builder(arrow_table, **kwargs):\n \"\"\"Evaluate string query on the passed pyarrow table.\"\"\"\n return gandiva_query(arrow_table, kwargs.get(\"expr\", \"\"))\n\n kwargs[\"expr\"] = expr\n # FIXME: `PandasQueryCompiler._prepare_method` was removed in #721,\n # it is no longer needed to wrap function to apply.\n func = self._prepare_method(query_builder, **kwargs)\n # FIXME: `PandasQueryCompiler._map_across_full_axis` was removed in #721.\n # This method call should be replaced to its equivalent from `operators.function`\n new_data = self._map_across_full_axis(1, func)\n # Query removes rows, so we need to update the index\n new_index = self._compute_index(0, new_data, False)\n return self.__constructor__(\n new_data, new_index, self.columns, self._dtype_cache\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler._compute_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/pyarrow/query_compiler.py_PyarrowQueryCompiler._compute_index_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/pyarrow/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 293, "span_ids": ["PyarrowQueryCompiler._compute_index"], "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": "@_inherit_docstrings(PandasQueryCompiler)\nclass PyarrowQueryCompiler(PandasQueryCompiler):\n\n def _compute_index(self, axis, data_object, compute_diff=True):\n \"\"\"\n Compute index labels of the passed Modin Frame along specified axis.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to compute index labels along. 0 is for index and 1 is for column.\n data_object : PyarrowOnRayDataframe\n Modin Frame object to build indices from.\n compute_diff : bool, default: True\n Whether to cut the resulted indices to a subset of the self indices.\n\n Returns\n -------\n pandas.Index\n \"\"\"\n\n def arrow_index_extraction(table, axis):\n \"\"\"Extract index labels from the passed pyarrow table the along specified axis.\"\"\"\n if not axis:\n return pandas.Index(table.column(table.num_columns - 1))\n else:\n try:\n return pandas.Index(table.columns)\n except AttributeError:\n return []\n\n index_obj = self.index if not axis else self.columns\n old_blocks = self.data if compute_diff else None\n # FIXME: `PandasDataframe.get_indices` was deprecated, this call should be\n # replaced either by `PandasDataframe._compute_axis_label` or by `PandasDataframe.axes`.\n new_indices, _ = data_object.get_indices(\n axis=axis,\n index_func=lambda df: arrow_index_extraction(df, axis),\n old_blocks=old_blocks,\n )\n return index_obj[new_indices] if compute_diff else new_indices", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/fuzzydata/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/fuzzydata/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/fuzzydata/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/fuzzydata/test/test_fuzzydata.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/fuzzydata/test/test_fuzzydata.py_os_", "embedding": null, "metadata": {"file_path": "modin/experimental/fuzzydata/test/test_fuzzydata.py", "file_name": "test_fuzzydata.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 66, "span_ids": ["test_fuzzydata_sample_workflow", "docstring"], "tokens": 451}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport glob\nimport uuid\nimport shutil\nfrom fuzzydata.core.generator import generate_workflow\nfrom fuzzydata.clients.modin import ModinWorkflow\n\nfrom modin.config import Engine\n\n\ndef test_fuzzydata_sample_workflow():\n # Workflow Generation Options\n wf_name = str(uuid.uuid4())[:8] # Unique name for the generated workflow\n num_versions = 10 # Number of unique CSV files to generate\n cols = 33 # Columns in Base Artifact\n rows = 1000 # Rows in Base Artifact\n bfactor = 1.0 # Branching Factor - 0.1 is linear, 10.0 is star-like\n exclude_ops = [\"groupby\"] # In-Memory groupby operations cause issue #4287\n matfreq = 2 # How many operations to chain before materialization\n\n engine = Engine.get().lower()\n\n # Create Output Directory for Workflow Data\n base_out_directory = (\n f\"/tmp/fuzzydata-test-wf-{engine}/\" # Must match corresponding github-action\n )\n if os.path.exists(base_out_directory):\n shutil.rmtree(base_out_directory)\n output_directory = f\"{base_out_directory}/{wf_name}/\"\n os.makedirs(output_directory, exist_ok=True)\n\n # Start Workflow Generation\n workflow = generate_workflow(\n workflow_class=ModinWorkflow,\n name=wf_name,\n num_versions=num_versions,\n base_shape=(cols, rows),\n out_directory=output_directory,\n bfactor=bfactor,\n exclude_ops=exclude_ops,\n matfreq=matfreq,\n wf_options={\"modin_engine\": engine},\n )\n\n # Assertions that the workflow generation worked correctly\n assert len(workflow) == num_versions\n assert len(list(glob.glob(f\"{output_directory}/artifacts/*.csv\"))) == len(\n workflow.artifact_dict\n )\n assert os.path.exists(f\"{output_directory}/{workflow.name}_operations.json\")\n assert os.path.getsize(f\"{output_directory}/{workflow.name}_operations.json\") > 0\n assert os.path.exists(f\"{output_directory}/{workflow.name}_gt_graph.csv\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/__init__.py_from_modin_config_import__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/__init__.py_from_modin_config_import__", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 59, "span_ids": ["docstring"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from modin.config import IsExperimental\n\nIsExperimental.put(True)\n\n# import numpy_wrap as early as possible to intercept all \"import numpy\" statements\n# in the user code\nfrom .numpy_wrap import _CAUGHT_NUMPY # noqa F401\nfrom modin.pandas import * # noqa F401, F403\nfrom .io import ( # noqa F401\n read_sql,\n read_csv_glob,\n read_custom_text,\n read_pickle_distributed,\n to_pickle_distributed,\n)\nimport warnings\n\nsetattr(DataFrame, \"to_pickle_distributed\", to_pickle_distributed) # noqa: F405\n\nwarnings.warn(\n \"Thank you for using the Modin Experimental pandas API.\"\n + \"\\nPlease note that some of these APIs deviate from pandas in order to \"\n + \"provide improved performance.\"\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_inspect_read_sql.return._DataFrame_query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_inspect_read_sql.return._DataFrame_query_compiler", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 119, "span_ids": ["read_sql", "docstring"], "tokens": 1061}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import inspect\nimport pathlib\nimport pickle\nfrom typing import Union, IO, AnyStr, Callable, Optional, Iterator\n\nimport pandas\nimport pandas._libs.lib as lib\nfrom pandas._typing import CompressionOptions, StorageOptions\n\nfrom . import DataFrame\nfrom modin.config import IsExperimental\nfrom modin.core.storage_formats import BaseQueryCompiler\n\n\ndef read_sql(\n sql,\n con,\n index_col=None,\n coerce_float=True,\n params=None,\n parse_dates=None,\n columns=None,\n chunksize=None,\n dtype_backend=lib.no_default,\n dtype=None,\n partition_column: Optional[str] = None,\n lower_bound: Optional[int] = None,\n upper_bound: Optional[int] = None,\n max_sessions: Optional[int] = None,\n) -> Union[DataFrame, Iterator[DataFrame]]:\n \"\"\"\n General documentation is available in `modin.pandas.read_sql`.\n\n This experimental feature provides distributed reading from a sql file.\n The function extended with `Spark-like parameters `_\n such as ``partition_column``, ``lower_bound`` and ``upper_bound``. With these\n parameters, the user will be able to specify how to partition the imported data.\n\n Parameters\n ----------\n sql : str or SQLAlchemy Selectable (select or text object)\n SQL query to be executed or a table name.\n con : SQLAlchemy connectable, str, or sqlite3 connection\n Using SQLAlchemy makes it possible to use any DB supported by that\n library. If a DBAPI2 object, only sqlite3 is supported. The user is responsible\n for engine disposal and connection closure for the SQLAlchemy\n connectable; str connections are closed automatically. See\n `here `_.\n index_col : str or list of str, optional\n Column(s) to set as index(MultiIndex).\n coerce_float : bool, default: True\n Attempts to convert values of non-string, non-numeric objects (like\n decimal.Decimal) to floating point, useful for SQL result sets.\n params : list, tuple or dict, optional\n List of parameters to pass to execute method. The syntax used to pass\n parameters is database driver dependent. Check your database driver\n documentation for which of the five syntax styles, described in PEP 249's\n paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params=\n {'name' : 'value'}.\n parse_dates : list or dict, optional\n - List of column names to parse as dates.\n - Dict of ``{column_name: format string}`` where format string is\n strftime compatible in case of parsing string times, or is one of\n (D, s, ns, ms, us) in case of parsing integer timestamps.\n - Dict of ``{column_name: arg dict}``, where the arg dict corresponds\n to the keyword arguments of :func:`pandas.to_datetime`\n Especially useful with databases without native Datetime support,\n such as SQLite.\n columns : list, optional\n List of column names to select from SQL table (only used when reading\n a table).\n chunksize : int, optional\n If specified, return an iterator where `chunksize` is the\n number of rows to include in each chunk.\n dtype_backend : {\"numpy_nullable\", \"pyarrow\"}, default: NumPy backed DataFrames\n Which dtype_backend to use, e.g. whether a DataFrame should have NumPy arrays,\n nullable dtypes are used for all dtypes that have a nullable implementation when\n \"numpy_nullable\" is set, PyArrow is used for all dtypes if \"pyarrow\" is set.\n The dtype_backends are still experimential.\n dtype : Type name or dict of columns, optional\n Data type for data or columns. E.g. np.float64 or {'a': np.float64, 'b': np.int32, 'c': 'Int64'}. The argument is ignored if a table is passed instead of a query.\n partition_column : str, optional\n Column used to share the data between the workers (MUST be a INTEGER column).\n lower_bound : int, optional\n The minimum value to be requested from the partition_column.\n upper_bound : int, optional\n The maximum value to be requested from the partition_column.\n max_sessions : int, optional\n The maximum number of simultaneous connections allowed to use.\n\n Returns\n -------\n modin.DataFrame or Iterator[modin.DataFrame]\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n assert IsExperimental.get(), \"This only works in experimental mode\"\n\n result = FactoryDispatcher.read_sql(**kwargs)\n if isinstance(result, BaseQueryCompiler):\n return DataFrame(query_compiler=result)\n return (DataFrame(query_compiler=qc) for qc in 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_modin-project__modin/modin/experimental/pandas/io.py_read_custom_text_read_custom_text.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_read_custom_text_read_custom_text.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 163, "span_ids": ["read_custom_text"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def read_custom_text(\n filepath_or_buffer,\n columns,\n custom_parser,\n compression=\"infer\",\n nrows: Optional[int] = None,\n is_quoting=True,\n):\n r\"\"\"\n Load custom text data from file.\n\n Parameters\n ----------\n filepath_or_buffer : str\n File path where the custom text data will be loaded from.\n columns : list or callable(file-like object, \\*\\*kwargs) -> list\n Column names of list type or callable that create column names from opened file\n and passed `kwargs`.\n custom_parser : callable(file-like object, \\*\\*kwargs) -> pandas.DataFrame\n Function that takes as input a part of the `filepath_or_buffer` file loaded into\n memory in file-like object form.\n compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default: 'infer'\n If 'infer' and 'path_or_url' is path-like, then detect compression from\n the following extensions: '.gz', '.bz2', '.zip', or '.xz' (otherwise no\n compression). If 'infer' and 'path_or_url' is not path-like, then use\n None (= no decompression).\n nrows : int, optional\n Amount of rows to read.\n is_quoting : bool, default: True\n Whether or not to consider quotes.\n\n Returns\n -------\n modin.DataFrame\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n assert IsExperimental.get(), \"This only works in experimental mode\"\n\n return DataFrame(query_compiler=FactoryDispatcher.read_custom_text(**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_modin-project__modin/modin/experimental/pandas/io.py__CSV_and_table__make_parser_func.return.parser_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py__CSV_and_table__make_parser_func.return.parser_func", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 245, "span_ids": ["_make_parser_func", "read_custom_text"], "tokens": 481}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# CSV and table\ndef _make_parser_func(sep: str) -> Callable:\n \"\"\"\n Create a parser function from the given sep.\n\n Parameters\n ----------\n sep : str\n The separator default to use for the parser.\n\n Returns\n -------\n Callable\n \"\"\"\n\n def parser_func(\n filepath_or_buffer: Union[str, pathlib.Path, IO[AnyStr]],\n *,\n sep=lib.no_default,\n delimiter=None,\n header=\"infer\",\n names=lib.no_default,\n index_col=None,\n usecols=None,\n dtype=None,\n engine=None,\n converters=None,\n true_values=None,\n false_values=None,\n skipinitialspace=False,\n skiprows=None,\n skipfooter=0,\n nrows=None,\n na_values=None,\n keep_default_na=True,\n na_filter=True,\n verbose=False,\n skip_blank_lines=True,\n parse_dates=None,\n infer_datetime_format=lib.no_default,\n keep_date_col=False,\n date_parser=lib.no_default,\n date_format=None,\n dayfirst=False,\n cache_dates=True,\n iterator=False,\n chunksize=None,\n compression=\"infer\",\n thousands=None,\n decimal: str = \".\",\n lineterminator=None,\n quotechar='\"',\n quoting=0,\n escapechar=None,\n comment=None,\n encoding=None,\n encoding_errors=\"strict\",\n dialect=None,\n on_bad_lines=\"error\",\n doublequote=True,\n delim_whitespace=False,\n low_memory=True,\n memory_map=False,\n float_precision=None,\n storage_options: StorageOptions = None,\n dtype_backend=lib.no_default,\n ) -> DataFrame:\n # ISSUE #2408: parse parameter shared with pandas read_csv and read_table and update with provided args\n _pd_read_csv_signature = {\n val.name for val in inspect.signature(pandas.read_csv).parameters.values()\n }\n _, _, _, f_locals = inspect.getargvalues(inspect.currentframe())\n if f_locals.get(\"sep\", sep) is False:\n f_locals[\"sep\"] = \"\\t\"\n\n kwargs = {k: v for k, v in f_locals.items() if k in _pd_read_csv_signature}\n return _read(**kwargs)\n\n parser_func.__doc__ = _read.__doc__\n return parser_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_modin-project__modin/modin/experimental/pandas/io.py__read__read.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py__read__read.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 296, "span_ids": ["_read"], "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": "def _read(**kwargs) -> DataFrame:\n \"\"\"\n General documentation is available in `modin.pandas.read_csv`.\n\n This experimental feature provides parallel reading from multiple csv files which are\n defined by glob pattern.\n\n Parameters\n ----------\n **kwargs : dict\n Keyword arguments in `modin.pandas.read_csv`.\n\n Returns\n -------\n modin.DataFrame\n\n Examples\n --------\n >>> import modin.experimental.pandas as pd\n >>> df = pd.read_csv_glob(\"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-1*\")\n UserWarning: `read_*` implementation has mismatches with pandas:\n Data types of partitions are different! Please refer to the troubleshooting section of the Modin documentation to fix this issue.\n VendorID tpep_pickup_datetime ... total_amount congestion_surcharge\n 0 1.0 2020-10-01 00:09:08 ... 4.30 0.0\n 1 1.0 2020-10-01 00:09:19 ... 13.30 2.5\n 2 1.0 2020-10-01 00:30:00 ... 15.36 2.5\n 3 2.0 2020-10-01 00:56:46 ... -3.80 0.0\n 4 2.0 2020-10-01 00:56:46 ... 3.80 0.0\n ... ... ... ... ... ...\n 4652008 NaN 2020-12-31 23:44:35 ... 43.95 2.5\n 4652009 NaN 2020-12-31 23:41:36 ... 20.17 2.5\n 4652010 NaN 2020-12-31 23:01:17 ... 78.98 0.0\n 4652011 NaN 2020-12-31 23:31:29 ... 39.50 0.0\n 4652012 NaN 2020-12-31 23:12:48 ... 20.64 0.0\n\n [4652013 rows x 18 columns]\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n pd_obj = FactoryDispatcher.read_csv_glob(**kwargs)\n # This happens when `read_csv` returns a TextFileReader object for iterating through\n if isinstance(pd_obj, pandas.io.parsers.TextFileReader):\n reader = pd_obj.read\n pd_obj.read = lambda *args, **kwargs: DataFrame(\n query_compiler=reader(*args, **kwargs)\n )\n return pd_obj\n\n return DataFrame(query_compiler=pd_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_modin-project__modin/modin/experimental/pandas/io.py_read_csv_glob_read_pickle_distributed.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_read_csv_glob_read_pickle_distributed.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 345, "span_ids": ["read_pickle_distributed", "impl"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "read_csv_glob = _make_parser_func(sep=\",\")\n\n\ndef read_pickle_distributed(\n filepath_or_buffer,\n compression: Optional[str] = \"infer\",\n storage_options: StorageOptions = None,\n):\n \"\"\"\n Load pickled pandas object from files.\n\n This experimental feature provides parallel reading from multiple pickle files which are\n defined by glob pattern. The files must contain parts of one dataframe, which can be\n obtained, for example, by `to_pickle_distributed` function.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n File path, URL, or buffer where the pickled object will be loaded from.\n Accept URL. URL is not limited to S3 and GCS.\n compression : {{'infer', 'gzip', 'bz2', 'zip', 'xz', None}}, default: 'infer'\n If 'infer' and 'path_or_url' is path-like, then detect compression from\n the following extensions: '.gz', '.bz2', '.zip', or '.xz' (otherwise no\n compression) If 'infer' and 'path_or_url' is not path-like, then use\n None (= no decompression).\n storage_options : dict, optional\n Extra options that make sense for a particular storage connection, e.g.\n host, port, username, password, etc., if using a URL that will be parsed by\n fsspec, e.g., starting \"s3://\", \"gcs://\". An error will be raised if providing\n this argument with a non-fsspec URL. See the fsspec and backend storage\n implementation docs for the set of allowed keys and values.\n\n Returns\n -------\n unpickled : same type as object stored in file\n\n Notes\n -----\n The number of partitions is equal to the number of input files.\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n assert IsExperimental.get(), \"This only works in experimental mode\"\n\n return DataFrame(query_compiler=FactoryDispatcher.read_pickle_distributed(**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_modin-project__modin/modin/experimental/pandas/io.py_to_pickle_distributed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/io.py_to_pickle_distributed_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 399, "span_ids": ["to_pickle_distributed"], "tokens": 568}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def to_pickle_distributed(\n self,\n filepath_or_buffer,\n compression: CompressionOptions = \"infer\",\n protocol: int = pickle.HIGHEST_PROTOCOL,\n storage_options: StorageOptions = None,\n):\n \"\"\"\n Pickle (serialize) object to file.\n\n This experimental feature provides parallel writing into multiple pickle files which are\n defined by glob pattern, otherwise (without glob pattern) default pandas implementation is used.\n\n Parameters\n ----------\n filepath_or_buffer : str, path object or file-like object\n File path where the pickled object will be stored.\n compression : {{'infer', 'gzip', 'bz2', 'zip', 'xz', None}}, default: 'infer'\n A string representing the compression to use in the output file. By\n default, infers from the file extension in specified path.\n Compression mode may be any of the following possible\n values: {{'infer', 'gzip', 'bz2', 'zip', 'xz', None}}. If compression\n mode is 'infer' and path_or_buf is path-like, then detect\n compression mode from the following extensions:\n '.gz', '.bz2', '.zip' or '.xz'. (otherwise no compression).\n If dict given and mode is 'zip' or inferred as 'zip', other entries\n passed as additional compression options.\n protocol : int, default: pickle.HIGHEST_PROTOCOL\n Int which indicates which protocol should be used by the pickler,\n default HIGHEST_PROTOCOL (see `pickle docs `_\n paragraph 12.1.2 for details). The possible values are 0, 1, 2, 3, 4, 5. A negative value\n for the protocol parameter is equivalent to setting its value to HIGHEST_PROTOCOL.\n storage_options : dict, optional\n Extra options that make sense for a particular storage connection, e.g.\n host, port, username, password, etc., if using a URL that will be parsed by\n fsspec, e.g., starting \"s3://\", \"gcs://\". An error will be raised if providing\n this argument with a non-fsspec URL. See the fsspec and backend storage\n implementation docs for the set of allowed keys and values.\n \"\"\"\n obj = self\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n if isinstance(self, DataFrame):\n obj = self._query_compiler\n FactoryDispatcher.to_pickle_distributed(\n obj,\n filepath_or_buffer=filepath_or_buffer,\n compression=compression,\n protocol=protocol,\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/numpy_wrap.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/numpy_wrap.py_sys_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/numpy_wrap.py", "file_name": "numpy_wrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 185, "span_ids": ["docstring"], "tokens": 1336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\n\n_CAUGHT_NUMPY = \"numpy\" not in sys.modules\ntry:\n import numpy as real_numpy\nexcept ImportError:\n pass\nelse:\n import types\n import copyreg\n from modin.config import Engine\n from modin.core.execution.dispatching.factories import REMOTE_ENGINES\n import modin\n import pandas\n import os\n\n _EXCLUDE_MODULES = [modin, pandas, real_numpy]\n try:\n import rpyc\n except ImportError:\n pass\n else:\n _EXCLUDE_MODULES.append(rpyc)\n _EXCLUDE_PATHS = tuple(\n os.path.dirname(mod.__file__) + os.sep for mod in _EXCLUDE_MODULES\n )\n\n class InterceptedNumpy(types.ModuleType):\n \"\"\"\n The class is intended to replace the \"numpy\" module as seen by outer world.\n\n Replacement occurs by getting attributes from either local NumPy or remote one when remote context\n is activated.\n It also registers helpers for pickling local NumPy objects in remote context\n and vice versa.\n\n Attributes\n ----------\n __own_attrs__ : set\n Attributes that are defined in this class so access to them must never be proxied.\n __current_numpy : ModuleType\n The module to which getting NumPy attributes redirects. For example,\n NumPy on remote machine.\n __prev_numpy : ModuleType\n The previous module that was accessed to get the NumPy attributes.\n __has_to_warn : bool\n Determines the situation when it is necessary to give a warning.\n __reducers : dict\n Custom routines that Pickle calls to serialize an instance of a class.\n \"\"\"\n\n __own_attrs__ = set([\"__own_attrs__\"])\n\n __spec__ = real_numpy.__spec__\n __current_numpy = real_numpy\n __prev_numpy = real_numpy\n __has_to_warn = not _CAUGHT_NUMPY\n __reducers = {}\n\n def __init__(self):\n self.__own_attrs__ = set(type(self).__dict__.keys())\n Engine.subscribe(self.__update_engine)\n\n def __swap_numpy(self, other_numpy=None):\n self.__current_numpy, self.__prev_numpy = (\n other_numpy or self.__prev_numpy,\n self.__current_numpy,\n )\n if self.__current_numpy is not real_numpy and self.__has_to_warn:\n import warnings\n\n warnings.warn(\n \"Was not able to intercept all numpy imports. \"\n + \"To intercept all of these please do 'import modin.experimental.pandas' as early as possible\"\n )\n self.__has_to_warn = False\n\n def __update_engine(self, _):\n if Engine.get() in REMOTE_ENGINES:\n from modin.experimental.cloud import get_connection\n\n self.__swap_numpy(get_connection().modules[\"numpy\"])\n else:\n self.__swap_numpy()\n\n def __make_reducer(self, name):\n \"\"\"\n Prepare a \"reducer\" routine - the one Pickle calls to serialize an instance of a class.\n\n Note that we need this to allow pickling a local numpy object in \"remote numpy\" context,\n because without a custom reduce callback pickle complains that what it reduced has a\n different \"numpy\" class than original.\n \"\"\"\n try:\n reducer = self.__reducers[name]\n except KeyError:\n\n def reducer(\n obj,\n real_obj=getattr(real_numpy, name),\n real_obj_reducer=getattr(real_numpy, name).__reduce__,\n ):\n # See details on __reduce__ protocol in Python docs:\n # https://docs.python.org/3.6/library/pickle.html#object.__reduce__\n reduced = real_obj_reducer(obj)\n if not isinstance(reduced, tuple):\n return reduced\n assert isinstance(\n reduced[0],\n (type, types.FunctionType, types.BuiltinFunctionType),\n ), \"Do not know how to support this reconstructor\"\n\n modobj = self.__current_numpy\n for submod in reduced[0].__module__.split(\".\")[1:]:\n modobj = getattr(modobj, submod)\n reconstruct = getattr(modobj, reduced[0].__name__)\n # TODO: see if replacing all \"real numpy\" things in reduced[1:] is needed\n return (reconstruct,) + reduced[1:]\n\n self.__reducers[name] = reducer\n return reducer\n\n def __get_numpy(self):\n frame = sys._getframe()\n try:\n # get the path to module where caller of caller is defined;\n # this function is expected to be called from one of\n # __getattr__, __setattr__ or __delattr__, so this\n # \"caller_file\" should point to the file that wants a\n # numpy attribute; we want to always give local numpy\n # to modin, numpy and rpyc as it's all internal for us\n caller_file = frame.f_back.f_back.f_code.co_filename\n except AttributeError:\n return self.__current_numpy\n finally:\n del frame\n if any(caller_file.startswith(mod_path) for mod_path in _EXCLUDE_PATHS):\n return real_numpy\n return self.__current_numpy\n\n def __getattr__(self, name): # noqa: D105\n # note that __getattr__ is not symmetric to __setattr__, as it is\n # only called when an attribute is not found by usual lookups\n obj = getattr(self.__get_numpy(), name)\n if isinstance(obj, type):\n # register a special callback for pickling\n copyreg.pickle(obj, self.__make_reducer(name))\n return obj\n\n def __setattr__(self, name, value): # noqa: D105\n # set our own attributes on the self instance, but pass through\n # setting other attributes to numpy being wrapped\n if name in self.__own_attrs__:\n super().__setattr__(name, value)\n else:\n setattr(self.__get_numpy(), name, value)\n\n def __delattr__(self, name): # noqa: D105\n # do not allow to delete our own attributes, pass through\n # deletion of others to numpy being wrapped\n if name not in self.__own_attrs__:\n delattr(self.__get_numpy(), name)\n\n sys.modules[\"numpy\"] = InterceptedNumpy()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_from_contextlib_import_nu_None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_from_contextlib_import_nu_None_11", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 32, "span_ids": ["docstring"], "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 contextlib import nullcontext\nimport glob\nimport json\n\nimport numpy as np\nimport pandas\nfrom pandas._testing import ensure_clean\nimport pytest\n\nimport modin.experimental.pandas as pd\nfrom modin.config import Engine, AsyncReadMode\nfrom modin.pandas.test.utils import (\n df_equals,\n teardown_test_files,\n test_data,\n eval_general,\n)\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom modin.pandas.test.utils import parse_dates_values_by_id, time_parsing_csv_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_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_from_sql_distributed_test_from_sql_distributed.df_equals_modin_df_from_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_from_sql_distributed_test_from_sql_distributed.df_equals_modin_df_from_t", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 64, "span_ids": ["test_from_sql_distributed"], "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 Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental API\",\n)\ndef test_from_sql_distributed(tmp_path, make_sql_connection):\n filename = \"test_from_sql_distributed.db\"\n table = \"test_from_sql_distributed\"\n conn = make_sql_connection(tmp_path / filename, table)\n query = \"select * from {0}\".format(table)\n\n pandas_df = pandas.read_sql(query, conn)\n modin_df_from_query = pd.read_sql(\n query,\n conn,\n partition_column=\"col1\",\n lower_bound=0,\n upper_bound=6,\n max_sessions=2,\n )\n modin_df_from_table = pd.read_sql(\n table,\n conn,\n partition_column=\"col1\",\n lower_bound=0,\n upper_bound=6,\n max_sessions=2,\n )\n\n df_equals(modin_df_from_query, pandas_df)\n df_equals(modin_df_from_table, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_from_sql_defaults_test_from_sql_defaults.df_equals_modin_df_from_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_from_sql_defaults_test_from_sql_defaults.df_equals_modin_df_from_t", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 84, "span_ids": ["test_from_sql_defaults"], "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": "@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental API\",\n)\ndef test_from_sql_defaults(tmp_path, make_sql_connection):\n filename = \"test_from_sql_distributed.db\"\n table = \"test_from_sql_distributed\"\n conn = make_sql_connection(tmp_path / filename, table)\n query = \"select * from {0}\".format(table)\n\n pandas_df = pandas.read_sql(query, conn)\n with pytest.warns(UserWarning):\n modin_df_from_query = pd.read_sql(query, conn)\n with pytest.warns(UserWarning):\n modin_df_from_table = pd.read_sql(table, conn)\n\n df_equals(modin_df_from_query, pandas_df)\n df_equals(modin_df_from_table, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob_TestCsvGlob.test_read_multiple_csv_nrows.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob_TestCsvGlob.test_read_multiple_csv_nrows.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 87, "end_line": 114, "span_ids": ["TestCsvGlob.test_read_multiple_small_csv", "TestCsvGlob.test_read_multiple_csv_nrows", "TestCsvGlob"], "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": "@pytest.mark.usefixtures(\"TestReadGlobCSVFixture\")\n@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental glob API\",\n)\nclass TestCsvGlob:\n def test_read_multiple_small_csv(self):\n pandas_df = pandas.concat([pandas.read_csv(fname) for fname in pytest.files])\n modin_df = pd.read_csv_glob(pytest.glob_path)\n\n # Indexes get messed up when concatting so we reset both.\n pandas_df = pandas_df.reset_index(drop=True)\n modin_df = modin_df.reset_index(drop=True)\n\n df_equals(modin_df, pandas_df)\n\n @pytest.mark.parametrize(\"nrows\", [35, 100])\n def test_read_multiple_csv_nrows(self, request, nrows):\n pandas_df = pandas.concat([pandas.read_csv(fname) for fname in pytest.files])\n pandas_df = pandas_df.iloc[:nrows, :]\n\n modin_df = pd.read_csv_glob(pytest.glob_path, nrows=nrows)\n\n # Indexes get messed up when concatting so we reset both.\n pandas_df = pandas_df.reset_index(drop=True)\n modin_df = modin_df.reset_index(drop=True)\n\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_csv_empty_frame_TestCsvGlob.test_read_csv_without_glob.with_pytest_warns_UserWar.with_pytest_raises_FileNo.pd_read_csv_glob_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_csv_empty_frame_TestCsvGlob.test_read_csv_without_glob.with_pytest_warns_UserWar.with_pytest_raises_FileNo.pd_read_csv_glob_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 116, "end_line": 133, "span_ids": ["TestCsvGlob.test_read_csv_empty_frame", "TestCsvGlob.test_read_csv_without_glob"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadGlobCSVFixture\")\n@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental glob API\",\n)\nclass TestCsvGlob:\n\n def test_read_csv_empty_frame(self):\n kwargs = {\n \"usecols\": [0],\n \"index_col\": 0,\n }\n\n modin_df = pd.read_csv_glob(pytest.files[0], **kwargs)\n pandas_df = pandas.read_csv(pytest.files[0], **kwargs)\n\n df_equals(modin_df, pandas_df)\n\n def test_read_csv_without_glob(self):\n with pytest.warns(UserWarning, match=r\"Shell-style wildcard\"):\n with pytest.raises(FileNotFoundError):\n pd.read_csv_glob(\n \"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-\",\n storage_options={\"anon\": 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_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_csv_glob_4373_TestCsvGlob.test_read_csv_glob_4373.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_csv_glob_4373_TestCsvGlob.test_read_csv_glob_4373.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 135, "end_line": 148, "span_ids": ["TestCsvGlob.test_read_csv_glob_4373"], "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.usefixtures(\"TestReadGlobCSVFixture\")\n@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental glob API\",\n)\nclass TestCsvGlob:\n\n def test_read_csv_glob_4373(self):\n columns, filename = [\"col0\"], \"1x1.csv\"\n df = pd.DataFrame([[1]], columns=columns)\n with (\n warns_that_defaulting_to_pandas()\n if Engine.get() == \"Dask\"\n else nullcontext()\n ):\n df.to_csv(filename)\n\n kwargs = {\"filepath_or_buffer\": filename, \"usecols\": columns}\n modin_df = pd.read_csv_glob(**kwargs)\n pandas_df = pandas.read_csv(**kwargs)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_single_csv_with_parse_dates_TestCsvGlob.test_read_single_csv_with_parse_dates.try_.else_.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_TestCsvGlob.test_read_single_csv_with_parse_dates_TestCsvGlob.test_read_single_csv_with_parse_dates.try_.else_.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 150, "end_line": 171, "span_ids": ["TestCsvGlob.test_read_single_csv_with_parse_dates"], "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": "@pytest.mark.usefixtures(\"TestReadGlobCSVFixture\")\n@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental glob API\",\n)\nclass TestCsvGlob:\n\n @pytest.mark.parametrize(\n \"parse_dates\",\n [pytest.param(value, id=id) for id, value in parse_dates_values_by_id.items()],\n )\n def test_read_single_csv_with_parse_dates(self, parse_dates):\n try:\n pandas_df = pandas.read_csv(time_parsing_csv_path, parse_dates=parse_dates)\n except Exception as pandas_exception:\n with pytest.raises(Exception) as modin_exception:\n modin_df = pd.read_csv_glob(\n time_parsing_csv_path, parse_dates=parse_dates\n )\n # Call __repr__ on the modin df to force it to materialize.\n repr(modin_df)\n assert isinstance(\n modin_exception.value, type(pandas_exception)\n ), \"Got Modin Exception type {}, but pandas Exception type {} was expected\".format(\n type(modin_exception.value), type(pandas_exception)\n )\n else:\n modin_df = pd.read_csv_glob(time_parsing_csv_path, parse_dates=parse_dates)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_multiple_csv_cloud_store_test_read_multiple_csv_cloud_store.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_multiple_csv_cloud_store_test_read_multiple_csv_cloud_store.eval_general_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 174, "end_line": 202, "span_ids": ["test_read_multiple_csv_cloud_store"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental glob API\",\n)\n@pytest.mark.parametrize(\n \"path\",\n [\n \"s3://modin-datasets/testing/multiple_csv/test_data*.csv\",\n \"gs://modin-testing/testing/multiple_csv/test_data*.csv\",\n ],\n)\ndef test_read_multiple_csv_cloud_store(path):\n def _pandas_read_csv_glob(path, storage_options):\n pandas_dfs = [\n pandas.read_csv(\n f\"{path.lower().split('*')[0]}{i}.csv\", storage_options=storage_options\n )\n for i in range(2)\n ]\n return pandas.concat(pandas_dfs).reset_index(drop=True)\n\n eval_general(\n pd,\n pandas,\n lambda module, **kwargs: pd.read_csv_glob(path, **kwargs).reset_index(drop=True)\n if hasattr(module, \"read_csv_glob\")\n else _pandas_read_csv_glob(path, **kwargs),\n storage_options={\"anon\": 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_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_default_to_pickle_filename_test_read_multiple_csv_s3_storage_opts.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_default_to_pickle_filename_test_read_multiple_csv_s3_storage_opts.eval_general_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 205, "end_line": 238, "span_ids": ["test_read_multiple_csv_s3_storage_opts", "impl"], "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": "test_default_to_pickle_filename = \"test_default_to_pickle.pkl\"\n\n\n@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental API\",\n)\n@pytest.mark.parametrize(\n \"storage_options\",\n [{\"anon\": False}, {\"anon\": True}, {\"key\": \"123\", \"secret\": \"123\"}, None],\n)\ndef test_read_multiple_csv_s3_storage_opts(storage_options):\n path = \"s3://modin-datasets/testing/multiple_csv/\"\n\n def _pandas_read_csv_glob(path, storage_options):\n pandas_df = pandas.concat(\n [\n pandas.read_csv(\n f\"{path}test_data{i}.csv\",\n storage_options=storage_options,\n )\n for i in range(2)\n ],\n ).reset_index(drop=True)\n return pandas_df\n\n eval_general(\n pd,\n pandas,\n lambda module, **kwargs: pd.read_csv_glob(path, **kwargs)\n if hasattr(module, \"read_csv_glob\")\n else _pandas_read_csv_glob(path, **kwargs),\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_distributed_pickling_test_distributed_pickling.teardown_test_files_pickl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_distributed_pickling_test_distributed_pickling.teardown_test_files_pickl", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 241, "end_line": 267, "span_ids": ["test_distributed_pickling"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental API\",\n)\n@pytest.mark.parametrize(\"compression\", [None, \"gzip\"])\n@pytest.mark.parametrize(\n \"filename\", [test_default_to_pickle_filename, \"test_to_pickle*.pkl\"]\n)\ndef test_distributed_pickling(filename, compression):\n data = test_data[\"int_data\"]\n df = pd.DataFrame(data)\n\n filename_param = filename\n if compression:\n filename = f\"{filename}.gz\"\n\n with (\n warns_that_defaulting_to_pandas()\n if filename_param == test_default_to_pickle_filename\n else nullcontext()\n ):\n df.to_pickle_distributed(filename, compression=compression)\n pickled_df = pd.read_pickle_distributed(filename, compression=compression)\n df_equals(pickled_df, df)\n\n pickle_files = glob.glob(filename)\n teardown_test_files(pickle_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_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_custom_json_text_test_read_custom_json_text.if_not_AsyncReadMode_get_.df_equals_df1_df2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_custom_json_text_test_read_custom_json_text.if_not_AsyncReadMode_get_.df_equals_df1_df2_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 270, "end_line": 312, "span_ids": ["test_read_custom_json_text"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental read_custom_text API\",\n)\n@pytest.mark.parametrize(\"set_async_read_mode\", [False, True], indirect=True)\ndef test_read_custom_json_text(set_async_read_mode):\n def _generate_json(file_name, nrows, ncols):\n data = np.random.rand(nrows, ncols)\n df = pandas.DataFrame(data, columns=[f\"col{x}\" for x in range(ncols)])\n df.to_json(file_name, lines=True, orient=\"records\")\n\n # Custom parser allows us to add some specifics to reading files,\n # which is not available through the ready-made API.\n # For example, the parser allows us to reduce the amount of RAM\n # required for reading by selecting a subset of columns.\n def _custom_parser(io_input, **kwargs):\n result = {\"col0\": [], \"col1\": [], \"col3\": []}\n for line in io_input:\n # for example, simjson can be used here\n obj = json.loads(line)\n for key in result:\n result[key].append(obj[key])\n return pandas.DataFrame(result).rename(columns={\"col0\": \"testID\"})\n\n with ensure_clean() as filename:\n _generate_json(filename, 64, 8)\n\n df1 = pd.read_custom_text(\n filename,\n columns=[\"testID\", \"col1\", \"col3\"],\n custom_parser=_custom_parser,\n is_quoting=False,\n )\n df2 = pd.read_json(filename, lines=True)[[\"col0\", \"col1\", \"col3\"]].rename(\n columns={\"col0\": \"testID\"}\n )\n if AsyncReadMode.get():\n # If read operations are asynchronous, then the dataframes\n # check should be inside `ensure_clean` context\n # because the file may be deleted before actual reading starts\n df_equals(df1, df2)\n if not AsyncReadMode.get():\n df_equals(df1, df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_evaluated_dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/pandas/test/test_io_exp.py_test_read_evaluated_dict_", "embedding": null, "metadata": {"file_path": "modin/experimental/pandas/test/test_io_exp.py", "file_name": "test_io_exp.py", "file_type": "text/x-python", "category": "test", "start_line": 315, "end_line": 370, "span_ids": ["test_read_evaluated_dict"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=f\"{Engine.get()} does not have experimental API\",\n)\n@pytest.mark.parametrize(\"set_async_read_mode\", [False, True], indirect=True)\ndef test_read_evaluated_dict(set_async_read_mode):\n def _generate_evaluated_dict(file_name, nrows, ncols):\n result = {}\n keys = [f\"col{x}\" for x in range(ncols)]\n\n with open(file_name, mode=\"w\") as _file:\n for i in range(nrows):\n data = np.random.rand(ncols)\n for idx, key in enumerate(keys):\n result[key] = data[idx]\n _file.write(str(result))\n _file.write(\"\\n\")\n\n # This parser allows us to read a format not supported by other reading functions\n def _custom_parser(io_input, **kwargs):\n cat_list = []\n asin_list = []\n for line in io_input:\n obj = eval(line)\n cat_list.append(obj[\"col1\"])\n asin_list.append(obj[\"col2\"])\n return pandas.DataFrame({\"col1\": asin_list, \"col2\": cat_list})\n\n def columns_callback(io_input, **kwargs):\n columns = None\n for line in io_input:\n columns = list(eval(line).keys())[1:3]\n break\n return columns\n\n with ensure_clean() as filename:\n _generate_evaluated_dict(filename, 64, 8)\n\n df1 = pd.read_custom_text(\n filename,\n columns=[\"col1\", \"col2\"],\n custom_parser=_custom_parser,\n )\n assert df1.shape == (64, 2)\n\n df2 = pd.read_custom_text(\n filename, columns=columns_callback, custom_parser=_custom_parser\n )\n if AsyncReadMode.get():\n # If read operations are asynchronous, then the dataframes\n # check should be inside `ensure_clean` context\n # because the file may be deleted before actual reading starts\n df_equals(df1, df2)\n if not AsyncReadMode.get():\n df_equals(df1, df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/sklearn/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/sklearn/model_selection/__init__.py_train_test_split_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/model_selection/__init__.py_train_test_split_", "embedding": null, "metadata": {"file_path": "modin/experimental/sklearn/model_selection/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "tokens": 19}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .train_test_split import train_test_split\n\n__all__ = [\"train_test_split\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/model_selection/train_test_split.py_train_test_split_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sklearn/model_selection/train_test_split.py_train_test_split_", "embedding": null, "metadata": {"file_path": "modin/experimental/sklearn/model_selection/train_test_split.py", "file_name": "train_test_split.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 39, "span_ids": ["train_test_split"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def train_test_split(df, **options):\n \"\"\"\n Split input data to train and test data.\n\n Parameters\n ----------\n df : modin.pandas.DataFrame / modin.pandas.Series\n Data to split.\n **options : dict\n Keyword arguments. If `train_size` key isn't provided\n `train_size` will be 0.75.\n\n Returns\n -------\n tuple\n A pair of modin.pandas.DataFrame / modin.pandas.Series.\n \"\"\"\n train_size = options.get(\"train_size\", 0.75)\n train = df.iloc[: int(len(df) * train_size)]\n test = df.iloc[len(train) :]\n return train, 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_modin-project__modin/modin/experimental/spreadsheet/__init__.py_try__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/__init__.py_try__", "embedding": null, "metadata": {"file_path": "modin/experimental/spreadsheet/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 26, "span_ids": ["docstring"], "tokens": 67}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 import modin_spreadsheet\nexcept ImportError:\n raise ImportError(\n 'Please `pip install \"modin[spreadsheet]\"` to install the spreadsheet extension'\n )\n\nfrom .general import from_dataframe, to_dataframe\n\n__all__ = [\"from_dataframe\", \"to_dataframe\"]\n\ndel modin_spreadsheet", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/general.py_from_import_pandas_as__from_dataframe.return.show_grid_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/general.py_from_import_pandas_as__from_dataframe.return.show_grid_", "embedding": null, "metadata": {"file_path": "modin/experimental/spreadsheet/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 184, "span_ids": ["from_dataframe", "docstring"], "tokens": 1470}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .. import pandas as pd\nfrom modin_spreadsheet import show_grid, SpreadsheetWidget\n\n\ndef from_dataframe(\n dataframe,\n show_toolbar=None,\n show_history=None,\n precision=None,\n grid_options=None,\n column_options=None,\n column_definitions=None,\n row_edit_callback=None,\n):\n \"\"\"\n Renders a DataFrame or Series as an interactive spreadsheet, represented by\n an instance of the ``SpreadsheetWidget`` class. The ``SpreadsheetWidget`` instance\n is constructed using the options passed in to this function. The\n ``dataframe`` argument to this function is used as the ``df`` kwarg in\n call to the SpreadsheetWidget constructor, and the rest of the parameters\n are passed through as is.\n\n If the ``dataframe`` argument is a Series, it will be converted to a\n DataFrame before being passed in to the SpreadsheetWidget constructor as the\n ``df`` kwarg.\n\n :rtype: SpreadsheetWidget\n\n Parameters\n ----------\n dataframe : DataFrame\n The DataFrame that will be displayed by this instance of\n SpreadsheetWidget.\n grid_options : dict\n Options to use when creating the SlickGrid control (i.e. the\n interactive grid). See the Notes section below for more information\n on the available options, as well as the default options that this\n widget uses.\n precision : integer\n The number of digits of precision to display for floating-point\n values. If unset, we use the value of\n `pandas.get_option('display.precision')`.\n show_toolbar : bool\n Whether to show a toolbar with options for adding/removing rows.\n Adding/removing rows is an experimental feature which only works\n with DataFrames that have an integer index.\n show_history : bool\n Whether to show the cell containing the spreadsheet transformation\n history.\n column_options : dict\n Column options that are to be applied to every column. See the\n Notes section below for more information on the available options,\n as well as the default options that this widget uses.\n column_definitions : dict\n Column options that are to be applied to individual\n columns. The keys of the dict should be the column names, and each\n value should be the column options for a particular column,\n represented as a dict. The available options for each column are the\n same options that are available to be set for all columns via the\n ``column_options`` parameter. See the Notes section below for more\n information on those options.\n row_edit_callback : callable\n A callable that is called to determine whether a particular row\n should be editable or not. Its signature should be\n ``callable(row)``, where ``row`` is a dictionary which contains a\n particular row's values, keyed by column name. The callback should\n return True if the provided row should be editable, and False\n otherwise.\n\n\n Notes\n -----\n The following dictionary is used for ``grid_options`` if none are\n provided explicitly::\n\n {\n # SlickGrid options\n 'fullWidthRows': True,\n 'syncColumnCellResize': True,\n 'forceFitColumns': False,\n 'defaultColumnWidth': 150,\n 'rowHeight': 28,\n 'enableColumnReorder': False,\n 'enableTextSelectionOnCells': True,\n 'editable': True,\n 'autoEdit': False,\n 'explicitInitialization': True,\n\n # Modin-spreadsheet options\n 'maxVisibleRows': 15,\n 'minVisibleRows': 8,\n 'sortable': True,\n 'filterable': True,\n 'highlightSelectedCell': False,\n 'highlightSelectedRow': True\n }\n\n The first group of options are SlickGrid \"grid options\" which are\n described in the `SlickGrid documentation\n `__.\n\n The second group of option are options that were added specifically\n for modin-spreadsheet and therefore are not documented in the SlickGrid documentation.\n The following bullet points describe these options.\n\n * **maxVisibleRows** The maximum number of rows that modin-spreadsheet will show.\n * **minVisibleRows** The minimum number of rows that modin-spreadsheet will show\n * **sortable** Whether the modin-spreadsheet instance will allow the user to sort\n columns by clicking the column headers. When this is set to ``False``,\n nothing will happen when users click the column headers.\n * **filterable** Whether the modin-spreadsheet instance will allow the user to filter\n the grid. When this is set to ``False`` the filter icons won't be shown\n for any columns.\n * **highlightSelectedCell** If you set this to True, the selected cell\n will be given a light blue border.\n * **highlightSelectedRow** If you set this to False, the light blue\n background that's shown by default for selected rows will be hidden.\n\n The following dictionary is used for ``column_options`` if none are\n provided explicitly::\n\n {\n # SlickGrid column options\n 'defaultSortAsc': True,\n 'maxWidth': None,\n 'minWidth': 30,\n 'resizable': True,\n 'sortable': True,\n 'toolTip': \"\",\n 'width': None\n\n # Modin-spreadsheet column options\n 'editable': True,\n }\n\n The first group of options are SlickGrid \"column options\" which are\n described in the `SlickGrid documentation\n `__.\n\n The ``editable`` option was added specifically for modin-spreadsheet and therefore is\n not documented in the SlickGrid documentation. This option specifies\n whether a column should be editable or not.\n\n See Also\n --------\n set_defaults : Permanently set global defaults for the parameters\n of ``show_grid``, with the exception of the ``dataframe``\n and ``column_definitions`` parameters, since those\n depend on the particular set of data being shown by an\n instance, and therefore aren't parameters we would want\n to set for all SpreadsheetWidget instances.\n set_grid_option : Permanently set global defaults for individual\n grid options. Does so by changing the defaults\n that the ``show_grid`` method uses for the\n ``grid_options`` parameter.\n SpreadsheetWidget : The widget class that is instantiated and returned by this\n method.\n\n \"\"\"\n if not isinstance(dataframe, pd.DataFrame):\n raise TypeError(\"dataframe must be modin.DataFrame, not %s\" % type(dataframe))\n return show_grid(\n dataframe,\n show_toolbar,\n show_history,\n precision,\n grid_options,\n column_options,\n column_definitions,\n row_edit_callback,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/general.py_to_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/general.py_to_dataframe_", "embedding": null, "metadata": {"file_path": "modin/experimental/spreadsheet/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 207, "span_ids": ["to_dataframe"], "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 to_dataframe(spreadsheet):\n \"\"\"\n Get a copy of the DataFrame that reflects the current state of the ``spreadsheet`` SpreadsheetWidget instance UI.\n This includes any sorting or filtering changes, as well as edits\n that have been made by double clicking cells.\n\n :rtype: DataFrame\n\n Parameters\n ----------\n spreadsheet : SpreadsheetWidget\n The SpreadsheetWidget instance that DataFrame that will be displayed by this instance of\n SpreadsheetWidget.\n \"\"\"\n if not isinstance(spreadsheet, SpreadsheetWidget):\n raise TypeError(\n \"spreadsheet must be modin_spreadsheet.SpreadsheetWidget, not %s\"\n % type(spreadsheet)\n )\n return spreadsheet.get_changed_df()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/spreadsheet/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/spreadsheet/test/test_general.py_pandas_get_test_data.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/test_general.py_pandas_get_test_data.return._", "embedding": null, "metadata": {"file_path": "modin/experimental/spreadsheet/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 30, "span_ids": ["get_test_data", "docstring"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport pytest\nimport modin.pandas as pd\nimport modin.experimental.spreadsheet as mss\nimport numpy as np\nfrom modin_spreadsheet import SpreadsheetWidget\n\n\ndef get_test_data():\n return {\n \"A\": 1.0,\n \"B\": pd.Timestamp(\"20130102\"),\n \"C\": pd.Series(1, index=list(range(4)), dtype=\"float32\"),\n \"D\": np.array([5, 2, 3, 1], dtype=\"int32\"),\n \"E\": pd.Categorical([\"test\", \"train\", \"foo\", \"bar\"]),\n \"F\": [\"foo\", \"bar\", \"buzz\", \"fox\"],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/test_general.py_test_from_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/spreadsheet/test/test_general.py_test_from_dataframe_", "embedding": null, "metadata": {"file_path": "modin/experimental/spreadsheet/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 75, "span_ids": ["test_from_dataframe", "test_to_dataframe"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_from_dataframe():\n data = get_test_data()\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_result = mss.from_dataframe(modin_df)\n assert isinstance(modin_result, SpreadsheetWidget)\n\n with pytest.raises(TypeError):\n mss.from_dataframe(pandas_df)\n\n # Check parameters don't error\n def can_edit_row(row):\n return row[\"D\"] > 2\n\n modin_result = mss.from_dataframe(\n modin_df,\n show_toolbar=True,\n show_history=True,\n precision=1,\n grid_options={\"forceFitColumns\": False, \"filterable\": False},\n column_options={\"D\": {\"editable\": True}},\n column_definitions={\"editable\": False},\n row_edit_callback=can_edit_row,\n )\n assert isinstance(modin_result, SpreadsheetWidget)\n\n\ndef test_to_dataframe():\n data = get_test_data()\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n spreadsheet = mss.from_dataframe(modin_df)\n modin_result = mss.to_dataframe(spreadsheet)\n\n assert modin_result.equals(modin_df)\n\n with pytest.raises(TypeError):\n mss.to_dataframe(\"Not a SpreadsheetWidget\")\n with pytest.raises(TypeError):\n mss.to_dataframe(pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/__init__.py_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/__init__.py_pd_", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 62, "span_ids": ["impl:3", "query", "docstring"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import modin.pandas as pd\nimport modin.config as cfg\n\n\n_query_impl = None\n\n\ndef query(sql: str, *args, **kwargs) -> pd.DataFrame:\n \"\"\"\n Execute SQL query using either HDK engine or dfsql.\n\n Parameters\n ----------\n sql : str\n SQL query to be executed.\n *args : *tuple\n Positional arguments, passed to the execution engine.\n **kwargs : **dict\n Keyword arguments, passed to the execution engine.\n\n Returns\n -------\n modin.pandas.DataFrame\n Execution result.\n \"\"\"\n global _query_impl\n\n if _query_impl is None:\n if cfg.StorageFormat.get() == \"Hdk\":\n from modin.experimental.sql.hdk.query import hdk_query as _query_impl\n else:\n from dfsql import sql_query as _query_impl\n\n return _query_impl(sql, *args, **kwargs)\n\n\n# dfsql adds the sql() method to the DataFrame class.\n# This code is used for lazy dfsql extensions initialization.\nif not hasattr(pd.DataFrame, \"sql\"):\n\n def dfsql_init(df, query):\n delattr(pd.DataFrame, \"sql\")\n import modin.experimental.sql.dfsql.query # noqa: F401\n\n df.sql = pd.DataFrame.sql(df)\n return df.sql(query)\n\n pd.DataFrame.sql = dfsql_init", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/dfsql/query.py_warnings_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/dfsql/query.py_warnings_", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/dfsql/query.py", "file_name": "query.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 29, "span_ids": ["docstring"], "tokens": 96}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import warnings\n\ntry:\n from dfsql import sql_query as dfsql_query\n\n # This import is required to inject the DataFrame.sql() method.\n import dfsql.extensions # noqa: F401\nexcept ImportError:\n warnings.warn(\n \"Modin experimental sql interface requires dfsql to be installed.\"\n + ' Run `pip install \"modin[sql]\"` to install it.'\n )\n raise\n\n__all__ = [\"dfsql_query\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/hdk/query.py_pa_hdk_query.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/hdk/query.py_pa_hdk_query.return.df", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/hdk/query.py", "file_name": "query.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 87, "span_ids": ["hdk_query", "docstring"], "tokens": 588}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pyarrow as pa\nfrom pandas.core.dtypes.common import get_dtype\n\nimport modin.pandas as pd\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.dataframe.utils import (\n ColNameCodec,\n)\nfrom modin.pandas.utils import from_arrow\nfrom modin.experimental.core.storage_formats.hdk import DFAlgQueryCompiler\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.hdk_worker import (\n HdkWorker,\n)\n\n\ndef hdk_query(query: str, **kwargs) -> pd.DataFrame:\n \"\"\"\n Execute SQL queries on the HDK backend.\n\n DataFrames are referenced in the query by names and are\n passed to this function as name=value arguments.\n\n Here is an example of a query to three data frames:\n\n ids = [1, 2, 3]\n first_names = [\"James\", \"Peter\", \"Claus\"]\n last_names = [\"Bond\", \"Pan\", \"Santa\"]\n courses_names = [\"Mathematics\", \"Physics\", \"Geography\"]\n student = pd.DataFrame({\"id\": ids, \"first_name\": first_names, \"last_name\": last_names})\n course = pd.DataFrame({\"id\": ids, \"course_name\": courses_names})\n student_course = pd.DataFrame({\"student_id\": ids, \"course_id\": [3, 2, 1]})\n query = '''\n SELECT\n student.first_name,\n student.last_name,\n course.course_name\n FROM student\n JOIN student_course\n ON student.id = student_course.student_id\n JOIN course\n ON course.id = student_course.course_id\n ORDER BY\n last_name\n '''\n res = hdk_query(query, student=student, course=course, student_course=student_course)\n print(res)\n\n Parameters\n ----------\n query : str\n SQL query to be executed.\n **kwargs : **dict\n DataFrames referenced by the query.\n\n Returns\n -------\n modin.pandas.DataFrame\n Execution result.\n \"\"\"\n worker = HdkWorker()\n if len(kwargs) > 0:\n query = _build_query(query, kwargs, worker.import_arrow_table)\n df = from_arrow(worker.executeDML(query))\n mdf = df._query_compiler._modin_frame\n schema = mdf._partitions[0][0].get().schema\n # HDK returns strings as dictionary. For the proper conversion to\n # Pandas, we need to replace dtypes of the corresponding columns.\n if replace := [\n i for i, col in enumerate(schema) if pa.types.is_dictionary(col.type)\n ]:\n dtypes = mdf._dtypes\n obj_type = get_dtype(object)\n for i in replace:\n dtypes[i] = obj_type\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/hdk/query.py__build_query_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/hdk/query.py__build_query_", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/hdk/query.py", "file_name": "query.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 134, "span_ids": ["_build_query"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _build_query(query: str, frames: dict, import_table: callable) -> str:\n \"\"\"\n Build query to be executed.\n\n Table and column names are mapped to the real names\n using the WITH statement.\n\n Parameters\n ----------\n query : str\n SQL query to be processed.\n frames : dict\n DataFrames referenced by the query.\n import_table : callable\n Used to import tables and assign the table names.\n\n Returns\n -------\n str\n SQL query to be executed.\n \"\"\"\n alias = []\n for name, df in frames.items():\n assert isinstance(df._query_compiler, DFAlgQueryCompiler)\n mf = df._query_compiler._modin_frame\n if not mf._has_arrow_table():\n mf._execute()\n assert mf._has_arrow_table()\n part = mf._partitions[0][0]\n at = part.get()\n\n if part.frame_id is None:\n part.frame_id = import_table(at)\n\n alias.append(\"WITH \" if len(alias) == 0 else \"\\n),\\n\")\n alias.extend((name, \" AS (\\n\", \" SELECT\\n\"))\n\n for i, col in enumerate(at.column_names):\n alias.append(\" \" if i == 0 else \",\\n \")\n alias.extend(('\"', col, '\"', \" AS \", '\"', ColNameCodec.decode(col), '\"'))\n alias.extend((\"\\n FROM\\n \", part.frame_id))\n\n alias.extend((\"\\n)\\n\", query))\n return \"\".join(alias)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/sql/test/test_sql.py_pandas_titanic_snippet._passenger_id_survived_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_pandas_titanic_snippet._passenger_id_survived_", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/test/test_sql.py", "file_name": "test_sql.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 34, "span_ids": ["docstring"], "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": "import pandas\nimport modin.pandas as pd\nimport modin.config as cfg\nfrom modin.pandas.test.utils import default_to_pandas_ignore_string, df_equals\n\nimport io\nimport pytest\n\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\ntitanic_snippet = \"\"\"passenger_id,survived,p_class,name,sex,age,sib_sp,parch,ticket,fare,cabin,embarked\n1,0,3,\"Braund, Mr. Owen Harris\",male,22,1,0,A/5 21171,7.25,,S\n2,1,1,\"Cumings, Mrs. John Bradley (Florence Briggs Thayer)\",female,38,1,0,PC 17599,71.2833,C85,C\n3,1,3,\"Heikkinen, Miss. Laina\",female,26,0,0,STON/O2. 3101282,7.925,,S\n4,1,1,\"Futrelle, Mrs. Jacques Heath (Lily May Peel)\",female,35,1,0,113803,53.1,C123,S\n5,0,3,\"Allen, Mr. William Henry\",male,35,0,0,373450,8.05,,S\n6,0,3,\"Moran, Mr. James\",male,,0,0,330877,8.4583,,Q\n7,0,1,\"McCarthy, Mr. Timothy J\",male,54,0,0,17463,51.8625,E46,S\n8,0,3,\"Palsson, Master. Gosta Leonard\",male,2,3,1,349909,21.075,,S\n9,1,3,\"Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)\",female,27,0,2,347742,11.1333,,S\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_test_sql_query_test_sql_query.assert_values_left_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_test_sql_query_test_sql_query.assert_values_left_va", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/test/test_sql.py", "file_name": "test_sql.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 52, "span_ids": ["test_sql_query"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sql_query():\n from modin.experimental.sql import query\n\n df = pd.read_csv(io.StringIO(titanic_snippet))\n sql = \"SELECT survived, p_class, count(passenger_id) as cnt FROM (SELECT * FROM titanic WHERE survived = 1) as t1 GROUP BY survived, p_class\"\n query_result = query(sql, titanic=df)\n expected_df = (\n df[df.survived == 1]\n .groupby([\"survived\", \"p_class\"])\n .agg({\"passenger_id\": \"count\"})\n .reset_index()\n )\n assert query_result.shape == expected_df.shape\n values_left = expected_df.dropna().values\n values_right = query_result.dropna().values\n assert (values_left == values_right).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_modin-project__modin/modin/experimental/sql/test/test_sql.py_test_sql_extension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/sql/test/test_sql.py_test_sql_extension_", "embedding": null, "metadata": {"file_path": "modin/experimental/sql/test/test_sql.py", "file_name": "test_sql.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 84, "span_ids": ["test_string_cast", "test_sql_extension"], "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": "def test_sql_extension():\n # This test is for DataFrame.sql() method, that is injected by\n # dfsql.extensions. In the HDK environment, there is no dfsql\n # module and, thus, this test fails.\n if cfg.StorageFormat.get() == \"Hdk\":\n return\n\n import modin.experimental.sql # noqa: F401\n\n df = pd.read_csv(io.StringIO(titanic_snippet))\n\n expected_df = df[df[\"survived\"] == 1][[\"passenger_id\", \"survived\"]]\n\n sql = \"SELECT passenger_id, survived WHERE survived = 1\"\n query_result = df.sql(sql)\n assert list(query_result.columns) == [\"passenger_id\", \"survived\"]\n values_left = expected_df.values\n values_right = query_result.values\n assert values_left.shape == values_right.shape\n assert (values_left == values_right).all()\n\n\ndef test_string_cast():\n from modin.experimental.sql import query\n\n data = {\"A\": [\"A\", \"B\", \"C\"], \"B\": [\"A\", \"B\", \"C\"]}\n mdf = pd.DataFrame(data)\n pdf = pandas.DataFrame(data)\n df_equals(pdf, query(\"SELECT * FROM df\", df=mdf))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/__init__.py_DMatrix_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/__init__.py_DMatrix_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 19, "span_ids": ["docstring"], "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 .xgboost import DMatrix, Booster, train\n\n__all__ = [\"DMatrix\", \"Booster\", \"train\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 15, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/experimental/xgboost/test/test_default.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_default.py_pytest_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 35, "span_ids": ["test_engine", "docstring"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nfrom modin.config import Engine\n\nimport modin.experimental.xgboost as xgb\nimport modin.pandas as pd\n\n\n@pytest.mark.skipif(\n Engine.get() == \"Ray\",\n reason=\"This test doesn't make sense on Ray engine.\",\n)\n@pytest.mark.skipif(\n Engine.get() == \"Python\",\n reason=\"This test doesn't make sense on non-distributed engine (see issue #2938).\",\n)\ndef test_engine():\n try:\n xgb.train({}, xgb.DMatrix(pd.DataFrame([0]), pd.DataFrame([0])))\n except ValueError:\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_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_np_check_dmatrix.try_.else_.assert_md_dm_feature_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_np_check_dmatrix.try_.else_.assert_md_dm_feature_type", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_dmatrix.py", "file_name": "test_dmatrix.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 49, "span_ids": ["check_dmatrix", "docstring"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pytest\nimport pandas\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.datasets import load_breast_cancer\nimport xgboost as xgb\n\nimport modin.pandas as pd\nimport modin.experimental.xgboost as mxgb\n\n\nrng = np.random.RandomState(1994)\n\n\ndef check_dmatrix(data, label=None, **kwargs):\n modin_data = pd.DataFrame(data)\n modin_label = label if label is None else pd.Series(label)\n try:\n dm = xgb.DMatrix(data, label=label, **kwargs)\n except Exception as xgb_exception:\n with pytest.raises(Exception) as mxgb_exception:\n mxgb.DMatrix(modin_data, label=modin_label, **kwargs)\n # Thrown exceptions are `XGBoostError`, which is a descendant of `ValueError`, and `ValueError`\n # for XGBoost and Modin, respectively, so we intentionally use `xgb_exception`\n # as a first parameter of `isinstance` to pass the assertion\n assert isinstance(\n xgb_exception, type(mxgb_exception.value)\n ), \"Got Modin Exception type {}, but xgboost Exception type {} was expected\".format(\n type(mxgb_exception.value), type(xgb_exception)\n )\n else:\n md_dm = mxgb.DMatrix(modin_data, label=modin_label, **kwargs)\n assert md_dm.num_row() == dm.num_row()\n assert md_dm.num_col() == dm.num_col()\n assert md_dm.feature_names == dm.feature_names\n assert md_dm.feature_types == dm.feature_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_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_dmatrix_feature_names_and_feature_types_test_dmatrix_feature_names_and_feature_types.check_dmatrix_data_featu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_dmatrix_feature_names_and_feature_types_test_dmatrix_feature_names_and_feature_types.check_dmatrix_data_featu", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_dmatrix.py", "file_name": "test_dmatrix.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 76, "span_ids": ["test_dmatrix_feature_names_and_feature_types"], "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": "@pytest.mark.parametrize(\n \"data\",\n [\n np.random.randn(5, 5),\n np.array([[1, 2], [3, 4]]),\n np.array([[\"a\", \"b\"], [\"c\", \"d\"]]),\n [[1, 2], [3, 4]],\n [[\"a\", \"b\"], [\"c\", \"d\"]],\n ],\n)\n@pytest.mark.parametrize(\n \"feature_names\",\n [\n list(\"abcdef\"),\n [\"a\", \"b\", \"c\", \"d\", \"d\"],\n [\"a\", \"b\", \"c\", \"d\", \"e<1\"],\n list(\"abcde\"),\n ],\n)\n@pytest.mark.parametrize(\n \"feature_types\",\n [None, \"q\", list(\"qiqiq\")],\n)\ndef test_dmatrix_feature_names_and_feature_types(data, feature_names, feature_types):\n check_dmatrix(data, feature_names=feature_names, feature_types=feature_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_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_feature_names_test_feature_names.None_1.repr_md_booster_predict_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_feature_names_test_feature_names.None_1.repr_md_booster_predict_m", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_dmatrix.py", "file_name": "test_dmatrix.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 121, "span_ids": ["test_feature_names"], "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_feature_names():\n dataset = load_breast_cancer()\n X = dataset.data\n y = dataset.target\n feature_names = [f\"feat{i}\" for i in range(X.shape[1])]\n\n check_dmatrix(\n X,\n y,\n feature_names=feature_names,\n )\n\n dmatrix = xgb.DMatrix(X, label=y, feature_names=feature_names)\n md_dmatrix = mxgb.DMatrix(\n pd.DataFrame(X), label=pd.Series(y), feature_names=feature_names\n )\n\n params = {\n \"objective\": \"binary:logistic\",\n \"eval_metric\": \"mlogloss\",\n }\n\n booster = xgb.train(params, dmatrix, num_boost_round=10)\n md_booster = mxgb.train(params, md_dmatrix, num_boost_round=10)\n\n predictions = booster.predict(dmatrix)\n modin_predictions = md_booster.predict(md_dmatrix)\n\n preds = pandas.DataFrame(predictions).apply(np.round, axis=0)\n modin_preds = modin_predictions.apply(np.round, axis=0)\n\n accuracy = accuracy_score(y, preds)\n md_accuracy = accuracy_score(y, modin_preds)\n\n np.testing.assert_allclose(accuracy, md_accuracy, atol=0.005, rtol=0.002)\n\n # Different feature_names (default) must raise error in this case\n dm = xgb.DMatrix(X)\n md_dm = mxgb.DMatrix(pd.DataFrame(X))\n with pytest.raises(ValueError):\n booster.predict(dm)\n with pytest.raises(ValueError):\n repr(md_booster.predict(md_dm))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_feature_weights_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_dmatrix.py_test_feature_weights_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_dmatrix.py", "file_name": "test_dmatrix.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 145, "span_ids": ["test_feature_weights"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_feature_weights():\n n_rows = 10\n n_cols = 50\n fw = rng.uniform(size=n_cols)\n X = rng.randn(n_rows, n_cols)\n dm = xgb.DMatrix(X)\n md_dm = mxgb.DMatrix(pd.DataFrame(X))\n dm.set_info(feature_weights=fw)\n md_dm.set_info(feature_weights=fw)\n np.testing.assert_allclose(\n dm.get_float_info(\"feature_weights\"), md_dm.get_float_info(\"feature_weights\")\n )\n # Handle empty\n dm.set_info(feature_weights=np.empty((0,)))\n md_dm.set_info(feature_weights=np.empty((0,)))\n\n assert (\n dm.get_float_info(\"feature_weights\").shape[0]\n == md_dm.get_float_info(\"feature_weights\").shape[0]\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_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_pytest_num_cpus.mp_cpu_count_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_pytest_num_cpus.mp_cpu_count_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_xgboost.py", "file_name": "test_xgboost.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 39, "span_ids": ["docstring"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nimport modin\nimport modin.experimental.xgboost as xgb\nimport modin.pandas as pd\nimport numpy as np\nimport xgboost\n\nfrom modin.experimental.sklearn.model_selection.train_test_split import train_test_split\nfrom sklearn.datasets import (\n load_iris,\n load_diabetes,\n load_digits,\n load_wine,\n load_breast_cancer,\n)\nfrom sklearn.metrics import accuracy_score, mean_squared_error\n\nimport multiprocessing as mp\nimport ray\n\n\nray.init(log_to_driver=False)\n\nnum_cpus = mp.cpu_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_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_binary_classification_datasets_test_xgb_with_binary_classification_datasets.np_testing_assert_allclos": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_binary_classification_datasets_test_xgb_with_binary_classification_datasets.np_testing_assert_allclos", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_xgboost.py", "file_name": "test_xgboost.py", "file_type": "text/x-python", "category": "test", "start_line": 42, "end_line": 113, "span_ids": ["test_xgb_with_binary_classification_datasets"], "tokens": 543}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"modin_type_y\",\n [pd.DataFrame, pd.Series],\n)\n@pytest.mark.parametrize(\n \"num_actors\",\n [1, num_cpus, None, modin.config.NPartitions.get() + 1],\n)\n@pytest.mark.parametrize(\n \"data\",\n [\n (\n load_breast_cancer(),\n {\"objective\": \"binary:logistic\", \"eval_metric\": [\"logloss\", \"error\"]},\n ),\n ],\n ids=[\"load_breast_cancer\"],\n)\ndef test_xgb_with_binary_classification_datasets(data, num_actors, modin_type_y):\n dataset, param = data\n num_round = 10\n\n X = dataset.data\n y = dataset.target\n xgb_dmatrix = xgboost.DMatrix(X, label=y)\n\n modin_X = pd.DataFrame(X)\n modin_y = modin_type_y(y)\n mxgb_dmatrix = xgb.DMatrix(modin_X, label=modin_y)\n\n evals_result_xgb = {}\n evals_result_mxgb = {}\n verbose_eval = False\n bst = xgboost.train(\n param,\n xgb_dmatrix,\n num_round,\n evals_result=evals_result_xgb,\n evals=[(xgb_dmatrix, \"train\")],\n verbose_eval=verbose_eval,\n )\n modin_bst = xgb.train(\n param,\n mxgb_dmatrix,\n num_round,\n evals_result=evals_result_mxgb,\n evals=[(mxgb_dmatrix, \"train\")],\n num_actors=num_actors,\n verbose_eval=verbose_eval,\n )\n\n for par in param[\"eval_metric\"]:\n assert len(evals_result_xgb[\"train\"][par]) == len(\n evals_result_xgb[\"train\"][par]\n )\n for i in range(len(evals_result_xgb[\"train\"][par])):\n np.testing.assert_allclose(\n evals_result_xgb[\"train\"][par][i],\n evals_result_mxgb[\"train\"][par][i],\n atol=0.011,\n )\n\n predictions = bst.predict(xgb_dmatrix)\n modin_predictions = modin_bst.predict(mxgb_dmatrix)\n\n preds = pd.DataFrame(predictions).apply(round)\n modin_preds = modin_predictions.apply(round)\n\n val = accuracy_score(y, preds)\n modin_val = accuracy_score(modin_y, modin_preds)\n\n np.testing.assert_allclose(val, modin_val, atol=0.002, rtol=0.002)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_multiclass_classification_datasets_test_xgb_with_multiclass_classification_datasets.np_testing_assert_allclos": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_multiclass_classification_datasets_test_xgb_with_multiclass_classification_datasets.np_testing_assert_allclos", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_xgboost.py", "file_name": "test_xgboost.py", "file_type": "text/x-python", "category": "test", "start_line": 116, "end_line": 198, "span_ids": ["test_xgb_with_multiclass_classification_datasets"], "tokens": 612}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"modin_type_y\",\n [pd.DataFrame, pd.Series],\n)\n@pytest.mark.parametrize(\n \"num_actors\",\n [1, num_cpus, None, modin.config.NPartitions.get() + 1],\n)\n@pytest.mark.parametrize(\n \"data\",\n [\n (\n load_iris(),\n {\"num_class\": 3},\n ),\n (\n load_digits(),\n {\"num_class\": 10},\n ),\n (\n load_wine(),\n {\"num_class\": 3},\n ),\n ],\n ids=[\"load_iris\", \"load_digits\", \"load_wine\"],\n)\ndef test_xgb_with_multiclass_classification_datasets(data, num_actors, modin_type_y):\n dataset, param_ = data\n num_round = 10\n part_param = {\"objective\": \"multi:softprob\", \"eval_metric\": \"mlogloss\"}\n param = {**param_, **part_param}\n\n X = dataset.data\n y = dataset.target\n xgb_dmatrix = xgboost.DMatrix(X, label=y)\n\n modin_X = pd.DataFrame(X)\n modin_y = modin_type_y(y)\n mxgb_dmatrix = xgb.DMatrix(modin_X, label=modin_y)\n\n evals_result_xgb = {}\n evals_result_mxgb = {}\n verbose_eval = False\n bst = xgboost.train(\n param,\n xgb_dmatrix,\n num_round,\n evals_result=evals_result_xgb,\n evals=[(xgb_dmatrix, \"train\")],\n verbose_eval=verbose_eval,\n )\n modin_bst = xgb.train(\n param,\n mxgb_dmatrix,\n num_round,\n evals_result=evals_result_mxgb,\n evals=[(mxgb_dmatrix, \"train\")],\n num_actors=num_actors,\n verbose_eval=verbose_eval,\n )\n\n assert len(evals_result_xgb[\"train\"][\"mlogloss\"]) == len(\n evals_result_mxgb[\"train\"][\"mlogloss\"]\n )\n for i in range(len(evals_result_xgb[\"train\"][\"mlogloss\"])):\n np.testing.assert_allclose(\n evals_result_xgb[\"train\"][\"mlogloss\"][i],\n evals_result_mxgb[\"train\"][\"mlogloss\"][i],\n atol=0.009,\n )\n\n predictions = bst.predict(xgb_dmatrix)\n modin_predictions = modin_bst.predict(mxgb_dmatrix)\n\n array_preds = np.asarray([np.argmax(line) for line in predictions])\n modin_array_preds = np.asarray(\n [np.argmax(line) for line in modin_predictions.to_numpy()]\n )\n\n val = accuracy_score(y, array_preds)\n modin_val = accuracy_score(modin_y, modin_array_preds)\n\n np.testing.assert_allclose(val, modin_val)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_regression_datasets_test_xgb_with_regression_datasets.np_testing_assert_allclos": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_xgb_with_regression_datasets_test_xgb_with_regression_datasets.np_testing_assert_allclos", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_xgboost.py", "file_name": "test_xgboost.py", "file_type": "text/x-python", "category": "test", "start_line": 201, "end_line": 267, "span_ids": ["test_xgb_with_regression_datasets"], "tokens": 576}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"modin_type_y\",\n [pd.DataFrame, pd.Series],\n)\n@pytest.mark.parametrize(\n \"num_actors\",\n [1, num_cpus, None, modin.config.NPartitions.get() + 1],\n)\n@pytest.mark.parametrize(\n \"data\",\n [(load_diabetes(), {\"eta\": 0.01})],\n ids=[\"load_diabetes\"],\n)\ndef test_xgb_with_regression_datasets(data, num_actors, modin_type_y):\n dataset, param = data\n num_round = 10\n\n X_df = pd.DataFrame(dataset.data)\n y_df = modin_type_y(dataset.target)\n X_train, X_test = train_test_split(X_df)\n y_train, y_test = train_test_split(y_df)\n\n train_xgb_dmatrix = xgboost.DMatrix(X_train, label=y_train)\n test_xgb_dmatrix = xgboost.DMatrix(X_test, label=y_test)\n\n train_mxgb_dmatrix = xgb.DMatrix(X_train, label=y_train)\n test_mxgb_dmatrix = xgb.DMatrix(X_test, label=y_test)\n\n evals_result_xgb = {}\n evals_result_mxgb = {}\n verbose_eval = False\n bst = xgboost.train(\n param,\n train_xgb_dmatrix,\n num_round,\n evals_result=evals_result_xgb,\n evals=[(train_xgb_dmatrix, \"train\"), (test_xgb_dmatrix, \"test\")],\n verbose_eval=verbose_eval,\n )\n modin_bst = xgb.train(\n param,\n train_mxgb_dmatrix,\n num_round,\n evals_result=evals_result_mxgb,\n evals=[(train_mxgb_dmatrix, \"train\"), (test_mxgb_dmatrix, \"test\")],\n num_actors=num_actors,\n verbose_eval=verbose_eval,\n )\n\n for param in [\"train\", \"test\"]:\n assert len(evals_result_xgb[param][\"rmse\"]) == len(\n evals_result_mxgb[param][\"rmse\"]\n )\n for i in range(len(evals_result_xgb[param][\"rmse\"])):\n np.testing.assert_allclose(\n evals_result_xgb[param][\"rmse\"][i],\n evals_result_mxgb[param][\"rmse\"][i],\n rtol=0.0007,\n )\n\n predictions = bst.predict(train_xgb_dmatrix)\n modin_predictions = modin_bst.predict(train_mxgb_dmatrix)\n\n val = mean_squared_error(y_train, predictions)\n modin_val = mean_squared_error(y_train, modin_predictions)\n\n np.testing.assert_allclose(val, modin_val, rtol=1.25e-05)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_invalid_input_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/test/test_xgboost.py_test_invalid_input_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/test/test_xgboost.py", "file_name": "test_xgboost.py", "file_type": "text/x-python", "category": "test", "start_line": 270, "end_line": 292, "span_ids": ["test_invalid_input"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_invalid_input():\n list_df = [[1, 2.0, True], [2, 3.0, False]]\n with pytest.raises(AssertionError):\n # Check that DMatrix uses only DataFrame\n xgb.DMatrix(list_df, label=pd.Series([1, 2]))\n\n param = {}\n num_round = 2\n with pytest.raises(AssertionError):\n # Check that train uses only DMatrix\n xgb.train(param, list_df, num_round)\n\n df = pd.DataFrame([[1, 2.0, True], [2, 3.0, False]], columns=[\"a\", \"b\", \"c\"])\n modin_dtrain = xgb.DMatrix(df, label=pd.Series([1, 2]))\n\n modin_bst = xgb.train(param, modin_dtrain, num_round)\n\n dt = [[1, 2.0, 3.3], [2, 3.0, 4.4]]\n\n with pytest.raises(AssertionError):\n # Check that predict uses only DMatrix\n modin_bst.predict(dt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/utils.py_logging_RabitContextManager.__exit__.self_rabit_tracker_join_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/utils.py_logging_RabitContextManager.__exit__.self_rabit_tracker_join_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 76, "span_ids": ["RabitContextManager", "RabitContextManager.__init__", "RabitContextManager.__exit__", "RabitContextManager.__enter__", "docstring"], "tokens": 361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport xgboost as xgb\n\nLOGGER = logging.getLogger(\"[modin.xgboost]\")\n\n\nclass RabitContextManager:\n \"\"\"\n A manager class that controls lifecycle of `xgb.RabitTracker`.\n\n All workers that are used for distributed training will connect to\n Rabit Tracker stored in this class.\n\n Parameters\n ----------\n num_workers : int\n Number of workers of `self.rabit_tracker`.\n host_ip : str\n IP address of host that creates `self` object.\n \"\"\"\n\n # TODO: Specify type of host_ip\n def __init__(self, num_workers: int, host_ip):\n self._num_workers = num_workers\n self.env = {\"DMLC_NUM_WORKER\": self._num_workers}\n self.rabit_tracker = xgb.RabitTracker(\n host_ip=host_ip, n_workers=self._num_workers\n )\n\n def __enter__(self):\n \"\"\"\n Entry point of manager.\n\n Updates Rabit Tracker environment, starts `self.rabit_tracker`.\n\n Returns\n -------\n dict\n Dict with Rabit Tracker environment.\n \"\"\"\n self.env.update(self.rabit_tracker.worker_envs())\n self.rabit_tracker.start(self._num_workers)\n return self.env\n\n # TODO: (type, value, traceback) -> *args\n def __exit__(self, type, value, traceback):\n \"\"\"\n Exit point of manager.\n\n Finishes `self.rabit_tracker`.\n\n Parameters\n ----------\n type : exception type\n Type of exception, captured by manager.\n value : Exception\n Exception value.\n traceback : TracebackType\n Traceback of exception.\n \"\"\"\n self.rabit_tracker.join()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/utils.py_RabitContext_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/utils.py_RabitContext_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 117, "span_ids": ["RabitContext.__enter__", "RabitContext", "RabitContext.__init__", "RabitContext.__exit__"], "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 RabitContext:\n \"\"\"\n Context to connect a worker to a rabit tracker.\n\n Parameters\n ----------\n actor_rank : int\n Rank of actor, connected to this context.\n args : list\n List with environment variables for Rabit Tracker.\n \"\"\"\n\n def __init__(self, actor_rank, args):\n self.args = args\n self.args.append((\"DMLC_TASK_ID=[modin.xgboost]:\" + str(actor_rank)).encode())\n\n def __enter__(self):\n \"\"\"\n Entry point of context.\n\n Connects to Rabit Tracker.\n \"\"\"\n xgb.rabit.init(self.args)\n LOGGER.info(\"-------------- rabit started ------------------\")\n\n def __exit__(self, *args):\n \"\"\"\n Exit point of context.\n\n Disconnects from Rabit Tracker.\n\n Parameters\n ----------\n *args : iterable\n Parameters for Exception capturing.\n \"\"\"\n xgb.rabit.finalize()\n LOGGER.info(\"-------------- rabit 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_modin-project__modin/modin/experimental/xgboost/xgboost.py_logging_DMatrix.feature_names.return.self__feature_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_logging_DMatrix.feature_names.return.self__feature_names", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 149, "span_ids": ["DMatrix.__init__", "DMatrix", "DMatrix.__iter__", "DMatrix.get_dmatrix_params", "DMatrix.feature_names", "docstring"], "tokens": 821}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 typing import Dict, Optional\n\nimport xgboost as xgb\n\nfrom modin.config import Engine\nfrom modin.distributed.dataframe.pandas import unwrap_partitions\nimport modin.pandas as pd\n\nLOGGER = logging.getLogger(\"[modin.xgboost]\")\n\n\nclass DMatrix:\n \"\"\"\n DMatrix holds references to partitions of Modin DataFrame.\n\n On init stage unwrapping partitions of Modin DataFrame is started.\n\n Parameters\n ----------\n data : modin.pandas.DataFrame\n Data source of DMatrix.\n label : modin.pandas.DataFrame or modin.pandas.Series, optional\n Labels used for training.\n missing : float, optional\n Value in the input data which needs to be present as a missing\n value. If ``None``, defaults to ``np.nan``.\n silent : boolean, optional\n Whether to print messages during construction or not.\n feature_names : list, optional\n Set names for features.\n feature_types : list, optional\n Set types for features.\n feature_weights : array_like, optional\n Set feature weights for column sampling.\n enable_categorical : boolean, optional\n Experimental support of specializing for categorical features.\n\n Notes\n -----\n Currently DMatrix doesn't support `weight`, `base_margin`, `nthread`,\n `group`, `qid`, `label_lower_bound`, `label_upper_bound` parameters.\n \"\"\"\n\n def __init__(\n self,\n data,\n label=None,\n missing=None,\n silent=False,\n feature_names=None,\n feature_types=None,\n feature_weights=None,\n enable_categorical=None,\n ):\n assert isinstance(\n data, pd.DataFrame\n ), f\"Type of `data` is {type(data)}, but expected {pd.DataFrame}.\"\n\n if label is not None:\n assert isinstance(\n label, (pd.DataFrame, pd.Series)\n ), f\"Type of `data` is {type(label)}, but expected {pd.DataFrame} or {pd.Series}.\"\n self.label = unwrap_partitions(label, axis=0)\n else:\n self.label = None\n\n self.data = unwrap_partitions(data, axis=0, get_ip=True)\n\n self._n_rows = data.shape[0]\n self._n_cols = data.shape[1]\n\n for i, dtype in enumerate(data.dtypes):\n if dtype == \"object\":\n raise ValueError(f\"Column {i} has unsupported data type {dtype}.\")\n\n self.feature_names = feature_names\n self.feature_types = feature_types\n\n self.missing = missing\n self.silent = silent\n self.feature_weights = feature_weights\n self.enable_categorical = enable_categorical\n\n self.metadata = (\n data.index,\n data.columns,\n data._query_compiler._modin_frame.row_lengths,\n )\n\n def __iter__(self):\n \"\"\"\n Return unwrapped `self.data` and `self.label`.\n\n Yields\n ------\n list\n List of `self.data` with pairs of references to IP of row partition\n and row partition [(IP_ref0, partition_ref0), ..].\n list\n List of `self.label` with references to row partitions\n [partition_ref0, ..].\n \"\"\"\n yield self.data\n yield self.label\n\n def get_dmatrix_params(self):\n \"\"\"\n Get dict of DMatrix parameters excluding `self.data`/`self.label`.\n\n Returns\n -------\n dict\n \"\"\"\n dmatrix_params = {\n \"feature_names\": self.feature_names,\n \"feature_types\": self.feature_types,\n \"missing\": self.missing,\n \"silent\": self.silent,\n \"feature_weights\": self.feature_weights,\n \"enable_categorical\": self.enable_categorical,\n }\n return dmatrix_params\n\n @property\n def feature_names(self):\n \"\"\"\n Get column labels.\n\n Returns\n -------\n Column labels.\n \"\"\"\n return self._feature_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_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.feature_names_3_DMatrix.feature_names_3.self._feature_names.feature_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.feature_names_3_DMatrix.feature_names_3.self._feature_names.feature_names", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 183, "span_ids": ["DMatrix.feature_names_3"], "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 DMatrix:\n\n @feature_names.setter\n def feature_names(self, feature_names):\n \"\"\"\n Set column labels.\n\n Parameters\n ----------\n feature_names : list or None\n Labels for columns. In the case of ``None``, existing feature names will be reset.\n \"\"\"\n if feature_names is not None:\n feature_names = (\n list(feature_names)\n if not isinstance(feature_names, str)\n else [feature_names]\n )\n\n if len(feature_names) != len(set(feature_names)):\n raise ValueError(\"Items in `feature_names` must be unique.\")\n if len(feature_names) != self.num_col() and self.num_col() != 0:\n raise ValueError(\n \"`feature_names` must have the same width as `self.data`.\"\n )\n if not all(\n isinstance(f, str) and not any(x in f for x in set((\"[\", \"]\", \"<\")))\n for f in feature_names\n ):\n raise ValueError(\n \"Items of `feature_names` must be string and must not contain [, ] or <.\"\n )\n else:\n feature_names = None\n self._feature_names = feature_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_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.feature_types_DMatrix.feature_types_5.self._feature_types.feature_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.feature_types_DMatrix.feature_types_5.self._feature_types.feature_types", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 218, "span_ids": ["DMatrix.feature_types_5", "DMatrix.feature_types"], "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 DMatrix:\n\n @property\n def feature_types(self):\n \"\"\"\n Get column types.\n\n Returns\n -------\n Column types.\n \"\"\"\n return self._feature_types\n\n @feature_types.setter\n def feature_types(self, feature_types):\n \"\"\"\n Set column types.\n\n Parameters\n ----------\n feature_types : list or None\n Labels for columns. In case None, existing feature names will be reset.\n \"\"\"\n if feature_types is not None:\n if not isinstance(feature_types, (list, str)):\n raise TypeError(\"feature_types must be string or list of strings\")\n if isinstance(feature_types, str):\n feature_types = [feature_types] * self.num_col()\n feature_types = (\n list(feature_types)\n if not isinstance(feature_types, str)\n else [feature_types]\n )\n else:\n feature_types = None\n self._feature_types = feature_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_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.num_row_DMatrix.get_float_info.return.getattr_self_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.num_row_DMatrix.get_float_info.return.getattr_self_name_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 220, "end_line": 253, "span_ids": ["DMatrix.num_row", "DMatrix.get_float_info", "DMatrix.num_col"], "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 DMatrix:\n\n def num_row(self):\n \"\"\"\n Get number of rows.\n\n Returns\n -------\n int\n \"\"\"\n return self._n_rows\n\n def num_col(self):\n \"\"\"\n Get number of columns.\n\n Returns\n -------\n int\n \"\"\"\n return self._n_cols\n\n def get_float_info(self, name):\n \"\"\"\n Get float property from the DMatrix.\n\n Parameters\n ----------\n name : str\n The field name of the information.\n\n Returns\n -------\n A NumPy array of float information of the data.\n \"\"\"\n return getattr(self, 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_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.set_info_DMatrix.set_info.if_feature_weights_is_not.self.feature_weights.feature_weights": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_DMatrix.set_info_DMatrix.set_info.if_feature_weights_is_not.self.feature_weights.feature_weights", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 284, "span_ids": ["DMatrix.set_info"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DMatrix:\n\n def set_info(\n self,\n *,\n label=None,\n feature_names=None,\n feature_types=None,\n feature_weights=None,\n ) -> None:\n \"\"\"\n Set meta info for DMatrix.\n\n Parameters\n ----------\n label : modin.pandas.DataFrame or modin.pandas.Series, optional\n Labels used for training.\n feature_names : list, optional\n Set names for features.\n feature_types : list, optional\n Set types for features.\n feature_weights : array_like, optional\n Set feature weights for column sampling.\n \"\"\"\n if label is not None:\n self.label = label\n if feature_names is not None:\n self.feature_names = feature_names\n if feature_types is not None:\n self.feature_types = feature_types\n if feature_weights is not None:\n self.feature_weights = feature_weights", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_Booster_Booster.__init__.super_Booster_self___in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_Booster_Booster.__init__.super_Booster_self___in", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 305, "span_ids": ["Booster.__init__", "Booster"], "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 Booster(xgb.Booster):\n \"\"\"\n A Modin Booster of XGBoost.\n\n Booster is the model of XGBoost, that contains low level routines for\n training, prediction and evaluation.\n\n Parameters\n ----------\n params : dict, optional\n Parameters for boosters.\n cache : list, default: empty\n List of cache items.\n model_file : string/os.PathLike/xgb.Booster/bytearray, optional\n Path to the model file if it's string or PathLike or xgb.Booster.\n \"\"\"\n\n def __init__(self, params=None, cache=(), model_file=None): # noqa: MD01\n super(Booster, self).__init__(params=params, cache=cache, model_file=model_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_modin-project__modin/modin/experimental/xgboost/xgboost.py_Booster.predict_Booster.predict.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_Booster.predict_Booster.predict.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 369, "span_ids": ["Booster.predict"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Booster(xgb.Booster):\n\n def predict(\n self,\n data: DMatrix,\n **kwargs,\n ):\n \"\"\"\n Run distributed prediction with a trained booster.\n\n During execution it runs ``xgb.predict`` on each worker for subset of `data`\n and creates Modin DataFrame with prediction results.\n\n Parameters\n ----------\n data : modin.experimental.xgboost.DMatrix\n Input data used for prediction.\n **kwargs : dict\n Other parameters are the same as for ``xgboost.Booster.predict``.\n\n Returns\n -------\n modin.pandas.DataFrame\n Modin DataFrame with prediction results.\n \"\"\"\n LOGGER.info(\"Prediction started\")\n\n if Engine.get() == \"Ray\":\n from .xgboost_ray import _predict\n else:\n raise ValueError(\"Current version supports only Ray engine.\")\n\n assert isinstance(\n data, DMatrix\n ), f\"Type of `data` is {type(data)}, but expected {DMatrix}.\"\n\n if (\n self.feature_names is not None\n and data.feature_names is not None\n and self.feature_names != data.feature_names\n ):\n data_missing = set(self.feature_names) - set(data.feature_names)\n self_missing = set(data.feature_names) - set(self.feature_names)\n\n msg = \"feature_names mismatch: {0} {1}\"\n\n if data_missing:\n msg += (\n \"\\nexpected \"\n + \", \".join(str(s) for s in data_missing)\n + \" in input data\"\n )\n\n if self_missing:\n msg += (\n \"\\ntraining data did not have the following fields: \"\n + \", \".join(str(s) for s in self_missing)\n )\n\n raise ValueError(msg.format(self.feature_names, data.feature_names))\n\n result = _predict(self.copy(), data, **kwargs)\n LOGGER.info(\"Prediction finished\")\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_modin-project__modin/modin/experimental/xgboost/xgboost.py_train_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost.py_train_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost.py", "file_name": "xgboost.py", "file_type": "text/x-python", "category": "implementation", "start_line": 372, "end_line": 430, "span_ids": ["train"], "tokens": 463}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def train(\n params: Dict,\n dtrain: DMatrix,\n *args,\n evals=(),\n num_actors: Optional[int] = None,\n evals_result: Optional[Dict] = None,\n **kwargs,\n):\n \"\"\"\n Run distributed training of XGBoost model.\n\n During work it evenly distributes `dtrain` between workers according\n to IP addresses partitions (in case of not even distribution of `dtrain`\n over nodes, some partitions will be re-distributed between nodes),\n runs xgb.train on each worker for subset of `dtrain` and reduces training results\n of each worker using Rabit Context.\n\n Parameters\n ----------\n params : dict\n Booster params.\n dtrain : modin.experimental.xgboost.DMatrix\n Data to be trained against.\n *args : iterable\n Other parameters for `xgboost.train`.\n evals : list of pairs (modin.experimental.xgboost.DMatrix, str), default: empty\n List of validation sets for which metrics will evaluated during training.\n Validation metrics will help us track the performance of the model.\n num_actors : int, optional\n Number of actors for training. If unspecified, this value will be\n computed automatically.\n evals_result : dict, optional\n Dict to store evaluation results in.\n **kwargs : dict\n Other parameters are the same as `xgboost.train`.\n\n Returns\n -------\n modin.experimental.xgboost.Booster\n A trained booster.\n \"\"\"\n LOGGER.info(\"Training started\")\n\n if Engine.get() == \"Ray\":\n from .xgboost_ray import _train\n else:\n raise ValueError(\"Current version supports only Ray engine.\")\n\n assert isinstance(\n dtrain, DMatrix\n ), f\"Type of `dtrain` is {type(dtrain)}, but expected {DMatrix}.\"\n result = _train(dtrain, params, *args, num_actors=num_actors, evals=evals, **kwargs)\n if isinstance(evals_result, dict):\n evals_result.update(result[\"history\"])\n\n LOGGER.info(\"Training finished\")\n return Booster(model_file=result[\"booster\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_time_ModinXGBoostActor.__init__.LOGGER_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_time_ModinXGBoostActor.__init__.LOGGER_info_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 61, "span_ids": ["ModinXGBoostActor.__init__", "ModinXGBoostActor", "docstring"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import time\nimport logging\nfrom typing import Dict, List\nimport math\nfrom collections import defaultdict\nimport warnings\n\nimport numpy as np\nimport xgboost as xgb\nimport ray\nfrom ray.util import get_node_ip_address\nimport pandas\n\nfrom modin.distributed.dataframe.pandas import from_partitions\nfrom modin.core.execution.ray.common import RayWrapper\nfrom .utils import RabitContext, RabitContextManager\n\nLOGGER = logging.getLogger(\"[modin.xgboost]\")\n\n\n@ray.remote(num_cpus=0)\nclass ModinXGBoostActor:\n \"\"\"\n Ray actor-class runs training on the remote worker.\n\n Parameters\n ----------\n rank : int\n Rank of this actor.\n nthread : int\n Number of threads used by XGBoost in this actor.\n \"\"\"\n\n def __init__(self, rank, nthread):\n self._evals = []\n self._rank = rank\n self._nthreads = nthread\n\n LOGGER.info(\n f\"Actor <{self._rank}>, nthread = {self._nthreads} was initialized.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor._get_dmatrix_ModinXGBoostActor._get_dmatrix.return.xgb_DMatrix_X_y_nthread": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor._get_dmatrix_ModinXGBoostActor._get_dmatrix.return.xgb_DMatrix_X_y_nthread", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 93, "span_ids": ["ModinXGBoostActor._get_dmatrix"], "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": "@ray.remote(num_cpus=0)\nclass ModinXGBoostActor:\n\n def _get_dmatrix(self, X_y, **dmatrix_kwargs):\n \"\"\"\n Create xgboost.DMatrix from sequence of pandas.DataFrame objects.\n\n First half of `X_y` should contains objects for `X`, second for `y`.\n\n Parameters\n ----------\n X_y : list\n List of pandas.DataFrame objects.\n **dmatrix_kwargs : dict\n Keyword parameters for ``xgb.DMatrix``.\n\n Returns\n -------\n xgb.DMatrix\n A XGBoost DMatrix.\n \"\"\"\n s = time.time()\n X = X_y[: len(X_y) // 2]\n y = X_y[len(X_y) // 2 :]\n\n assert (\n len(X) == len(y) and len(X) > 0\n ), \"X and y should have the equal length more than 0\"\n\n X = pandas.concat(X, axis=0)\n y = pandas.concat(y, axis=0)\n LOGGER.info(f\"Concat time: {time.time() - s} s\")\n\n return xgb.DMatrix(X, y, nthread=self._nthreads, **dmatrix_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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.set_train_data_ModinXGBoostActor.set_train_data.if_add_as_eval_method_is_.self__evals_append_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.set_train_data_ModinXGBoostActor.set_train_data.if_add_as_eval_method_is_.self__evals_append_self_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 113, "span_ids": ["ModinXGBoostActor.set_train_data"], "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": "@ray.remote(num_cpus=0)\nclass ModinXGBoostActor:\n\n def set_train_data(self, *X_y, add_as_eval_method=None, **dmatrix_kwargs):\n \"\"\"\n Set train data for actor.\n\n Parameters\n ----------\n *X_y : iterable\n Sequence of ray.ObjectRef objects. First half of sequence is for\n `X` data, second for `y`. When it is passed in actor, auto-materialization\n of ray.ObjectRef -> pandas.DataFrame happens.\n add_as_eval_method : str, optional\n Name of eval data. Used in case when train data also used for evaluation.\n **dmatrix_kwargs : dict\n Keyword parameters for ``xgb.DMatrix``.\n \"\"\"\n self._dtrain = self._get_dmatrix(X_y, **dmatrix_kwargs)\n\n if add_as_eval_method is not None:\n self._evals.append((self._dtrain, add_as_eval_method))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.add_eval_data_ModinXGBoostActor.add_eval_data.self__evals_append_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.add_eval_data_ModinXGBoostActor.add_eval_data.self__evals_append_self_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 130, "span_ids": ["ModinXGBoostActor.add_eval_data"], "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": "@ray.remote(num_cpus=0)\nclass ModinXGBoostActor:\n\n def add_eval_data(self, *X_y, eval_method, **dmatrix_kwargs):\n \"\"\"\n Add evaluation data for actor.\n\n Parameters\n ----------\n *X_y : iterable\n Sequence of ray.ObjectRef objects. First half of sequence is for\n `X` data, second for `y`. When it is passed in actor, auto-materialization\n of ray.ObjectRef -> pandas.DataFrame happens.\n eval_method : str\n Name of eval data.\n **dmatrix_kwargs : dict\n Keyword parameters for ``xgb.DMatrix``.\n \"\"\"\n self._evals.append((self._get_dmatrix(X_y, **dmatrix_kwargs), eval_method))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.train_ModinXGBoostActor.train.with_RabitContext_self__r.return._booster_bst_history": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_ModinXGBoostActor.train_ModinXGBoostActor.train.with_RabitContext_self__r.return._booster_bst_history", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 176, "span_ids": ["ModinXGBoostActor.train"], "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": "@ray.remote(num_cpus=0)\nclass ModinXGBoostActor:\n\n def train(self, rabit_args, params, *args, **kwargs):\n \"\"\"\n Run local XGBoost training.\n\n Connects to Rabit Tracker environment to share training data between\n actors and trains XGBoost booster using `self._dtrain`.\n\n Parameters\n ----------\n rabit_args : list\n List with environment variables for Rabit Tracker.\n params : dict\n Booster params.\n *args : iterable\n Other parameters for `xgboost.train`.\n **kwargs : dict\n Other parameters for `xgboost.train`.\n\n Returns\n -------\n dict\n A dictionary with trained booster and dict of\n evaluation results\n as {\"booster\": xgb.Booster, \"history\": dict}.\n \"\"\"\n local_params = params.copy()\n local_dtrain = self._dtrain\n local_evals = self._evals\n\n local_params[\"nthread\"] = self._nthreads\n\n evals_result = dict()\n\n s = time.time()\n with RabitContext(self._rank, rabit_args):\n bst = xgb.train(\n local_params,\n local_dtrain,\n *args,\n evals=local_evals,\n evals_result=evals_result,\n **kwargs,\n )\n LOGGER.info(f\"Local training time: {time.time() - s} s\")\n return {\"booster\": bst, \"history\": evals_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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_cluster_cpus__get_min_cpus_per_node.return.max_node_cpus_if_max_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_cluster_cpus__get_min_cpus_per_node.return.max_node_cpus_if_max_node", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 204, "span_ids": ["_get_cluster_cpus", "_get_min_cpus_per_node"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_cluster_cpus():\n \"\"\"\n Get number of CPUs available on Ray cluster.\n\n Returns\n -------\n int\n Number of CPUs available on cluster.\n \"\"\"\n return ray.cluster_resources().get(\"CPU\", 1)\n\n\ndef _get_min_cpus_per_node():\n \"\"\"\n Get min number of node CPUs available on cluster nodes.\n\n Returns\n -------\n int\n Min number of CPUs per node.\n \"\"\"\n # TODO: max_node_cpus -> min_node_cpus\n max_node_cpus = min(\n node.get(\"Resources\", {}).get(\"CPU\", 0.0) for node in ray.nodes()\n )\n return max_node_cpus if max_node_cpus > 0.0 else _get_cluster_cpus()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_cpus_per_actor__get_cpus_per_actor.return.cpus_per_actor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_cpus_per_actor__get_cpus_per_actor.return.cpus_per_actor", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 225, "span_ids": ["_get_cpus_per_actor"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_cpus_per_actor(num_actors):\n \"\"\"\n Get number of CPUs to use by each actor.\n\n Parameters\n ----------\n num_actors : int\n Number of Ray actors.\n\n Returns\n -------\n int\n Number of CPUs per actor.\n \"\"\"\n cluster_cpus = _get_cluster_cpus()\n cpus_per_actor = max(\n 1, min(int(_get_min_cpus_per_node() or 1), int(cluster_cpus // num_actors))\n )\n return cpus_per_actor", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_num_actors__get_num_actors.if_num_actors_is_None_.else_.RuntimeError_num_actors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__get_num_actors__get_num_actors.if_num_actors_is_None_.else_.RuntimeError_num_actors", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 253, "span_ids": ["_get_num_actors"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_num_actors(num_actors=None):\n \"\"\"\n Get number of actors to create.\n\n Parameters\n ----------\n num_actors : int, optional\n Desired number of actors. If is None, integer number of actors\n will be computed by condition 2 CPUs per 1 actor.\n\n Returns\n -------\n int\n Number of actors to create.\n \"\"\"\n min_cpus_per_node = _get_min_cpus_per_node()\n if num_actors is None:\n num_actors_per_node = max(1, int(min_cpus_per_node // 2))\n return num_actors_per_node * len(ray.nodes())\n elif isinstance(num_actors, int):\n assert (\n num_actors % len(ray.nodes()) == 0\n ), \"`num_actors` must be a multiple to number of nodes in Ray cluster.\"\n return num_actors\n else:\n RuntimeError(\"`num_actors` must be int or 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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_create_actors_create_actors.return.actors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py_create_actors_create_actors.return.actors", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 286, "span_ids": ["create_actors"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_actors(num_actors):\n \"\"\"\n Create ModinXGBoostActors.\n\n Parameters\n ----------\n num_actors : int\n Number of actors to create.\n\n Returns\n -------\n list\n List of pairs (ip, actor).\n \"\"\"\n num_cpus_per_actor = _get_cpus_per_actor(num_actors)\n node_ips = [\n key for key in ray.cluster_resources().keys() if key.startswith(\"node:\")\n ]\n num_actors_per_node = num_actors // len(node_ips)\n actors_ips = [ip for ip in node_ips for _ in range(num_actors_per_node)]\n\n actors = [\n (\n node_ip.split(\"node:\")[-1],\n ModinXGBoostActor.options(resources={node_ip: 0.01}).remote(\n i, nthread=num_cpus_per_actor\n ),\n )\n for i, node_ip in enumerate(actors_ips)\n ]\n return actors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__split_data_across_actors__split_data_across_actors.for_rank___actor_in_e.set_func_actor_X_parts": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__split_data_across_actors__split_data_across_actors.for_rank___actor_in_e.set_func_actor_X_parts", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 289, "end_line": 321, "span_ids": ["_split_data_across_actors"], "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 _split_data_across_actors(\n actors: List,\n set_func,\n X_parts,\n y_parts,\n):\n \"\"\"\n Split row partitions of data between actors.\n\n Parameters\n ----------\n actors : list\n List of used actors.\n set_func : callable\n The function for setting data in actor.\n X_parts : list\n Row partitions of X data.\n y_parts : list\n Row partitions of y data.\n \"\"\"\n X_parts_by_actors = _assign_row_partitions_to_actors(\n actors,\n X_parts,\n )\n\n y_parts_by_actors = _assign_row_partitions_to_actors(\n actors,\n y_parts,\n data_for_aligning=X_parts_by_actors,\n )\n\n for rank, (_, actor) in enumerate(actors):\n set_func(actor, *(X_parts_by_actors[rank][0] + y_parts_by_actors[rank][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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__assign_row_partitions_to_actors__assign_row_partitions_to_actors.num_actors.len_actors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__assign_row_partitions_to_actors__assign_row_partitions_to_actors.num_actors.len_actors_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 324, "end_line": 352, "span_ids": ["_assign_row_partitions_to_actors"], "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 _assign_row_partitions_to_actors(\n actors: List,\n row_partitions,\n data_for_aligning=None,\n):\n \"\"\"\n Assign row_partitions to actors.\n\n `row_partitions` will be assigned to actors according to their IPs.\n If distribution isn't even, partitions will be moved from actor\n with excess partitions to actor with lack of them.\n\n Parameters\n ----------\n actors : list\n List of used actors.\n row_partitions : list\n Row partitions of data to assign.\n data_for_aligning : dict, optional\n Data according to the order of which should be\n distributed `row_partitions`. Used to align y with X.\n\n Returns\n -------\n dict\n Dictionary of assigned to actors partitions\n as {actor_rank: (partitions, order)}.\n \"\"\"\n num_actors = len(actors)\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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__assign_row_partitions_to_actors.if_data_for_aligning_is_N__assign_row_partitions_to_actors.return.row_parts_by_ranks": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__assign_row_partitions_to_actors.if_data_for_aligning_is_N__assign_row_partitions_to_actors.return.row_parts_by_ranks", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 353, "end_line": 454, "span_ids": ["_assign_row_partitions_to_actors"], "tokens": 922}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _assign_row_partitions_to_actors(\n actors: List,\n row_partitions,\n data_for_aligning=None,\n):\n # ... other code\n if data_for_aligning is None:\n parts_ips_ref, parts_ref = zip(*row_partitions)\n\n # Group actors which are one the same ip\n actor_ips = defaultdict(list)\n for rank, (ip, _) in enumerate(actors):\n actor_ips[ip].append(rank)\n\n # Get distribution of parts between nodes ({ip:[(part, position),..],..})\n init_parts_distribution = defaultdict(list)\n for idx, (ip, part_ref) in enumerate(\n zip(RayWrapper.materialize(list(parts_ips_ref)), parts_ref)\n ):\n init_parts_distribution[ip].append((part_ref, idx))\n\n num_parts = len(parts_ref)\n min_parts_per_actor = math.floor(num_parts / num_actors)\n max_parts_per_actor = math.ceil(num_parts / num_actors)\n num_actors_with_max_parts = num_parts % num_actors\n\n row_partitions_by_actors = defaultdict(list)\n # Fill actors without movement parts between ips\n for actor_ip, ranks in actor_ips.items():\n # Loop across actors which are placed on actor_ip\n for rank in ranks:\n num_parts_on_ip = len(init_parts_distribution[actor_ip])\n\n # Check that have something to distribute on this ip\n if num_parts_on_ip == 0:\n break\n # Check that node with `actor_ip` has enough parts for minimal\n # filling actor with `rank`\n if num_parts_on_ip >= min_parts_per_actor:\n # Check that node has enough parts for max filling\n # actor with `rank`\n if (\n num_parts_on_ip >= max_parts_per_actor\n and num_actors_with_max_parts > 0\n ):\n pop_slice = slice(0, max_parts_per_actor)\n num_actors_with_max_parts -= 1\n else:\n pop_slice = slice(0, min_parts_per_actor)\n\n row_partitions_by_actors[rank].extend(\n init_parts_distribution[actor_ip][pop_slice]\n )\n # Delete parts which we already assign\n del init_parts_distribution[actor_ip][pop_slice]\n else:\n row_partitions_by_actors[rank].extend(\n init_parts_distribution[actor_ip]\n )\n init_parts_distribution[actor_ip] = []\n\n # Remove empty IPs\n for ip in list(init_parts_distribution):\n if len(init_parts_distribution[ip]) == 0:\n init_parts_distribution.pop(ip)\n\n # IP's aren't necessary now\n init_parts_distribution = [\n pair for pairs in init_parts_distribution.values() for pair in pairs\n ]\n\n # Fill the actors with extra parts (movements data between nodes)\n for rank in range(len(actors)):\n num_parts_on_rank = len(row_partitions_by_actors[rank])\n\n if num_parts_on_rank == max_parts_per_actor or (\n num_parts_on_rank == min_parts_per_actor\n and num_actors_with_max_parts == 0\n ):\n continue\n\n if num_actors_with_max_parts > 0:\n pop_slice = slice(0, max_parts_per_actor - num_parts_on_rank)\n num_actors_with_max_parts -= 1\n else:\n pop_slice = slice(0, min_parts_per_actor - num_parts_on_rank)\n\n row_partitions_by_actors[rank].extend(init_parts_distribution[pop_slice])\n del init_parts_distribution[pop_slice]\n\n if len(init_parts_distribution) != 0:\n raise RuntimeError(\n f\"Not all partitions were ditributed between actors: {len(init_parts_distribution)} left.\"\n )\n\n row_parts_by_ranks = dict()\n for rank, pairs_part_pos in dict(row_partitions_by_actors).items():\n parts, order = zip(*pairs_part_pos)\n row_parts_by_ranks[rank] = (list(parts), list(order))\n else:\n row_parts_by_ranks = {rank: ([], []) for rank in range(len(actors))}\n\n for rank, (_, order_of_indexes) in data_for_aligning.items():\n row_parts_by_ranks[rank][1].extend(order_of_indexes)\n for row_idx in order_of_indexes:\n row_parts_by_ranks[rank][0].append(row_partitions[row_idx])\n\n return row_parts_by_ranks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__train__train.s_5.time_time_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__train__train.s_5.time_time_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 554, "span_ids": ["_train"], "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": "def _train(\n dtrain,\n params: Dict,\n *args,\n num_actors=None,\n evals=(),\n **kwargs,\n):\n \"\"\"\n Run distributed training of XGBoost model on Ray engine.\n\n During work it evenly distributes `dtrain` between workers according\n to IP addresses partitions (in case of not even distribution of `dtrain`\n by nodes, part of partitions will be re-distributed between nodes),\n runs xgb.train on each worker for subset of `dtrain` and reduces training results\n of each worker using Rabit Context.\n\n Parameters\n ----------\n dtrain : modin.experimental.DMatrix\n Data to be trained against.\n params : dict\n Booster params.\n *args : iterable\n Other parameters for `xgboost.train`.\n num_actors : int, optional\n Number of actors for training. If unspecified, this value will be\n computed automatically.\n evals : list of pairs (modin.experimental.xgboost.DMatrix, str), default: empty\n List of validation sets for which metrics will be evaluated during training.\n Validation metrics will help us track the performance of the model.\n **kwargs : dict\n Other parameters are the same as `xgboost.train`.\n\n Returns\n -------\n dict\n A dictionary with trained booster and dict of\n evaluation results\n as {\"booster\": xgboost.Booster, \"history\": dict}.\n \"\"\"\n s = time.time()\n\n X_row_parts, y_row_parts = dtrain\n dmatrix_kwargs = dtrain.get_dmatrix_params()\n\n assert len(X_row_parts) == len(y_row_parts), \"Unaligned train data\"\n\n num_actors = _get_num_actors(num_actors)\n\n if num_actors > len(X_row_parts):\n num_actors = len(X_row_parts)\n\n if evals:\n min_num_parts = num_actors\n for (eval_X, _), eval_method in evals:\n if len(eval_X) < min_num_parts:\n min_num_parts = len(eval_X)\n method_name = eval_method\n\n if num_actors != min_num_parts:\n num_actors = min_num_parts\n warnings.warn(\n f\"`num_actors` is set to {num_actors}, because `evals` data with name `{method_name}` has only {num_actors} partition(s).\"\n )\n\n actors = create_actors(num_actors)\n\n add_as_eval_method = None\n if evals:\n for eval_data, method in evals[:]:\n if eval_data is dtrain:\n add_as_eval_method = method\n evals.remove((eval_data, method))\n\n for (eval_X, eval_y), eval_method in evals:\n # Split data across workers\n _split_data_across_actors(\n actors,\n lambda actor, *X_y: actor.add_eval_data.remote(\n *X_y, eval_method=eval_method, **dmatrix_kwargs\n ),\n eval_X,\n eval_y,\n )\n\n # Split data across workers\n _split_data_across_actors(\n actors,\n lambda actor, *X_y: actor.set_train_data.remote(\n *X_y, add_as_eval_method=add_as_eval_method, **dmatrix_kwargs\n ),\n X_row_parts,\n y_row_parts,\n )\n LOGGER.info(f\"Data preparation time: {time.time() - s} s\")\n\n s = time.time()\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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__train.with_RabitContextManager___train.with_RabitContextManager_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__train.with_RabitContextManager___train.with_RabitContextManager_.return.result", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 555, "end_line": 567, "span_ids": ["_train"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _train(\n dtrain,\n params: Dict,\n *args,\n num_actors=None,\n evals=(),\n **kwargs,\n):\n # ... other code\n with RabitContextManager(len(actors), get_node_ip_address()) as env:\n rabit_args = [(\"%s=%s\" % item).encode() for item in env.items()]\n\n # Train\n fut = [\n actor.train.remote(rabit_args, params, *args, **kwargs)\n for _, actor in actors\n ]\n # All results should be the same because of Rabit tracking. So we just\n # return the first one.\n result = RayWrapper.materialize(fut[0])\n LOGGER.info(f\"Training time: {time.time() - s} s\")\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_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__map_predict__map_predict.return.prediction": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__map_predict__map_predict.return.prediction", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 599, "span_ids": ["_map_predict"], "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": "@ray.remote\ndef _map_predict(booster, part, columns, dmatrix_kwargs={}, **kwargs):\n \"\"\"\n Run prediction on a remote worker.\n\n Parameters\n ----------\n booster : xgboost.Booster or ray.ObjectRef\n A trained booster.\n part : pandas.DataFrame or ray.ObjectRef\n Partition of full data used for local prediction.\n columns : list or ray.ObjectRef\n Columns for the result.\n dmatrix_kwargs : dict, optional\n Keyword parameters for ``xgb.DMatrix``.\n **kwargs : dict\n Other parameters are the same as for ``xgboost.Booster.predict``.\n\n Returns\n -------\n ray.ObjectRef\n ``ray.ObjectRef`` with partial prediction.\n \"\"\"\n dmatrix = xgb.DMatrix(part, **dmatrix_kwargs)\n prediction = pandas.DataFrame(\n booster.predict(dmatrix, **kwargs),\n index=part.index,\n columns=columns,\n )\n return prediction", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__predict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/xgboost/xgboost_ray.py__predict_", "embedding": null, "metadata": {"file_path": "modin/experimental/xgboost/xgboost_ray.py", "file_name": "xgboost_ray.py", "file_type": "text/x-python", "category": "implementation", "start_line": 602, "end_line": 666, "span_ids": ["_predict"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _predict(\n booster,\n data,\n **kwargs,\n):\n \"\"\"\n Run distributed prediction with a trained booster on Ray engine.\n\n During execution it runs ``xgb.predict`` on each worker for subset of `data`\n and creates Modin DataFrame with prediction results.\n\n Parameters\n ----------\n booster : xgboost.Booster\n A trained booster.\n data : modin.experimental.xgboost.DMatrix\n Input data used for prediction.\n **kwargs : dict\n Other parameters are the same as for ``xgboost.Booster.predict``.\n\n Returns\n -------\n modin.pandas.DataFrame\n Modin DataFrame with prediction results.\n \"\"\"\n s = time.time()\n dmatrix_kwargs = data.get_dmatrix_params()\n\n # Get metadata from DMatrix\n input_index, input_columns, row_lengths = data.metadata\n\n # Infer columns of result\n def _get_num_columns(booster, n_features, **kwargs):\n rng = np.random.RandomState(777)\n test_data = rng.randn(1, n_features)\n test_predictions = booster.predict(\n xgb.DMatrix(test_data), validate_features=False, **kwargs\n )\n num_columns = (\n test_predictions.shape[1] if len(test_predictions.shape) > 1 else 1\n )\n return num_columns\n\n result_num_columns = _get_num_columns(booster, len(input_columns), **kwargs)\n new_columns = list(range(result_num_columns))\n\n # Put common data in object store\n booster = RayWrapper.put(booster)\n new_columns_ref = RayWrapper.put(new_columns)\n\n prediction_refs = [\n _map_predict.remote(booster, part, new_columns_ref, dmatrix_kwargs, **kwargs)\n for _, part in data.data\n ]\n predictions = from_partitions(\n prediction_refs,\n 0,\n index=input_index,\n columns=new_columns,\n row_lengths=row_lengths,\n column_widths=[len(new_columns)],\n )\n LOGGER.info(f\"Prediction time: {time.time() - s} s\")\n return predictions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/__init__.py_ClassLogger_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/__init__.py_ClassLogger_", "embedding": null, "metadata": {"file_path": "modin/logging/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 24, "span_ids": ["docstring"], "tokens": 70}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .class_logger import ClassLogger # noqa: F401\nfrom .config import get_logger # noqa: F401\nfrom .logger_decorator import enable_logging, disable_logging # noqa: F401\n\n__all__ = [\n \"ClassLogger\",\n \"get_logger\",\n \"enable_logging\",\n \"disable_logging\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/class_logger.py_from_typing_import_Dict__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/class_logger.py_from_typing_import_Dict__", "embedding": null, "metadata": {"file_path": "modin/logging/class_logger.py", "file_name": "class_logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 62, "span_ids": ["ClassLogger", "ClassLogger.__init_subclass__", "docstring"], "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 typing import Dict, Optional\n\nfrom .logger_decorator import enable_logging\n\n\nclass ClassLogger:\n \"\"\"\n Ensure all subclasses of the class being inherited are logged, too.\n\n Notes\n -----\n This mixin must go first in class bases declaration to have the desired effect.\n \"\"\"\n\n _modin_logging_layer = \"PANDAS-API\"\n\n @classmethod\n def __init_subclass__(\n cls,\n modin_layer: Optional[str] = None,\n class_name: Optional[str] = None,\n log_level: str = \"info\",\n **kwargs: Dict,\n ) -> None:\n \"\"\"\n Apply logging decorator to all children of ``ClassLogger``.\n\n Parameters\n ----------\n modin_layer : str, default: \"PANDAS-API\"\n Specified by the logger (e.g. PANDAS-API).\n class_name : str, optional\n The name of the class the decorator is being applied to.\n Composed from the decorated class name if not specified.\n log_level : str, default: \"info\"\n The log level (INFO, DEBUG, WARNING, etc.).\n **kwargs : dict\n \"\"\"\n modin_layer = modin_layer or cls._modin_logging_layer\n super().__init_subclass__(**kwargs)\n enable_logging(modin_layer, class_name, log_level)(cls)\n cls._modin_logging_layer = modin_layer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_logging_ModinFormatter.formatTime.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_logging_ModinFormatter.formatTime.return.s", "embedding": null, "metadata": {"file_path": "modin/logging/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 69, "span_ids": ["ModinFormatter.formatTime", "ModinFormatter", "docstring"], "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 logging\nfrom logging.handlers import RotatingFileHandler\nimport datetime as dt\nimport os\nimport uuid\nimport platform\nimport psutil\nimport pandas\nimport threading\nimport time\nfrom typing import Optional\n\nimport modin\nfrom modin.config import LogMemoryInterval, LogFileSize, LogMode\n\n__LOGGER_CONFIGURED__: bool = False\n\n\nclass ModinFormatter(logging.Formatter): # noqa: PR01\n \"\"\"Implement custom formatter to log at microsecond granularity.\"\"\"\n\n def formatTime(\n self, record: logging.LogRecord, datefmt: Optional[str] = None\n ) -> str:\n \"\"\"\n Return the creation time of the specified LogRecord as formatted text.\n\n This custom logging formatter inherits from the logging module and\n records timestamps at the microsecond level of granularity.\n\n Parameters\n ----------\n record : LogRecord\n The specified LogRecord object.\n datefmt : str, default: None\n Used with time.ststrftime() to format time record.\n\n Returns\n -------\n str\n Datetime string containing microsecond timestamp.\n \"\"\"\n ct = dt.datetime.fromtimestamp(record.created)\n if datefmt:\n s = ct.strftime(datefmt)\n else:\n # Format datetime object ct to microseconds\n t = ct.strftime(\"%Y-%m-%d %H:%M:%S\")\n s = f\"{t},{record.msecs:03}\"\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_bytes_int_to_str_bytes_int_to_str.return.f_n_bytes_1000_2f_P_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_bytes_int_to_str_bytes_int_to_str.return.f_n_bytes_1000_2f_P_s", "embedding": null, "metadata": {"file_path": "modin/logging/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 95, "span_ids": ["bytes_int_to_str"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bytes_int_to_str(num_bytes: int, suffix: str = \"B\") -> str:\n \"\"\"\n Scale bytes to its human-readable format (e.g: 1253656678 => '1.17GB').\n\n Parameters\n ----------\n num_bytes : int\n Number of bytes.\n suffix : str, default: \"B\"\n Suffix to add to conversion of num_bytes.\n\n Returns\n -------\n str\n Human-readable string format.\n \"\"\"\n factor = 1000\n # Convert n_bytes to float b/c we divide it by factor\n n_bytes: float = num_bytes\n for unit in [\"\", \"K\", \"M\", \"G\", \"T\", \"P\"]:\n if n_bytes < factor:\n return f\"{n_bytes:.2f}{unit}{suffix}\"\n n_bytes /= factor\n return f\"{n_bytes * 1000:.2f}P{suffix}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py__create_logger__create_logger.return.logger": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py__create_logger__create_logger.return.logger", "embedding": null, "metadata": {"file_path": "modin/logging/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 138, "span_ids": ["_create_logger"], "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": "def _create_logger(\n namespace: str, job_id: str, log_name: str, log_level: int\n) -> logging.Logger:\n \"\"\"\n Create and configure logger as Modin expects it to be.\n\n Parameters\n ----------\n namespace : str\n Logging namespace to use, e.g. \"modin.logger.default\".\n job_id : str\n Part of path to where logs are stored.\n log_name : str\n Name of the log file to create.\n log_level : int\n Log level as accepted by `Logger.setLevel()`.\n\n Returns\n -------\n Logger\n Logger object configured per Modin settings.\n \"\"\"\n log_filename = f\".modin/logs/job_{job_id}/{log_name}.log\"\n os.makedirs(os.path.dirname(log_filename), exist_ok=True)\n\n logger = logging.getLogger(namespace)\n logfile = RotatingFileHandler(\n filename=log_filename,\n mode=\"a\",\n maxBytes=LogFileSize.get() * int(1e6),\n backupCount=10,\n )\n formatter = ModinFormatter(\n fmt=\"%(process)d, %(thread)d, %(asctime)s, %(message)s\",\n datefmt=\"%Y-%m-%d,%H:%M:%S.%f\",\n )\n logfile.setFormatter(formatter)\n logger.addHandler(logfile)\n logger.setLevel(log_level)\n\n return logger", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_configure_logging_configure_logging.__LOGGER_CONFIGURED__.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_configure_logging_configure_logging.__LOGGER_CONFIGURED__.True", "embedding": null, "metadata": {"file_path": "modin/logging/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 180, "span_ids": ["configure_logging"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def configure_logging() -> None:\n \"\"\"Configure Modin logging by setting up directory structure and formatting.\"\"\"\n global __LOGGER_CONFIGURED__\n current_timestamp = dt.datetime.now().strftime(\"%Y.%m.%d_%H-%M-%S\")\n job_id = f\"{current_timestamp}_{uuid.uuid4().hex}\"\n\n logger = _create_logger(\n \"modin.logger.default\",\n job_id,\n \"trace\",\n logging.INFO if LogMode.get() == \"enable_api_only\" else logging.DEBUG,\n )\n\n logger.info(f\"OS Version: {platform.platform()}\")\n logger.info(f\"Python Version: {platform.python_version()}\")\n num_physical_cores = str(psutil.cpu_count(logical=False))\n num_total_cores = str(psutil.cpu_count(logical=True))\n logger.info(f\"Modin Version: {modin.__version__}\")\n logger.info(f\"Pandas Version: {pandas.__version__}\")\n logger.info(f\"Physical Cores: {num_physical_cores}\")\n logger.info(f\"Total Cores: {num_total_cores}\")\n\n if LogMode.get() != \"enable_api_only\":\n mem_sleep = LogMemoryInterval.get()\n mem_logger = _create_logger(\n \"modin_memory.logger\", job_id, \"memory\", logging.DEBUG\n )\n\n svmem = psutil.virtual_memory()\n mem_logger.info(f\"Memory Total: {bytes_int_to_str(svmem.total)}\")\n mem_logger.info(f\"Memory Available: {bytes_int_to_str(svmem.available)}\")\n mem_logger.info(f\"Memory Used: {bytes_int_to_str(svmem.used)}\")\n mem = threading.Thread(\n target=memory_thread, args=[mem_logger, mem_sleep], daemon=True\n )\n mem.start()\n\n _create_logger(\"modin.logger.errors\", job_id, \"error\", logging.INFO)\n\n __LOGGER_CONFIGURED__ = 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_modin-project__modin/modin/logging/config.py_memory_thread_memory_thread.while_True_.time_sleep_sleep_time_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_memory_thread_memory_thread.while_True_.time_sleep_sleep_time_", "embedding": null, "metadata": {"file_path": "modin/logging/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 199, "span_ids": ["memory_thread"], "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 memory_thread(logger: logging.Logger, sleep_time: int) -> None:\n \"\"\"\n Configure Modin logging system memory profiling thread.\n\n Parameters\n ----------\n logger : logging.Logger\n The logger object.\n sleep_time : int\n The interval at which to profile system memory.\n \"\"\"\n while True:\n rss_mem = bytes_int_to_str(psutil.Process().memory_info().rss)\n svmem = psutil.virtual_memory()\n logger.info(f\"Memory Percentage: {svmem.percent}%\")\n logger.info(f\"RSS Memory: {rss_mem}\")\n time.sleep(sleep_time)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_get_logger_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/config.py_get_logger_", "embedding": null, "metadata": {"file_path": "modin/logging/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 219, "span_ids": ["get_logger"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_logger(namespace: str = \"modin.logger.default\") -> logging.Logger:\n \"\"\"\n Configure Modin logger based on Modin config and returns the logger.\n\n Parameters\n ----------\n namespace : str, default: \"modin.logger.default\"\n Which namespace to use for logging.\n\n Returns\n -------\n logging.Logger\n The Modin logger.\n \"\"\"\n if not __LOGGER_CONFIGURED__ and LogMode.get() != \"disable\":\n configure_logging()\n return logging.getLogger(namespace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_from_typing_import_Any_O_disable_logging.return.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_from_typing_import_Any_O_disable_logging.return.func", "embedding": null, "metadata": {"file_path": "modin/logging/logger_decorator.py", "file_name": "logger_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 46, "span_ids": ["disable_logging", "docstring"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Any, Optional, Callable, Dict, Union, Type, Tuple\nfrom types import FunctionType, MethodType\nfrom functools import wraps\nfrom logging import Logger\n\nfrom modin.config import LogMode\nfrom .config import get_logger\n\n_MODIN_LOGGER_NOWRAP = \"__modin_logging_nowrap__\"\n\n\ndef disable_logging(func: Callable) -> Callable:\n \"\"\"\n Disable logging of one particular function. Useful for decorated classes.\n\n Parameters\n ----------\n func : callable\n A method in a logger-decorated class for which logging should be disabled.\n\n Returns\n -------\n func\n A function with logging disabled.\n \"\"\"\n setattr(func, _MODIN_LOGGER_NOWRAP, True)\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_modin-project__modin/modin/logging/logger_decorator.py_enable_logging_enable_logging.assert_hasattr_Logger_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_enable_logging_enable_logging.assert_hasattr_Logger_lo", "embedding": null, "metadata": {"file_path": "modin/logging/logger_decorator.py", "file_name": "logger_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 80, "span_ids": ["enable_logging"], "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 enable_logging(\n modin_layer: Union[str, Callable, Type] = \"PANDAS-API\",\n name: Optional[str] = None,\n log_level: str = \"info\",\n) -> Callable:\n \"\"\"\n Log Decorator used on specific Modin functions or classes.\n\n Parameters\n ----------\n modin_layer : str or object to decorate, default: \"PANDAS-API\"\n Specified by the logger (e.g. PANDAS-API).\n If it's an object to decorate, call logger_decorator() on it with default arguments.\n name : str, optional\n The name of the object the decorator is being applied to.\n Composed from the decorated object name if not specified.\n log_level : str, default: \"info\"\n The log level (INFO, DEBUG, WARNING, etc.).\n\n Returns\n -------\n func\n A decorator function.\n \"\"\"\n if not isinstance(modin_layer, str):\n # assume the decorator is used in a form without parenthesis like:\n # @enable_logging\n # def func()\n return enable_logging()(modin_layer)\n\n log_level = log_level.lower()\n assert hasattr(Logger, log_level.lower()), f\"Invalid log level: {log_level}\"\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_modin-project__modin/modin/logging/logger_decorator.py_enable_logging.decorator_enable_logging.decorator.stop_line.f_STOP_modin_layer_uppe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_enable_logging.decorator_enable_logging.decorator.stop_line.f_STOP_modin_layer_uppe", "embedding": null, "metadata": {"file_path": "modin/logging/logger_decorator.py", "file_name": "logger_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 109, "span_ids": ["enable_logging"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def enable_logging(\n modin_layer: Union[str, Callable, Type] = \"PANDAS-API\",\n name: Optional[str] = None,\n log_level: str = \"info\",\n) -> Callable:\n # ... other code\n\n def decorator(obj: Any) -> Any:\n \"\"\"Decorate function or class to add logs to Modin API function(s).\"\"\"\n if isinstance(obj, type):\n seen: Dict[Any, Any] = {}\n for attr_name, attr_value in vars(obj).items():\n if isinstance(\n attr_value, (FunctionType, MethodType, classmethod, staticmethod)\n ) and not hasattr(attr_value, _MODIN_LOGGER_NOWRAP):\n try:\n wrapped = seen[attr_value]\n except KeyError:\n wrapped = seen[attr_value] = enable_logging(\n modin_layer,\n f\"{name or obj.__name__}.{attr_name}\",\n log_level,\n )(attr_value)\n\n setattr(obj, attr_name, wrapped)\n return obj\n elif isinstance(obj, classmethod):\n return classmethod(decorator(obj.__func__))\n elif isinstance(obj, staticmethod):\n return staticmethod(decorator(obj.__func__))\n\n assert isinstance(modin_layer, str), \"modin_layer is somehow not a string!\"\n\n start_line = f\"START::{modin_layer.upper()}::{name or obj.__name__}\"\n stop_line = f\"STOP::{modin_layer.upper()}::{name or obj.__name__}\"\n # ... other code\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_modin-project__modin/modin/logging/logger_decorator.py_enable_logging.decorator.run_and_log_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/logging/logger_decorator.py_enable_logging.decorator.run_and_log_", "embedding": null, "metadata": {"file_path": "modin/logging/logger_decorator.py", "file_name": "logger_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 155, "span_ids": ["enable_logging"], "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": "def enable_logging(\n modin_layer: Union[str, Callable, Type] = \"PANDAS-API\",\n name: Optional[str] = None,\n log_level: str = \"info\",\n) -> Callable:\n\n def decorator(obj: Any) -> Any:\n # ... other code\n\n @wraps(obj)\n def run_and_log(*args: Tuple, **kwargs: Dict) -> Any:\n \"\"\"\n Compute function with logging if Modin logging is enabled.\n\n Parameters\n ----------\n *args : tuple\n The function arguments.\n **kwargs : dict\n The function keyword arguments.\n\n Returns\n -------\n Any\n \"\"\"\n if LogMode.get() == \"disable\":\n return obj(*args, **kwargs)\n\n logger = get_logger()\n logger_level = getattr(logger, log_level)\n logger_level(start_line)\n try:\n result = obj(*args, **kwargs)\n except BaseException as e:\n # Only log the exception if a deeper layer of the modin stack has not\n # already logged it.\n if not hasattr(e, \"_modin_logged\"):\n # use stack_info=True so that even if we are a few layers deep in\n # modin, we log a stack trace that includes calls to higher layers\n # of modin\n get_logger(\"modin.logger.errors\").exception(\n stop_line, stack_info=True\n )\n e._modin_logged = True # type: ignore[attr-defined]\n raise\n finally:\n logger_level(stop_line)\n return result\n\n # make sure we won't decorate multiple times\n return disable_logging(run_and_log)\n\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/__init__.py_array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/__init__.py_array_", "embedding": null, "metadata": {"file_path": "modin/numpy/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 200, "span_ids": ["where", "impl", "docstring"], "tokens": 743}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .arr import array\n\nfrom .array_creation import (\n zeros_like,\n ones_like,\n tri,\n)\n\nfrom .array_shaping import (\n ravel,\n shape,\n transpose,\n hstack,\n split,\n append,\n)\n\nfrom .logic import (\n all,\n any,\n isfinite,\n isinf,\n isnan,\n isnat,\n isneginf,\n isposinf,\n iscomplex,\n isreal,\n isscalar,\n logical_not,\n logical_and,\n logical_or,\n logical_xor,\n greater,\n greater_equal,\n less,\n less_equal,\n equal,\n not_equal,\n)\n\nfrom .math import (\n absolute,\n abs,\n add,\n divide,\n dot,\n float_power,\n floor_divide,\n power,\n prod,\n multiply,\n remainder,\n mod,\n subtract,\n sum,\n true_divide,\n mean,\n maximum,\n amax,\n max,\n minimum,\n amin,\n min,\n sqrt,\n exp,\n argmax,\n argmin,\n var,\n)\n\nfrom .trigonometry import (\n tanh,\n)\n\nfrom .constants import (\n Inf,\n Infinity,\n NAN,\n NINF,\n NZERO,\n NaN,\n PINF,\n PZERO,\n e,\n euler_gamma,\n inf,\n infty,\n nan,\n newaxis,\n pi,\n)\n\nfrom . import linalg\n\n\ndef where(condition, x=None, y=None):\n if condition is True:\n return x\n if condition is False:\n return y\n if hasattr(condition, \"where\"):\n return condition.where(x=x, y=y)\n raise NotImplementedError(\n f\"np.where for condition of type {type(condition)} is not yet supported in Modin.\"\n )\n\n\n__all__ = [ # noqa: F405\n \"linalg\",\n \"array\",\n \"zeros_like\",\n \"ones_like\",\n \"ravel\",\n \"shape\",\n \"transpose\",\n \"all\",\n \"any\",\n \"isfinite\",\n \"isinf\",\n \"isnan\",\n \"isnat\",\n \"isneginf\",\n \"isposinf\",\n \"iscomplex\",\n \"isreal\",\n \"isscalar\",\n \"logical_not\",\n \"logical_and\",\n \"logical_or\",\n \"logical_xor\",\n \"greater\",\n \"greater_equal\",\n \"less\",\n \"less_equal\",\n \"equal\",\n \"not_equal\",\n \"absolute\",\n \"abs\",\n \"add\",\n \"divide\",\n \"dot\",\n \"float_power\",\n \"floor_divide\",\n \"power\",\n \"prod\",\n \"multiply\",\n \"remainder\",\n \"mod\",\n \"subtract\",\n \"sum\",\n \"true_divide\",\n \"mean\",\n \"maximum\",\n \"amax\",\n \"max\",\n \"minimum\",\n \"amin\",\n \"min\",\n \"where\",\n \"Inf\",\n \"Infinity\",\n \"NAN\",\n \"NINF\",\n \"NZERO\",\n \"NaN\",\n \"PINF\",\n \"PZERO\",\n \"e\",\n \"euler_gamma\",\n \"inf\",\n \"infty\",\n \"nan\",\n \"newaxis\",\n \"pi\",\n \"sqrt\",\n \"tanh\",\n \"exp\",\n \"argmax\",\n \"argmin\",\n \"var\",\n \"split\",\n \"hstack\",\n \"append\",\n \"tri\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_from_math_import_prod_check_kwargs.if_not_.raise_TypeError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_from_math_import_prod_check_kwargs.if_not_.raise_TypeError_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 60, "span_ids": ["check_kwargs", "docstring"], "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": "from math import prod\nimport numpy\nimport pandas\nfrom pandas.core.dtypes.common import is_list_like, is_numeric_dtype, is_bool_dtype\nfrom pandas.api.types import is_scalar\nfrom inspect import signature\n\nimport modin.pandas as pd\nfrom modin.error_message import ErrorMessage\nfrom modin.core.dataframe.algebra import (\n Map,\n Reduce,\n Binary,\n)\n\nfrom .utils import try_convert_from_interoperable_type\n\n\ndef check_kwargs(order=\"C\", subok=True, keepdims=None, casting=\"same_kind\", where=True):\n if order not in [\"K\", \"C\"]:\n ErrorMessage.single_warning(\n \"Array order besides 'C' is not currently supported in Modin. Defaulting to 'C' order.\"\n )\n if not subok:\n ErrorMessage.single_warning(\n \"Subclassing types is not currently supported in Modin. Defaulting to the same base dtype.\"\n )\n if keepdims:\n ErrorMessage.single_warning(\n \"Modin does not yet support broadcasting between nested 1D arrays and 2D arrays.\"\n )\n if casting != \"same_kind\":\n ErrorMessage.single_warning(\n \"Modin does not yet support the `casting` argument.\"\n )\n if not (\n is_scalar(where) or (isinstance(where, array) and is_bool_dtype(where.dtype))\n ):\n if not isinstance(where, array):\n raise NotImplementedError(\n f\"Modin only supports scalar or modin.numpy.array `where` parameter, not `where` parameter of type {type(where)}\"\n )\n raise TypeError(\n f\"Cannot cast array data from {where.dtype} to dtype('bool') according to the rule 'safe'\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_check_can_broadcast_to_output_check_can_broadcast_to_output.if_not_broadcast_ok_.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_check_can_broadcast_to_output_check_can_broadcast_to_output.if_not_broadcast_ok_.raise_ValueError_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 109, "span_ids": ["check_can_broadcast_to_output"], "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": "def check_can_broadcast_to_output(arr_in: \"array\", arr_out: \"array\"):\n if not isinstance(arr_out, array):\n raise TypeError(\"return arrays must be of modin.numpy.array type.\")\n # Broadcasting is ok if both arrays have matching ndim + shape, OR\n # arr_in is 1xN or a 1D N-element array and arr_out is MxN.\n # Note that 1xN arr_in cannot be broadcasted into a 1D N-element arr_out.\n #\n # This is slightly different from the rules for checking if two inputs\n # of a binary operation can be broadcasted together.\n broadcast_ok = (\n (\n # Case 1: arrays have matching ndim + shape\n # Case 2a: arr_in is 1D N-element, arr_out is 1D N-element (covered here)\n arr_in._ndim == arr_out._ndim\n and arr_in.shape == arr_out.shape\n )\n or (\n # Case 2b: both arrays are 2D, arr_in is 1xN and arr_out is MxN\n arr_in._ndim == 2\n and arr_out._ndim == 2\n and arr_in.shape[0] == 1\n and arr_in.shape[1] == arr_out.shape[1]\n )\n or (\n # Case 2c: arr_in is 1D N-element, arr_out is MxN\n arr_in._ndim == 1\n and arr_out._ndim == 2\n and arr_in.shape[0] == arr_out.shape[1]\n and arr_out.shape[0] == 1\n )\n )\n # Case 2b would require duplicating the 1xN result M times to match the shape of out,\n # which we currently do not support. See GH#5831.\n if (\n arr_in._ndim == 2\n and arr_out._ndim == 2\n and arr_in.shape[0] == 1\n and arr_in.shape[1] == arr_out.shape[1]\n and arr_in.shape[0] != 1\n ):\n raise NotImplementedError(\n f\"Modin does not currently support broadcasting shape {arr_in.shape} to output operand with shape {arr_out.shape}\"\n )\n if not broadcast_ok:\n raise ValueError(\n f\"non-broadcastable output operand with shape {arr_out.shape} doesn't match the broadcast shape {arr_in.shape}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_fix_dtypes_and_determine_return_fix_dtypes_and_determine_return.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_fix_dtypes_and_determine_return_fix_dtypes_and_determine_return.return.result", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 141, "span_ids": ["fix_dtypes_and_determine_return"], "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 fix_dtypes_and_determine_return(\n query_compiler_in, _ndim, dtype=None, out=None, where=True\n):\n if dtype is not None:\n query_compiler_in = query_compiler_in.astype(\n {col_name: dtype for col_name in query_compiler_in.columns}\n )\n result = array(_query_compiler=query_compiler_in, _ndim=_ndim)\n if out is not None:\n out = try_convert_from_interoperable_type(out, copy=False)\n check_can_broadcast_to_output(result, out)\n result._query_compiler = result._query_compiler.astype(\n {col_name: out.dtype for col_name in result._query_compiler.columns}\n )\n if isinstance(where, array):\n out._update_inplace(where.where(result, out)._query_compiler)\n elif where:\n out._update_inplace(result._query_compiler)\n return out\n if isinstance(where, array) and out is None:\n from .array_creation import zeros_like\n\n out = zeros_like(result).astype(dtype if dtype is not None else result.dtype)\n out._query_compiler = where.where(result, out)._query_compiler\n return out\n elif not where:\n from .array_creation import zeros_like\n\n return zeros_like(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_modin-project__modin/modin/numpy/arr.py_array_array.__init__.self.indexer.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array_array.__init__.self.indexer.None", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 240, "span_ids": ["array.__init__", "array"], "tokens": 831}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n \"\"\"\n Modin distributed representation of ``numpy.array``.\n\n Internally, the data can be divided into partitions along both columns and rows\n in order to parallelize computations and utilize the user's hardware as much as possible.\n\n Notes\n -----\n The ``array`` class is a lightweight shim that relies on the pandas Query Compiler in order to\n provide functionality.\n \"\"\"\n\n def __init__(\n self,\n object=None,\n dtype=None,\n *,\n copy=True,\n order=\"K\",\n subok=False,\n ndmin=0,\n like=numpy._NoValue,\n _query_compiler=None,\n _ndim=None,\n ):\n self._siblings = []\n ErrorMessage.single_warning(\n \"Using Modin's new NumPy API. To convert from a Modin object to a NumPy array, either turn off the ExperimentalNumPyAPI flag, or use `modin.utils.to_numpy`.\"\n )\n if isinstance(object, array):\n _query_compiler = object._query_compiler.copy()\n if not copy:\n object._add_sibling(self)\n _ndim = object._ndim\n elif isinstance(object, (pd.DataFrame, pd.Series)):\n _query_compiler = object._query_compiler.copy()\n if not copy:\n object._add_sibling(self)\n _ndim = 1 if isinstance(object, pd.Series) else 2\n if _query_compiler is not None:\n self._query_compiler = _query_compiler\n self._ndim = _ndim\n new_dtype = pandas.core.dtypes.cast.find_common_type(\n list(self._query_compiler.dtypes.values)\n )\n elif is_list_like(object) and not is_list_like(object[0]):\n series = pd.Series(object)\n self._query_compiler = series._query_compiler\n self._ndim = 1\n new_dtype = self._query_compiler.dtypes.values[0]\n else:\n target_kwargs = {\n \"dtype\": None,\n \"copy\": True,\n \"order\": \"K\",\n \"subok\": False,\n \"ndmin\": 0,\n \"like\": numpy._NoValue,\n }\n for key, value in target_kwargs.copy().items():\n if value == locals()[key]:\n target_kwargs.pop(key)\n else:\n target_kwargs[key] = locals()[key]\n arr = numpy.asarray(object)\n assert arr.ndim in (\n 1,\n 2,\n ), \"modin.numpy currently only supports 1D and 2D objects.\"\n self._ndim = len(arr.shape)\n if self._ndim > 2:\n ErrorMessage.not_implemented(\n \"NumPy arrays with dimensions higher than 2 are not yet supported.\"\n )\n\n self._query_compiler = pd.DataFrame(arr)._query_compiler\n new_dtype = arr.dtype\n # These two lines are necessary so that our query compiler does not keep track of indices\n # and try to map like indices to like indices. (e.g. if we multiply two arrays that used\n # to be dataframes, and the dataframes had the same column names but ordered differently\n # we want to do a simple broadcast where we only consider position, as numpy would, rather\n # than pair columns with the same name and multiply them.)\n self._query_compiler = self._query_compiler.reset_index(drop=True)\n self._query_compiler.columns = range(len(self._query_compiler.columns))\n new_dtype = new_dtype if dtype is None else dtype\n if isinstance(new_dtype, pandas.Float64Dtype):\n new_dtype = numpy.float64\n cols_with_wrong_dtype = self._query_compiler.dtypes != new_dtype\n if cols_with_wrong_dtype.any():\n self._query_compiler = self._query_compiler.astype(\n {\n col_name: new_dtype\n for col_name in self._query_compiler.columns[cols_with_wrong_dtype]\n }\n )\n self.indexer = 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_modin-project__modin/modin/numpy/arr.py_array.__getitem___array.__setitem__.return.self_indexer___setitem___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__getitem___array.__setitem__.return.self_indexer___setitem___", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 258, "span_ids": ["array.__setitem__", "array.__getitem__"], "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 array(object):\n\n def __getitem__(self, key):\n if isinstance(key, array) and is_bool_dtype(key.dtype) and key._ndim == 2:\n raise NotImplementedError(\n \"Advanced indexing with 2D boolean indexes is not currently supported.\"\n )\n if self.indexer is None:\n from .indexing import ArrayIndexer\n\n self.indexer = ArrayIndexer(self)\n return self.indexer.__getitem__(key)\n\n def __setitem__(self, key, item):\n if self.indexer is None:\n from .indexing import ArrayIndexer\n\n self.indexer = ArrayIndexer(self)\n return self.indexer.__setitem__(key, item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._add_sibling_array._update_inplace.old_query_compiler_free_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._add_sibling_array._update_inplace.old_query_compiler_free_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 290, "span_ids": ["array._update_inplace", "array._add_sibling"], "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 array(object):\n\n def _add_sibling(self, sibling):\n \"\"\"\n Add an array object to the list of siblings.\n\n Siblings are objects that share the same query compiler. This function is called\n when a shallow copy is made.\n\n Parameters\n ----------\n sibling : BasePandasDataset\n Dataset to add to siblings list.\n \"\"\"\n sibling._siblings = self._siblings + [self]\n self._siblings += [sibling]\n for sib in self._siblings:\n sib._siblings += [sibling]\n\n def _update_inplace(self, new_query_compiler):\n \"\"\"\n Update the current array inplace.\n\n Parameters\n ----------\n new_query_compiler : query_compiler\n The new QueryCompiler to use to manage the data.\n \"\"\"\n old_query_compiler = self._query_compiler\n self._query_compiler = new_query_compiler\n for sib in self._siblings:\n sib._query_compiler = new_query_compiler\n old_query_compiler.free()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._validate_axis_array._validate_axis.return.axis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._validate_axis_array._validate_axis.return.axis", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 292, "end_line": 318, "span_ids": ["array._validate_axis"], "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 array(object):\n\n def _validate_axis(self, axis):\n \"\"\"\n Check that the provided axis argument is valid on this array.\n\n Parameters\n ----------\n axis : int, optional\n The axis argument passed to the function.\n\n Returns\n -------\n int, optional\n Axis to apply the function over (None, 0, or 1).\n\n Raises\n -------\n numpy.AxisError\n if the axis is invalid.\n \"\"\"\n if axis is not None and axis < 0:\n new_axis = axis + self._ndim\n if self._ndim == 1 and new_axis != 0:\n raise numpy.AxisError(axis, 1)\n elif self._ndim == 2 and new_axis not in [0, 1]:\n raise numpy.AxisError(axis, 2)\n return new_axis\n return axis", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_ufunc___array.__array_ufunc__.out_kwarg.kwargs_get_out_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_ufunc___array.__array_ufunc__.out_kwarg.kwargs_get_out_None_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 412, "span_ids": ["array.__array_ufunc__"], "tokens": 814}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):\n ufunc_name = ufunc.__name__\n supported_array_layer = hasattr(self, ufunc_name) or hasattr(\n self, f\"__{ufunc_name}__\"\n )\n if supported_array_layer:\n args = []\n for input in inputs:\n input = try_convert_from_interoperable_type(input)\n if not (isinstance(input, array) or is_scalar(input)):\n input = array(input)\n args += [input]\n function = (\n getattr(args[0], ufunc_name)\n if hasattr(args[0], ufunc_name)\n else getattr(args[0], f\"__{ufunc_name}__\")\n )\n len_expected_arguments = len(\n [\n param\n for param in signature(function).parameters.values()\n if param.default == param.empty\n ]\n )\n if len_expected_arguments == (len(args) - 1) and method == \"__call__\":\n return function(*tuple(args[1:]), **kwargs)\n else:\n ErrorMessage.single_warning(\n f\"{ufunc} method {method} is not yet supported in Modin. Defaulting to NumPy.\"\n )\n args = []\n for input in inputs:\n if isinstance(input, array):\n input = input._to_numpy()\n if isinstance(input, pd.DataFrame):\n input = input._query_compiler.to_numpy()\n if isinstance(input, pd.Series):\n input = input._query_compiler.to_numpy().flatten()\n args += [input]\n output = self._to_numpy().__array_ufunc__(\n ufunc, method, *args, **kwargs\n )\n if is_scalar(output):\n return output\n return array(output)\n new_ufunc = None\n out_ndim = -1\n if method == \"__call__\":\n if len(inputs) == 1:\n new_ufunc = Map.register(ufunc)\n out_ndim = len(inputs[0].shape)\n else:\n new_ufunc = Binary.register(ufunc)\n out_ndim = max(\n [len(inp.shape) for inp in inputs if hasattr(inp, \"shape\")]\n )\n elif method == \"reduce\":\n if len(inputs) == 1:\n new_ufunc = Reduce.register(ufunc, axis=kwargs.get(\"axis\", None))\n if kwargs.get(\"axis\", None) is None:\n out_ndim = 0\n else:\n out_ndim = len(inputs[0].shape) - 1\n elif method == \"accumulate\":\n if len(inputs) == 1:\n new_ufunc = Reduce.register(ufunc, axis=None)\n out_ndim = 0\n if new_ufunc is None:\n ErrorMessage.single_warning(\n f\"{ufunc} is not yet supported in Modin. Defaulting to NumPy.\"\n )\n args = []\n for input in inputs:\n if isinstance(input, array):\n input = input._to_numpy()\n if isinstance(input, pd.DataFrame):\n input = input._query_compiler.to_numpy()\n if isinstance(input, pd.Series):\n input = input._query_compiler.to_numpy().flatten()\n args += [input]\n output = self._to_numpy().__array_ufunc__(ufunc, method, *args, **kwargs)\n if is_scalar(output):\n return output\n return array(output)\n args = []\n for input in inputs:\n input = try_convert_from_interoperable_type(input)\n if not (isinstance(input, array) or is_scalar(input)):\n input = array(input)\n args += [\n input._query_compiler if hasattr(input, \"_query_compiler\") else input\n ]\n out_kwarg = kwargs.get(\"out\", None)\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_modin-project__modin/modin/numpy/arr.py_array.__array_ufunc__.if_out_kwarg_is_not_None__array.__array_ufunc__.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_ufunc__.if_out_kwarg_is_not_None__array.__array_ufunc__.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 413, "end_line": 427, "span_ids": ["array.__array_ufunc__"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):\n # ... other code\n if out_kwarg is not None:\n # If `out` is a modin.numpy.array, `kwargs.get(\"out\")` returns a 1-tuple\n # whose only element is that array, so we need to unwrap it from the tuple.\n out_kwarg = out_kwarg[0]\n where_kwarg = kwargs.get(\"where\", True)\n kwargs[\"out\"] = None\n kwargs[\"where\"] = True\n result = new_ufunc(*args, **kwargs)\n return fix_dtypes_and_determine_return(\n result,\n out_ndim,\n dtype=kwargs.get(\"dtype\", None),\n out=out_kwarg,\n where=where_kwarg,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_function___array.__array_function__.return.modin_func_args_kwarg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__array_function___array.__array_function__.return.modin_func_args_kwarg", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 429, "end_line": 442, "span_ids": ["array.__array_function__"], "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 array(object):\n\n def __array_function__(self, func, types, args, kwargs):\n from . import array_creation as creation, array_shaping as shaping, math\n\n func_name = func.__name__\n modin_func = None\n if hasattr(math, func_name):\n modin_func = getattr(math, func_name)\n elif hasattr(shaping, func_name):\n modin_func = getattr(shaping, func_name)\n elif hasattr(creation, func_name):\n modin_func = getattr(creation, func_name)\n if modin_func is None:\n return NotImplemented\n return modin_func(*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_modin-project__modin/modin/numpy/arr.py_array.where_array.where.return.array_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.where_array.where.return.array_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 444, "end_line": 528, "span_ids": ["array.where"], "tokens": 812}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def where(self, x=None, y=None):\n if not is_bool_dtype(self.dtype):\n raise NotImplementedError(\n \"Modin currently only supports where on condition arrays with boolean dtype.\"\n )\n if x is None and y is None:\n ErrorMessage.single_warning(\n \"np.where method with only condition specified is not yet supported in Modin. Defaulting to NumPy.\"\n )\n condition = self._to_numpy()\n return array(numpy.where(condition))\n x, y = try_convert_from_interoperable_type(\n x\n ), try_convert_from_interoperable_type(y)\n if not (\n (isinstance(x, array) or is_scalar(x))\n and (isinstance(y, array) or is_scalar(y))\n ):\n raise ValueError(\n \"np.where requires x and y to either be np.arrays or scalars.\"\n )\n if is_scalar(x) and is_scalar(y):\n ErrorMessage.single_warning(\n \"np.where not supported when both x and y are scalars. Defaulting to NumPy.\"\n )\n return array(numpy.where(self._to_numpy(), x, y))\n if is_scalar(x) and not is_scalar(y):\n if self._ndim < y._ndim:\n if not self.shape[0] == y.shape[1]:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {y.shape}\"\n )\n ErrorMessage.single_warning(\n \"np.where method where condition must be broadcast is not yet available in Modin. Defaulting to NumPy.\"\n )\n return array(numpy.where(self._to_numpy(), x, y._to_numpy()))\n elif self._ndim == y._ndim:\n if not self.shape == y.shape:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {y.shape}\"\n )\n return array(\n _query_compiler=y._query_compiler.where((~self)._query_compiler, x),\n _ndim=y._ndim,\n )\n else:\n ErrorMessage.single_warning(\n \"np.where method with broadcast is not yet available in Modin. Defaulting to NumPy.\"\n )\n return numpy.where(self._to_numpy(), x, y._to_numpy())\n if not is_scalar(x) and is_scalar(y):\n if self._ndim < x._ndim:\n if not self.shape[0] == x.shape[1]:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {x.shape}\"\n )\n ErrorMessage.single_warning(\n \"np.where method where condition must be broadcast is not yet available in Modin. Defaulting to NumPy.\"\n )\n return array(numpy.where(self._to_numpy(), x._to_numpy(), y))\n elif self._ndim == x._ndim:\n if not self.shape == x.shape:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {x.shape}\"\n )\n return array(\n _query_compiler=x._query_compiler.where(self._query_compiler, y),\n _ndim=x._ndim,\n )\n else:\n ErrorMessage.single_warning(\n \"np.where method with broadcast is not yet available in Modin. Defaulting to NumPy.\"\n )\n return array(numpy.where(self._to_numpy(), x._to_numpy(), y))\n if not (x.shape == y.shape and y.shape == self.shape):\n ErrorMessage.single_warning(\n \"np.where method with broadcast is not yet available in Modin. Defaulting to NumPy.\"\n )\n return array(numpy.where(self._to_numpy(), x._to_numpy(), y._to_numpy()))\n return array(\n _query_compiler=x._query_compiler.where(\n self._query_compiler, y._query_compiler\n ),\n _ndim=self._ndim,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.max_array.max.if_truthy_where_or_out_is.else_.return.numpy_ones_like_intermedi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.max_array.max.if_truthy_where_or_out_is.else_.return.numpy_ones_like_intermedi", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 530, "end_line": 617, "span_ids": ["array.max"], "tokens": 872}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def max(\n self, axis=None, dtype=None, out=None, keepdims=None, initial=None, where=True\n ):\n check_kwargs(keepdims=keepdims, where=where)\n apply_axis = self._validate_axis(axis)\n truthy_where = bool(where)\n if initial is None and where is not True:\n raise ValueError(\n \"reduction operation 'maximum' does not have an identity, so to use a where mask one has to specify 'initial'\"\n )\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n target = where.where(self, initial) if isinstance(where, array) else self\n result = target._query_compiler.max(axis=0)\n if keepdims:\n if initial is not None and result.lt(initial).any():\n result = pd.Series([initial])._query_compiler\n if initial is not None and out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)._query_compiler\n )\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, dtype, out, truthy_where\n )\n else:\n return array([initial])\n if initial is not None:\n result = max(result.to_numpy()[0, 0], initial)\n else:\n result = result.to_numpy()[0, 0]\n return result if truthy_where else initial\n if axis is None:\n target = where.where(self, initial) if isinstance(where, array) else self\n result = target._query_compiler.max(axis=0).max(axis=1).to_numpy()[0, 0]\n if initial is not None:\n result = max(result, initial)\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 1, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if initial is not None and out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]]))._query_compiler,\n 2,\n dtype,\n out,\n truthy_where,\n )\n else:\n return array([[initial]])\n return result if truthy_where else initial\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n target = where.where(self, initial) if isinstance(where, array) else self\n result = target._query_compiler.max(axis=apply_axis)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n if initial is not None:\n result = max(result.to_numpy()[0, 0], initial)\n else:\n result = result.to_numpy()[0, 0]\n return result if truthy_where else initial\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if initial is not None and out is not None:\n out._update_inplace((numpy.ones_like(out) * initial)._query_compiler)\n intermediate = fix_dtypes_and_determine_return(\n result, new_ndim, dtype, out, truthy_where\n )\n if initial is not None:\n intermediate._update_inplace(\n (intermediate > initial).where(intermediate, initial)._query_compiler\n )\n if truthy_where or out is not None:\n return intermediate\n else:\n return numpy.ones_like(intermediate) * initial", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.min_array.min.if_truthy_where_or_out_is.else_.return.numpy_ones_like_intermedi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.min_array.min.if_truthy_where_or_out_is.else_.return.numpy_ones_like_intermedi", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 619, "end_line": 706, "span_ids": ["array.min"], "tokens": 873}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def min(\n self, axis=None, dtype=None, out=None, keepdims=None, initial=None, where=True\n ):\n check_kwargs(keepdims=keepdims, where=where)\n truthy_where = bool(where)\n apply_axis = self._validate_axis(axis)\n if initial is None and where is not True:\n raise ValueError(\n \"reduction operation 'minimum' does not have an identity, so to use a where mask one has to specify 'initial'\"\n )\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n target = where.where(self, initial) if isinstance(where, array) else self\n result = target._query_compiler.min(axis=0)\n if keepdims:\n if initial is not None and result.gt(initial).any():\n result = pd.Series([initial])._query_compiler\n if initial is not None and out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)._query_compiler\n )\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, dtype, out, truthy_where\n )\n else:\n return array([initial])\n if initial is not None:\n result = min(result.to_numpy()[0, 0], initial)\n else:\n result = result.to_numpy()[0, 0]\n return result if truthy_where else initial\n if apply_axis is None:\n target = where.where(self, initial) if isinstance(where, array) else self\n result = target._query_compiler.min(axis=0).min(axis=1).to_numpy()[0, 0]\n if initial is not None:\n result = min(result, initial)\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 1, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if initial is not None and out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]]))._query_compiler,\n 2,\n dtype,\n out,\n truthy_where,\n )\n else:\n return array([[initial]])\n return result if truthy_where else initial\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n target = where.where(self, initial) if isinstance(where, array) else self\n result = target._query_compiler.min(axis=apply_axis)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n if initial is not None:\n result = min(result.to_numpy()[0, 0], initial)\n else:\n result = result.to_numpy()[0, 0]\n return result if truthy_where else initial\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if initial is not None and out is not None:\n out._update_inplace((numpy.ones_like(out) * initial)._query_compiler)\n intermediate = fix_dtypes_and_determine_return(\n result, new_ndim, dtype, out, truthy_where\n )\n if initial is not None:\n intermediate._update_inplace(\n (intermediate < initial).where(intermediate, initial)._query_compiler\n )\n if truthy_where or out is not None:\n return intermediate\n else:\n return numpy.ones_like(intermediate) * initial", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__abs___array.__invert__.return.array__query_compiler_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__abs___array.__invert__.return.array__query_compiler_sel", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 748, "span_ids": ["array:3", "array.__abs__", "array.__invert__"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def __abs__(\n self,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else self.dtype)\n )\n check_kwargs(order=order, casting=casting, subok=subok, where=where)\n result = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n ).abs()\n if dtype is not None:\n result = result.astype({col_name: dtype for col_name in result.columns})\n if out is not None:\n out = try_convert_from_interoperable_type(out, copy=False)\n check_can_broadcast_to_output(self, out)\n out._update_inplace(result)\n return out\n return array(_query_compiler=result, _ndim=self._ndim)\n\n absolute = __abs__\n\n def __invert__(self):\n \"\"\"\n Apply bitwise inverse to each element of the `BasePandasDataset`.\n\n Returns\n -------\n BasePandasDataset\n New BasePandasDataset containing bitwise inverse to each value.\n \"\"\"\n if not is_numeric_dtype(self.dtype):\n raise TypeError(f\"bad operand type for unary ~: '{self.dtype}'\")\n return array(_query_compiler=self._query_compiler.invert(), _ndim=self._ndim)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._preprocess_binary_op_array._preprocess_binary_op.broadcast.self__ndim_other__ndim": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._preprocess_binary_op_array._preprocess_binary_op.broadcast.self__ndim_other__ndim", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 750, "end_line": 816, "span_ids": ["array._preprocess_binary_op"], "tokens": 630}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def _preprocess_binary_op(self, other, cast_input_types=True, dtype=None, out=None):\n \"\"\"\n Processes arguments and performs dtype conversions necessary to perform binary\n operations. If the arguments to the binary operation are a 1D object and a 2D object,\n then it will swap the order of the caller and callee return values in order to\n facilitate native broadcasting by modin.\n\n This function may modify `self._query_compiler` and `other._query_compiler` by replacing\n it with the result of `astype`.\n\n Parameters\n ----------\n other : array or scalar\n The RHS of the binary operation.\n cast_input_types : bool, default: True\n If specified, the columns of the caller/callee query compilers will be assigned\n dtypes in the following priority, depending on what values were specified:\n (1) the `dtype` argument,\n (2) the dtype of the `out` array,\n (3) the common parent dtype of `self` and `other`.\n If this flag is not specified, then the resulting dtype is left to be determined\n by the result of the modin operation.\n dtype : numpy type, optional\n The desired dtype of the output array.\n out : array, optional\n Existing array object to which to assign the computation's result.\n\n Returns\n -------\n tuple\n Returns a 4-tuple with the following elements:\n - 0: QueryCompiler object that is the LHS of the binary operation, with types converted\n as needed.\n - 1: QueryCompiler object OR scalar that is the RHS of the binary operation, with types\n converted as needed.\n - 2: The ndim of the result.\n - 3: kwargs to pass to the query compiler.\n \"\"\"\n other = try_convert_from_interoperable_type(other)\n\n if cast_input_types:\n operand_dtype = (\n self.dtype\n if not isinstance(other, array)\n else pandas.core.dtypes.cast.find_common_type([self.dtype, other.dtype])\n )\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else operand_dtype)\n )\n self._query_compiler = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n )\n if is_scalar(other):\n # Return early, since no need to check broadcasting behavior if RHS is a scalar\n return (self._query_compiler, other, self._ndim, {})\n elif cast_input_types:\n other._query_compiler = other._query_compiler.astype(\n {col_name: out_dtype for col_name in other._query_compiler.columns}\n )\n\n if not isinstance(other, array):\n raise TypeError(\n f\"Unsupported operand type(s): '{type(self)}' and '{type(other)}'\"\n )\n broadcast = self._ndim != other._ndim\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_modin-project__modin/modin/numpy/arr.py_array._preprocess_binary_op.if_broadcast__array._preprocess_binary_op.if_broadcast_.else_.if_self_shape_other_sh.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._preprocess_binary_op.if_broadcast__array._preprocess_binary_op.if_broadcast_.else_.if_self_shape_other_sh.else_.return._", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 817, "end_line": 864, "span_ids": ["array._preprocess_binary_op"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def _preprocess_binary_op(self, other, cast_input_types=True, dtype=None, out=None):\n # ... other code\n if broadcast:\n # In this case, we have a 1D object doing a binary op with a 2D object\n caller, callee = (self, other) if self._ndim == 2 else (other, self)\n if callee.shape[0] != caller.shape[1]:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {other.shape}\"\n )\n return (\n caller._query_compiler,\n callee._query_compiler,\n caller._ndim,\n {\"broadcast\": broadcast, \"axis\": 1},\n )\n else:\n if self.shape != other.shape:\n # In this case, we either have two mismatched objects trying to do an operation\n # or a nested 1D object that must be broadcasted trying to do an operation.\n broadcast = True\n if self.shape[0] == other.shape[0]:\n matched_dimension = 0\n elif self.shape[1] == other.shape[1]:\n matched_dimension = 1\n broadcast = False\n else:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {other.shape}\"\n )\n if (\n self.shape[matched_dimension ^ 1] == 1\n or other.shape[matched_dimension ^ 1] == 1\n ):\n return (\n self._query_compiler,\n other._query_compiler,\n self._ndim,\n {\"broadcast\": broadcast, \"axis\": matched_dimension},\n )\n else:\n raise ValueError(\n f\"operands could not be broadcast together with shapes {self.shape} {other.shape}\"\n )\n else:\n return (\n self._query_compiler,\n other._query_compiler,\n self._ndim,\n {\"broadcast\": 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_modin-project__modin/modin/numpy/arr.py_array._greater_array.__gt__.return.self__greater_x2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._greater_array.__gt__.return.self__greater_x2_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 866, "end_line": 894, "span_ids": ["array._greater", "array.__gt__"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def _greater(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if is_scalar(x2):\n return array(_query_compiler=self._query_compiler.gt(x2), _ndim=self._ndim)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object > 2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object < 1D_object.\n result = caller.lt(callee, **kwargs)\n else:\n result = caller.gt(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)\n\n def __gt__(self, x2):\n return self._greater(x2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._greater_equal_array._greater_equal.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._greater_equal_array._greater_equal.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 896, "end_line": 921, "span_ids": ["array._greater_equal"], "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 array(object):\n\n def _greater_equal(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if is_scalar(x2):\n return array(_query_compiler=self._query_compiler.ge(x2), _ndim=self._ndim)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object >= 2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object <= 1D_object.\n result = caller.le(callee, **kwargs)\n else:\n result = caller.ge(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__ge___array._less.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__ge___array._less.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 923, "end_line": 951, "span_ids": ["array.__ge__", "array._less"], "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 array(object):\n\n def __ge__(self, x2):\n return self._greater_equal(x2)\n\n def _less(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if is_scalar(x2):\n return array(_query_compiler=self._query_compiler.lt(x2), _ndim=self._ndim)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object < 2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object < 1D_object.\n result = caller.gt(callee, **kwargs)\n else:\n result = caller.lt(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__lt___array._less_equal.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__lt___array._less_equal.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 953, "end_line": 981, "span_ids": ["array._less_equal", "array.__lt__"], "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 array(object):\n\n def __lt__(self, x2):\n return self._less(x2)\n\n def _less_equal(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if is_scalar(x2):\n return array(_query_compiler=self._query_compiler.le(x2), _ndim=self._ndim)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object <= 2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object <= 1D_object.\n result = caller.ge(callee, **kwargs)\n else:\n result = caller.le(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__le___array._equal.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__le___array._equal.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 983, "end_line": 1005, "span_ids": ["array._equal", "array.__le__"], "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 array(object):\n\n def __le__(self, x2):\n return self._less_equal(x2)\n\n def _equal(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if is_scalar(x2):\n return array(_query_compiler=self._query_compiler.eq(x2), _ndim=self._ndim)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n result = caller.eq(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__eq___array.__ne__.return.self__not_equal_x2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__eq___array.__ne__.return.self__not_equal_x2_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1007, "end_line": 1032, "span_ids": ["array.__ne__", "array.__eq__", "array._not_equal"], "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 array(object):\n\n def __eq__(self, x2):\n return self._equal(x2)\n\n def _not_equal(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if is_scalar(x2):\n return array(_query_compiler=self._query_compiler.ne(x2), _ndim=self._ndim)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n result = caller.ne(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)\n\n def __ne__(self, x2):\n return self._not_equal(x2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._unary_math_operator_array._unary_math_operator.return.array__query_compiler_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._unary_math_operator_array._unary_math_operator.return.array__query_compiler_res", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1034, "end_line": 1062, "span_ids": ["array._unary_math_operator"], "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 array(object):\n\n def _unary_math_operator(\n self,\n opName,\n *args,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else self.dtype)\n )\n check_kwargs(order=order, casting=casting, subok=subok, where=where)\n result = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n )\n result = getattr(result, opName)(*args)\n if dtype is not None:\n result = result.astype({col_name: dtype for col_name in result.columns})\n if out is not None:\n out = try_convert_from_interoperable_type(out)\n check_can_broadcast_to_output(self, out)\n out._query_compiler = result\n return out\n return array(_query_compiler=result, _ndim=self._ndim)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.tanh_array.sqrt.return.self__unary_math_operator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.tanh_array.sqrt.return.self__unary_math_operator", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1064, "end_line": 1119, "span_ids": ["array.tanh", "array.sqrt", "array.exp"], "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 array(object):\n\n def tanh(\n self,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self._unary_math_operator(\n \"_tanh\",\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )\n\n def exp(\n self,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self._unary_math_operator(\n \"_exp\",\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )\n\n def sqrt(\n self,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self._unary_math_operator(\n \"_sqrt\",\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.append_array.append.return.array__query_compiler_new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.append_array.append.return.array__query_compiler_new", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1121, "end_line": 1143, "span_ids": ["array.append"], "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 array(object):\n\n def append(self, values, axis=None):\n if not isinstance(values, array):\n if is_list_like(values):\n lengths = [len(a) if is_list_like(a) else None for a in values]\n if any(numpy.array(lengths[1:]) != lengths[0]):\n raise ValueError(\n \"setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.\"\n )\n values = array(values)\n if axis is None:\n return self.flatten().hstack([values.flatten()])\n elif self._ndim == 1:\n if values._ndim == 1:\n return self.hstack([values])\n raise ValueError(\n f\"all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has {values._ndim} dimension(s)\"\n )\n if (axis ^ 1 < values._ndim) and self.shape[axis ^ 1] != values.shape[axis ^ 1]:\n raise ValueError(\n f\"all the input array dimensions except for the concatenation axis must match exactly, but along dimension {axis ^ 1}, the array at index 0 has size {self.shape[axis^1]} and the array at index 1 has size {values.shape[axis^1]}\"\n )\n new_qc = self._query_compiler.concat(axis, values._query_compiler)\n return array(_query_compiler=new_qc, _ndim=self._ndim)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.hstack_array.hstack.return.array__query_compiler_new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.hstack_array.hstack.return.array__query_compiler_new", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1145, "end_line": 1168, "span_ids": ["array.hstack"], "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 array(object):\n\n def hstack(self, others, dtype=None, casting=\"same_kind\"):\n check_kwargs(casting=casting)\n new_dtype = (\n dtype\n if dtype is not None\n else pandas.core.dtypes.cast.find_common_type(\n [self.dtype] + [a.dtype for a in others]\n )\n )\n for index, i in enumerate([a._ndim for a in others]):\n if i != self._ndim:\n raise ValueError(\n f\"all the input arrays must have same number of dimensions, but the array at index 0 has {self._ndim} dimension(s) and the array at index {index} has {i} dimension(s)\"\n )\n if self._ndim == 1:\n new_qc = self._query_compiler.concat(0, [o._query_compiler for o in others])\n else:\n for index, i in enumerate([a.shape[0] for a in others]):\n if i != self.shape[0]:\n raise ValueError(\n f\"all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size {self.shape[0]} and the array at index {index} has size {i}\"\n )\n new_qc = self._query_compiler.concat(1, [o._query_compiler for o in others])\n return array(_query_compiler=new_qc, _ndim=self._ndim, dtype=new_dtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.split_array.split.return.arrays": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.split_array.split.return.arrays", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1170, "end_line": 1236, "span_ids": ["array.split"], "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 array(object):\n\n def split(self, indices, axis=0):\n if axis is not None and axis < 0:\n new_axis = axis + self._ndim\n if self._ndim == 1 and new_axis != 0:\n raise IndexError\n elif self._ndim == 2 and new_axis not in [0, 1]:\n raise IndexError\n axis = new_axis\n if self._ndim == 1:\n if axis != 0:\n raise IndexError\n if self._ndim == 2:\n if axis > 1:\n raise IndexError\n arrays = []\n if is_list_like(indices) or isinstance(indices, array):\n if not isinstance(indices, array):\n indices = array(indices)\n if indices._ndim != 1:\n raise TypeError(\n \"only integer scalar arrays can be converted to a scalar index\"\n )\n prev_index = 0\n for i in range(len(indices) + 1):\n if i < len(indices):\n end_index = indices._query_compiler.take_2d_positional(\n [i]\n ).to_numpy()[0, 0]\n if end_index == 0:\n ErrorMessage.single_warning(\n \"Defaulting to NumPy for empty arrays.\"\n )\n new_shape = list(self.shape)\n new_shape[axis] = 0\n arrays.append(numpy.empty(new_shape, dtype=self.dtype))\n continue\n if end_index < 0:\n end_index = self.shape[axis] + end_index\n else:\n end_index = self.shape[axis]\n if prev_index > self.shape[axis] or prev_index == end_index:\n ErrorMessage.single_warning(\"Defaulting to NumPy for empty arrays.\")\n new_shape = list(self.shape)\n new_shape[axis] = 0\n arrays.append(numpy.empty(new_shape, dtype=self.dtype))\n else:\n idxs = list(range(prev_index, min(end_index, self.shape[axis])))\n if axis == 0:\n new_qc = self._query_compiler.take_2d_positional(index=idxs)\n else:\n new_qc = self._query_compiler.take_2d_positional(columns=idxs)\n arrays.append(array(_query_compiler=new_qc, _ndim=self._ndim))\n prev_index = end_index\n else:\n if self.shape[axis] % indices != 0:\n raise ValueError(\"array split does not result in an equal division\")\n for i in range(0, self.shape[axis], self.shape[axis] // indices):\n if axis == 0:\n new_qc = self._query_compiler.take_2d_positional(\n index=list(range(i, i + self.shape[axis] // indices))\n )\n else:\n new_qc = self._query_compiler.take_2d_positional(\n columns=list(range(i, i + self.shape[axis] // indices))\n )\n arrays.append(array(_query_compiler=new_qc, _ndim=self._ndim))\n return arrays", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._compute_masked_variance_array._compute_masked_variance.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._compute_masked_variance_array._compute_masked_variance.return.target", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1238, "end_line": 1260, "span_ids": ["array._compute_masked_variance"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def _compute_masked_variance(self, mask, output_dtype, axis, ddof):\n if axis == 0 and self._ndim != 1:\n # Our broadcasting is wrong, so we can't do the final subtraction at the end.\n raise NotImplementedError(\n \"Masked variance on 2D arrays along axis = 0 is currently unsupported.\"\n )\n axis_mean = self.mean(axis, output_dtype, keepdims=True, where=mask)\n target = mask.where(self, numpy.nan)\n if self._ndim == 1:\n axis_mean = axis_mean._to_numpy()[0]\n target = target._query_compiler.sub(axis_mean).pow(2).sum(axis=axis)\n else:\n target = (target - axis_mean)._query_compiler.pow(2).sum(axis=axis)\n num_elems = (\n mask.where(self, 0)._query_compiler.notna().sum(axis=axis, skipna=False)\n )\n num_elems = num_elems.sub(ddof)\n target = target.truediv(num_elems)\n na_propagation_mask = mask.where(self, 0)._query_compiler.sum(\n axis=axis, skipna=False\n )\n target = target.where(na_propagation_mask.notna(), numpy.nan)\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.var_array.var.if_self__ndim_1_.if_keepdims_.if_truthy_where_or_out_is.else_.return.array_numpy_nan_dtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.var_array.var.if_self__ndim_1_.if_keepdims_.if_truthy_where_or_out_is.else_.return.array_numpy_nan_dtype_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1262, "end_line": 1297, "span_ids": ["array.var"], "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": "class array(object):\n\n def var(\n self, axis=None, dtype=None, out=None, ddof=0, keepdims=None, *, where=True\n ):\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else self.dtype)\n )\n out_type = getattr(out_dtype, \"type\", out_dtype)\n if isinstance(where, array) and issubclass(out_type, numpy.integer):\n out_dtype = numpy.float64\n apply_axis = self._validate_axis(axis)\n check_kwargs(keepdims=keepdims, where=where)\n truthy_where = bool(where)\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n if isinstance(where, array):\n result = self._compute_masked_variance(where, out_dtype, 0, ddof)\n else:\n result = self._query_compiler.var(axis=0, skipna=False, ddof=ddof)\n if keepdims:\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if out is not None:\n out._query_compiler = (\n numpy.ones_like(out) * numpy.nan\n )._query_compiler\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, dtype, out, truthy_where\n )\n else:\n return array([numpy.nan], dtype=out_dtype)\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_modin-project__modin/modin/numpy/arr.py_array.var.if_apply_axis_is_None__array.var.if_truthy_where_or_out_is.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.var.if_apply_axis_is_None__array.var.if_truthy_where_or_out_is.else_.return._", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1298, "end_line": 1386, "span_ids": ["array.var"], "tokens": 886}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def var(\n self, axis=None, dtype=None, out=None, ddof=0, keepdims=None, *, where=True\n ):\n # ... other code\n if apply_axis is None:\n # If any of the (non-masked) elements of our array are `NaN`, we know that the\n # result of `mean` must be `NaN`. This is a fastpath to see if any unmasked elements\n # are `NaN`.\n contains_na_check = (\n where.where(self, 0) if isinstance(where, array) else self\n )\n if (\n contains_na_check._query_compiler.isna()\n .any(axis=1)\n .any(axis=0)\n .to_numpy()[0, 0]\n ):\n return numpy.nan\n result = where.where(self, numpy.nan) if isinstance(where, array) else self\n # Since our current QueryCompiler does not have a variance that reduces 2D objects to\n # a single value, we need to calculate the variance ourselves. First though, we need\n # to figure out how many objects that we are taking the variance over (since any\n # entries in our array that are `numpy.nan` must be ignored when taking the variance,\n # and so cannot be included in the final division (of the sum over num total elements))\n num_na_elements = (\n result._query_compiler.isna().sum(axis=1).sum(axis=0).to_numpy()[0, 0]\n )\n num_total_elements = prod(self.shape) - num_na_elements\n mean = (\n numpy.array(\n [result._query_compiler.sum(axis=1).sum(axis=0).to_numpy()[0, 0]],\n dtype=out_dtype,\n )\n / num_total_elements\n )[0]\n result = (\n numpy.array(\n [\n result._query_compiler.sub(mean)\n .pow(2)\n .sum(axis=1)\n .sum(axis=0)\n .to_numpy()[0, 0]\n ],\n dtype=out_dtype,\n )\n / (num_total_elements - ddof)\n )[0]\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 1, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if out is not None:\n out._query_compiler = (\n numpy.ones_like(out) * numpy.nan\n )._query_compiler\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]]))\n .astype(out_dtype)\n ._query_compiler,\n 2,\n dtype,\n out,\n truthy_where,\n )\n else:\n return array([[numpy.nan]], dtype=out_dtype)\n return result if truthy_where else numpy.nan\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n if isinstance(where, array):\n result = self._compute_masked_variance(where, out_dtype, apply_axis, ddof)\n else:\n result = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n ).var(axis=apply_axis, skipna=False, ddof=ddof)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n return result.to_numpy()[0, 0] if truthy_where else numpy.nan\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if out is not None:\n out._query_compiler = (numpy.ones_like(out) * numpy.nan)._query_compiler\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, new_ndim, dtype, out, truthy_where\n )\n else:\n return (\n numpy.ones(array(_query_compiler=result, _ndim=new_ndim).shape)\n ) * numpy.nan", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._compute_masked_mean_array._compute_masked_mean.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._compute_masked_mean_array._compute_masked_mean.return.target", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1388, "end_line": 1404, "span_ids": ["array._compute_masked_mean"], "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 array(object):\n\n def _compute_masked_mean(self, mask, output_dtype, axis):\n # By default, pandas ignores NaN values when doing computations.\n # NumPy; however, propagates the value by default. We use pandas\n # default behaviour in order to mask values (by replacing them)\n # with NaN when initially computing the mean, but we need to propagate\n # NaN values that were not masked to the final output, so we do a\n # sum along the same axis (where masked values are 0) to see where\n # NumPy would propagate NaN, and swap out those values in our result\n # with NaN.\n target = mask.where(self, numpy.nan)._query_compiler\n target = target.astype(\n {col_name: output_dtype for col_name in target.columns}\n ).mean(axis=axis)\n na_propagation_mask = mask.where(self, 0)._query_compiler\n na_propagation_mask = na_propagation_mask.sum(axis=axis, skipna=False)\n target = target.where(na_propagation_mask.notna(), numpy.nan)\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.mean_array.mean.if_self__ndim_1_.return.result_to_numpy_0_0_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.mean_array.mean.if_self__ndim_1_.return.result_to_numpy_0_0_i", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1406, "end_line": 1446, "span_ids": ["array.mean"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def mean(self, axis=None, dtype=None, out=None, keepdims=None, *, where=True):\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else self.dtype)\n )\n out_type = getattr(out_dtype, \"type\", out_dtype)\n if isinstance(where, array) and issubclass(out_type, numpy.integer):\n out_dtype = numpy.float64\n apply_axis = self._validate_axis(axis)\n check_kwargs(keepdims=keepdims, where=where)\n truthy_where = bool(where)\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n if isinstance(where, array):\n result = self._compute_masked_mean(where, out_dtype, 0)\n else:\n result = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n ).mean(axis=0, skipna=False)\n if keepdims:\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * numpy.nan)._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, dtype, out, truthy_where\n )\n else:\n return array([numpy.nan], dtype=out_dtype)\n # This is just to see if `where` is a truthy value. If `where` is an array,\n # we would have already masked the input before computing `result`, so here\n # we just want to ensure that `where=False` was not passed in, and if it was\n # we return `numpy.nan`, since that is what NumPy would do.\n return result.to_numpy()[0, 0] if where else numpy.nan\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_modin-project__modin/modin/numpy/arr.py_array.mean.if_apply_axis_is_None__array.mean.if_truthy_where_or_out_is.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.mean.if_apply_axis_is_None__array.mean.if_truthy_where_or_out_is.else_.return._", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1447, "end_line": 1522, "span_ids": ["array.mean"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def mean(self, axis=None, dtype=None, out=None, keepdims=None, *, where=True):\n # ... other code\n if apply_axis is None:\n # If any of the (non-masked) elements of our array are `NaN`, we know that the\n # result of `mean` must be `NaN`. This is a fastpath to see if any unmasked elements\n # are `NaN`.\n contains_na_check = (\n where.where(self, 0) if isinstance(where, array) else self\n )\n if (\n contains_na_check._query_compiler.isna()\n .any(axis=1)\n .any(axis=0)\n .to_numpy()[0, 0]\n ):\n return numpy.nan\n result = where.where(self, numpy.nan) if isinstance(where, array) else self\n # Since our current QueryCompiler does not have a mean that reduces 2D objects to\n # a single value, we need to calculate the mean ourselves. First though, we need\n # to figure out how many objects that we are taking the mean over (since any\n # entries in our array that are `numpy.nan` must be ignored when taking the mean,\n # and so cannot be included in the final division (of the sum over num total elements))\n num_na_elements = (\n result._query_compiler.isna().sum(axis=1).sum(axis=0).to_numpy()[0, 0]\n )\n num_total_elements = prod(self.shape) - num_na_elements\n result = (\n numpy.array(\n [result._query_compiler.sum(axis=1).sum(axis=0).to_numpy()[0, 0]],\n dtype=out_dtype,\n )\n / num_total_elements\n )[0]\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 1, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * numpy.nan)._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]]))\n .astype(out_dtype)\n ._query_compiler,\n 2,\n dtype,\n out,\n truthy_where,\n )\n else:\n return array([[numpy.nan]], dtype=out_dtype)\n return result if truthy_where else numpy.nan\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n if isinstance(where, array):\n result = self._compute_masked_mean(where, out_dtype, apply_axis)\n else:\n result = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n ).mean(axis=apply_axis, skipna=False)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n return result.to_numpy()[0, 0] if truthy_where else numpy.nan\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if out is not None:\n out._update_inplace((numpy.ones_like(out) * numpy.nan)._query_compiler)\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, new_ndim, dtype, out, truthy_where\n )\n else:\n return (\n numpy.ones(array(_query_compiler=result, _ndim=new_ndim).shape)\n ) * numpy.nan", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__add___array.__radd__.return.self___add___x2_out_whe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__add___array.__radd__.return.self___add___x2_out_whe", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1524, "end_line": 1551, "span_ids": ["array.__radd__", "array.__add__"], "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 array(object):\n\n def __add__(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n result = caller.add(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)\n\n def __radd__(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self.__add__(x2, out, where, casting, order, dtype, subok)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.divide_array.divide.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.divide_array.divide.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1553, "end_line": 1574, "span_ids": ["array.divide"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def divide(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object/2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object.rtruediv(1D_object).\n result = caller.rtruediv(callee, **kwargs)\n else:\n result = caller.truediv(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__truediv___array.__rtruediv__.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__truediv___array.__rtruediv__.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1576, "end_line": 1596, "span_ids": ["array.__rtruediv__", "array:5"], "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 array(object):\n\n __truediv__ = divide\n\n def __rtruediv__(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n result = caller.truediv(callee, **kwargs)\n else:\n result = caller.rtruediv(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.floor_divide_array.floor_divide.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.floor_divide_array.floor_divide.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1598, "end_line": 1651, "span_ids": ["array.floor_divide"], "tokens": 514}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def floor_divide(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n operand_dtype = (\n self.dtype\n if not isinstance(x2, array)\n else pandas.core.dtypes.cast.find_common_type([self.dtype, x2.dtype])\n )\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else operand_dtype)\n )\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n if is_scalar(x2):\n result = self._query_compiler.floordiv(x2)\n if x2 == 0 and numpy.issubdtype(out_dtype, numpy.integer):\n # NumPy's floor_divide by 0 works differently from pandas', so we need to fix\n # the output.\n result = (\n result.replace(numpy.inf, 0)\n .replace(numpy.NINF, 0)\n .where(self._query_compiler.ne(0), 0)\n )\n return fix_dtypes_and_determine_return(\n result, self._ndim, dtype, out, where\n )\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # Modin does not correctly support broadcasting when the caller of the function is\n # a Series (1D), and the operand is a Dataframe (2D). We cannot workaround this using\n # commutativity, and `rfloordiv` also works incorrectly. GH#5529\n raise NotImplementedError(\n \"Using floor_divide with broadcast is not currently available in Modin.\"\n )\n result = caller.floordiv(callee, **kwargs)\n if callee.eq(0).any() and numpy.issubdtype(out_dtype, numpy.integer):\n # NumPy's floor_divide by 0 works differently from pandas', so we need to fix\n # the output.\n result = (\n result.replace(numpy.inf, 0)\n .replace(numpy.NINF, 0)\n .where(callee.ne(0), 0)\n )\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__floordiv___array.__pow__.power": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__floordiv___array.__pow__.power", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1653, "end_line": 1679, "span_ids": ["array.power", "array:9", "array:7"], "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 array(object):\n\n __floordiv__ = floor_divide\n\n def power(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # Modin does not correctly support broadcasting when the caller of the function is\n # a Series (1D), and the operand is a Dataframe (2D). We cannot workaround this using\n # commutativity, and `rpow` also works incorrectly. GH#5529\n raise NotImplementedError(\n \"Using power with broadcast is not currently available in Modin.\"\n )\n result = caller.pow(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)\n\n __pow__ = power", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.prod_array.prod.if_truthy_where_or_out_is.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.prod_array.prod.if_truthy_where_or_out_is.else_.return._", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1681, "end_line": 1777, "span_ids": ["array.prod"], "tokens": 878}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def prod(\n self, axis=None, dtype=None, out=None, keepdims=None, initial=None, where=True\n ):\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else self.dtype)\n )\n initial = 1 if initial is None else initial\n check_kwargs(keepdims=keepdims, where=where)\n apply_axis = self._validate_axis(axis)\n truthy_where = bool(where)\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n target = where.where(self, 1) if isinstance(where, array) else self\n result = target._query_compiler.astype(\n {col_name: out_dtype for col_name in target._query_compiler.columns}\n ).prod(axis=0, skipna=False)\n result = result.mul(initial)\n if keepdims:\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)\n .astype(out_dtype)\n ._query_compiler\n )\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, dtype, out, truthy_where\n )\n else:\n return array([initial], dtype=out_dtype)\n return result.to_numpy()[0, 0] if truthy_where else initial\n if apply_axis is None:\n result = self\n if isinstance(where, array):\n result = where.where(self, 1)\n result = (\n result.astype(out_dtype)\n ._query_compiler.prod(axis=1, skipna=False)\n .prod(axis=0, skipna=False)\n .to_numpy()[0, 0]\n )\n result *= initial\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 1, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)\n .astype(out_dtype)\n ._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]]))\n .astype(out_dtype)\n ._query_compiler,\n 2,\n dtype,\n out,\n truthy_where,\n )\n else:\n return array([[initial]], dtype=out_dtype)\n return result if truthy_where else initial\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n target = where.where(self, 1) if isinstance(where, array) else self\n result = target._query_compiler.astype(\n {col_name: out_dtype for col_name in target._query_compiler.columns}\n ).prod(axis=apply_axis, skipna=False)\n result = result.mul(initial)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n return result.to_numpy()[0, 0] if truthy_where else initial\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if initial is not None and out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial).astype(out_dtype)._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, new_ndim, dtype, out, truthy_where\n )\n else:\n return (\n numpy.ones_like(array(_query_compiler=result, _ndim=new_ndim)) * initial\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.multiply_array.__rmul__.return.self_multiply_x2_out_wh": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.multiply_array.__rmul__.return.self_multiply_x2_out_wh", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1779, "end_line": 1808, "span_ids": ["array.multiply", "array.__rmul__", "array:11"], "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 array(object):\n\n def multiply(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n result = caller.mul(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)\n\n __mul__ = multiply\n\n def __rmul__(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self.multiply(x2, out, where, casting, order, dtype, subok)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.dot_array.dot.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.dot_array.dot.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1810, "end_line": 1840, "span_ids": ["array.dot"], "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 array(object):\n\n def dot(self, other, out=None):\n other = try_convert_from_interoperable_type(other)\n if numpy.isscalar(other):\n # other is scalar -- result is an array\n result = self._query_compiler.mul(other)\n result_ndim = self._ndim\n elif not isinstance(other, array):\n raise TypeError(\n f\"Unsupported operand type(s): '{type(self)}' and '{type(other)}'\"\n )\n elif self._ndim == 1 and other._ndim == 1:\n # both 1D arrays -- result is a scalar\n result = self._query_compiler.dot(\n other._query_compiler, squeeze_self=True, squeeze_other=True\n )\n return result.to_numpy()[0, 0]\n elif self._ndim == 2 and other._ndim == 2:\n # both 2D arrays -- result is a 2D array\n result = self._query_compiler.dot(other._query_compiler)\n result_ndim = 2\n elif self._ndim == 1 and other._ndim == 2:\n result = self._query_compiler.dot(other._query_compiler, squeeze_self=True)\n result_ndim = 1\n elif self._ndim == 2 and other._ndim == 1:\n result = self._query_compiler.dot(other._query_compiler)\n result_ndim = 1\n return fix_dtypes_and_determine_return(\n result,\n result_ndim,\n out=out,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__matmul___array._norm.if_axis_is_None_.else_.return.array__query_compiler_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__matmul___array._norm.if_axis_is_None_.else_.return.array__query_compiler_res", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1842, "end_line": 1876, "span_ids": ["array.__matmul__", "array._norm"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def __matmul__(self, other):\n if numpy.isscalar(other):\n # numpy's original error message is something cryptic about a gufunc signature\n raise ValueError(\n \"cannot call matmul with a scalar argument (use np.dot instead)\"\n )\n return self.dot(other)\n\n def _norm(self, ord=None, axis=None, keepdims=False):\n check_kwargs(keepdims=keepdims)\n if ord is not None and ord not in (\"fro\",): # , numpy.inf, -numpy.inf, 0):\n raise NotImplementedError(\"unsupported ord argument for norm:\", ord)\n if isinstance(axis, int) and axis < 0:\n apply_axis = self._ndim + axis\n else:\n apply_axis = axis or 0\n if apply_axis >= self._ndim or apply_axis < 0:\n raise numpy.AxisError(axis, self._ndim)\n result = self._query_compiler.pow(2)\n if self._ndim == 2:\n result = result.sum(axis=apply_axis)\n if axis is None:\n result = result.sum(axis=apply_axis ^ 1)\n else:\n result = result.sum(axis=0)\n if axis is None:\n # Return a scalar\n return result._sqrt().to_numpy()[0, 0]\n else:\n result = result._sqrt()\n # the DF may be transposed after processing through pandas\n # check query compiler shape to ensure this is a row vector (1xN) not column (Nx1)\n if len(result.index) != 1:\n result = result.transpose()\n return array(_query_compiler=result, _ndim=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_modin-project__modin/modin/numpy/arr.py_array.remainder_array.remainder.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.remainder_array.remainder.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1878, "end_line": 1925, "span_ids": ["array.remainder"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def remainder(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n operand_dtype = (\n self.dtype\n if not isinstance(x2, array)\n else pandas.core.dtypes.cast.find_common_type([self.dtype, x2.dtype])\n )\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else operand_dtype)\n )\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n if is_scalar(x2):\n result = self._query_compiler.astype(\n {col_name: out_dtype for col_name in self._query_compiler.columns}\n ).mod(x2)\n if x2 == 0 and numpy.issubdtype(out_dtype, numpy.integer):\n # NumPy's remainder by 0 works differently from pandas', so we need to fix\n # the output.\n result = result.replace(numpy.NaN, 0)\n return fix_dtypes_and_determine_return(\n result, self._ndim, dtype, out, where\n )\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # Modin does not correctly support broadcasting when the caller of the function is\n # a Series (1D), and the operand is a Dataframe (2D). We cannot workaround this using\n # commutativity, and `rmod` also works incorrectly. GH#5529\n raise NotImplementedError(\n \"Using remainder with broadcast is not currently available in Modin.\"\n )\n result = caller.mod(callee, **kwargs)\n if callee.eq(0).any() and numpy.issubdtype(out_dtype, numpy.integer):\n # NumPy's floor_divide by 0 works differently from pandas', so we need to fix\n # the output.\n result = result.replace(numpy.NaN, 0)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__mod___array.subtract.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__mod___array.subtract.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1927, "end_line": 1950, "span_ids": ["array:13", "array.subtract"], "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 array(object):\n\n __mod__ = remainder\n\n def subtract(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object - 2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object.rsub(1D_object).\n result = caller.rsub(callee, **kwargs)\n else:\n result = caller.sub(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__sub___array.__rsub__.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__sub___array.__rsub__.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1952, "end_line": 1975, "span_ids": ["array.__rsub__", "array:15"], "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 array(object):\n\n __sub__ = subtract\n\n def __rsub__(\n self,\n x2,\n out=None,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(order=order, subok=subok, casting=casting, where=where)\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, dtype=dtype, out=out\n )\n if caller != self._query_compiler:\n # In this case, we are doing an operation that looks like this 1D_object - 2D_object.\n # For Modin to broadcast directly, we have to swap it so that the operation is actually\n # 2D_object.sub(1D_object).\n result = caller.sub(callee, **kwargs)\n else:\n result = caller.rsub(callee, **kwargs)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.sum_array.sum.if_truthy_where_or_out_is.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.sum_array.sum.if_truthy_where_or_out_is.else_.return._", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1977, "end_line": 2072, "span_ids": ["array.sum"], "tokens": 874}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def sum(\n self, axis=None, dtype=None, out=None, keepdims=None, initial=None, where=True\n ):\n out_dtype = (\n dtype\n if dtype is not None\n else (out.dtype if out is not None else self.dtype)\n )\n initial = 0 if initial is None else initial\n check_kwargs(keepdims=keepdims, where=where)\n apply_axis = self._validate_axis(axis)\n truthy_where = bool(where)\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n target = where.where(self, 0) if isinstance(where, array) else self\n result = target._query_compiler.astype(\n {col_name: out_dtype for col_name in target._query_compiler.columns}\n ).sum(axis=0, skipna=False)\n result = result.add(initial)\n if keepdims:\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out, dtype=out_dtype) * initial)\n .astype(out_dtype)\n ._query_compiler\n )\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, dtype, out, truthy_where\n )\n else:\n return array([initial], dtype=out_dtype)\n return result.to_numpy()[0, 0] if truthy_where else initial\n if apply_axis is None:\n result = self\n if isinstance(where, array):\n result = where.where(self, 0)\n result = (\n result.astype(out_dtype)\n ._query_compiler.sum(axis=1, skipna=False)\n .sum(axis=0, skipna=False)\n .to_numpy()[0, 0]\n )\n result += initial\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 1, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial)\n .astype(out_dtype)\n ._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]], dtype=out_dtype))._query_compiler,\n 2,\n dtype,\n out,\n truthy_where,\n )\n else:\n return array([[initial]], dtype=out_dtype)\n return result if truthy_where else initial\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n target = where.where(self, 0) if isinstance(where, array) else self\n result = target._query_compiler.astype(\n {col_name: out_dtype for col_name in target._query_compiler.columns}\n ).sum(axis=apply_axis, skipna=False)\n result = result.add(initial)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n return result.to_numpy()[0, 0] if truthy_where else initial\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if out is not None:\n out._update_inplace(\n (numpy.ones_like(out) * initial).astype(out_dtype)._query_compiler\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, new_ndim, dtype, out, truthy_where\n )\n else:\n return (\n numpy.zeros_like(array(_query_compiler=result, _ndim=new_ndim))\n + initial\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.all_array.all.if_truthy_where_or_out_is.else_.return.numpy_ones_like_array__qu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.all_array.all.if_truthy_where_or_out_is.else_.return.numpy_ones_like_array__qu", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2074, "end_line": 2127, "span_ids": ["array.all"], "tokens": 572}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def all(self, axis=None, out=None, keepdims=None, *, where=True):\n check_kwargs(keepdims=keepdims, where=where)\n truthy_where = bool(where)\n apply_axis = self._validate_axis(axis)\n target = where.where(self, True) if isinstance(where, array) else self\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n result = target._query_compiler.all(axis=0)\n if keepdims:\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, bool, out, truthy_where\n )\n else:\n return array([True], dtype=bool)\n return result.to_numpy()[0, 0] if truthy_where else True\n if apply_axis is None:\n result = target._query_compiler.all(axis=1).all(axis=0)\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]], dtype=bool))._query_compiler,\n 2,\n bool,\n out,\n truthy_where,\n )\n else:\n return array([[True]], dtype=bool)\n return result.to_numpy()[0, 0] if truthy_where else True\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n result = target._query_compiler.all(axis=apply_axis)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n result = result.to_numpy()[0, 0]\n return result if truthy_where else True\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, new_ndim, bool, out, truthy_where\n )\n else:\n return numpy.ones_like(array(_query_compiler=result, _ndim=new_ndim))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._all_array._any.any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._all_array._any.any", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2129, "end_line": 2186, "span_ids": ["array:17", "array.any", "array:19"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n _all = all\n\n def any(self, axis=None, out=None, keepdims=None, *, where=True):\n check_kwargs(keepdims=keepdims, where=where)\n truthy_where = bool(where)\n apply_axis = self._validate_axis(axis)\n target = where.where(self, False) if isinstance(where, array) else self\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n result = target._query_compiler.any(axis=0)\n if keepdims:\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, 1, bool, out, truthy_where\n )\n else:\n return array([False], dtype=bool)\n return result.to_numpy()[0, 0] if truthy_where else False\n if apply_axis is None:\n result = target._query_compiler.any(axis=1).any(axis=0)\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]], dtype=bool))._query_compiler,\n 2,\n bool,\n out,\n truthy_where,\n )\n else:\n return array([[False]], dtype=bool)\n return result.to_numpy()[0, 0] if truthy_where else False\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n result = target._query_compiler.any(axis=apply_axis)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n result = result.to_numpy()[0, 0]\n return result if truthy_where else False\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n if truthy_where or out is not None:\n return fix_dtypes_and_determine_return(\n result, new_ndim, bool, out, truthy_where\n )\n else:\n return numpy.zeros_like(array(_query_compiler=result, _ndim=new_ndim))\n\n _any = any", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.argmax_array.argmax.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.argmax_array.argmax.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2188, "end_line": 2249, "span_ids": ["array.argmax"], "tokens": 725}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def argmax(self, axis=None, out=None, keepdims=None):\n check_kwargs(keepdims=keepdims)\n apply_axis = self._validate_axis(axis)\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n if self._query_compiler.isna().any(axis=1).any(axis=0).to_numpy()[0, 0]:\n na_row_map = self._query_compiler.isna().any(axis=1)\n result = na_row_map.idxmax()\n else:\n result = self._query_compiler.idxmax(axis=0)\n if keepdims:\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n return fix_dtypes_and_determine_return(\n result, 1, numpy.int64, out, True\n )\n return result.to_numpy()[0, 0]\n if apply_axis is None:\n if self._query_compiler.isna().any(axis=1).any(axis=0).to_numpy()[0, 0]:\n na_row_map = self._query_compiler.isna().any(axis=1)\n na_row = self._query_compiler.getitem_array(na_row_map)\n col_idx = na_row.to_numpy().argmax()\n final_idxmax = na_row_map.idxmax().to_numpy().flatten()\n else:\n inner_idxs = self._query_compiler.idxmax(axis=1)\n final_idxmax = (\n self._query_compiler.max(axis=1).idxmax(axis=0).to_numpy().flatten()\n )\n col_idx = inner_idxs.take_2d_positional(final_idxmax, [0]).to_numpy()[\n 0, 0\n ]\n result = (self.shape[1] * final_idxmax[0]) + col_idx\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]], dtype=bool))._query_compiler,\n 2,\n numpy.int64,\n out,\n True,\n )\n return result\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n result = self._query_compiler.idxmax(axis=apply_axis)\n na_mask = self._query_compiler.isna().any(axis=apply_axis)\n if na_mask.any(axis=apply_axis ^ 1).to_numpy()[0, 0]:\n na_idxs = self._query_compiler.isna().idxmax(axis=apply_axis)\n result = na_mask.where(na_idxs, result)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n result = result.to_numpy()[0, 0]\n return result\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n return fix_dtypes_and_determine_return(result, new_ndim, numpy.int64, out, 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_modin-project__modin/modin/numpy/arr.py_array.argmin_array.argmin.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.argmin_array.argmin.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2251, "end_line": 2314, "span_ids": ["array.argmin"], "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 array(object):\n\n def argmin(self, axis=None, out=None, keepdims=None):\n check_kwargs(keepdims=keepdims)\n apply_axis = self._validate_axis(axis)\n if self._ndim == 1:\n if apply_axis == 1:\n raise numpy.AxisError(1, 1)\n if self._query_compiler.isna().any(axis=1).any(axis=0).to_numpy()[0, 0]:\n na_row_map = self._query_compiler.isna().any(axis=1)\n # numpy apparently considers nan to be the minimum value in an array if present\n # therefore, we use idxmax on the mask array to identify where nans are\n result = na_row_map.idxmax()\n else:\n result = self._query_compiler.idxmin(axis=0)\n if keepdims:\n if out is not None and out.shape != (1,):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n return fix_dtypes_and_determine_return(\n result, 1, numpy.int64, out, True\n )\n return result.to_numpy()[0, 0]\n if apply_axis is None:\n if self._query_compiler.isna().any(axis=1).any(axis=0).to_numpy()[0, 0]:\n na_row_map = self._query_compiler.isna().any(axis=1)\n na_row = self._query_compiler.getitem_array(na_row_map)\n col_idx = na_row.to_numpy().argmax()\n final_idxmax = na_row_map.idxmax().to_numpy().flatten()\n else:\n inner_idxs = self._query_compiler.idxmin(axis=1)\n final_idxmax = (\n self._query_compiler.min(axis=1).idxmin(axis=0).to_numpy().flatten()\n )\n col_idx = inner_idxs.take_2d_positional(final_idxmax, [0]).to_numpy()[\n 0, 0\n ]\n result = (self.shape[1] * final_idxmax[0]) + col_idx\n if keepdims:\n if out is not None and out.shape != (1, 1):\n raise ValueError(\n f\"operand was set up as a reduction along axis 0, but the length of the axis is {out.shape[0]} (it has to be 1)\"\n )\n return fix_dtypes_and_determine_return(\n array(numpy.array([[result]], dtype=bool))._query_compiler,\n 2,\n numpy.int64,\n out,\n True,\n )\n return result\n if apply_axis > 1:\n raise numpy.AxisError(axis, 2)\n result = self._query_compiler.idxmin(axis=apply_axis)\n na_mask = self._query_compiler.isna().any(axis=apply_axis)\n if na_mask.any(axis=apply_axis ^ 1).to_numpy()[0, 0]:\n na_idxs = self._query_compiler.isna().idxmax(axis=apply_axis)\n result = na_mask.where(na_idxs, result)\n new_ndim = self._ndim - 1 if not keepdims else self._ndim\n if new_ndim == 0:\n result = result.to_numpy()[0, 0]\n return result\n if not keepdims and apply_axis != 1:\n result = result.transpose()\n return fix_dtypes_and_determine_return(result, new_ndim, numpy.int64, out, 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_modin-project__modin/modin/numpy/arr.py_array._isfinite_array._logical_not.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._isfinite_array._logical_not.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2316, "end_line": 2405, "span_ids": ["array._iscomplex", "array._logical_not", "array._isreal", "array._isnat", "array._isneginf", "array._isfinite", "array._isposinf", "array._isinf", "array._isnan"], "tokens": 641}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class array(object):\n\n def _isfinite(\n self,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n result = self._query_compiler._isfinite()\n return fix_dtypes_and_determine_return(result, self._ndim, dtype, out, where)\n\n def _isinf(\n self,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n result = self._query_compiler._isinf()\n return fix_dtypes_and_determine_return(result, self._ndim, dtype, out, where)\n\n def _isnan(\n self,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n result = self._query_compiler.isna()\n return fix_dtypes_and_determine_return(result, self._ndim, dtype, out, where)\n\n def _isnat(\n self,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n result = self._query_compiler._isnat()\n return fix_dtypes_and_determine_return(result, self._ndim, dtype, out, where)\n\n def _isneginf(self, out=None):\n result = self._query_compiler._isneginf()\n return fix_dtypes_and_determine_return(result, self._ndim, out=out)\n\n def _isposinf(self, out=None):\n result = self._query_compiler._isposinf()\n return fix_dtypes_and_determine_return(result, self._ndim, out=out)\n\n def _iscomplex(self):\n result = self._query_compiler._iscomplex()\n return fix_dtypes_and_determine_return(result, self._ndim)\n\n def _isreal(self):\n result = self._query_compiler._isreal()\n return fix_dtypes_and_determine_return(result, self._ndim)\n\n def _logical_not(\n self,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n result = self._query_compiler._logical_not()\n return fix_dtypes_and_determine_return(result, self._ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._logical_binop_array._logical_binop.return.fix_dtypes_and_determine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._logical_binop_array._logical_binop.return.fix_dtypes_and_determine_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2407, "end_line": 2420, "span_ids": ["array._logical_binop"], "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 array(object):\n\n def _logical_binop(\n self, qc_method_name, x2, out, where, casting, order, dtype, subok\n ):\n check_kwargs(where=where, casting=casting, order=order, subok=subok)\n if self._ndim != x2._ndim:\n raise ValueError(\n \"modin.numpy logic operators do not currently support broadcasting between arrays of different dimensions\"\n )\n caller, callee, new_ndim, kwargs = self._preprocess_binary_op(\n x2, cast_input_types=False, dtype=dtype, out=out\n )\n # Deliberately do not pass **kwargs, since they're not used\n result = getattr(caller, qc_method_name)(callee)\n return fix_dtypes_and_determine_return(result, new_ndim, dtype, out, where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._logical_and_array._logical_xor.return.self__logical_binop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._logical_and_array._logical_xor.return.self__logical_binop_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2422, "end_line": 2468, "span_ids": ["array._logical_xor", "array._logical_and", "array._logical_or"], "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 array(object):\n\n def _logical_and(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self._logical_binop(\n \"_logical_and\", x2, out, where, casting, order, dtype, subok\n )\n\n def _logical_or(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self._logical_binop(\n \"_logical_or\", x2, out, where, casting, order, dtype, subok\n )\n\n def _logical_xor(\n self,\n x2,\n /,\n out=None,\n *,\n where=True,\n casting=\"same_kind\",\n order=\"K\",\n dtype=None,\n subok=True,\n ):\n return self._logical_binop(\n \"_logical_xor\", x2, out, where, casting, order, dtype, subok\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.flatten_array._get_shape.return._len_self__query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.flatten_array._get_shape.return._len_self__query_compiler", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2470, "end_line": 2489, "span_ids": ["array.flatten", "array._get_shape"], "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 array(object):\n\n def flatten(self, order=\"C\"):\n check_kwargs(order=order)\n qcs = [\n self._query_compiler.getitem_row_array([index_val]).reset_index(drop=True)\n for index_val in self._query_compiler.index[1:]\n ]\n new_query_compiler = (\n self._query_compiler.getitem_row_array([self._query_compiler.index[0]])\n .reset_index(drop=True)\n .concat(1, qcs, ignore_index=True)\n )\n new_query_compiler.columns = range(len(new_query_compiler.columns))\n new_query_compiler = new_query_compiler.transpose()\n new_ndim = 1\n return array(_query_compiler=new_query_compiler, _ndim=new_ndim)\n\n def _get_shape(self):\n if self._ndim == 1:\n return (len(self._query_compiler.index),)\n return (len(self._query_compiler.index), len(self._query_compiler.columns))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._set_shape_array._set_shape.if_isinstance_new_shape_.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._set_shape_array._set_shape.if_isinstance_new_shape_.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2491, "end_line": 2514, "span_ids": ["array._set_shape"], "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 array(object):\n\n def _set_shape(self, new_shape):\n if not (isinstance(new_shape, int)) and not isinstance(new_shape, tuple):\n raise TypeError(\n f\"expected a sequence of integers or a single integer, got '{new_shape}'\"\n )\n elif isinstance(new_shape, tuple):\n for dim in new_shape:\n if not isinstance(dim, int):\n raise TypeError(\n f\"'{type(dim)}' object cannot be interpreted as an integer\"\n )\n\n new_dimensions = new_shape if isinstance(new_shape, int) else prod(new_shape)\n if new_dimensions != prod(self._get_shape()):\n raise ValueError(\n f\"cannot reshape array of size {prod(self._get_shape())} into {new_shape if isinstance(new_shape, tuple) else (new_shape,)}\"\n )\n if isinstance(new_shape, int) or len(new_shape) == 1:\n self._update_inplace(self.flatten()._query_compiler)\n self._ndim = 1\n else:\n raise NotImplementedError(\n \"Modin numpy does not currently support reshaping to a 2D object\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.shape_array.__len__.return.self_shape_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.shape_array.__len__.return.self_shape_0_", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2516, "end_line": 2538, "span_ids": ["array.dtype", "array:21", "array:23", "array.__len__", "array.size", "array.transpose"], "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 array(object):\n\n shape = property(_get_shape, _set_shape)\n\n def transpose(self):\n if self._ndim == 1:\n return self\n return array(_query_compiler=self._query_compiler.transpose(), _ndim=self._ndim)\n\n T = property(transpose)\n\n @property\n def dtype(self):\n dtype = self._query_compiler.dtypes\n if self._ndim == 1:\n return dtype[0]\n else:\n return pandas.core.dtypes.cast.find_common_type(list(dtype.values))\n\n @property\n def size(self):\n return prod(self.shape)\n\n def __len__(self):\n return self.shape[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_modin-project__modin/modin/numpy/arr.py_array.astype_array.astype.return.array__query_compiler_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.astype_array.astype.return.array__query_compiler_res", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2540, "end_line": 2551, "span_ids": ["array.astype"], "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 array(object):\n\n def astype(self, dtype, order=\"K\", casting=\"unsafe\", subok=True, copy=True):\n if casting != \"unsafe\":\n raise ValueError(\n \"Modin does not support `astype` with `casting != unsafe`.\"\n )\n check_kwargs(order=order, subok=subok)\n result = self._query_compiler.astype(\n {col_name: dtype for col_name in self._query_compiler.columns}\n )\n if not copy and subok and numpy.issubdtype(self.dtype, dtype):\n return self\n return array(_query_compiler=result, _ndim=self._ndim)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._build_repr_array_array._build_repr_array.return.arr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array._build_repr_array_array._build_repr_array.return.arr", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2553, "end_line": 2582, "span_ids": ["array._build_repr_array"], "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 array(object):\n\n def _build_repr_array(self):\n def _generate_indices_for_axis(\n axis_size, num_elements=numpy.get_printoptions()[\"edgeitems\"]\n ):\n if axis_size > num_elements * 2:\n return list(range(num_elements + 1)) + list(\n range(axis_size - num_elements, axis_size)\n )\n return list(range(axis_size))\n\n # We want to rely on NumPy for creating a string representation of this array; however\n # we also don't want to materialize all of the data to the head node. Instead, we will\n # materialize enough data that NumPy can build the summarized representation of the array\n # (while changing with the NumPy print options so it will format this smaller array as\n # abridged) and return this smaller array. In the worst case, this array will have\n # (2*numpy.get_printoptions()[\"edgeitems\"] + 1)^2 items, so 49 items max for the default\n # value of 3.\n if self._ndim == 1 or self.shape[1] == 0:\n idxs = _generate_indices_for_axis(len(self))\n arr = self._query_compiler.getitem_row_array(idxs).to_numpy()\n if self._ndim == 1:\n arr = arr.flatten()\n elif self.shape[0] == 1:\n idxs = _generate_indices_for_axis(self.shape[1])\n arr = self._query_compiler.getitem_column_array(idxs).to_numpy()\n else:\n row_idxs = _generate_indices_for_axis(len(self))\n col_idxs = _generate_indices_for_axis(self.shape[1])\n arr = self._query_compiler.take_2d_positional(row_idxs, col_idxs).to_numpy()\n return arr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__repr___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/arr.py_array.__repr___", "embedding": null, "metadata": {"file_path": "modin/numpy/arr.py", "file_name": "arr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2584, "end_line": 2603, "span_ids": ["array._to_numpy", "array.__repr__"], "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 array(object):\n\n def __repr__(self):\n # If we are dealing with a small array, we can just collate all the data on the\n # head node and let numpy handle the logic to get a string representation.\n if self.size <= numpy.get_printoptions()[\"threshold\"]:\n return repr(self._to_numpy())\n arr = self._build_repr_array()\n prev_threshold = numpy.get_printoptions()[\"threshold\"]\n numpy.set_printoptions(threshold=arr.size - 1)\n try:\n repr_str = repr(arr)\n finally:\n numpy.set_printoptions(threshold=prev_threshold)\n return repr_str\n\n def _to_numpy(self):\n arr = self._query_compiler.to_numpy()\n if self._ndim == 1:\n arr = arr.flatten()\n return arr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_creation.py_numpy__create_array.return.array_getattr_numpy_nump": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_creation.py_numpy__create_array.return.array_getattr_numpy_nump", "embedding": null, "metadata": {"file_path": "modin/numpy/array_creation.py", "file_name": "array_creation.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 32, "span_ids": ["_create_array", "docstring"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\n\nfrom modin.error_message import ErrorMessage\nfrom .arr import array\n\n\ndef _create_array(dtype, shape, order, subok, numpy_method):\n if order not in [\"K\", \"C\"]:\n ErrorMessage.single_warning(\n \"Array order besides 'C' is not currently supported in Modin. Defaulting to 'C' order.\"\n )\n if not subok:\n ErrorMessage.single_warning(\n \"Subclassing types is not currently supported in Modin. Defaulting to the same base dtype.\"\n )\n ErrorMessage.single_warning(f\"np.{numpy_method}_like defaulting to NumPy.\")\n return array(getattr(numpy, numpy_method)(shape, dtype=dtype))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_creation.py_zeros_like_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_creation.py_zeros_like_", "embedding": null, "metadata": {"file_path": "modin/numpy/array_creation.py", "file_name": "array_creation.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 60, "span_ids": ["zeros_like", "ones_like", "tri"], "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": "def zeros_like(a, dtype=None, order=\"K\", subok=True, shape=None):\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"zeros_like\", type(a))\n return numpy.zeros_like(a, dtype=dtype, order=order, subok=subok, shape=shape)\n dtype = a.dtype if dtype is None else dtype\n shape = a.shape if shape is None else shape\n return _create_array(dtype, shape, order, subok, \"zeros\")\n\n\ndef ones_like(a, dtype=None, order=\"K\", subok=True, shape=None):\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"ones_like\", type(a))\n return numpy.ones_like(a, dtype=dtype, order=order, subok=subok, shape=shape)\n dtype = a.dtype if dtype is None else dtype\n shape = a.shape if shape is None else shape\n return _create_array(dtype, shape, order, subok, \"ones\")\n\n\ndef tri(N, M=None, k=0, dtype=float, like=None):\n if like is not None:\n ErrorMessage.single_warning(\n \"Modin NumPy does not support the `like` argument for np.tri. Defaulting to `like=None`.\"\n )\n ErrorMessage.single_warning(\"np.tri defaulting to NumPy.\")\n return array(numpy.tri(N, M=M, k=k, dtype=dtype))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_shaping.py_numpy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/array_shaping.py_numpy_", "embedding": null, "metadata": {"file_path": "modin/numpy/array_shaping.py", "file_name": "array_shaping.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 77, "span_ids": ["shape", "transpose", "ravel", "append", "hstack", "split", "docstring"], "tokens": 481}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\n\nfrom modin.error_message import ErrorMessage\nfrom .arr import array\nfrom .utils import try_convert_from_interoperable_type\n\n\ndef ravel(a, order=\"C\"):\n a = try_convert_from_interoperable_type(a)\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"ravel\", type(a))\n return numpy.ravel(a, order=order)\n if order != \"C\":\n ErrorMessage.single_warning(\n \"Array order besides 'C' is not currently supported in Modin. Defaulting to 'C' order.\"\n )\n return a.flatten(order)\n\n\ndef shape(a):\n a = try_convert_from_interoperable_type(a)\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"shape\", type(a))\n return numpy.shape(a)\n return a.shape\n\n\ndef transpose(a, axes=None):\n a = try_convert_from_interoperable_type(a)\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"transpose\", type(a))\n return numpy.transpose(a, axes=axes)\n if axes is not None:\n raise NotImplementedError(\n \"Modin does not support arrays higher than 2-dimensions. Please use `transpose` with `axis=None` on a 2-dimensional or lower object.\"\n )\n return a.transpose()\n\n\ndef split(arr, indices, axis=0):\n arr = try_convert_from_interoperable_type(arr)\n if not isinstance(arr, array):\n ErrorMessage.bad_type_for_numpy_op(\"split\", type(arr))\n return numpy.split(arr, indices, axis=axis)\n return arr.split(indices, axis)\n\n\ndef hstack(tup, dtype=None, casting=\"same_kind\"):\n a = try_convert_from_interoperable_type(tup[0])\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"hstack\", type(a))\n return numpy.hstack(tup, dtype=dtype, casting=casting)\n return a.hstack(tup[1:], dtype, casting)\n\n\ndef append(arr, values, axis=None):\n arr = try_convert_from_interoperable_type(arr)\n if not isinstance(arr, array):\n ErrorMessage.bad_type_for_numpy_op(\"append\", type(arr))\n return numpy.append(arr, values, axis=axis)\n return arr.append(values, axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/constants.py_from_numpy_import__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/constants.py_from_numpy_import__", "embedding": null, "metadata": {"file_path": "modin/numpy/constants.py", "file_name": "constants.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 50, "span_ids": ["docstring"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from numpy import (\n Inf,\n Infinity,\n NAN,\n NINF,\n NZERO,\n NaN,\n PINF,\n PZERO,\n e,\n euler_gamma,\n inf,\n infty,\n nan,\n newaxis,\n pi,\n)\n\n__all__ = [\n \"Inf\",\n \"Infinity\",\n \"NAN\",\n \"NINF\",\n \"NZERO\",\n \"NaN\",\n \"PINF\",\n \"PZERO\",\n \"e\",\n \"euler_gamma\",\n \"inf\",\n \"infty\",\n \"nan\",\n \"newaxis\",\n \"pi\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_np_broadcast_item.try_.except_ValueError_.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_np_broadcast_item.try_.except_ValueError_.raise_ValueError_", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 130, "span_ids": ["broadcast_item", "docstring"], "tokens": 801}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pandas\nimport itertools\nfrom pandas.api.types import is_list_like, is_bool\nfrom pandas.core.dtypes.common import is_integer, is_bool_dtype, is_integer_dtype\nfrom pandas.core.indexing import IndexingError\nfrom modin.error_message import ErrorMessage\n\nfrom .arr import array\nfrom modin.pandas.utils import is_scalar\nfrom modin.pandas.indexing import compute_sliced_len, is_tuple, is_slice, is_range_like\n\n\ndef broadcast_item(\n obj,\n row_lookup,\n col_lookup,\n item,\n need_columns_reindex=True,\n):\n \"\"\"\n Use NumPy to broadcast or reshape item with reindexing.\n\n Parameters\n ----------\n obj : DataFrame or Series\n The object containing the necessary information about the axes.\n row_lookup : slice or scalar\n The global row index to locate inside of `item`.\n col_lookup : range, array, list, slice or scalar\n The global col index to locate inside of `item`.\n item : DataFrame, Series, or query_compiler\n Value that should be broadcast to a new shape of `to_shape`.\n need_columns_reindex : bool, default: True\n In the case of assigning columns to a dataframe (broadcasting is\n part of the flow), reindexing is not needed.\n\n Returns\n -------\n np.ndarray\n `item` after it was broadcasted to `to_shape`.\n\n Raises\n ------\n ValueError\n 1) If `row_lookup` or `col_lookup` contains values missing in\n DataFrame/Series index or columns correspondingly.\n 2) If `item` cannot be broadcast from its own shape to `to_shape`.\n\n Notes\n -----\n NumPy is memory efficient, there shouldn't be performance issue.\n \"\"\"\n new_row_len = (\n len(obj._query_compiler.index[row_lookup])\n if isinstance(row_lookup, slice)\n else len(row_lookup)\n )\n new_col_len = (\n len(obj._query_compiler.columns[col_lookup])\n if isinstance(col_lookup, slice)\n else len(col_lookup)\n )\n to_shape = new_row_len, new_col_len\n\n if isinstance(item, array):\n # convert indices in lookups to names, as pandas reindex expects them to be so\n axes_to_reindex = {}\n index_values = obj._query_compiler.index[row_lookup]\n if not index_values.equals(item._query_compiler.index):\n axes_to_reindex[\"index\"] = index_values\n if need_columns_reindex and isinstance(item, array) and item._ndim == 2:\n column_values = obj._query_compiler.columns[col_lookup]\n if not column_values.equals(item._query_compiler.columns):\n axes_to_reindex[\"columns\"] = column_values\n # New value for columns/index make that reindex add NaN values\n if axes_to_reindex:\n row_axes = axes_to_reindex.get(\"index\", None)\n if row_axes is not None:\n item._query_compiler = item._query_compiler.reindex(\n axis=0, labels=row_axes, copy=None\n )\n col_axes = axes_to_reindex.get(\"columns\", None)\n if col_axes is not None:\n item._query_compiler = item._query_compiler.reindex(\n axis=1, labels=col_axes, copy=None\n )\n try:\n item = np.array(item) if not isinstance(item, array) else item._to_numpy()\n if np.prod(to_shape) == np.prod(item.shape):\n return item.reshape(to_shape)\n else:\n return np.broadcast_to(item, to_shape)\n except ValueError:\n from_shape = np.array(item).shape\n raise ValueError(\n f\"could not broadcast input array from shape {from_shape} into shape \"\n + f\"{to_shape}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_is_boolean_array_is_integer_slice.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_is_boolean_array_is_integer_slice.return.True", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 133, "end_line": 190, "span_ids": ["is_integer_slice", "is_integer_array", "is_boolean_array"], "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": "def is_boolean_array(x):\n \"\"\"\n Check that argument is an array of bool.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is an array of bool, False otherwise.\n \"\"\"\n if isinstance(x, (np.ndarray, array, pandas.Series, pandas.Index)):\n return is_bool_dtype(x.dtype)\n return is_list_like(x) and all(map(is_bool, x))\n\n\ndef is_integer_array(x):\n \"\"\"\n Check that argument is an array of integers.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is an array of integers, False otherwise.\n \"\"\"\n if isinstance(x, (np.ndarray, array, pandas.Series, pandas.Index)):\n return is_integer_dtype(x.dtype)\n return is_list_like(x) and all(map(is_integer, x))\n\n\ndef is_integer_slice(x):\n \"\"\"\n Check that argument is an array of int.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is an array of int, False otherwise.\n \"\"\"\n if not is_slice(x):\n return False\n for pos in [x.start, x.stop, x.step]:\n if not ((pos is None) or is_integer(pos)):\n return False # one position is neither None nor int\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_modin-project__modin/modin/numpy/indexing.py_boolean_mask_to_numeric_boolean_mask_to_numeric.if_isinstance_indexer_n.else_.return.np_fromiter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_boolean_mask_to_numeric_boolean_mask_to_numeric.if_isinstance_indexer_n.else_.return.np_fromiter_", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 216, "span_ids": ["boolean_mask_to_numeric"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def boolean_mask_to_numeric(indexer):\n \"\"\"\n Convert boolean mask to numeric indices.\n\n Parameters\n ----------\n indexer : list-like of booleans\n\n Returns\n -------\n np.ndarray of ints\n Numerical positions of ``True`` elements in the passed `indexer`.\n \"\"\"\n if isinstance(indexer, (np.ndarray, array, pandas.Series)):\n return np.where(indexer)[0]\n else:\n # It's faster to build the resulting numpy array from the reduced amount of data via\n # `compress` iterator than convert non-numpy-like `indexer` to numpy and apply `np.where`.\n return np.fromiter(\n # `itertools.compress` masks `data` with the `selectors` mask,\n # works about ~10% faster than a pure list comprehension\n itertools.compress(data=range(len(indexer)), selectors=indexer),\n dtype=np.int64,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py__ILOC_INT_ONLY_ERROR__compute_ndim.return.ndim": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py__ILOC_INT_ONLY_ERROR__compute_ndim.return.ndim", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 251, "span_ids": ["_compute_ndim", "impl"], "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": "_ILOC_INT_ONLY_ERROR = \"\"\"\nLocation based indexing can only have [integer, integer slice (START point is\nINCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types.\n\"\"\"\n\n\ndef _compute_ndim(row_loc, col_loc):\n \"\"\"\n Compute the number of dimensions of result from locators.\n\n Parameters\n ----------\n row_loc : list or scalar\n Row locator.\n col_loc : list or scalar\n Column locator.\n\n Returns\n -------\n {0, 1, 2}\n Number of dimensions in located dataset.\n \"\"\"\n row_scalar = is_scalar(row_loc) or is_tuple(row_loc)\n col_scalar = is_scalar(col_loc) or is_tuple(col_loc)\n\n if row_scalar and col_scalar:\n ndim = 0\n elif row_scalar ^ col_scalar:\n ndim = 1\n else:\n ndim = 2\n\n return ndim", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer_ArrayIndexer._get_numpy_object_from_qc_view.return.res_arr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer_ArrayIndexer._get_numpy_object_from_qc_view.return.res_arr", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 254, "end_line": 328, "span_ids": ["ArrayIndexer.__init__", "ArrayIndexer._get_numpy_object_from_qc_view", "ArrayIndexer"], "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 ArrayIndexer(object):\n \"\"\"\n An indexer for modin_arr.__{get|set}item__ functionality.\n\n Parameters\n ----------\n array : modin.numpy.array\n Array to operate on.\n \"\"\"\n\n def __init__(self, array):\n self.arr = array\n\n def _get_numpy_object_from_qc_view(\n self,\n qc_view,\n row_scalar: bool,\n col_scalar: bool,\n ndim: int,\n ):\n \"\"\"\n Convert the query compiler view to the appropriate NumPy object.\n\n Parameters\n ----------\n qc_view : BaseQueryCompiler\n Query compiler to convert.\n row_scalar : bool\n Whether indexer for rows is scalar.\n col_scalar : bool\n Whether indexer for columns is scalar.\n ndim : {0, 1, 2}\n Number of dimensions in dataset to be retrieved.\n\n Returns\n -------\n modin.numpy.array\n The array object with the data from the query compiler view.\n\n Notes\n -----\n Usage of `slice(None)` as a lookup is a hack to pass information about\n full-axis grab without computing actual indices that triggers lazy computations.\n Ideally, this API should get rid of using slices as indexers and either use a\n common ``Indexer`` object or range and ``np.ndarray`` only.\n \"\"\"\n if ndim == 2:\n return array(_query_compiler=qc_view, _ndim=self.arr._ndim)\n if self.arr._ndim == 1 and not row_scalar:\n return array(_query_compiler=qc_view, _ndim=1)\n\n if self.arr._ndim == 1:\n _ndim = 0\n elif ndim == 0:\n _ndim = 0\n else:\n # We are in the case where ndim == 1\n # The axis we squeeze on depends on whether we are looking for an exact\n # value or a subset of rows and columns. Knowing if we have a full MultiIndex\n # lookup or scalar lookup can help us figure out whether we need to squeeze\n # on the row or column index.\n if row_scalar and col_scalar:\n _ndim = 0\n elif not any([row_scalar, col_scalar]):\n _ndim = 2\n else:\n _ndim = 1\n if row_scalar:\n qc_view = qc_view.transpose()\n\n if _ndim == 0:\n return qc_view.to_numpy()[0, 0]\n\n res_arr = array(_query_compiler=qc_view, _ndim=_ndim)\n return res_arr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._parse_row_and_column_locators_ArrayIndexer._parse_row_and_column_locators.return.row_loc_col_loc__comput": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._parse_row_and_column_locators_ArrayIndexer._parse_row_and_column_locators.return.row_loc_col_loc__comput", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 330, "end_line": 367, "span_ids": ["ArrayIndexer._parse_row_and_column_locators"], "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 ArrayIndexer(object):\n\n def _parse_row_and_column_locators(self, tup):\n \"\"\"\n Unpack the user input for getitem and setitem and compute ndim.\n\n loc[a] -> ([a], :), 1D\n loc[[a,b]] -> ([a,b], :),\n loc[a,b] -> ([a], [b]), 0D\n\n Parameters\n ----------\n tup : tuple\n User input to unpack.\n\n Returns\n -------\n row_loc : scalar or list\n Row locator(s) as a scalar or List.\n col_list : scalar or list\n Column locator(s) as a scalar or List.\n ndim : {0, 1, 2}\n Number of dimensions of located dataset.\n \"\"\"\n row_loc, col_loc = slice(None), slice(None)\n\n if is_tuple(tup):\n row_loc = tup[0]\n if len(tup) == 2:\n col_loc = tup[1]\n if len(tup) > 2:\n raise IndexingError(\"Too many indexers\")\n else:\n row_loc = tup\n\n row_loc = row_loc(self.arr) if callable(row_loc) else row_loc\n col_loc = col_loc(self.arr) if callable(col_loc) else col_loc\n row_loc = row_loc._to_numpy() if isinstance(row_loc, array) else row_loc\n col_loc = col_loc._to_numpy() if isinstance(col_loc, array) else col_loc\n return row_loc, col_loc, _compute_ndim(row_loc, col_loc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer.__getitem___ArrayIndexer.__getitem__.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer.__getitem___ArrayIndexer.__getitem__.return.result", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 413, "span_ids": ["ArrayIndexer.__getitem__"], "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 ArrayIndexer(object):\n\n def __getitem__(self, key):\n \"\"\"\n Retrieve dataset according to `key`.\n\n Parameters\n ----------\n key : callable or tuple\n The global row numbers to retrieve data from.\n\n Returns\n -------\n DataFrame or Series\n Located dataset.\n\n See Also\n --------\n pandas.DataFrame.iloc\n \"\"\"\n row_loc, col_loc, ndim = self._parse_row_and_column_locators(key)\n row_scalar = is_scalar(row_loc)\n col_scalar = is_scalar(col_loc)\n self._check_dtypes(row_loc)\n self._check_dtypes(col_loc)\n\n row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)\n if isinstance(row_lookup, slice):\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=row_lookup != slice(None),\n extra_log=f\"Only None-slices are acceptable as a slice argument in masking, got: {row_lookup}\",\n )\n row_lookup = None\n if isinstance(col_lookup, slice):\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=col_lookup != slice(None),\n extra_log=f\"Only None-slices are acceptable as a slice argument in masking, got: {col_lookup}\",\n )\n col_lookup = None\n qc_view = self.arr._query_compiler.take_2d_positional(row_lookup, col_lookup)\n result = self._get_numpy_object_from_qc_view(\n qc_view,\n row_scalar=row_scalar,\n col_scalar=col_scalar,\n ndim=ndim,\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_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._determine_setitem_axis_ArrayIndexer._determine_setitem_axis.return.axis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._determine_setitem_axis_ArrayIndexer._determine_setitem_axis.return.axis", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 415, "end_line": 473, "span_ids": ["ArrayIndexer._determine_setitem_axis"], "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": "class ArrayIndexer(object):\n\n def _determine_setitem_axis(self, row_lookup, col_lookup, row_scalar, col_scalar):\n \"\"\"\n Determine an axis along which we should do an assignment.\n\n Parameters\n ----------\n row_lookup : slice or list\n Indexer for rows.\n col_lookup : slice or list\n Indexer for columns.\n row_scalar : bool\n Whether indexer for rows is scalar or not.\n col_scalar : bool\n Whether indexer for columns is scalar or not.\n\n Returns\n -------\n int or None\n None if this will be a both axis assignment, number of axis to assign in other cases.\n\n Notes\n -----\n axis = 0: column assignment df[col] = item\n axis = 1: row assignment df.loc[row] = item\n axis = None: assignment along both axes\n \"\"\"\n if self.arr.shape == (1, 1):\n return None if not (row_scalar ^ col_scalar) else 1 if row_scalar else 0\n\n def get_axis(axis):\n return (\n self.arr._query_compiler.index\n if axis == 0\n else self.arr._query_compiler.columns\n )\n\n row_lookup_len, col_lookup_len = [\n len(lookup)\n if not isinstance(lookup, slice)\n else compute_sliced_len(lookup, len(get_axis(i)))\n for i, lookup in enumerate([row_lookup, col_lookup])\n ]\n\n if col_lookup_len == 1 and row_lookup_len == 1:\n axis = None\n elif (\n row_lookup_len == len(self.arr._query_compiler.index)\n and col_lookup_len == 1\n and self.arr._ndim == 2\n ):\n axis = 0\n elif (\n col_lookup_len == len(self.arr._query_compiler.columns)\n and row_lookup_len == 1\n ):\n axis = 1\n else:\n axis = None\n return axis", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._write_items_ArrayIndexer._write_items.self_arr__update_inplace_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._write_items_ArrayIndexer._write_items.self_arr__update_inplace_", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 475, "end_line": 489, "span_ids": ["ArrayIndexer._write_items"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArrayIndexer(object):\n\n def _write_items(self, row_lookup, col_lookup, item):\n \"\"\"\n Perform remote write and replace blocks.\n\n Parameters\n ----------\n row_lookup : slice or scalar\n The global row index to write item to.\n col_lookup : slice or scalar\n The global col index to write item to.\n item : numpy.ndarray\n The new item value that needs to be assigned to `self`.\n \"\"\"\n new_qc = self.arr._query_compiler.write_items(row_lookup, col_lookup, item)\n self.arr._update_inplace(new_qc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._setitem_positional_ArrayIndexer._setitem_positional.if_axis_is_None_.else_.self__write_items_row_loo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._setitem_positional_ArrayIndexer._setitem_positional.if_axis_is_None_.else_.self__write_items_row_loo", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 491, "end_line": 524, "span_ids": ["ArrayIndexer._setitem_positional"], "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 ArrayIndexer(object):\n\n def _setitem_positional(self, row_lookup, col_lookup, item, axis=None):\n \"\"\"\n Assign `item` value to located dataset.\n\n Parameters\n ----------\n row_lookup : slice or scalar\n The global row index to write item to.\n col_lookup : slice or scalar\n The global col index to write item to.\n item : DataFrame, Series or scalar\n The new item needs to be set. It can be any shape that's\n broadcast-able to the product of the lookup tables.\n axis : {None, 0, 1}, default: None\n If not None, it means that whole axis is used to assign a value.\n 0 means assign to whole column, 1 means assign to whole row.\n If None, it means that partial assignment is done on both axes.\n \"\"\"\n # Convert slices to indices for the purposes of application.\n # TODO (devin-petersohn): Apply to slice without conversion to list\n if isinstance(row_lookup, slice):\n row_lookup = range(len(self.arr._query_compiler.index))[row_lookup]\n if isinstance(col_lookup, slice):\n col_lookup = range(len(self.arr._query_compiler.columns))[col_lookup]\n if axis is None:\n if not is_scalar(item):\n item = broadcast_item(self.arr, row_lookup, col_lookup, item)\n self.arr._query_compiler = self.arr._query_compiler.write_items(\n row_lookup, col_lookup, item\n )\n else:\n if not is_scalar(item):\n item = broadcast_item(self.arr, row_lookup, col_lookup, item)\n self._write_items(row_lookup, col_lookup, item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer.__setitem___ArrayIndexer.__setitem__.self__setitem_positional_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer.__setitem___ArrayIndexer.__setitem__.self__setitem_positional_", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 526, "end_line": 555, "span_ids": ["ArrayIndexer.__setitem__"], "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 ArrayIndexer(object):\n\n def __setitem__(self, key, item):\n \"\"\"\n Assign `item` value to dataset located by `key`.\n\n Parameters\n ----------\n key : callable or tuple\n The global row numbers to assign data to.\n item : modin.pandas.DataFrame, modin.pandas.Series or scalar\n Value that should be assigned to located dataset.\n\n See Also\n --------\n pandas.DataFrame.iloc\n \"\"\"\n row_loc, col_loc, _ = self._parse_row_and_column_locators(key)\n row_scalar = is_scalar(row_loc)\n col_scalar = is_scalar(col_loc)\n self._check_dtypes(row_loc)\n self._check_dtypes(col_loc)\n\n row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)\n self._setitem_positional(\n row_lookup,\n col_lookup,\n item,\n axis=self._determine_setitem_axis(\n row_lookup, col_lookup, row_scalar, col_scalar\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_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._compute_lookup_ArrayIndexer._compute_lookup.return.lookups": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._compute_lookup_ArrayIndexer._compute_lookup.return.lookups", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 557, "end_line": 620, "span_ids": ["ArrayIndexer._compute_lookup"], "tokens": 580}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArrayIndexer(object):\n\n def _compute_lookup(self, row_loc, col_loc):\n \"\"\"\n Compute index and column labels from index and column integer locators.\n\n Parameters\n ----------\n row_loc : slice, list, array or tuple\n Row locator.\n col_loc : slice, list, array or tuple\n Columns locator.\n\n Returns\n -------\n row_lookup : slice(None) if full axis grab, pandas.RangeIndex if repetition is detected, numpy.ndarray otherwise\n List of index labels.\n col_lookup : slice(None) if full axis grab, pandas.RangeIndex if repetition is detected, numpy.ndarray otherwise\n List of columns labels.\n\n Notes\n -----\n Usage of `slice(None)` as a resulting lookup is a hack to pass information about\n full-axis grab without computing actual indices that triggers lazy computations.\n Ideally, this API should get rid of using slices as indexers and either use a\n common ``Indexer`` object or range and ``np.ndarray`` only.\n \"\"\"\n lookups = []\n for axis, axis_loc in enumerate((row_loc, col_loc)):\n if is_scalar(axis_loc):\n axis_loc = np.array([axis_loc])\n if isinstance(axis_loc, slice):\n axis_lookup = (\n axis_loc\n if axis_loc == slice(None)\n else pandas.RangeIndex(\n *axis_loc.indices(len(self.arr._query_compiler.get_axis(axis)))\n )\n )\n elif is_range_like(axis_loc):\n axis_lookup = pandas.RangeIndex(\n axis_loc.start, axis_loc.stop, axis_loc.step\n )\n elif is_boolean_array(axis_loc):\n axis_lookup = boolean_mask_to_numeric(axis_loc)\n else:\n if isinstance(axis_loc, pandas.Index):\n axis_loc = axis_loc.values\n elif is_list_like(axis_loc) and not isinstance(axis_loc, np.ndarray):\n # `Index.__getitem__` works much faster with numpy arrays than with python lists,\n # so although we lose some time here on converting to numpy, `Index.__getitem__`\n # speedup covers the loss that we gain here.\n axis_loc = np.array(axis_loc, dtype=np.int64)\n # Relatively fast check allows us to not trigger `self.qc.get_axis()` computation\n # if there're no negative indices and so they don't not depend on the axis length.\n if isinstance(axis_loc, np.ndarray) and not (axis_loc < 0).any():\n axis_lookup = axis_loc\n else:\n axis_lookup = pandas.RangeIndex(\n len(self.arr._query_compiler.get_axis(axis))\n )[axis_loc]\n\n if isinstance(axis_lookup, pandas.Index) and not is_range_like(axis_lookup):\n axis_lookup = axis_lookup.values\n lookups.append(axis_lookup)\n return lookups", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._check_dtypes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/indexing.py_ArrayIndexer._check_dtypes_", "embedding": null, "metadata": {"file_path": "modin/numpy/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 622, "end_line": 643, "span_ids": ["ArrayIndexer._check_dtypes"], "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 ArrayIndexer(object):\n\n def _check_dtypes(self, locator):\n \"\"\"\n Check that `locator` is an integer scalar, integer slice, integer list or array of booleans.\n\n Parameters\n ----------\n locator : scalar, list, slice or array\n Object to check.\n\n Raises\n ------\n ValueError\n If check fails.\n \"\"\"\n is_int = is_integer(locator)\n is_int_slice = is_integer_slice(locator)\n is_int_arr = is_integer_array(locator)\n is_bool_arr = is_boolean_array(locator)\n\n if not any([is_int, is_int_slice, is_int_arr, is_bool_arr]):\n raise ValueError(_ILOC_INT_ONLY_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_modin-project__modin/modin/numpy/linalg.py_numpy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/linalg.py_numpy_", "embedding": null, "metadata": {"file_path": "modin/numpy/linalg.py", "file_name": "linalg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 27, "span_ids": ["norm", "docstring"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\n\nfrom .arr import array\nfrom .utils import try_convert_from_interoperable_type\nfrom modin.error_message import ErrorMessage\n\n\ndef norm(x, ord=None, axis=None, keepdims=False):\n x = try_convert_from_interoperable_type(x)\n if not isinstance(x, array):\n ErrorMessage.bad_type_for_numpy_op(\"linalg.norm\", type(x))\n return numpy.linalg.norm(x, ord=ord, axis=axis, keepdims=keepdims)\n return x._norm(ord=ord, axis=axis, keepdims=keepdims)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/logic.py_numpy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/logic.py_numpy_", "embedding": null, "metadata": {"file_path": "modin/numpy/logic.py", "file_name": "logic.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 62, "span_ids": ["impl:21", "impl", "_dispatch_logic", "isscalar", "docstring"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\n\nfrom .arr import array\nfrom .utils import try_convert_from_interoperable_type\nfrom modin.error_message import ErrorMessage\nfrom modin.utils import _inherit_docstrings\n\n\ndef _dispatch_logic(operator_name):\n @_inherit_docstrings(getattr(numpy, operator_name))\n def call(x, *args, **kwargs):\n x = try_convert_from_interoperable_type(x)\n if not isinstance(x, array):\n ErrorMessage.bad_type_for_numpy_op(operator_name, type(x))\n return getattr(numpy, operator_name)(x, *args, **kwargs)\n return getattr(x, f\"_{operator_name}\")(*args, **kwargs)\n\n return call\n\n\nall = _dispatch_logic(\"all\")\nany = _dispatch_logic(\"any\")\nisfinite = _dispatch_logic(\"isfinite\")\nisinf = _dispatch_logic(\"isinf\")\nisnan = _dispatch_logic(\"isnan\")\nisnat = _dispatch_logic(\"isnat\")\nisneginf = _dispatch_logic(\"isneginf\")\nisposinf = _dispatch_logic(\"isposinf\")\niscomplex = _dispatch_logic(\"iscomplex\")\nisreal = _dispatch_logic(\"isreal\")\n\n\ndef isscalar(e):\n if isinstance(e, array):\n return False\n return numpy.isscalar(e)\n\n\nlogical_not = _dispatch_logic(\"logical_not\")\nlogical_and = _dispatch_logic(\"logical_and\")\nlogical_or = _dispatch_logic(\"logical_or\")\nlogical_xor = _dispatch_logic(\"logical_xor\")\ngreater = _dispatch_logic(\"greater\")\ngreater_equal = _dispatch_logic(\"greater_equal\")\nless = _dispatch_logic(\"less\")\nless_equal = _dispatch_logic(\"less_equal\")\nequal = _dispatch_logic(\"equal\")\nnot_equal = _dispatch_logic(\"not_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_modin-project__modin/modin/numpy/math.py_numpy__dispatch_math.return.call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_numpy__dispatch_math.return.call", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 35, "span_ids": ["_dispatch_math", "docstring"], "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 numpy\n\nfrom .arr import array\nfrom .utils import try_convert_from_interoperable_type\nfrom modin.error_message import ErrorMessage\nfrom modin.utils import _inherit_docstrings\n\n\ndef _dispatch_math(operator_name, arr_method_name=None):\n # `operator_name` is the name of the method on the numpy API\n # `arr_method_name` is the name of the method on the modin.numpy.array object,\n # which is assumed to be `operator_name` by default\n @_inherit_docstrings(getattr(numpy, operator_name))\n def call(x, *args, **kwargs):\n x = try_convert_from_interoperable_type(x)\n if not isinstance(x, array):\n ErrorMessage.bad_type_for_numpy_op(operator_name, type(x))\n return getattr(numpy, operator_name)(x, *args, **kwargs)\n\n return getattr(x, arr_method_name or operator_name)(*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_modin-project__modin/modin/numpy/math.py_absolute_mean._dispatch_math_mean_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_absolute_mean._dispatch_math_mean_", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 53, "span_ids": ["impl"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "absolute = _dispatch_math(\"absolute\")\nabs = absolute\nadd = _dispatch_math(\"add\", \"__add__\")\ndivide = _dispatch_math(\"divide\")\ndot = _dispatch_math(\"dot\")\nfloat_power = _dispatch_math(\"float_power\")\nfloor_divide = _dispatch_math(\"floor_divide\")\npower = _dispatch_math(\"power\")\nprod = _dispatch_math(\"prod\")\nmultiply = _dispatch_math(\"multiply\")\nremainder = _dispatch_math(\"remainder\")\nmod = remainder\nsubtract = _dispatch_math(\"subtract\")\nsum = _dispatch_math(\"sum\")\ntrue_divide = _dispatch_math(\"true_divide\", \"divide\")\nmean = _dispatch_math(\"mean\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_var_var.return.x1_var_axis_axis_out_out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_var_var.return.x1_var_axis_axis_out_out", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 63, "span_ids": ["var"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def var(x1, axis=None, dtype=None, out=None, keepdims=None, *, where=True):\n x1 = try_convert_from_interoperable_type(x1)\n if not isinstance(x1, array):\n ErrorMessage.bad_type_for_numpy_op(\"var\", type(x1))\n return numpy.var(\n x1, axis=axis, out=out, keepdims=keepdims, where=where, dtype=dtype\n )\n return x1.var(axis=axis, out=out, keepdims=keepdims, where=where, dtype=dtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py__Maximum_and_minimum_are_maximum.return.numpy_maximum_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py__Maximum_and_minimum_are_maximum.return.numpy_maximum_", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 85, "span_ids": ["var", "maximum"], "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": "# Maximum and minimum are ufunc's in NumPy, which means that our array's __array_ufunc__\n# implementation will automatically handle this. We still need the function though, so that\n# if the operands are modin.pandas objects, we can convert them to arrays, but after that\n# we can just use NumPy's maximum/minimum since that will route to our array's ufunc.\ndef maximum(\n x1, x2, out=None, where=True, casting=\"same_kind\", order=\"K\", dtype=None, subok=True\n):\n x1 = try_convert_from_interoperable_type(x1)\n if not isinstance(x1, array):\n ErrorMessage.bad_type_for_numpy_op(\"maximum\", type(x1))\n return numpy.maximum(\n x1,\n x2,\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_minimum_min.amin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_minimum_min.amin", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 109, "span_ids": ["minimum", "impl:33"], "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 minimum(\n x1, x2, out=None, where=True, casting=\"same_kind\", order=\"K\", dtype=None, subok=True\n):\n x1 = try_convert_from_interoperable_type(x1)\n if not isinstance(x1, array):\n ErrorMessage.bad_type_for_numpy_op(\"minimum\", type(x1))\n return numpy.minimum(\n x1,\n x2,\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )\n\n\namax = _dispatch_math(\"amax\", \"max\")\namin = _dispatch_math(\"amin\", \"min\")\nmax = amax\nmin = amin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_sqrt_sqrt.return.x_sqrt_out_where_castin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_sqrt_sqrt.return.x_sqrt_out_where_castin", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 127, "span_ids": ["sqrt"], "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 sqrt(\n x, out=None, *, where=True, casting=\"same_kind\", order=\"K\", dtype=None, subok=True\n):\n x = try_convert_from_interoperable_type(x)\n if not isinstance(x, array):\n ErrorMessage.bad_type_for_numpy_op(\"sqrt\", type(x))\n return numpy.sqrt(\n x,\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )\n return x.sqrt(out, where, casting, order, dtype, subok)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_exp_exp.return.x_exp_out_where_casting": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_exp_exp.return.x_exp_out_where_casting", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 145, "span_ids": ["exp"], "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 exp(\n x, out=None, *, where=True, casting=\"same_kind\", order=\"K\", dtype=None, subok=True\n):\n x = try_convert_from_interoperable_type(x)\n if not isinstance(x, array):\n ErrorMessage.bad_type_for_numpy_op(\"exp\", type(x))\n return numpy.exp(\n x,\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )\n return x.exp(out, where, casting, order, dtype, subok)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_argmax_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/math.py_argmax_", "embedding": null, "metadata": {"file_path": "modin/numpy/math.py", "file_name": "math.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 162, "span_ids": ["argmax", "argmin"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def argmax(a, axis=None, out=None, *, keepdims=None):\n a = try_convert_from_interoperable_type(a)\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"argmax\", type(a))\n return numpy.argmax(a, axis=axis, out=out, keepdims=keepdims)\n return a.argmax(axis=axis, out=out, keepdims=keepdims)\n\n\ndef argmin(a, axis=None, out=None, *, keepdims=None):\n a = try_convert_from_interoperable_type(a)\n if not isinstance(a, array):\n ErrorMessage.bad_type_for_numpy_op(\"argmin\", type(a))\n return numpy.argmin(a, axis=axis, out=out, keepdims=keepdims)\n return a.argmin(axis=axis, out=out, keepdims=keepdims)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/numpy/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/numpy/test/test_array.py_numpy_test_repr.assert_repr_modin_arr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_numpy_test_repr.assert_repr_modin_arr_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 48, "span_ids": ["test_repr", "change_numpy_print_threshold", "docstring"], "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": "import numpy\nimport pytest\nimport warnings\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\n@pytest.fixture\ndef change_numpy_print_threshold():\n prev_threshold = numpy.get_printoptions()[\"threshold\"]\n numpy.set_printoptions(threshold=50)\n yield prev_threshold\n numpy.set_printoptions(threshold=prev_threshold)\n\n\n@pytest.mark.parametrize(\n \"size\",\n [\n 100,\n (2, 100),\n (100, 2),\n (1, 100),\n (100, 1),\n (100, 100),\n (6, 100),\n (100, 6),\n (100, 7),\n (7, 100),\n ],\n)\ndef test_repr(size, change_numpy_print_threshold):\n numpy_arr = numpy.random.randint(-100, 100, size=size)\n modin_arr = np.array(numpy_arr)\n assert repr(modin_arr) == repr(numpy_arr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_shape_test_dtype.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_shape_test_dtype.None_1", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 64, "span_ids": ["test_shape", "test_dtype"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"size\", [100, (2, 100), (100, 2), (1, 100), (100, 1)])\ndef test_shape(size):\n numpy_arr = numpy.random.randint(-100, 100, size=size)\n modin_arr = np.array(numpy_arr)\n assert modin_arr.shape == numpy_arr.shape\n\n\ndef test_dtype():\n numpy_arr = numpy.array([[1, \"2\"], [3, \"4\"]])\n modin_arr = np.array([[1, \"2\"], [3, \"4\"]])\n assert modin_arr.dtype == numpy_arr.dtype\n modin_arr = modin_arr == modin_arr.T\n numpy_arr = numpy_arr == numpy_arr.T\n assert modin_arr.dtype == numpy_arr.dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_conversion_test_conversion.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_conversion_test_conversion.None_5", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 86, "span_ids": ["test_conversion"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_conversion():\n import modin.pandas as pd\n from modin.numpy.utils import try_convert_from_interoperable_type\n\n df = pd.DataFrame(numpy.random.randint(0, 100, size=(100, 100)))\n series = df.iloc[0]\n df_converted = try_convert_from_interoperable_type(df)\n assert isinstance(df_converted, np.array)\n series_converted = try_convert_from_interoperable_type(series)\n assert isinstance(series_converted, np.array)\n assert_scalar_or_array_equal(df_converted, df)\n assert_scalar_or_array_equal(series_converted, series)\n pandas_df = df._to_pandas()\n pandas_series = series._to_pandas()\n pandas_converted = try_convert_from_interoperable_type(pandas_df)\n assert isinstance(pandas_converted, type(pandas_df))\n assert pandas_converted.equals(pandas_df)\n pandas_converted = try_convert_from_interoperable_type(pandas_series)\n assert isinstance(pandas_converted, type(pandas_series))\n assert pandas_converted.equals(pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_to_df_test_to_df.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_to_df_test_to_df.None_2", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 112, "span_ids": ["test_to_df"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_to_df():\n import modin.pandas as pd\n from modin.pandas.test.utils import df_equals\n\n import pandas\n\n modin_df = pd.DataFrame(np.array([1, 2, 3]))\n pandas_df = pandas.DataFrame(numpy.array([1, 2, 3]))\n df_equals(pandas_df, modin_df)\n modin_df = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6]]))\n pandas_df = pandas.DataFrame(numpy.array([[1, 2, 3], [4, 5, 6]]))\n df_equals(pandas_df, modin_df)\n for kw in [{}, {\"dtype\": str}]:\n modin_df, pandas_df = [\n lib[0].DataFrame(\n lib[1].array([[1, 2, 3], [4, 5, 6]]),\n columns=[\"col 0\", \"col 1\", \"col 2\"],\n index=pd.Index([4, 6]),\n **kw\n )\n for lib in ((pd, np), (pandas, numpy))\n ]\n df_equals(pandas_df, modin_df)\n df_equals(pandas_df, modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_to_series_test_to_series.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_to_series_test_to_series.None_1", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 115, "end_line": 134, "span_ids": ["test_to_series"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_to_series():\n import modin.pandas as pd\n from modin.pandas.test.utils import df_equals\n\n import pandas\n\n with pytest.raises(ValueError, match=\"Data must be 1-dimensional\"):\n pd.Series(np.array([[1, 2, 3], [4, 5, 6]]))\n modin_series = pd.Series(np.array([1, 2, 3]), index=pd.Index([-1, -2, -3]))\n pandas_series = pandas.Series(\n numpy.array([1, 2, 3]), index=pandas.Index([-1, -2, -3])\n )\n df_equals(modin_series, pandas_series)\n modin_series = pd.Series(\n np.array([1, 2, 3]), index=pd.Index([-1, -2, -3]), dtype=str\n )\n pandas_series = pandas.Series(\n numpy.array([1, 2, 3]), index=pandas.Index([-1, -2, -3]), dtype=str\n )\n df_equals(modin_series, pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_update_inplace_test_update_inplace.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_update_inplace_test_update_inplace.None_3", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 146, "span_ids": ["test_update_inplace"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_update_inplace():\n out = np.array([1, 2, 3])\n arr1 = np.array([1, 2, 3])\n arr2 = np.array(out, copy=False)\n np.add(arr1, arr1, out=out)\n assert_scalar_or_array_equal(out, arr2)\n out = np.array([1, 2, 3])\n arr2 = np.array(out, copy=False)\n np.add(arr1, arr1, out=out, where=False)\n assert_scalar_or_array_equal(out, arr2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_out_broadcast_test_out_broadcast.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_out_broadcast_test_out_broadcast.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 164, "span_ids": ["test_out_broadcast"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data_out\",\n [\n numpy.zeros((1, 3)),\n numpy.zeros((2, 3)),\n ],\n)\ndef test_out_broadcast(data_out):\n if data_out.shape == (2, 3):\n pytest.xfail(\"broadcasting would require duplicating row: see GH#5819\")\n data1 = [[1, 2, 3]]\n data2 = [7, 8, 9]\n modin_out, numpy_out = np.array(data_out), numpy.array(data_out)\n numpy.add(numpy.array(data1), numpy.array(data2), out=numpy_out)\n np.add(np.array(data1), np.array(data2), out=modin_out)\n assert_scalar_or_array_equal(modin_out, numpy_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_modin-project__modin/modin/numpy/test/test_array.py_test_out_broadcast_error_test_out_broadcast_error.None_4.np_add_np_array_1_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_out_broadcast_error_test_out_broadcast_error.None_4.np_add_np_array_1_2_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 167, "end_line": 196, "span_ids": ["test_out_broadcast_error"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_out_broadcast_error():\n with pytest.raises(ValueError):\n # Incompatible dimensions between inputs\n np.add(np.array([1, 2, 3]), np.array([[1, 2], [3, 4]]))\n\n with pytest.raises(ValueError):\n # Compatible input broadcast dimensions, but output array dimensions are wrong\n out = np.array([0])\n np.add(np.array([[1, 2], [3, 4]]), np.array([1, 2]), out=out)\n\n with pytest.raises(ValueError):\n # Compatible input broadcast dimensions, but output array dimensions are wrong\n # (cannot broadcast a 2x2 result into a 1x2 array)\n out = np.array([0, 0])\n np.add(np.array([[1, 2], [3, 4]]), np.array([1, 2]), out=out)\n\n with pytest.raises(ValueError):\n # Compatible input broadcast dimensions, but output array dimensions are wrong\n # (cannot broadcast 1x2 into 1D 2-element array)\n out = np.array([0, 0])\n np.add(np.array([[1, 2]]), np.array([1, 2]), out=out)\n\n with pytest.raises(ValueError):\n # Compatible input broadcast dimensions, but output array dimensions are wrong\n # (cannot broadcast a 2x2 result into a 3x2 array)\n # Technically, our error message here does not match numpy's exactly, as the\n # numpy message will specify both input shapes, whereas we only specify the\n # shape of the default broadcast between the two inputs\n out = np.array([[0, 0], [0, 0], [0, 0]])\n np.add(np.array([[1, 2], [3, 4]]), np.array([1, 2]), 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_modin-project__modin/modin/numpy/test/test_array.py_test_array_ufunc_test_array_ufunc._operation_that_Modin_do": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_ufunc_test_array_ufunc._operation_that_Modin_do", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 199, "end_line": 216, "span_ids": ["test_array_ufunc"], "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": "@pytest.mark.parametrize(\"size\", [100, (2, 100), (100, 2), (1, 100), (100, 1)])\ndef test_array_ufunc(size):\n # Test ufunc.__call__\n numpy_arr = numpy.random.randint(-100, 100, size=size)\n modin_arr = np.array(numpy_arr)\n modin_result = numpy.sign(modin_arr)\n numpy_result = numpy.sign(numpy_arr)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # Test ufunc that we have support for.\n modin_result = numpy.add(modin_arr, modin_arr)\n numpy_result = numpy.add(numpy_arr, numpy_arr)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # Test ufunc that we have support for, but method that we do not implement.\n modin_result = numpy.add.reduce(modin_arr)\n numpy_result = numpy.add.reduce(numpy_arr)\n assert numpy_result == modin_result\n # We do not test ufunc.reduce and ufunc.accumulate, since these require a binary reduce\n # operation that Modin does not currently support.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_function_test_array_function.assert_numpy_result_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_function_test_array_function.assert_numpy_result_mo", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 219, "end_line": 234, "span_ids": ["test_array_function"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"size\", [100, (2, 100), (100, 2), (1, 100), (100, 1)])\ndef test_array_function(size):\n numpy_arr = numpy.random.randint(-100, 100, size=size)\n modin_arr = np.array(numpy_arr)\n # Test from array shaping\n modin_result = numpy.ravel(modin_arr)\n numpy_result = numpy.ravel(numpy_arr)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # Test from array creation\n modin_result = numpy.zeros_like(modin_arr)\n numpy_result = numpy.zeros_like(numpy_arr)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # Test from math\n modin_result = numpy.sum(modin_arr)\n numpy_result = numpy.sum(numpy_arr)\n assert numpy_result == modin_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_modin-project__modin/modin/numpy/test/test_array.py_test_array_where_test_array_where.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_array_where_test_array_where.None_4", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 237, "end_line": 271, "span_ids": ["test_array_where"], "tokens": 503}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_array_where():\n numpy_flat_arr = numpy.random.randint(-100, 100, size=100)\n modin_flat_arr = np.array(numpy_flat_arr)\n with pytest.warns(\n UserWarning, match=\"np.where method with only condition specified\"\n ):\n warnings.filterwarnings(\"ignore\", message=\"Distributing\")\n (modin_flat_arr <= 0).where()\n with pytest.raises(ValueError, match=\"np.where requires x and y\"):\n (modin_flat_arr <= 0).where(x=[\"Should Fail.\"])\n with pytest.warns(UserWarning, match=\"np.where not supported when both x and y\"):\n warnings.filterwarnings(\"ignore\", message=\"Distributing\")\n modin_result = (modin_flat_arr <= 0).where(x=4, y=5)\n numpy_result = numpy.where(numpy_flat_arr <= 0, 4, 5)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_flat_bool_arr = modin_flat_arr <= 0\n numpy_flat_bool_arr = numpy_flat_arr <= 0\n modin_result = modin_flat_bool_arr.where(x=5, y=modin_flat_arr)\n numpy_result = numpy.where(numpy_flat_bool_arr, 5, numpy_flat_arr)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_flat_bool_arr.where(x=modin_flat_arr, y=5)\n numpy_result = numpy.where(numpy_flat_bool_arr, numpy_flat_arr, 5)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_flat_bool_arr.where(x=modin_flat_arr, y=(-1 * modin_flat_arr))\n numpy_result = numpy.where(\n numpy_flat_bool_arr, numpy_flat_arr, (-1 * numpy_flat_arr)\n )\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_arr = numpy_flat_arr.reshape((10, 10))\n modin_arr = np.array(numpy_arr)\n modin_bool_arr = modin_arr > 0\n numpy_bool_arr = numpy_arr > 0\n modin_result = modin_bool_arr.where(modin_arr, 10 * modin_arr)\n numpy_result = numpy.where(numpy_bool_arr, numpy_arr, 10 * numpy_arr)\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array.py_test_flatten_test_transpose.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_flatten_test_transpose.None_2", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 274, "end_line": 290, "span_ids": ["test_transpose", "test_flatten"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_flatten():\n numpy_flat_arr = numpy.random.randint(-100, 100, size=100)\n modin_flat_arr = np.array(numpy_flat_arr)\n assert_scalar_or_array_equal(modin_flat_arr.flatten(), numpy_flat_arr.flatten())\n numpy_arr = numpy_flat_arr.reshape((10, 10))\n modin_arr = np.array(numpy_arr)\n assert_scalar_or_array_equal(modin_arr.flatten(), numpy_arr.flatten())\n\n\ndef test_transpose():\n numpy_flat_arr = numpy.random.randint(-100, 100, size=100)\n modin_flat_arr = np.array(numpy_flat_arr)\n assert_scalar_or_array_equal(modin_flat_arr.transpose(), numpy_flat_arr.transpose())\n numpy_arr = numpy_flat_arr.reshape((10, 10))\n modin_arr = np.array(numpy_arr)\n assert_scalar_or_array_equal(modin_arr.transpose(), numpy_arr.transpose())\n assert_scalar_or_array_equal(modin_arr.T, numpy_arr.T)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_astype_test_astype.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_astype_test_astype.None_6", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 293, "end_line": 311, "span_ids": ["test_astype"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_astype():\n numpy_arr = numpy.array([[1, 2], [3, 4]])\n modin_arr = np.array([[1, 2], [3, 4]])\n modin_result = modin_arr.astype(numpy.float64)\n numpy_result = numpy_arr.astype(numpy.float64)\n assert modin_result.dtype == numpy_result.dtype\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.astype(str)\n numpy_result = numpy_arr.astype(str)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_arr, numpy_arr)\n modin_result = modin_arr.astype(str, copy=False)\n numpy_result = numpy_arr.astype(str, copy=False)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_arr, numpy_arr)\n modin_result = modin_arr.astype(numpy.float64, copy=False)\n numpy_result = numpy_arr.astype(numpy.float64, copy=False)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_arr, numpy_arr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_set_shape_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array.py_test_set_shape_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array.py", "file_name": "test_array.py", "file_type": "text/x-python", "category": "test", "start_line": 314, "end_line": 324, "span_ids": ["test_set_shape"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_set_shape():\n numpy_arr = numpy.array([[1, 2, 3], [4, 5, 6]])\n numpy_arr.shape = (6,)\n modin_arr = np.array([[1, 2, 3], [4, 5, 6]])\n modin_arr.shape = (6,)\n assert_scalar_or_array_equal(modin_arr, numpy_arr)\n modin_arr.shape = 6 # Same as using (6,)\n assert_scalar_or_array_equal(modin_arr, numpy_arr)\n with pytest.raises(ValueError, match=\"cannot reshape\"):\n modin_arr.shape = (4,)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_numpy_test_basic_arithmetic_with_broadcast.if_operator_not_in___tr.else_.numpy_testing_assert_arra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_numpy_test_basic_arithmetic_with_broadcast.if_operator_not_in___tr.else_.numpy_testing_assert_arra", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 85, "span_ids": ["test_basic_arithmetic_with_broadcast", "docstring"], "tokens": 530}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\nimport pytest\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\n@pytest.mark.parametrize(\n \"operand1_shape\",\n [\n 100,\n (1, 100),\n (3, 100),\n ],\n)\n@pytest.mark.parametrize(\n \"operand2_shape\",\n [\n 100,\n (1, 100),\n (3, 100),\n 1,\n ],\n)\n@pytest.mark.parametrize(\n \"operator\",\n [\n \"__add__\",\n \"__sub__\",\n \"__truediv__\",\n \"__mul__\",\n \"__rtruediv__\",\n \"__rmul__\",\n \"__radd__\",\n \"__rsub__\",\n \"__ge__\",\n \"__gt__\",\n \"__lt__\",\n \"__le__\",\n \"__eq__\",\n \"__ne__\",\n ],\n)\ndef test_basic_arithmetic_with_broadcast(operand1_shape, operand2_shape, operator):\n \"\"\"Test of operators that support broadcasting.\"\"\"\n if operand1_shape == (1, 100) or operand2_shape == (1, 100):\n # For some reason, marking the param with xfail leads to [XPASS(strict)] and a reported failure\n pytest.xfail(reason=\"broadcasting is broken: see GH#5894\")\n operand1 = numpy.random.randint(-100, 100, size=operand1_shape)\n operand2 = numpy.random.randint(-100, 100, size=operand2_shape)\n numpy_result = getattr(operand1, operator)(operand2)\n if operand2_shape == 1:\n # Tests binary ops with a scalar\n modin_result = getattr(np.array(operand1), operator)(operand2[0])\n else:\n modin_result = getattr(np.array(operand1), operator)(np.array(operand2))\n if operator not in [\"__truediv__\", \"__rtruediv__\"]:\n assert_scalar_or_array_equal(\n modin_result,\n numpy_result,\n err_msg=f\"Binary Op {operator} failed.\",\n )\n else:\n # Truediv can have precision issues, where thanks to floating point error, the numbers\n # aren't exactly the same across both, but are functionally equivalent, since the difference\n # is less than 1e-12.\n numpy.testing.assert_array_almost_equal(\n modin_result._to_numpy(),\n numpy_result,\n decimal=12,\n err_msg=\"Binary Op __truediv__ failed.\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_binary_bad_broadcast_test_binary_bad_broadcast.None_2.getattr_np_array_operand1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_binary_bad_broadcast_test_binary_bad_broadcast.None_2.getattr_np_array_operand1", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 129, "span_ids": ["test_binary_bad_broadcast"], "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": "@pytest.mark.parametrize(\"matched_axis\", [0, 1])\n@pytest.mark.parametrize(\n \"operator\",\n [\n \"__add__\",\n \"__sub__\",\n \"__truediv__\",\n \"__mul__\",\n \"__rtruediv__\",\n \"__rmul__\",\n \"__radd__\",\n \"__rsub__\",\n \"__ge__\",\n \"__gt__\",\n \"__lt__\",\n \"__le__\",\n pytest.param(\n \"__eq__\",\n marks=pytest.mark.xfail(\n reason=\"numpy behavior on eq/ne is counterintuitive: see GH#5893\"\n ),\n ),\n pytest.param(\n \"__ne__\",\n marks=pytest.mark.xfail(\n reason=\"numpy behavior on eq/ne is counterintuitive: see GH#5893\"\n ),\n ),\n ],\n)\ndef test_binary_bad_broadcast(matched_axis, operator):\n \"\"\"Tests broadcasts between 2d arrays that should fail.\"\"\"\n if matched_axis == 0:\n operand1 = numpy.random.randint(-100, 100, size=(3, 100))\n operand2 = numpy.random.randint(-100, 100, size=(3, 200))\n else:\n operand1 = numpy.random.randint(-100, 100, size=(100, 3))\n operand2 = numpy.random.randint(-100, 100, size=(200, 3))\n with pytest.raises(ValueError):\n getattr(operand1, operator)(operand2)\n with pytest.raises(ValueError):\n getattr(np.array(operand1), operator)(np.array(operand2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_arithmetic_test_arithmetic.for_size_textdim_in_10.numpy_testing_assert_arra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_arithmetic_test_arithmetic.for_size_textdim_in_10.numpy_testing_assert_arra", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 146, "span_ids": ["test_arithmetic"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"operator\", [\"__pow__\", \"__floordiv__\", \"__mod__\"])\ndef test_arithmetic(operator):\n \"\"\"Test of operators that do not yet support broadcasting.\"\"\"\n for size, textdim in ((100, \"1D\"), ((10, 10), \"2D\")):\n operand1 = numpy.random.randint(-100, 100, size=size)\n lower_bound = -100 if operator != \"__pow__\" else 0\n operand2 = numpy.random.randint(lower_bound, 100, size=size)\n modin_result = getattr(np.array(operand1), operator)(np.array(operand2))\n numpy_result = getattr(operand1, operator)(operand2)\n numpy.testing.assert_array_almost_equal(\n modin_result._to_numpy(),\n numpy_result,\n decimal=12,\n err_msg=f\"Binary Op {operator} failed on {textdim} arrays.\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_arithmetic_nans_and_zeros_test_arithmetic_nans_and_zeros.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_arithmetic_nans_and_zeros_test_arithmetic_nans_and_zeros.None_2", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 163, "span_ids": ["test_arithmetic_nans_and_zeros"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_arithmetic_nans_and_zeros():\n numpy_arr1 = numpy.array([[1, 0, 3], [numpy.nan, 0, numpy.nan]])\n numpy_arr2 = numpy.array([1, 0, 0])\n assert_scalar_or_array_equal(\n (np.array(numpy_arr1) // np.array(numpy_arr2)),\n numpy_arr1 // numpy_arr2,\n )\n assert_scalar_or_array_equal(\n (np.array([0]) // 0),\n numpy.array([0]) // 0,\n )\n assert_scalar_or_array_equal(\n (np.array([0], dtype=numpy.float64) // 0),\n numpy.array([0], dtype=numpy.float64) // 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_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_scalar_arithmetic_test_scalar_arithmetic.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_scalar_arithmetic_test_scalar_arithmetic.None_7", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 204, "span_ids": ["test_scalar_arithmetic"], "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": "@pytest.mark.parametrize(\"size\", [100, (2, 100), (100, 2), (1, 100), (100, 1)])\ndef test_scalar_arithmetic(size):\n numpy_arr = numpy.random.randint(-100, 100, size=size)\n modin_arr = np.array(numpy_arr)\n scalar = numpy.random.randint(1, 100)\n assert_scalar_or_array_equal(\n (scalar * modin_arr), scalar * numpy_arr, err_msg=\"__mul__ failed.\"\n )\n assert_scalar_or_array_equal(\n (modin_arr * scalar),\n scalar * numpy_arr,\n err_msg=\"__rmul__ failed.\",\n )\n assert_scalar_or_array_equal(\n (scalar / modin_arr),\n scalar / numpy_arr,\n err_msg=\"__rtruediv__ failed.\",\n )\n assert_scalar_or_array_equal(\n (modin_arr / scalar),\n numpy_arr / scalar,\n err_msg=\"__truediv__ failed.\",\n )\n assert_scalar_or_array_equal(\n (scalar + modin_arr),\n scalar + numpy_arr,\n err_msg=\"__radd__ failed.\",\n )\n assert_scalar_or_array_equal(\n (modin_arr + scalar), scalar + numpy_arr, err_msg=\"__add__ failed.\"\n )\n assert_scalar_or_array_equal(\n (scalar - modin_arr),\n scalar - numpy_arr,\n err_msg=\"__rsub__ failed.\",\n )\n assert_scalar_or_array_equal(\n (modin_arr - scalar), numpy_arr - scalar, err_msg=\"__sub__ failed.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_unary_arithmetic_test_unary_arithmetic.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_unary_arithmetic_test_unary_arithmetic.None_1", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 207, "end_line": 219, "span_ids": ["test_unary_arithmetic"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"op_name\", [\"abs\", \"exp\", \"sqrt\", \"tanh\"])\ndef test_unary_arithmetic(op_name):\n numpy_flat_arr = numpy.random.randint(-100, 100, size=100)\n modin_flat_arr = np.array(numpy_flat_arr)\n assert_scalar_or_array_equal(\n getattr(np, op_name)(modin_flat_arr),\n getattr(numpy, op_name)(numpy_flat_arr),\n )\n numpy_arr = numpy_flat_arr.reshape((10, 10))\n modin_arr = np.array(numpy_arr)\n assert_scalar_or_array_equal(\n getattr(np, op_name)(modin_arr), getattr(numpy, op_name)(numpy_arr)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_invert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_arithmetic.py_test_invert_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_arithmetic.py", "file_name": "test_array_arithmetic.py", "file_type": "text/x-python", "category": "test", "start_line": 222, "end_line": 235, "span_ids": ["test_invert"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_invert():\n numpy_flat_arr = numpy.random.randint(-100, 100, size=100)\n modin_flat_arr = np.array(numpy_flat_arr)\n assert_scalar_or_array_equal(~modin_flat_arr, ~numpy_flat_arr)\n numpy_arr = numpy_flat_arr.reshape((10, 10))\n modin_arr = np.array(numpy_arr)\n assert_scalar_or_array_equal(~modin_arr, ~numpy_arr)\n numpy_flat_arr = numpy.random.randint(-100, 100, size=100) < 0\n modin_flat_arr = np.array(numpy_flat_arr)\n assert_scalar_or_array_equal(~modin_flat_arr, ~numpy_flat_arr)\n numpy_arr = numpy_flat_arr.reshape((10, 10))\n modin_arr = np.array(numpy_arr)\n assert_scalar_or_array_equal(~modin_arr, ~numpy_arr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_numpy_test_max.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_numpy_test_max.None_7", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 84, "span_ids": ["test_max", "docstring"], "tokens": 927}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\nimport pytest\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\ndef test_max():\n # Test 1D\n numpy_arr = numpy.random.randint(-100, 100, size=100)\n modin_arr = np.array(numpy_arr)\n assert modin_arr.max() == numpy_arr.max()\n modin_result = modin_arr.max(axis=0)\n numpy_result = modin_arr.max(axis=0)\n assert modin_result == numpy_result\n modin_result = modin_arr.max(initial=200)\n numpy_result = numpy_arr.max(initial=200)\n assert modin_result == numpy_result\n modin_result = modin_arr.max(initial=0, where=False)\n numpy_result = numpy_arr.max(initial=0, where=False)\n assert modin_result == numpy_result\n modin_result = modin_arr.max(keepdims=True)\n numpy_result = numpy_arr.max(keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_arr = numpy.array([1, 10000, 2, 3, 4, 5])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([True, False, True, True, True, True])\n modin_mask = np.array(numpy_mask)\n assert numpy_arr.max(where=numpy_mask, initial=5) == modin_arr.max(\n where=modin_mask, initial=5\n )\n # Test 2D\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n assert modin_arr.max() == numpy_arr.max()\n modin_result = modin_arr.max(axis=0)\n numpy_result = numpy_arr.max(axis=0)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.max(axis=0, keepdims=True)\n numpy_result = numpy_arr.max(axis=0, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.max(axis=1)\n numpy_result = numpy_arr.max(axis=1)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.max(axis=1, keepdims=True)\n numpy_result = numpy_arr.max(axis=1, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.max(initial=200)\n numpy_result = numpy_arr.max(initial=200)\n assert modin_result == numpy_result\n modin_result = modin_arr.max(initial=0, where=False)\n numpy_result = numpy_arr.max(initial=0, where=False)\n assert modin_result == numpy_result\n with pytest.raises(ValueError):\n modin_arr.max(out=modin_arr, keepdims=True)\n modin_out = np.array([[1]])\n numpy_out = modin_out._to_numpy()\n modin_result = modin_arr.max(out=modin_out, keepdims=True)\n numpy_result = numpy_arr.max(out=numpy_out, keepdims=True)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n modin_result = modin_arr.max(axis=0, where=False, initial=4)\n numpy_result = numpy_arr.max(axis=0, where=False, initial=4)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\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_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_max.numpy_out_36_test_max.None_17": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_max.numpy_out_36_test_max.None_17", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 120, "span_ids": ["test_max"], "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": "def test_max():\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.max(axis=0, where=False, initial=4, out=modin_out)\n numpy_result = numpy_arr.max(axis=0, where=False, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.max(axis=0, initial=4, out=modin_out)\n numpy_result = numpy_arr.max(axis=0, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.max(axis=1, initial=4, out=modin_out)\n numpy_result = numpy_arr.max(axis=1, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n numpy_where = numpy.full(20, False)\n numpy_where[:10] = True\n numpy.random.shuffle(numpy_where)\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.max(axis=0, initial=4, out=modin_out, where=modin_where)\n numpy_result = numpy_arr.max(axis=0, initial=4, out=numpy_out, where=numpy_where)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.array([[1, 10000, 2], [3, 4, 5]])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([[True, False, True], [True, True, True]])\n modin_mask = np.array(numpy_mask)\n assert_scalar_or_array_equal(\n modin_arr.max(where=modin_mask, initial=5),\n numpy_arr.max(where=numpy_mask, initial=5),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_min_test_min.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_min_test_min.None_7", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 186, "span_ids": ["test_min"], "tokens": 904}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_min():\n # Test 1D\n numpy_arr = numpy.random.randint(-100, 100, size=100)\n modin_arr = np.array(numpy_arr)\n assert modin_arr.min() == numpy_arr.min()\n modin_result = modin_arr.min(axis=0)\n numpy_result = modin_arr.min(axis=0)\n assert modin_result == numpy_result\n modin_result = modin_arr.min(initial=-200)\n numpy_result = numpy_arr.min(initial=-200)\n assert modin_result == numpy_result\n modin_result = modin_arr.min(initial=0, where=False)\n numpy_result = numpy_arr.min(initial=0, where=False)\n assert modin_result == numpy_result\n modin_result = modin_arr.min(keepdims=True)\n numpy_result = numpy_arr.min(keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_arr = numpy.array([1, -10000, 2, 3, 4, 5])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([True, False, True, True, True, True])\n modin_mask = np.array(numpy_mask)\n assert numpy_arr.min(where=numpy_mask, initial=5) == modin_arr.min(\n where=modin_mask, initial=5\n )\n # Test 2D\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n assert modin_arr.min() == numpy_arr.min()\n modin_result = modin_arr.min(axis=0)\n numpy_result = numpy_arr.min(axis=0)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.min(axis=0, keepdims=True)\n numpy_result = numpy_arr.min(axis=0, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.min(axis=1)\n numpy_result = numpy_arr.min(axis=1)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.min(axis=1, keepdims=True)\n numpy_result = numpy_arr.min(axis=1, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.min(initial=-200)\n numpy_result = numpy_arr.min(initial=-200)\n assert modin_result == numpy_result\n modin_result = modin_arr.min(initial=0, where=False)\n numpy_result = numpy_arr.min(initial=0, where=False)\n assert modin_result == numpy_result\n with pytest.raises(ValueError):\n modin_arr.min(out=modin_arr, keepdims=True)\n modin_out = np.array([[1]])\n numpy_out = modin_out._to_numpy()\n modin_result = modin_arr.min(out=modin_out, keepdims=True)\n numpy_result = numpy_arr.min(out=numpy_out, keepdims=True)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n modin_result = modin_arr.min(axis=0, where=False, initial=4)\n numpy_result = numpy_arr.min(axis=0, where=False, initial=4)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\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_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_min.numpy_out_36_test_min.None_17": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_min.numpy_out_36_test_min.None_17", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 222, "span_ids": ["test_min"], "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": "def test_min():\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.min(axis=0, where=False, initial=4, out=modin_out)\n numpy_result = numpy_arr.min(axis=0, where=False, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.min(axis=0, initial=4, out=modin_out)\n numpy_result = numpy_arr.min(axis=0, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.min(axis=1, initial=4, out=modin_out)\n numpy_result = numpy_arr.min(axis=1, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n numpy_where = numpy.full(20, False)\n numpy_where[:10] = True\n numpy.random.shuffle(numpy_where)\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.min(axis=0, initial=4, out=modin_out, where=modin_where)\n numpy_result = numpy_arr.min(axis=0, initial=4, out=numpy_out, where=numpy_where)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.array([[1, -10000, 2], [3, 4, 5]])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([[True, False, True], [True, True, True]])\n modin_mask = np.array(numpy_mask)\n assert_scalar_or_array_equal(\n modin_arr.min(where=modin_mask, initial=5),\n numpy_arr.min(where=numpy_mask, initial=5),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_sum_test_sum.modin_out_37.np_array_numpy_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_sum_test_sum.modin_out_37.np_array_numpy_out_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 225, "end_line": 288, "span_ids": ["test_sum"], "tokens": 911}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sum():\n # Test 1D\n numpy_arr = numpy.random.randint(-100, 100, size=100)\n modin_arr = np.array(numpy_arr)\n assert modin_arr.sum() == numpy_arr.sum()\n modin_result = modin_arr.sum(axis=0)\n numpy_result = modin_arr.sum(axis=0)\n assert modin_result == numpy_result\n modin_result = modin_arr.sum(initial=-200)\n numpy_result = numpy_arr.sum(initial=-200)\n assert modin_result == numpy_result\n modin_result = modin_arr.sum(initial=0, where=False)\n numpy_result = numpy_arr.sum(initial=0, where=False)\n assert modin_result == numpy_result\n modin_result = modin_arr.sum(keepdims=True)\n numpy_result = numpy_arr.sum(keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_arr = numpy.array([1, 10000, 2, 3, 4, 5])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([True, False, True, True, True, True])\n modin_mask = np.array(numpy_mask)\n assert numpy_arr.sum(where=numpy_mask) == modin_arr.sum(where=modin_mask)\n # Test 2D\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n assert modin_arr.sum() == numpy_arr.sum()\n modin_result = modin_arr.sum(axis=0)\n numpy_result = numpy_arr.sum(axis=0)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.sum(axis=0, keepdims=True)\n numpy_result = numpy_arr.sum(axis=0, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.sum(axis=1)\n numpy_result = numpy_arr.sum(axis=1)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.sum(axis=1, keepdims=True)\n numpy_result = numpy_arr.sum(axis=1, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.sum(initial=-200)\n numpy_result = numpy_arr.sum(initial=-200)\n assert modin_result == numpy_result\n modin_result = modin_arr.sum(initial=0, where=False)\n numpy_result = numpy_arr.sum(initial=0, where=False)\n assert modin_result == numpy_result\n with pytest.raises(ValueError):\n modin_arr.sum(out=modin_arr, keepdims=True)\n modin_out = np.array([[1]])\n numpy_out = modin_out._to_numpy()\n modin_result = modin_arr.sum(out=modin_out, keepdims=True)\n numpy_result = numpy_arr.sum(out=numpy_out, keepdims=True)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n modin_result = modin_arr.sum(axis=0, where=False, initial=4)\n numpy_result = numpy_arr.sum(axis=0, where=False, initial=4)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\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_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_sum.modin_result_38_test_sum.None_19": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_sum.modin_result_38_test_sum.None_19", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 289, "end_line": 334, "span_ids": ["test_sum"], "tokens": 680}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sum():\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n modin_result = modin_arr.sum(axis=0, where=False, initial=4, out=modin_out)\n numpy_result = numpy_arr.sum(axis=0, where=False, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.sum(axis=0, initial=4, out=modin_out)\n numpy_result = numpy_arr.sum(axis=0, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.sum(axis=1, initial=4, out=modin_out)\n numpy_result = numpy_arr.sum(axis=1, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n numpy_where = numpy.full(20, False)\n numpy_where[:10] = True\n numpy.random.shuffle(numpy_where)\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.sum(axis=0, initial=4, out=modin_out, where=modin_where)\n numpy_result = numpy_arr.sum(axis=0, initial=4, out=numpy_out, where=numpy_where)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_where = numpy.full(400, False)\n numpy_where[:200] = True\n numpy.random.shuffle(numpy_where)\n numpy_where = numpy_where.reshape((20, 20))\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.sum(where=modin_where)\n numpy_result = numpy_arr.sum(where=numpy_where)\n assert modin_result == numpy_result\n # Test NA propagation\n numpy_arr = numpy.array([[1, 2], [3, 4], [5, numpy.nan]])\n modin_arr = np.array([[1, 2], [3, 4], [5, np.nan]])\n assert numpy.isnan(modin_arr.sum())\n assert_scalar_or_array_equal(\n modin_arr.sum(axis=1),\n numpy_arr.sum(axis=1),\n )\n assert_scalar_or_array_equal(\n modin_arr.sum(axis=0),\n numpy_arr.sum(axis=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_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_mean_test_mean.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_mean_test_mean.None_9", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 337, "end_line": 400, "span_ids": ["test_mean"], "tokens": 834}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_mean():\n # Test 1D\n numpy_arr = numpy.random.randint(-100, 100, size=100)\n modin_arr = np.array(numpy_arr)\n assert modin_arr.mean() == numpy_arr.mean()\n modin_result = modin_arr.mean(axis=0)\n numpy_result = modin_arr.mean(axis=0)\n assert modin_result == numpy_result\n modin_result = modin_arr.mean()\n numpy_result = numpy_arr.mean()\n assert modin_result == numpy_result\n modin_result = modin_arr.mean(keepdims=True)\n numpy_result = numpy_arr.mean(keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_arr = numpy.array([1, 10000, 2, 3, 4, 5])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([True, False, True, True, True, True])\n modin_mask = np.array(numpy_mask)\n assert numpy_arr.mean(where=numpy_mask) == modin_arr.mean(where=modin_mask)\n # Test 2D\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n assert modin_arr.mean() == numpy_arr.mean()\n modin_result = modin_arr.mean(axis=0)\n numpy_result = numpy_arr.mean(axis=0)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.mean(axis=0, keepdims=True)\n numpy_result = numpy_arr.mean(axis=0, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.mean(axis=1)\n numpy_result = numpy_arr.mean(axis=1)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.mean(axis=1, keepdims=True)\n numpy_result = numpy_arr.mean(axis=1, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.mean()\n numpy_result = numpy_arr.mean()\n assert modin_result == numpy_result\n with pytest.raises(ValueError):\n modin_arr.mean(out=modin_arr, keepdims=True)\n modin_out = np.array([[1]])\n numpy_out = modin_out._to_numpy()\n modin_result = modin_arr.mean(out=modin_out, keepdims=True)\n numpy_result = numpy_arr.mean(out=numpy_out, keepdims=True)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.mean(axis=0, where=False, out=modin_out)\n numpy_result = numpy_arr.mean(axis=0, where=False, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.mean(axis=0, out=modin_out)\n numpy_result = numpy_arr.mean(axis=0, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\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_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_mean.None_10_test_mean.assert_modin_arr_mean_whe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_mean.None_10_test_mean.assert_modin_arr_mean_whe", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 401, "end_line": 440, "span_ids": ["test_mean"], "tokens": 500}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_mean():\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.mean(axis=1, out=modin_out)\n numpy_result = numpy_arr.mean(axis=1, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n numpy_where = numpy.full(20, False)\n numpy_where[:10] = True\n numpy.random.shuffle(numpy_where)\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.mean(axis=0, out=modin_out, where=modin_where)\n numpy_result = numpy_arr.mean(axis=0, out=numpy_out, where=numpy_where)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_where = numpy.full(400, False)\n numpy_where[:200] = True\n numpy.random.shuffle(numpy_where)\n numpy_where = numpy_where.reshape((20, 20))\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.mean(where=modin_where)\n numpy_result = numpy_arr.mean(where=numpy_where)\n assert modin_result == numpy_result\n # Test NA propagation\n numpy_arr = numpy.array([[1, 2], [3, 4], [5, numpy.nan]])\n modin_arr = np.array([[1, 2], [3, 4], [5, np.nan]])\n assert numpy.isnan(modin_arr.mean())\n assert_scalar_or_array_equal(\n modin_arr.mean(axis=1),\n numpy_arr.mean(axis=1),\n )\n assert_scalar_or_array_equal(\n modin_arr.mean(axis=0),\n numpy_arr.mean(axis=0),\n )\n numpy_where = numpy.array([[True, True], [True, True], [True, False]])\n modin_where = np.array(numpy_where)\n assert modin_arr.mean(where=modin_where) == numpy_arr.mean(where=numpy_where)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_prod_test_prod.modin_out_37.np_array_numpy_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_prod_test_prod.modin_out_37.np_array_numpy_out_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 443, "end_line": 506, "span_ids": ["test_prod"], "tokens": 911}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_prod():\n # Test 1D\n numpy_arr = numpy.random.randint(-100, 100, size=100)\n modin_arr = np.array(numpy_arr)\n assert modin_arr.prod() == numpy_arr.prod()\n modin_result = modin_arr.prod(axis=0)\n numpy_result = modin_arr.prod(axis=0)\n assert modin_result == numpy_result\n modin_result = modin_arr.prod(initial=-200)\n numpy_result = numpy_arr.prod(initial=-200)\n assert modin_result == numpy_result\n modin_result = modin_arr.prod(initial=0, where=False)\n numpy_result = numpy_arr.prod(initial=0, where=False)\n assert modin_result == numpy_result\n modin_result = modin_arr.prod(keepdims=True)\n numpy_result = numpy_arr.prod(keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_arr = numpy.array([1, 10000, 2, 3, 4, 5])\n modin_arr = np.array(numpy_arr)\n numpy_mask = numpy.array([True, False, True, True, True, True])\n modin_mask = np.array(numpy_mask)\n assert numpy_arr.prod(where=numpy_mask) == modin_arr.prod(where=modin_mask)\n # Test 2D\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n assert modin_arr.prod() == numpy_arr.prod()\n modin_result = modin_arr.prod(axis=0)\n numpy_result = numpy_arr.prod(axis=0)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.prod(axis=0, keepdims=True)\n numpy_result = numpy_arr.prod(axis=0, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.prod(axis=1)\n numpy_result = numpy_arr.prod(axis=1)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.prod(axis=1, keepdims=True)\n numpy_result = numpy_arr.prod(axis=1, keepdims=True)\n assert modin_result.shape == numpy_result.shape\n assert_scalar_or_array_equal(modin_result, numpy_result)\n modin_result = modin_arr.prod(initial=-200)\n numpy_result = numpy_arr.prod(initial=-200)\n assert modin_result == numpy_result\n modin_result = modin_arr.prod(initial=0, where=False)\n numpy_result = numpy_arr.prod(initial=0, where=False)\n assert modin_result == numpy_result\n with pytest.raises(ValueError):\n modin_arr.prod(out=modin_arr, keepdims=True)\n modin_out = np.array([[1]])\n numpy_out = modin_out._to_numpy()\n modin_result = modin_arr.prod(out=modin_out, keepdims=True)\n numpy_result = numpy_arr.prod(out=numpy_out, keepdims=True)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n modin_result = modin_arr.prod(axis=0, where=False, initial=4)\n numpy_result = numpy_arr.prod(axis=0, where=False, initial=4)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n # ... other code\n assert_scalar_or_array_equal(modin_result, numpy_result)\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_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_prod.modin_result_38_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_axis_functions.py_test_prod.modin_result_38_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_axis_functions.py", "file_name": "test_array_axis_functions.py", "file_type": "text/x-python", "category": "test", "start_line": 507, "end_line": 555, "span_ids": ["test_prod"], "tokens": 710}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_prod():\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result.shape == numpy_result.shape\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n assert modin_result == numpy_result\n # ... other code\n modin_result = modin_arr.prod(axis=0, where=False, initial=4, out=modin_out)\n numpy_result = numpy_arr.prod(axis=0, where=False, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_arr = numpy.random.randint(-100, 100, size=(20, 20))\n modin_arr = np.array(numpy_arr)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.prod(axis=0, initial=4, out=modin_out)\n numpy_result = numpy_arr.prod(axis=0, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n modin_result = modin_arr.prod(axis=1, initial=4, out=modin_out)\n numpy_result = numpy_arr.prod(axis=1, initial=4, out=numpy_out)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_out = numpy.ones(20)\n modin_out = np.array(numpy_out)\n numpy_where = numpy.full(20, False)\n numpy_where[:10] = True\n numpy.random.shuffle(numpy_where)\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.prod(axis=0, initial=4, out=modin_out, where=modin_where)\n numpy_result = numpy_arr.prod(axis=0, initial=4, out=numpy_out, where=numpy_where)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert_scalar_or_array_equal(modin_out, numpy_out)\n numpy_where = numpy.full(400, False)\n numpy_where[:200] = True\n numpy.random.shuffle(numpy_where)\n numpy_where = numpy_where.reshape((20, 20))\n modin_where = np.array(numpy_where)\n modin_result = modin_arr.prod(where=modin_where)\n numpy_result = numpy_arr.prod(where=numpy_where)\n assert modin_result == numpy_result\n # Test NA propagation\n numpy_arr = numpy.array([[1, 2], [3, 4], [5, numpy.nan]])\n modin_arr = np.array([[1, 2], [3, 4], [5, np.nan]])\n assert numpy.isnan(modin_arr.prod())\n assert_scalar_or_array_equal(\n modin_arr.prod(axis=1),\n numpy_arr.prod(axis=1),\n )\n assert_scalar_or_array_equal(\n modin_arr.prod(axis=0),\n numpy_arr.prod(axis=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_modin-project__modin/modin/numpy/test/test_array_creation.py_numpy_test_zeros_like.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_creation.py_numpy_test_zeros_like.None_3", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_creation.py", "file_name": "test_array_creation.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 37, "span_ids": ["test_zeros_like", "docstring"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\ndef test_zeros_like():\n modin_arr = np.array([[1.0, 2.0], [3.0, 4.0]])\n numpy_arr = modin_arr._to_numpy()\n assert_scalar_or_array_equal(np.zeros_like(modin_arr), numpy.zeros_like(numpy_arr))\n assert_scalar_or_array_equal(\n np.zeros_like(modin_arr, dtype=numpy.int8),\n numpy.zeros_like(numpy_arr, dtype=numpy.int8),\n )\n assert_scalar_or_array_equal(\n np.zeros_like(modin_arr, shape=(10, 10)),\n numpy.zeros_like(numpy_arr, shape=(10, 10)),\n )\n modin_arr = np.array([[1, 2], [3, 4]])\n numpy_arr = modin_arr._to_numpy()\n assert_scalar_or_array_equal(\n np.zeros_like(modin_arr),\n numpy.zeros_like(numpy_arr),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_creation.py_test_ones_like_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_creation.py_test_ones_like_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_creation.py", "file_name": "test_array_creation.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 61, "span_ids": ["test_ones_like"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ones_like():\n modin_arr = np.array([[1.0, 2.0], [3.0, 4.0]])\n numpy_arr = modin_arr._to_numpy()\n assert_scalar_or_array_equal(\n np.ones_like(modin_arr),\n numpy.ones_like(numpy_arr),\n )\n assert_scalar_or_array_equal(\n np.ones_like(modin_arr, dtype=numpy.int8),\n numpy.ones_like(numpy_arr, dtype=numpy.int8),\n )\n assert_scalar_or_array_equal(\n np.ones_like(modin_arr, shape=(10, 10)),\n numpy.ones_like(numpy_arr, shape=(10, 10)),\n )\n modin_arr = np.array([[1, 2], [3, 4]])\n numpy_arr = modin_arr._to_numpy()\n assert_scalar_or_array_equal(\n np.ones_like(modin_arr),\n numpy.ones_like(numpy_arr),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_numpy_test_getitem_1d.if_is_list_like_numpy_res.else_.assert_modin_result_nu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_numpy_test_getitem_1d.if_is_list_like_numpy_res.else_.assert_modin_result_nu", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_indexing.py", "file_name": "test_array_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 43, "span_ids": ["test_getitem_1d", "docstring"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\nimport pytest\nfrom pandas.core.dtypes.common import is_list_like\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\n@pytest.mark.parametrize(\n \"index\",\n (\n 0,\n 1,\n -1, # Scalar indices\n slice(0, 1, 1),\n slice(1, -1, 1), # Slices\n [0, 2],\n [1, -1], # Lists\n ),\n ids=lambda i: f\"index={i}\",\n)\ndef test_getitem_1d(index):\n data = [1, 2, 3, 4, 5]\n numpy_result = numpy.array(data)[index]\n modin_result = np.array(data)[index]\n if is_list_like(numpy_result):\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert modin_result.shape == numpy_result.shape\n else:\n assert modin_result == numpy_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_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_getitem_2d_test_getitem_2d.if_is_list_like_numpy_res.else_.assert_modin_result_nu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_getitem_2d_test_getitem_2d.if_is_list_like_numpy_res.else_.assert_modin_result_nu", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_indexing.py", "file_name": "test_array_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 72, "span_ids": ["test_getitem_2d"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"index\",\n (\n 0,\n 1,\n -1, # Scalar indices\n slice(0, 1, 1),\n slice(1, -1, 1), # Slices\n slice(None, None, None),\n slice(None, 1, None),\n slice(0, 1, None),\n slice(0, None, None),\n [0, 2],\n [2, 0],\n [1, -1], # Lists\n ),\n ids=lambda i: f\"index={i}\",\n)\ndef test_getitem_2d(index):\n data = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]\n numpy_result = numpy.array(data)[index]\n modin_result = np.array(data)[index]\n if is_list_like(numpy_result):\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert modin_result.shape == numpy_result.shape\n else:\n assert modin_result == numpy_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_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_getitem_nested_test_getitem_nested.None_1.else_.assert_modin_result_nu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_getitem_nested_test_getitem_nested.None_1.else_.assert_modin_result_nu", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_indexing.py", "file_name": "test_array_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 94, "span_ids": ["test_getitem_nested"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_getitem_nested():\n # Index into the result of slicing a 1D array\n data = [1, 2, 3, 4, 5]\n numpy_result = numpy.array(data)[1:3][1]\n modin_result = np.array(data)[1:3][1]\n if is_list_like(numpy_result):\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert modin_result.shape == numpy_result.shape\n else:\n assert (\n modin_result == numpy_result\n ) # Index into the result of indexing a 2D array\n data = [[1, 2, 3], [4, 5, 6]]\n numpy_result = numpy.array(data)[1][1]\n modin_result = np.array(data)[1][1]\n if is_list_like(numpy_result):\n assert_scalar_or_array_equal(modin_result, numpy_result)\n assert modin_result.shape == numpy_result.shape\n else:\n assert modin_result == numpy_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_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_setitem_1d_test_setitem_1d_error.with_pytest_raises_ValueE.arr_0_5_1_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_setitem_1d_test_setitem_1d_error.with_pytest_raises_ValueE.arr_0_5_1_2_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_indexing.py", "file_name": "test_array_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 97, "end_line": 122, "span_ids": ["test_setitem_1d_error", "test_setitem_1d"], "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": "@pytest.mark.parametrize(\n (\"index\", \"value\"),\n [\n (0, 1),\n (1, 1),\n (-1, 1), # Scalar indices\n (slice(0, 1, 1), [7]),\n (slice(1, -1, 1), [7, 8, 9]), # Slices\n (slice(0, 4, 1), 7), # Slice with broadcast\n ([0, 2], [7, 8]),\n ([1, -1], [7, 8]), # Lists\n ],\n ids=lambda i: f\"{i}\",\n)\ndef test_setitem_1d(index, value):\n data = [1, 2, 3, 4, 5]\n modin_arr, numpy_arr = np.array(data), numpy.array(data)\n numpy_arr[index] = value\n modin_arr[index] = value\n assert_scalar_or_array_equal(modin_arr, numpy_arr)\n\n\ndef test_setitem_1d_error():\n arr = np.array([1, 2, 3, 4, 5])\n with pytest.raises(ValueError, match=\"could not broadcast\"):\n arr[0:5] = [1, 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_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_setitem_2d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_indexing.py_test_setitem_2d_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_indexing.py", "file_name": "test_array_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 151, "span_ids": ["test_setitem_2d"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n (\"index\", \"value\"),\n [\n (0, 1),\n (1, 1),\n (-1, 1), # Scalar indices\n (slice(0, 1, 1), [13]), # arr[0:1:1] = [13]\n (slice(1, -1, 1), [13]), # arr[1:-1:1] = 13\n (slice(None, None, None), [7]), # arr[:] = [7]\n (slice(None, 1, None), [7]), # arr[:1] = [7]\n (slice(0, 1, None), [7]), # arr[0:1] = [7]\n (slice(0, None, None), [7]), # arr[0:] = [7]\n ([0, 2], [[13, 14, 15], [16, 17, 18]]),\n ([2, 0], [[13, 14, 15], [16, 17, 18]]),\n ([1, -1], [[13, 14, 15], [16, 17, 18]]), # Lists\n ],\n ids=lambda i: f\"{i}\",\n)\ndef test_setitem_2d(index, value):\n if index == [2, 0]:\n pytest.xfail(\"indexing with unsorted list would fail: see GH#5886\")\n data = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]\n modin_arr, numpy_arr = np.array(data), numpy.array(data)\n numpy_arr[index] = value\n modin_arr[index] = value\n assert_scalar_or_array_equal(modin_arr, numpy_arr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_pytest_test_dot_from_pandas_reindex.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_pytest_test_dot_from_pandas_reindex.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_linalg.py", "file_name": "test_array_linalg.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 33, "span_ids": ["test_dot_from_pandas_reindex", "docstring"], "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 pytest\nimport numpy\nimport numpy.linalg as NLA\n\nimport modin.pandas as pd\nimport modin.numpy as np\nimport modin.numpy.linalg as LA\nfrom .utils import assert_scalar_or_array_equal\n\n\ndef test_dot_from_pandas_reindex():\n # Reindexing the dataframe does not change the output of dot\n # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dot.html\n df = pd.DataFrame([[0, 1, -2, -1], [1, 1, 1, 1]])\n s = pd.Series([1, 1, 2, 1])\n result1 = np.dot(df, s)\n s2 = s.reindex([1, 0, 2, 3])\n result2 = np.dot(df, s2)\n assert_scalar_or_array_equal(result1, result2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_dot_1d_test_dot_scalar.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_dot_1d_test_dot_scalar.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_linalg.py", "file_name": "test_array_linalg.py", "file_type": "text/x-python", "category": "test", "start_line": 36, "end_line": 60, "span_ids": ["test_dot_1d", "test_dot_scalar", "test_dot_2d"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dot_1d():\n x1 = numpy.random.randint(-100, 100, size=100)\n x2 = numpy.random.randint(-100, 100, size=100)\n numpy_result = numpy.dot(x1, x2)\n x1, x2 = np.array(x1), np.array(x2)\n modin_result = np.dot(x1, x2)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n\ndef test_dot_2d():\n x1 = numpy.random.randint(-100, 100, size=(100, 3))\n x2 = numpy.random.randint(-100, 100, size=(3, 50))\n numpy_result = numpy.dot(x1, x2)\n x1, x2 = np.array(x1), np.array(x2)\n modin_result = np.dot(x1, x2)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n\ndef test_dot_scalar():\n x1 = numpy.random.randint(-100, 100, size=(100, 3))\n x2 = numpy.random.randint(-100, 100)\n numpy_result = numpy.dot(x1, x2)\n x1 = np.array(x1)\n modin_result = np.dot(x1, x2)\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_matmul_scalar_test_matmul_scalar.with_pytest_raises_ValueE.x1_x2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_matmul_scalar_test_matmul_scalar.with_pytest_raises_ValueE.x1_x2", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_linalg.py", "file_name": "test_array_linalg.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 71, "span_ids": ["test_matmul_scalar"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_matmul_scalar():\n x1 = numpy.random.randint(-100, 100, size=(100, 3))\n x2 = numpy.random.randint(-100, 100)\n x1 = np.array(x1)\n # Modin error message differs from numpy for readability; the original numpy error is:\n # ValueError: matmul: Input operand 1 does not have enough dimensions (has 0, gufunc\n # core with signature (n?,k),(k,m?)->(n?,m?) requires 1)\n with pytest.raises(ValueError):\n x1 @ x2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_dot_broadcast_test_dot_broadcast.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_dot_broadcast_test_dot_broadcast.None_1", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_linalg.py", "file_name": "test_array_linalg.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 89, "span_ids": ["test_dot_broadcast"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dot_broadcast():\n # 2D @ 1D\n x1 = numpy.random.randint(-100, 100, size=(100, 3))\n x2 = numpy.random.randint(-100, 100, size=(3,))\n numpy_result = numpy.dot(x1, x2)\n x1, x2 = np.array(x1), np.array(x2)\n modin_result = np.dot(x1, x2)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n # 1D @ 2D\n x1 = numpy.random.randint(-100, 100, size=(100,))\n x2 = numpy.random.randint(-100, 100, size=(100, 3))\n numpy_result = numpy.dot(x1, x2)\n x1, x2 = np.array(x1), np.array(x2)\n modin_result = np.dot(x1, x2)\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_norm_fro_2d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_linalg.py_test_norm_fro_2d_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_linalg.py", "file_name": "test_array_linalg.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 110, "span_ids": ["test_norm_fro_2d", "test_norm_fro_1d"], "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": "@pytest.mark.parametrize(\"axis\", [None, 0, 1], ids=[\"axis=None\", \"axis=0\", \"axis=1\"])\ndef test_norm_fro_2d(axis):\n x1 = numpy.random.randint(-10, 10, size=(100, 3))\n numpy_result = NLA.norm(x1, axis=axis)\n x1 = np.array(x1)\n modin_result = LA.norm(x1, axis=axis)\n # Result may be a scalar\n if isinstance(modin_result, np.array):\n modin_result = modin_result._to_numpy()\n numpy.testing.assert_allclose(modin_result, numpy_result, rtol=1e-12)\n\n\ndef test_norm_fro_1d():\n x1 = numpy.random.randint(-10, 10, size=100)\n numpy_result = NLA.norm(x1)\n x1 = np.array(x1)\n modin_result = LA.norm(x1)\n numpy.testing.assert_allclose(modin_result, numpy_result, rtol=1e-12)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_pytest_small_arr_r_1d.numpy_array_numpy_nan_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_pytest_small_arr_r_1d.numpy_array_numpy_nan_0", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_logic.py", "file_name": "test_array_logic.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 32, "span_ids": ["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": "import pytest\nimport numpy\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\nsmall_arr_c_2d = numpy.array(\n [\n [1j, 1, 0, -numpy.inf, numpy.inf, 0.5],\n [1 + 1.1j, numpy.nan, 0, numpy.nan, 2, 0.3],\n ]\n)\nsmall_arr_c_1d = numpy.array([numpy.nan, 0, -numpy.inf, numpy.inf, 5, -0.1, 1 + 1.1j])\n\nsmall_arr_r_2d = numpy.array(\n [[1, 0, -numpy.inf, numpy.inf, 0.5], [numpy.nan, 0, numpy.nan, 2, 0.3]]\n)\nsmall_arr_r_1d = numpy.array([numpy.nan, 0, -numpy.inf, numpy.inf, 5, -0.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_modin-project__modin/modin/numpy/test/test_array_logic.py_test_unary_with_axis_test_unary_with_axis.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_unary_with_axis_test_unary_with_axis.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_logic.py", "file_name": "test_array_logic.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 47, "span_ids": ["test_unary_with_axis"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"operand_shape\", [100, (3, 100)])\n@pytest.mark.parametrize(\"operator\", [\"any\", \"all\"])\n@pytest.mark.parametrize(\"axis\", [None, 0, 1], ids=[\"axis=None\", \"axis=0\", \"axis=1\"])\ndef test_unary_with_axis(operand_shape, operator, axis):\n if isinstance(operand_shape, int) and axis == 1:\n pytest.skip(\"cannot use axis=1 on 1D arrays\")\n x1 = numpy.random.randint(-100, 100, size=operand_shape)\n numpy_result = getattr(numpy, operator)(x1, axis=axis)\n x1 = np.array(x1)\n modin_result = getattr(np, operator)(x1, axis=axis)\n assert_scalar_or_array_equal(\n modin_result, numpy_result, err_msg=f\"Unary operator {operator} failed.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_all_any_where_test_all_any_where.assert_not_bool_arr_any_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_all_any_where_test_all_any_where.assert_not_bool_arr_any_w", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_logic.py", "file_name": "test_array_logic.py", "file_type": "text/x-python", "category": "test", "start_line": 50, "end_line": 82, "span_ids": ["test_all_any_where"], "tokens": 364}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_all_any_where():\n arr = np.array([[0, 1], [1, 0]])\n where = np.array([[False, True], [True, False]])\n result = arr.all(where=where)\n # Result should be np.bool_ True, since where mask isolates the non-zero elements\n assert result\n\n where = np.array([[True, False], [False, False]])\n result = arr.all(where=where, axis=1)\n assert_scalar_or_array_equal(result, numpy.array([False, True]))\n\n # Results should contain vacuous Trues in the relevant shape\n result = arr.all(where=False, axis=1)\n assert_scalar_or_array_equal(result, numpy.array([True, True]))\n result = arr.all(where=False, axis=0)\n assert_scalar_or_array_equal(result, numpy.array([True, True]))\n assert bool(arr.all(where=False, axis=None))\n\n where = np.array([[True, False], [False, True]])\n result = arr.any(where=where)\n # Result should be np.bool_ False, since mask isolates only zero elements\n assert not result\n\n where = np.array([[False, True], [False, False]])\n result = arr.any(where=where, axis=1)\n assert_scalar_or_array_equal(result, numpy.array([True, False]))\n\n # Results should contain vacuous Falses in the relevant shape\n result = arr.any(where=False, axis=1)\n assert_scalar_or_array_equal(result, numpy.array([False, False]))\n result = arr.any(where=False, axis=0)\n assert_scalar_or_array_equal(result, numpy.array([False, False]))\n assert not bool(arr.any(where=False, axis=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_modin-project__modin/modin/numpy/test/test_array_logic.py_test_unary_with_complex_test_unary_with_complex.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_unary_with_complex_test_unary_with_complex.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_logic.py", "file_name": "test_array_logic.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 94, "span_ids": ["test_unary_with_complex"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", [small_arr_c_2d, small_arr_c_1d], ids=[\"2D\", \"1D\"])\n@pytest.mark.parametrize(\n \"operator\", [\"isfinite\", \"isinf\", \"isnan\", \"iscomplex\", \"isreal\"]\n)\ndef test_unary_with_complex(data, operator):\n x1 = data\n numpy_result = getattr(numpy, operator)(x1)\n x1 = np.array(x1)\n modin_result = getattr(np, operator)(x1)\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_logic.py_test_isnat_test_logical_not.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_isnat_test_logical_not.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_logic.py", "file_name": "test_array_logic.py", "file_type": "text/x-python", "category": "test", "start_line": 97, "end_line": 121, "span_ids": ["test_logical_not", "test_isnat", "test_unary_without_complex"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_isnat():\n x1 = numpy.array([numpy.datetime64(\"2016-01-01\"), numpy.datetime64(\"NaT\")])\n numpy_result = numpy.isnat(x1)\n x1 = np.array(x1)\n modin_result = np.isnat(x1)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n\n@pytest.mark.parametrize(\"data\", [small_arr_r_2d, small_arr_r_1d], ids=[\"2D\", \"1D\"])\n@pytest.mark.parametrize(\"operator\", [\"isneginf\", \"isposinf\"])\ndef test_unary_without_complex(data, operator):\n x1 = data\n numpy_result = getattr(numpy, operator)(x1)\n x1 = np.array(x1)\n modin_result = getattr(np, operator)(x1)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n\n@pytest.mark.parametrize(\"data\", [small_arr_r_2d, small_arr_r_1d], ids=[\"2D\", \"1D\"])\ndef test_logical_not(data):\n x1 = data\n numpy_result = numpy.logical_not(x1)\n x1 = np.array(x1)\n modin_result = np.logical_not(x1)\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_logic.py_test_logical_binops_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_logic.py_test_logical_binops_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_logic.py", "file_name": "test_array_logic.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 138, "span_ids": ["test_logical_binops"], "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": "@pytest.mark.parametrize(\"operand1_shape\", [100, (3, 100)])\n@pytest.mark.parametrize(\"operand2_shape\", [100, (3, 100)])\n@pytest.mark.parametrize(\"operator\", [\"logical_and\", \"logical_or\", \"logical_xor\"])\ndef test_logical_binops(operand1_shape, operand2_shape, operator):\n if operand1_shape != operand2_shape:\n pytest.xfail(\"TODO fix broadcasting behavior for binary logic operators\")\n x1 = numpy.random.randint(-100, 100, size=operand1_shape)\n x2 = numpy.random.randint(-100, 100, size=operand2_shape)\n numpy_result = getattr(numpy, operator)(x1, x2)\n x1, x2 = np.array(x1), np.array(x2)\n modin_result = getattr(np, operator)(x1, x2)\n assert_scalar_or_array_equal(\n modin_result, numpy_result, err_msg=f\"Logic binary operator {operator} failed.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_math.py_numpy_test_argmax_argmin.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_math.py_numpy_test_argmax_argmin.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_math.py", "file_name": "test_array_math.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 34, "span_ids": ["test_argmax_argmin", "docstring"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\nimport pytest\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\n@pytest.mark.parametrize(\n \"data\",\n [\n [3, 2, 1, 1],\n [-87.434, -90.908, -87.152, -84.903],\n [-87.434, -90.908, np.nan, -87.152, -84.903],\n ],\n ids=[\"ints\", \"floats\", \"floats with nan\"],\n)\n@pytest.mark.parametrize(\"op\", [\"argmin\", \"argmax\"])\ndef test_argmax_argmin(data, op):\n numpy_result = getattr(numpy, op)(numpy.array(data))\n modin_result = getattr(np, op)(np.array(data))\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_math.py_test_rem_mod_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_math.py_test_rem_mod_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_math.py", "file_name": "test_array_math.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 48, "span_ids": ["test_rem_mod"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rem_mod():\n \"\"\"Tests remainder and mod, which, unlike the C/matlab equivalents, are identical in numpy.\"\"\"\n a = numpy.array([[2, -1], [10, -3]])\n b = numpy.array(([-3, 3], [3, -7]))\n numpy_result = numpy.remainder(a, b)\n modin_result = np.remainder(np.array(a), np.array(b))\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n numpy_result = numpy.mod(a, b)\n modin_result = np.mod(np.array(a), np.array(b))\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_shaping.py_numpy_test_transpose.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_numpy_test_transpose.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_shaping.py", "file_name": "test_array_shaping.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 42, "span_ids": ["test_transpose", "test_shape", "test_ravel", "docstring"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\nimport pytest\n\nimport modin.numpy as np\nfrom .utils import assert_scalar_or_array_equal\n\n\n@pytest.mark.parametrize(\"operand_shape\", [100, (100, 3), (3, 100)])\ndef test_ravel(operand_shape):\n x = numpy.random.randint(-100, 100, size=operand_shape)\n numpy_result = numpy.ravel(x)\n modin_result = np.ravel(np.array(x))\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n\n@pytest.mark.parametrize(\"operand_shape\", [100, (100, 3), (3, 100)])\ndef test_shape(operand_shape):\n x = numpy.random.randint(-100, 100, size=operand_shape)\n numpy_result = numpy.shape(x)\n modin_result = np.shape(np.array(x))\n assert modin_result == numpy_result\n\n\n@pytest.mark.parametrize(\"operand_shape\", [100, (100, 3), (3, 100)])\ndef test_transpose(operand_shape):\n x = numpy.random.randint(-100, 100, size=operand_shape)\n numpy_result = numpy.transpose(x)\n modin_result = np.transpose(np.array(x))\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_split_2d_test_split_2d.None_1.assert_scalar_or_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_split_2d_test_split_2d.None_1.assert_scalar_or_array_eq", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_shaping.py", "file_name": "test_array_shaping.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 58, "span_ids": ["test_split_2d"], "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": "@pytest.mark.parametrize(\"axis\", [0, 1])\ndef test_split_2d(axis):\n x = numpy.random.randint(-100, 100, size=(6, 4))\n # Integer argument: split into N equal arrays along axis\n numpy_result = numpy.split(x, 2, axis=axis)\n modin_result = np.split(np.array(x), 2, axis=axis)\n for modin_entry, numpy_entry in zip(modin_result, numpy_result):\n assert_scalar_or_array_equal(modin_entry, numpy_entry)\n # List argument: split at specified indices\n idxs = [2, 3]\n numpy_result = numpy.split(x, idxs, axis=axis)\n modin_result = np.split(np.array(x), idxs, axis=axis)\n for modin_entry, numpy_entry in zip(modin_result, numpy_result):\n assert_scalar_or_array_equal(modin_entry, numpy_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_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_split_2d_oob_test_split_2d_uneven.with_pytest_raises_.np_split_x_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_split_2d_oob_test_split_2d_uneven.with_pytest_raises_.np_split_x_2_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_shaping.py", "file_name": "test_array_shaping.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 77, "span_ids": ["test_split_2d_uneven", "test_split_2d_oob"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_split_2d_oob():\n # Supplying an index out of bounds results in an empty sub-array, for which modin\n # would return a numpy array by default\n x = numpy.random.randint(-100, 100, size=(6, 4))\n idxs = [2, 3, 6]\n numpy_result = numpy.split(x, idxs)\n modin_result = np.split(np.array(x), idxs)\n for modin_entry, numpy_entry in zip(modin_result, numpy_result):\n assert_scalar_or_array_equal(modin_entry, numpy_entry)\n\n\ndef test_split_2d_uneven():\n x = np.array(numpy.random.randint(-100, 100, size=(3, 2)))\n with pytest.raises(\n ValueError, match=\"array split does not result in an equal division\"\n ):\n np.split(x, 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_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_hstack_test_hstack.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_hstack_test_hstack.None_1", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_shaping.py", "file_name": "test_array_shaping.py", "file_type": "text/x-python", "category": "test", "start_line": 80, "end_line": 92, "span_ids": ["test_hstack"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_hstack():\n # 2D arrays\n a = numpy.random.randint(-100, 100, size=(5, 3))\n b = numpy.random.randint(-100, 100, size=(5, 2))\n numpy_result = numpy.hstack((a, b))\n modin_result = np.hstack((np.array(a), np.array(b)))\n assert_scalar_or_array_equal(modin_result, numpy_result)\n # 1D arrays\n a = numpy.random.randint(-100, 100, size=(5,))\n b = numpy.random.randint(-100, 100, size=(3,))\n numpy_result = numpy.hstack((a, b))\n modin_result = np.hstack((np.array(a), np.array(b)))\n assert_scalar_or_array_equal(modin_result, numpy_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_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/test_array_shaping.py_test_append_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/test_array_shaping.py", "file_name": "test_array_shaping.py", "file_type": "text/x-python", "category": "test", "start_line": 95, "end_line": 111, "span_ids": ["test_append", "test_append_error"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_append():\n # Examples taken from numpy docs\n xs = [[1, 2, 3], [[4, 5, 6], [7, 8, 9]]]\n numpy_result = numpy.append(*xs)\n modin_result = np.append(*[np.array(x) for x in xs])\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n numpy_result = numpy.append([[1, 2, 3], [4, 5, 6]], [[7, 8, 9]], axis=0)\n modin_result = np.append(np.array([[1, 2, 3], [4, 5, 6]]), [[7, 8, 9]], axis=0)\n assert_scalar_or_array_equal(modin_result, numpy_result)\n\n\n@pytest.mark.xfail(reason=\"append error checking is incorrect: see GH#5896\")\ndef test_append_error():\n with pytest.raises(ValueError):\n np.append(np.array([[1, 2, 3], [4, 5, 6]]), np.array([7, 8, 9]), axis=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_modin-project__modin/modin/numpy/test/utils.py_numpy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/test/utils.py_numpy_", "embedding": null, "metadata": {"file_path": "modin/numpy/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 31, "span_ids": ["assert_scalar_or_array_equal", "docstring"], "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 numpy\n\nimport modin.numpy as np\n\n\ndef assert_scalar_or_array_equal(x1, x2, err_msg=None):\n \"\"\"\n Assert whether the result of the numpy and modin computations are the same.\n\n If either argument is a modin array object, then `_to_numpy()` is called on it.\n The arguments are compared with `numpy.testing.assert_array_equals`.\n \"\"\"\n if isinstance(x1, np.array):\n x1 = x1._to_numpy()\n if isinstance(x2, np.array):\n x2 = x2._to_numpy()\n numpy.testing.assert_array_equal(x1, x2, err_msg=err_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_modin-project__modin/modin/numpy/trigonometry.py_numpy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/trigonometry.py_numpy_", "embedding": null, "metadata": {"file_path": "modin/numpy/trigonometry.py", "file_name": "trigonometry.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 39, "span_ids": ["tanh", "docstring"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy\n\nfrom .arr import array\nfrom .utils import try_convert_from_interoperable_type\nfrom modin.error_message import ErrorMessage\n\n\ndef tanh(\n x, out=None, where=True, casting=\"same_kind\", order=\"K\", dtype=None, subok=True\n):\n x = try_convert_from_interoperable_type(x)\n if not isinstance(x, array):\n ErrorMessage.bad_type_for_numpy_op(\"tanh\", type(x))\n return numpy.tanh(\n x,\n out=out,\n where=where,\n casting=casting,\n order=order,\n dtype=dtype,\n subok=subok,\n )\n return x.tanh(\n out=out, where=where, casting=casting, order=order, dtype=dtype, subok=subok\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/utils.py_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/numpy/utils.py_pd_", "embedding": null, "metadata": {"file_path": "modin/numpy/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 26, "span_ids": ["try_convert_from_interoperable_type", "docstring"], "tokens": 65}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import modin.pandas as pd\nimport modin.numpy as np\n\n_INTEROPERABLE_TYPES = (pd.DataFrame, pd.Series)\n\n\ndef try_convert_from_interoperable_type(obj, copy=False):\n if isinstance(obj, _INTEROPERABLE_TYPES):\n obj = np.array(obj, copy=copy)\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_modin-project__modin/modin/pandas/__init__.py_pandas__is_first_update._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py_pandas__is_first_update._", "embedding": null, "metadata": {"file_path": "modin/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 91, "span_ids": ["imports:4", "docstring"], "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": "import pandas\nimport warnings\n\n__pandas_version__ = \"2.0.2\"\n\nif pandas.__version__ != __pandas_version__:\n warnings.warn(\n f\"The pandas version installed ({pandas.__version__}) does not match the supported pandas version in\"\n + f\" Modin ({__pandas_version__}). This may cause undesired side effects!\"\n )\n\nwith warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n from pandas import (\n eval,\n factorize,\n test,\n date_range,\n period_range,\n Index,\n MultiIndex,\n CategoricalIndex,\n bdate_range,\n DatetimeIndex,\n Timedelta,\n Timestamp,\n set_eng_float_format,\n options,\n describe_option,\n set_option,\n get_option,\n reset_option,\n option_context,\n NaT,\n PeriodIndex,\n Categorical,\n Interval,\n UInt8Dtype,\n UInt16Dtype,\n UInt32Dtype,\n UInt64Dtype,\n SparseDtype,\n Int8Dtype,\n Int16Dtype,\n Int32Dtype,\n Int64Dtype,\n StringDtype,\n BooleanDtype,\n CategoricalDtype,\n DatetimeTZDtype,\n IntervalDtype,\n PeriodDtype,\n RangeIndex,\n TimedeltaIndex,\n IntervalIndex,\n IndexSlice,\n Grouper,\n array,\n Period,\n DateOffset,\n timedelta_range,\n infer_freq,\n interval_range,\n ExcelWriter,\n NamedAgg,\n NA,\n api,\n ArrowDtype,\n Flags,\n Float32Dtype,\n Float64Dtype,\n from_dummies,\n )\nimport os\n\nfrom modin.config import Parameter\n\n_is_first_update = {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py__update_engine__update_engine._is_first_update_publishe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py__update_engine__update_engine._is_first_update_publishe", "embedding": null, "metadata": {"file_path": "modin/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 191, "span_ids": ["_update_engine"], "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": "def _update_engine(publisher: Parameter):\n from modin.config import Engine, StorageFormat, CpuCount\n from modin.config.envvars import IsExperimental\n from modin.config.pubsub import ValueSource\n\n # Set this so that Pandas doesn't try to multithread by itself\n os.environ[\"OMP_NUM_THREADS\"] = \"1\"\n\n sfmt = StorageFormat.get()\n\n if sfmt == \"Hdk\":\n is_hdk = True\n elif sfmt == \"Omnisci\":\n is_hdk = True\n StorageFormat.put(\"Hdk\")\n warnings.warn(\n \"The OmniSci storage format has been deprecated. Please use \"\n + '`StorageFormat.put(\"hdk\")` or `MODIN_STORAGE_FORMAT=\"hdk\"` instead.'\n )\n else:\n is_hdk = False\n\n if is_hdk and publisher.get_value_source() == ValueSource.DEFAULT:\n publisher.put(\"Native\")\n IsExperimental.put(True)\n if (\n publisher.get() == \"Native\"\n and StorageFormat.get_value_source() == ValueSource.DEFAULT\n ):\n is_hdk = True\n StorageFormat.put(\"Hdk\")\n IsExperimental.put(True)\n\n if publisher.get() == \"Ray\":\n if _is_first_update.get(\"Ray\", True):\n from modin.core.execution.ray.common import initialize_ray\n\n initialize_ray()\n elif publisher.get() == \"Native\":\n # With HDK storage format there is only a single worker per node\n # and we allow it to work on all cores.\n if is_hdk:\n os.environ[\"OMP_NUM_THREADS\"] = str(CpuCount.get())\n else:\n raise ValueError(\n f\"Storage format should be 'Hdk' with 'Native' engine, but provided {sfmt}.\"\n )\n elif publisher.get() == \"Dask\":\n if _is_first_update.get(\"Dask\", True):\n from modin.core.execution.dask.common import initialize_dask\n\n initialize_dask()\n elif publisher.get() == \"Unidist\":\n if _is_first_update.get(\"Unidist\", True):\n from modin.core.execution.unidist.common import initialize_unidist\n\n initialize_unidist()\n elif publisher.get() == \"Cloudray\":\n from modin.experimental.cloud import get_connection\n\n conn = get_connection()\n if _is_first_update.get(\"Cloudray\", True):\n\n @conn.teleport\n def init_remote_ray(partition):\n from ray import ray_constants\n import modin\n from modin.core.execution.ray.common import initialize_ray\n\n modin.set_execution(\"Ray\", partition)\n initialize_ray(\n override_is_cluster=True,\n override_redis_address=f\"localhost:{ray_constants.DEFAULT_PORT}\",\n override_redis_password=ray_constants.REDIS_DEFAULT_PASSWORD,\n )\n\n init_remote_ray(StorageFormat.get())\n # import FactoryDispatcher here to initialize IO class\n # so it doesn't skew read_csv() timings later on\n import modin.core.execution.dispatching.factories.dispatcher # noqa: F401\n else:\n get_connection().modules[\"modin\"].set_execution(\"Ray\", StorageFormat.get())\n elif publisher.get() == \"Cloudpython\":\n from modin.experimental.cloud import get_connection\n\n get_connection().modules[\"modin\"].set_execution(\"Python\")\n elif publisher.get() == \"Cloudnative\":\n from modin.experimental.cloud import get_connection\n\n assert (\n is_hdk\n ), f\"Storage format should be 'Hdk' with 'Cloudnative' engine, but provided {sfmt}.\"\n get_connection().modules[\"modin\"].set_execution(\"Native\", \"Hdk\")\n\n elif publisher.get() not in Engine.NOINIT_ENGINES:\n raise ImportError(\"Unrecognized execution engine: {}.\".format(publisher.get()))\n\n _is_first_update[publisher.get()] = 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_modin-project__modin/modin/pandas/__init__.py___version___from_modin_utils_import_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py___version___from_modin_utils_import_s", "embedding": null, "metadata": {"file_path": "modin/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 194, "end_line": 249, "span_ids": ["impl:9"], "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": "from .. import __version__\nfrom .dataframe import DataFrame\nfrom .io import (\n read_csv,\n read_parquet,\n read_json,\n read_html,\n read_clipboard,\n read_excel,\n read_hdf,\n read_feather,\n read_stata,\n read_sas,\n read_pickle,\n read_sql,\n read_gbq,\n read_table,\n read_fwf,\n read_sql_table,\n read_sql_query,\n read_spss,\n ExcelFile,\n to_pickle,\n HDFStore,\n json_normalize,\n read_orc,\n read_xml,\n)\nfrom .series import Series\nfrom .general import (\n concat,\n isna,\n isnull,\n merge,\n merge_asof,\n merge_ordered,\n notnull,\n notna,\n pivot,\n to_numeric,\n qcut,\n to_datetime,\n unique,\n value_counts,\n get_dummies,\n melt,\n crosstab,\n lreshape,\n wide_to_long,\n to_timedelta,\n pivot_table,\n cut,\n)\n\nfrom .plotting import Plotting as plotting\nfrom modin.utils import show_versions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py___all___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/__init__.py___all___", "embedding": null, "metadata": {"file_path": "modin/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 365, "span_ids": ["impl:9", "impl:18"], "tokens": 605}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "__all__ = [ # noqa: F405\n \"DataFrame\",\n \"Series\",\n \"read_csv\",\n \"read_parquet\",\n \"read_json\",\n \"read_html\",\n \"read_clipboard\",\n \"read_excel\",\n \"read_hdf\",\n \"read_feather\",\n \"read_stata\",\n \"read_sas\",\n \"read_pickle\",\n \"read_sql\",\n \"read_gbq\",\n \"read_table\",\n \"read_spss\",\n \"read_orc\",\n \"json_normalize\",\n \"concat\",\n \"eval\",\n \"cut\",\n \"factorize\",\n \"test\",\n \"qcut\",\n \"to_datetime\",\n \"get_dummies\",\n \"isna\",\n \"isnull\",\n \"merge\",\n \"pivot_table\",\n \"date_range\",\n \"Index\",\n \"MultiIndex\",\n \"Series\",\n \"bdate_range\",\n \"period_range\",\n \"DatetimeIndex\",\n \"to_timedelta\",\n \"set_eng_float_format\",\n \"options\",\n \"describe_option\",\n \"set_option\",\n \"get_option\",\n \"reset_option\",\n \"option_context\",\n \"CategoricalIndex\",\n \"Timedelta\",\n \"Timestamp\",\n \"NaT\",\n \"PeriodIndex\",\n \"Categorical\",\n \"__version__\",\n \"melt\",\n \"crosstab\",\n \"plotting\",\n \"Interval\",\n \"UInt8Dtype\",\n \"UInt16Dtype\",\n \"UInt32Dtype\",\n \"UInt64Dtype\",\n \"SparseDtype\",\n \"Int8Dtype\",\n \"Int16Dtype\",\n \"Int32Dtype\",\n \"Int64Dtype\",\n \"CategoricalDtype\",\n \"DatetimeTZDtype\",\n \"IntervalDtype\",\n \"PeriodDtype\",\n \"BooleanDtype\",\n \"StringDtype\",\n \"NA\",\n \"RangeIndex\",\n \"TimedeltaIndex\",\n \"IntervalIndex\",\n \"IndexSlice\",\n \"Grouper\",\n \"array\",\n \"Period\",\n \"show_versions\",\n \"DateOffset\",\n \"timedelta_range\",\n \"infer_freq\",\n \"interval_range\",\n \"ExcelWriter\",\n \"read_fwf\",\n \"read_sql_table\",\n \"read_sql_query\",\n \"ExcelFile\",\n \"to_pickle\",\n \"HDFStore\",\n \"lreshape\",\n \"wide_to_long\",\n \"merge_asof\",\n \"merge_ordered\",\n \"notnull\",\n \"notna\",\n \"pivot\",\n \"to_numeric\",\n \"unique\",\n \"value_counts\",\n \"NamedAgg\",\n \"api\",\n \"read_xml\",\n \"ArrowDtype\",\n \"Flags\",\n \"Float32Dtype\",\n \"Float64Dtype\",\n \"from_dummies\",\n]\n\ndel pandas, Parameter", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_pandas_BaseSparseAccessor._validate.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_pandas_BaseSparseAccessor._validate.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/pandas/accessor.py", "file_name": "accessor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 64, "span_ids": ["BaseSparseAccessor.__init__", "BaseSparseAccessor", "BaseSparseAccessor._validate", "docstring"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nfrom pandas.core.arrays.sparse.dtype import SparseDtype\n\nfrom modin import pandas as pd\nfrom modin.error_message import ErrorMessage\nfrom modin.utils import _inherit_docstrings\nfrom modin.logging import ClassLogger\n\n\nclass BaseSparseAccessor(ClassLogger):\n \"\"\"\n Base class for various sparse DataFrame accessor classes.\n\n Parameters\n ----------\n data : DataFrame or Series\n Object to operate on.\n \"\"\"\n\n _validation_msg = \"Can only use the '.sparse' accessor with Sparse data.\"\n\n def __init__(self, data=None):\n self._parent = data\n self._validate(data)\n\n @classmethod\n def _validate(cls, data):\n \"\"\"\n Verify that `data` dtypes are compatible with `pandas.core.arrays.sparse.dtype.SparseDtype`.\n\n Parameters\n ----------\n data : DataFrame\n Object to check.\n\n Raises\n ------\n NotImplementedError\n Function is implemented in child classes.\n \"\"\"\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_modin-project__modin/modin/pandas/accessor.py_BaseSparseAccessor._default_to_pandas_BaseSparseAccessor._default_to_pandas.return.self__parent__default_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_BaseSparseAccessor._default_to_pandas_BaseSparseAccessor._default_to_pandas.return.self__parent__default_to_", "embedding": null, "metadata": {"file_path": "modin/pandas/accessor.py", "file_name": "accessor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 86, "span_ids": ["BaseSparseAccessor._default_to_pandas"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseSparseAccessor(ClassLogger):\n\n def _default_to_pandas(self, op, *args, **kwargs):\n \"\"\"\n Convert dataset to pandas type and call a pandas sparse.`op` on it.\n\n Parameters\n ----------\n op : str\n Name of pandas function.\n *args : list\n Additional positional arguments to be passed in `op`.\n **kwargs : dict\n Additional keywords arguments to be passed in `op`.\n\n Returns\n -------\n object\n Result of operation.\n \"\"\"\n return self._parent._default_to_pandas(\n lambda parent: op(parent.sparse, *args, **kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_SparseFrameAccessor_SparseFrameAccessor.to_coo.return.self__default_to_pandas_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_SparseFrameAccessor_SparseFrameAccessor.to_coo.return.self__default_to_pandas_p", "embedding": null, "metadata": {"file_path": "modin/pandas/accessor.py", "file_name": "accessor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 125, "span_ids": ["SparseFrameAccessor.to_dense", "SparseFrameAccessor", "SparseFrameAccessor.from_spmatrix", "SparseFrameAccessor.density", "SparseFrameAccessor.to_coo", "SparseFrameAccessor._validate"], "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": "@_inherit_docstrings(pandas.core.arrays.sparse.accessor.SparseFrameAccessor)\nclass SparseFrameAccessor(BaseSparseAccessor):\n @classmethod\n def _validate(cls, data):\n \"\"\"\n Verify that `data` dtypes are compatible with `pandas.core.arrays.sparse.dtype.SparseDtype`.\n\n Parameters\n ----------\n data : DataFrame\n Object to check.\n\n Raises\n ------\n AttributeError\n If check fails.\n \"\"\"\n dtypes = data.dtypes\n if not all(isinstance(t, SparseDtype) for t in dtypes):\n raise AttributeError(cls._validation_msg)\n\n @property\n def density(self):\n return self._parent._default_to_pandas(pandas.DataFrame.sparse).density\n\n @classmethod\n def from_spmatrix(cls, data, index=None, columns=None):\n ErrorMessage.default_to_pandas(\"`from_spmatrix`\")\n return pd.DataFrame(\n pandas.DataFrame.sparse.from_spmatrix(data, index=index, columns=columns)\n )\n\n def to_dense(self):\n return self._default_to_pandas(pandas.DataFrame.sparse.to_dense)\n\n def to_coo(self):\n return self._default_to_pandas(pandas.DataFrame.sparse.to_coo)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_SparseAccessor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/accessor.py_SparseAccessor_", "embedding": null, "metadata": {"file_path": "modin/pandas/accessor.py", "file_name": "accessor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 194, "span_ids": ["SparseAccessor.from_coo", "SparseAccessor.npoints", "SparseAccessor.density", "SparseAccessor.sp_values", "SparseAccessor.to_dense", "CachedAccessor", "SparseAccessor._validate", "SparseAccessor", "CachedAccessor.__get__", "SparseAccessor.to_coo", "SparseAccessor.fill_value", "CachedAccessor.__init__"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.arrays.sparse.accessor.SparseAccessor)\nclass SparseAccessor(BaseSparseAccessor):\n @classmethod\n def _validate(cls, data):\n \"\"\"\n Verify that `data` dtype is compatible with `pandas.core.arrays.sparse.dtype.SparseDtype`.\n\n Parameters\n ----------\n data : Series\n Object to check.\n\n Raises\n ------\n AttributeError\n If check fails.\n \"\"\"\n if not isinstance(data.dtype, SparseDtype):\n raise AttributeError(cls._validation_msg)\n\n @property\n def density(self):\n return self._parent._default_to_pandas(pandas.Series.sparse).density\n\n @property\n def fill_value(self):\n return self._parent._default_to_pandas(pandas.Series.sparse).fill_value\n\n @property\n def npoints(self):\n return self._parent._default_to_pandas(pandas.Series.sparse).npoints\n\n @property\n def sp_values(self):\n return self._parent._default_to_pandas(pandas.Series.sparse).sp_values\n\n @classmethod\n def from_coo(cls, A, dense_index=False):\n return cls._default_to_pandas(\n pandas.Series.sparse.from_coo, A, dense_index=dense_index\n )\n\n def to_coo(self, row_levels=(0,), column_levels=(1,), sort_labels=False):\n return self._default_to_pandas(\n pandas.Series.sparse.to_coo,\n row_levels=row_levels,\n column_levels=column_levels,\n sort_labels=sort_labels,\n )\n\n def to_dense(self):\n return self._default_to_pandas(pandas.Series.sparse.to_dense)\n\n\n@_inherit_docstrings(pandas.core.accessor.CachedAccessor)\nclass CachedAccessor(ClassLogger):\n def __init__(self, name: str, accessor) -> None:\n self._name = name\n self._accessor = accessor\n\n def __get__(self, obj, cls):\n if obj is None:\n return self._accessor\n accessor_obj = self._accessor(obj)\n object.__setattr__(obj, self._name, accessor_obj)\n return accessor_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_modin-project__modin/modin/pandas/base.py_from___future___import_an__doc_binary_op_kwargs._returns_BasePandasDa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_from___future___import_an__doc_binary_op_kwargs._returns_BasePandasDa", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 111, "span_ids": ["docstring:16", "docstring"], "tokens": 618}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 annotations\nimport numpy as np\nimport pandas\nfrom pandas.compat import numpy as numpy_compat\nfrom pandas.core.common import count_not_none, pipe\nfrom pandas.core.methods.describe import refine_percentiles\nfrom pandas.core.dtypes.common import (\n is_list_like,\n is_dict_like,\n is_numeric_dtype,\n is_datetime_or_timedelta_dtype,\n is_dtype_equal,\n is_object_dtype,\n is_integer,\n)\nfrom pandas.core.indexes.api import ensure_index\nimport pandas.core.window.rolling\nimport pandas.core.resample\nimport pandas.core.generic\nfrom pandas.util._validators import (\n validate_percentile,\n validate_bool_kwarg,\n validate_ascending,\n)\nfrom pandas._libs.lib import no_default, NoDefault\nfrom pandas._libs.tslibs import to_offset\nfrom pandas._typing import (\n IndexKeyFunc,\n StorageOptions,\n CompressionOptions,\n Axis,\n IndexLabel,\n Level,\n TimedeltaConvertibleTypes,\n TimestampConvertibleTypes,\n RandomState,\n DtypeBackend,\n npt,\n)\nimport pickle as pkl\nimport re\nfrom typing import Optional, Union, Sequence, Hashable\nimport warnings\n\n\nfrom .utils import is_full_grab_slice, _doc_binary_op\nfrom modin.utils import try_cast_to_pandas, _inherit_docstrings\nfrom modin.error_message import ErrorMessage\nfrom modin import pandas as pd\nfrom modin.pandas.utils import is_scalar\nfrom modin.config import IsExperimental\nfrom modin.logging import disable_logging, ClassLogger\n\n# Similar to pandas, sentinel value to use as kwarg in place of None when None has\n# special meaning and needs to be distinguished from a user explicitly passing None.\nsentinel = object()\n\n# Do not lookup certain attributes in columns or index, as they're used for some\n# special purposes, like serving remote context\n_ATTRS_NO_LOOKUP = {\"____id_pack__\", \"__name__\", \"_cache\"}\n\n_DEFAULT_BEHAVIOUR = {\n \"__init__\",\n \"__class__\",\n \"_get_index\",\n \"_set_index\",\n \"_pandas_class\",\n \"_get_axis_number\",\n \"empty\",\n \"index\",\n \"columns\",\n \"name\",\n \"dtypes\",\n \"dtype\",\n \"groupby\",\n \"_get_name\",\n \"_set_name\",\n \"_default_to_pandas\",\n \"_query_compiler\",\n \"_to_pandas\",\n \"_repartition\",\n \"_build_repr_df\",\n \"_reduce_dimension\",\n \"__repr__\",\n \"__len__\",\n \"__constructor__\",\n \"_create_or_update_from_compiler\",\n \"_update_inplace\",\n # for persistance support;\n # see DataFrame methods docstrings for more\n \"_inflate_light\",\n \"_inflate_full\",\n \"__reduce__\",\n \"__reduce_ex__\",\n \"_init\",\n} | _ATTRS_NO_LOOKUP\n\n_doc_binary_op_kwargs = {\"returns\": \"BasePandasDataset\", \"left\": \"BasePandasDataset\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py__get_repr_axis_label_indexer__get_repr_axis_label_indexer.return.list_all_positions_front": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py__get_repr_axis_label_indexer__get_repr_axis_label_indexer.return.list_all_positions_front", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 158, "span_ids": ["_get_repr_axis_label_indexer"], "tokens": 474}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_repr_axis_label_indexer(labels, num_for_repr):\n \"\"\"\n Get the indexer for the given axis labels to be used for the repr.\n\n Parameters\n ----------\n labels : pandas.Index\n The axis labels.\n num_for_repr : int\n The number of elements to display.\n\n Returns\n -------\n slice or list\n The indexer to use for the repr.\n \"\"\"\n if len(labels) <= num_for_repr:\n return slice(None)\n # At this point, the entire axis has len(labels) elements, and num_for_repr <\n # len(labels). We want to select a pandas subframe containing elements such that:\n # - the repr of the pandas subframe will be the same as the repr of the entire\n # frame.\n # - the pandas repr will not be able to show all the elements and will put an\n # ellipsis in the middle\n #\n # We accomplish this by selecting some elements from the front and some from the\n # back, with the front having at most 1 element more than the back. The total\n # number of elements will be num_for_repr + 1.\n\n if num_for_repr % 2 == 0:\n # If num_for_repr is even, take an extra element from the front.\n # The total number of elements we are selecting is (num_for_repr // 2) * 2 + 1\n # = num_for_repr + 1\n front_repr_num = num_for_repr // 2 + 1\n back_repr_num = num_for_repr // 2\n else:\n # If num_for_repr is odd, take an extra element from both the front and the\n # back. The total number of elements we are selecting is\n # (num_for_repr // 2) * 2 + 1 + 1 = num_for_repr + 1\n front_repr_num = num_for_repr // 2 + 1\n back_repr_num = num_for_repr // 2 + 1\n all_positions = range(len(labels))\n return list(all_positions[:front_repr_num]) + (\n [] if back_repr_num == 0 else list(all_positions[-back_repr_num:])\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset_BasePandasDataset._pandas_class.pandas_core_generic_NDFra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset_BasePandasDataset._pandas_class.pandas_core_generic_NDFra", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 173, "span_ids": ["BasePandasDataset"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n \"\"\"\n Implement most of the common code that exists in DataFrame/Series.\n\n Since both objects share the same underlying representation, and the algorithms\n are the same, we use this object to define the general behavior of those objects\n and then use those objects to define the output type.\n \"\"\"\n\n # Pandas class that we pretend to be; usually it has the same name as our class\n # but lives in \"pandas\" namespace.\n _pandas_class = pandas.core.generic.NDFrame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._is_dataframe_BasePandasDataset._is_dataframe.return.issubclass_self__pandas_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._is_dataframe_BasePandasDataset._is_dataframe.return.issubclass_self__pandas_c", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 189, "span_ids": ["BasePandasDataset._is_dataframe"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @pandas.util.cache_readonly\n def _is_dataframe(self) -> bool:\n \"\"\"\n Tell whether this is a dataframe.\n\n Ideally, other methods of BasePandasDataset shouldn't care whether this\n is a dataframe or a series, but sometimes we need to know. This method\n is better than hasattr(self, \"columns\"), which for series will call\n self.__getattr__(\"columns\"), which requires materializing the index.\n\n Returns\n -------\n bool : Whether this is a dataframe.\n \"\"\"\n return issubclass(self._pandas_class, pandas.DataFrame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._create_or_update_from_compiler_BasePandasDataset._create_or_update_from_compiler.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._create_or_update_from_compiler_BasePandasDataset._create_or_update_from_compiler.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 207, "span_ids": ["BasePandasDataset._create_or_update_from_compiler"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _create_or_update_from_compiler(self, new_query_compiler, inplace=False):\n \"\"\"\n Return or update a ``DataFrame`` or ``Series`` with given `new_query_compiler`.\n\n Parameters\n ----------\n new_query_compiler : PandasQueryCompiler\n QueryCompiler to use to manage the data.\n inplace : bool, default: False\n Whether or not to perform update or creation inplace.\n\n Returns\n -------\n DataFrame, Series or None\n None if update was done, ``DataFrame`` or ``Series`` otherwise.\n \"\"\"\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._add_sibling_BasePandasDataset._add_sibling.for_sib_in_self__siblings.sib__siblings_sibling": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._add_sibling_BasePandasDataset._add_sibling.for_sib_in_self__siblings.sib__siblings_sibling", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 224, "span_ids": ["BasePandasDataset._add_sibling"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _add_sibling(self, sibling):\n \"\"\"\n Add a DataFrame or Series object to the list of siblings.\n\n Siblings are objects that share the same query compiler. This function is called\n when a shallow copy is made.\n\n Parameters\n ----------\n sibling : BasePandasDataset\n Dataset to add to siblings list.\n \"\"\"\n sibling._siblings = self._siblings + [self]\n self._siblings += [sibling]\n for sib in self._siblings:\n sib._siblings += [sibling]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._build_repr_df_BasePandasDataset._update_inplace.old_query_compiler_free_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._build_repr_df_BasePandasDataset._update_inplace.old_query_compiler_free_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 226, "end_line": 274, "span_ids": ["BasePandasDataset._build_repr_df", "BasePandasDataset._update_inplace"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _build_repr_df(self, num_rows, num_cols):\n \"\"\"\n Build pandas DataFrame for string representation.\n\n Parameters\n ----------\n num_rows : int\n Number of rows to show in string representation. If number of\n rows in this dataset is greater than `num_rows` then half of\n `num_rows` rows from the beginning and half of `num_rows` rows\n from the end are shown.\n num_cols : int\n Number of columns to show in string representation. If number of\n columns in this dataset is greater than `num_cols` then half of\n `num_cols` columns from the beginning and half of `num_cols`\n columns from the end are shown.\n\n Returns\n -------\n pandas.DataFrame or pandas.Series\n A pandas dataset with `num_rows` or fewer rows and `num_cols` or fewer columns.\n \"\"\"\n # Fast track for empty dataframe.\n if len(self.index) == 0 or (self._is_dataframe and len(self.columns) == 0):\n return pandas.DataFrame(\n index=self.index,\n columns=self.columns if self._is_dataframe else None,\n )\n row_indexer = _get_repr_axis_label_indexer(self.index, num_rows)\n if self._is_dataframe:\n indexer = row_indexer, _get_repr_axis_label_indexer(self.columns, num_cols)\n else:\n indexer = row_indexer\n return self.iloc[indexer]._query_compiler.to_pandas()\n\n def _update_inplace(self, new_query_compiler):\n \"\"\"\n Update the current DataFrame inplace.\n\n Parameters\n ----------\n new_query_compiler : query_compiler\n The new QueryCompiler to use to manage the data.\n \"\"\"\n old_query_compiler = self._query_compiler\n self._query_compiler = new_query_compiler\n for sib in self._siblings:\n sib._query_compiler = new_query_compiler\n old_query_compiler.free()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_other_BasePandasDataset._validate_other._Do_dtype_checking_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_other_BasePandasDataset._validate_other._Do_dtype_checking_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 276, "end_line": 351, "span_ids": ["BasePandasDataset._validate_other"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _validate_other(\n self,\n other,\n axis,\n dtype_check=False,\n compare_index=False,\n ):\n \"\"\"\n Help to check validity of other in inter-df operations.\n\n Parameters\n ----------\n other : modin.pandas.BasePandasDataset\n Another dataset to validate against `self`.\n axis : {None, 0, 1}\n Specifies axis along which to do validation. When `1` or `None`\n is specified, validation is done along `index`, if `0` is specified\n validation is done along `columns` of `other` frame.\n dtype_check : bool, default: False\n Validates that both frames have compatible dtypes.\n compare_index : bool, default: False\n Compare Index if True.\n\n Returns\n -------\n modin.pandas.BasePandasDataset\n Other frame if it is determined to be valid.\n\n Raises\n ------\n ValueError\n If `other` is `Series` and its length is different from\n length of `self` `axis`.\n TypeError\n If any validation checks fail.\n \"\"\"\n if isinstance(other, BasePandasDataset):\n return other._query_compiler\n if not is_list_like(other):\n # We skip dtype checking if the other is a scalar. Note that pandas\n # is_scalar can be misleading as it is False for almost all objects,\n # even when those objects should be treated as scalars. See e.g.\n # https://github.com/modin-project/modin/issues/5236. Therefore, we\n # detect scalars by checking that `other` is neither a list-like nor\n # another BasePandasDataset.\n return other\n axis = self._get_axis_number(axis) if axis is not None else 1\n result = other\n if axis == 0:\n if len(other) != len(self._query_compiler.index):\n raise ValueError(\n f\"Unable to coerce to Series, length must be {len(self._query_compiler.index)}: \"\n + f\"given {len(other)}\"\n )\n else:\n if len(other) != len(self._query_compiler.columns):\n raise ValueError(\n f\"Unable to coerce to Series, length must be {len(self._query_compiler.columns)}: \"\n + f\"given {len(other)}\"\n )\n if hasattr(other, \"dtype\"):\n other_dtypes = [other.dtype] * len(other)\n elif is_dict_like(other):\n other_dtypes = [\n type(other[label])\n for label in self._query_compiler.get_axis(axis)\n # The binary operation is applied for intersection of axis labels\n # and dictionary keys. So filtering out extra keys.\n if label in other\n ]\n else:\n other_dtypes = [type(x) for x in other]\n if compare_index:\n if not self.index.equals(other.index):\n raise TypeError(\"Cannot perform operation with non-equal index\")\n # Do dtype checking.\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_other.if_dtype_check__BasePandasDataset._validate_other.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_other.if_dtype_check__BasePandasDataset._validate_other.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 352, "end_line": 380, "span_ids": ["BasePandasDataset._validate_other"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _validate_other(\n self,\n other,\n axis,\n dtype_check=False,\n compare_index=False,\n ):\n # ... other code\n if dtype_check:\n self_dtypes = self._get_dtypes()\n if is_dict_like(other):\n # The binary operation is applied for the intersection of axis labels\n # and dictionary keys. So filtering `self_dtypes` to match the `other`\n # dictionary.\n self_dtypes = [\n dtype\n for label, dtype in zip(\n self._query_compiler.get_axis(axis), self._get_dtypes()\n )\n if label in other\n ]\n\n # TODO(https://github.com/modin-project/modin/issues/5239):\n # this spuriously rejects other that is a list including some\n # custom type that can be added to self's elements.\n if not all(\n (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))\n or (is_object_dtype(self_dtype) and is_object_dtype(other_dtype))\n or (\n is_datetime_or_timedelta_dtype(self_dtype)\n and is_datetime_or_timedelta_dtype(other_dtype)\n )\n or is_dtype_equal(self_dtype, other_dtype)\n for self_dtype, other_dtype in zip(self_dtypes, other_dtypes)\n ):\n raise TypeError(\"Cannot do operation with improper dtypes\")\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_function_BasePandasDataset._validate_function.for_fn_in_func_.if_isinstance_fn_str_.elif_not_callable_fn_.on_invalid_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._validate_function_BasePandasDataset._validate_function.for_fn_in_func_.if_isinstance_fn_str_.elif_not_callable_fn_.on_invalid_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 382, "end_line": 424, "span_ids": ["BasePandasDataset._validate_function"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _validate_function(self, func, on_invalid=None):\n \"\"\"\n Check the validity of the function which is intended to be applied to the frame.\n\n Parameters\n ----------\n func : object\n on_invalid : callable(str, cls), optional\n Function to call in case invalid `func` is met, `on_invalid` takes an error\n message and an exception type as arguments. If not specified raise an\n appropriate exception.\n **Note:** This parameter is a hack to concord with pandas error types.\n \"\"\"\n\n def error_raiser(msg, exception=Exception):\n raise exception(msg)\n\n if on_invalid is None:\n on_invalid = error_raiser\n\n if isinstance(func, dict):\n [self._validate_function(fn, on_invalid) for fn in func.values()]\n return\n # We also could validate this, but it may be quite expensive for lazy-frames\n # if not all(idx in self.axes[axis] for idx in func.keys()):\n # error_raiser(\"Invalid dict keys\", KeyError)\n\n if not is_list_like(func):\n func = [func]\n\n for fn in func:\n if isinstance(fn, str):\n if not (hasattr(self, fn) or hasattr(np, fn)):\n on_invalid(\n f\"{fn} is not valid function for {type(self)} object.\",\n AttributeError,\n )\n elif not callable(fn):\n on_invalid(\n f\"One of the passed functions has an invalid type: {type(fn)}: {fn}, \"\n + \"only callable or string is acceptable.\",\n TypeError,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._binary_op_BasePandasDataset._binary_op.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._binary_op_BasePandasDataset._binary_op.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 426, "end_line": 472, "span_ids": ["BasePandasDataset._binary_op"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _binary_op(self, op, other, **kwargs):\n \"\"\"\n Do binary operation between two datasets.\n\n Parameters\n ----------\n op : str\n Name of binary operation.\n other : modin.pandas.BasePandasDataset\n Second operand of binary operation.\n **kwargs : dict\n Additional parameters to binary operation.\n\n Returns\n -------\n modin.pandas.BasePandasDataset\n Result of binary operation.\n \"\"\"\n # _axis indicates the operator will use the default axis\n if kwargs.pop(\"_axis\", None) is None:\n if kwargs.get(\"axis\", None) is not None:\n kwargs[\"axis\"] = axis = self._get_axis_number(kwargs.get(\"axis\", None))\n else:\n kwargs[\"axis\"] = axis = 1\n else:\n axis = 0\n if kwargs.get(\"level\", None) is not None:\n # Broadcast is an internally used argument\n kwargs.pop(\"broadcast\", None)\n return self._default_to_pandas(\n getattr(self._pandas_class, op), other, **kwargs\n )\n other = self._validate_other(other, axis, dtype_check=True)\n exclude_list = [\n \"__add__\",\n \"__radd__\",\n \"__and__\",\n \"__rand__\",\n \"__or__\",\n \"__ror__\",\n \"__xor__\",\n \"__rxor__\",\n ]\n if op in exclude_list:\n kwargs.pop(\"axis\")\n new_query_compiler = getattr(self._query_compiler, op)(other, **kwargs)\n return self._create_or_update_from_compiler(new_query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._default_to_pandas_BasePandasDataset._default_to_pandas.if_isinstance_result_typ.else_.try_.except_TypeError_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._default_to_pandas_BasePandasDataset._default_to_pandas.if_isinstance_result_typ.else_.try_.except_TypeError_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 560, "span_ids": ["BasePandasDataset._default_to_pandas"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _default_to_pandas(self, op, *args, **kwargs):\n \"\"\"\n Convert dataset to pandas type and call a pandas function on it.\n\n Parameters\n ----------\n op : str\n Name of pandas function.\n *args : list\n Additional positional arguments to be passed to `op`.\n **kwargs : dict\n Additional keywords arguments to be passed to `op`.\n\n Returns\n -------\n object\n Result of operation.\n \"\"\"\n empty_self_str = \"\" if not self.empty else \" for empty DataFrame\"\n ErrorMessage.default_to_pandas(\n \"`{}.{}`{}\".format(\n type(self).__name__,\n op if isinstance(op, str) else op.__name__,\n empty_self_str,\n )\n )\n\n args = try_cast_to_pandas(args)\n kwargs = try_cast_to_pandas(kwargs)\n pandas_obj = self._to_pandas()\n if callable(op):\n result = op(pandas_obj, *args, **kwargs)\n elif isinstance(op, str):\n # The inner `getattr` is ensuring that we are treating this object (whether\n # it is a DataFrame, Series, etc.) as a pandas object. The outer `getattr`\n # will get the operation (`op`) from the pandas version of the class and run\n # it on the object after we have converted it to pandas.\n attr = getattr(self._pandas_class, op)\n if isinstance(attr, property):\n result = getattr(pandas_obj, op)\n else:\n result = attr(pandas_obj, *args, **kwargs)\n else:\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=True,\n extra_log=\"{} is an unsupported operation\".format(op),\n )\n # SparseDataFrames cannot be serialized by arrow and cause problems for Modin.\n # For now we will use pandas.\n if isinstance(result, type(self)) and not isinstance(\n result, (pandas.SparseDataFrame, pandas.SparseSeries)\n ):\n return self._create_or_update_from_compiler(\n result, inplace=kwargs.get(\"inplace\", False)\n )\n elif isinstance(result, pandas.DataFrame):\n from .dataframe import DataFrame\n\n return DataFrame(result)\n elif isinstance(result, pandas.Series):\n from .series import Series\n\n return Series(result)\n # inplace\n elif result is None:\n return self._create_or_update_from_compiler(\n getattr(pd, type(pandas_obj).__name__)(pandas_obj)._query_compiler,\n inplace=True,\n )\n else:\n try:\n if (\n isinstance(result, (list, tuple))\n and len(result) == 2\n and isinstance(result[0], pandas.DataFrame)\n ):\n # Some operations split the DataFrame into two (e.g. align). We need to wrap\n # both of the returned results\n if isinstance(result[1], pandas.DataFrame):\n second = self.__constructor__(result[1])\n else:\n second = result[1]\n return self.__constructor__(result[0]), second\n else:\n return result\n except TypeError:\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._get_axis_number_BasePandasDataset._get_axis_number.return.cls__pandas_class__get_ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._get_axis_number_BasePandasDataset._get_axis_number.return.cls__pandas_class__get_ax", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 562, "end_line": 580, "span_ids": ["BasePandasDataset._get_axis_number"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @classmethod\n def _get_axis_number(cls, axis):\n \"\"\"\n Convert axis name or number to axis index.\n\n Parameters\n ----------\n axis : int, str or pandas._libs.lib.NoDefault\n Axis name ('index' or 'columns') or number to be converted to axis index.\n\n Returns\n -------\n int\n 0 or 1 - axis index in the array of axes stored in the dataframe.\n \"\"\"\n if axis is no_default:\n axis = None\n\n return cls._pandas_class._get_axis_number(axis) if axis is not None else 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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__constructor___BasePandasDataset.add.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__constructor___BasePandasDataset.add.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 582, "end_line": 633, "span_ids": ["BasePandasDataset._set_index", "BasePandasDataset.add", "BasePandasDataset._get_index", "BasePandasDataset:5", "BasePandasDataset.__constructor__", "BasePandasDataset.abs"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @pandas.util.cache_readonly\n def __constructor__(self):\n \"\"\"\n Construct DataFrame or Series object depending on self type.\n\n Returns\n -------\n modin.pandas.BasePandasDataset\n Constructed object.\n \"\"\"\n return type(self)\n\n def abs(self): # noqa: RT01, D200\n \"\"\"\n Return a `BasePandasDataset` with absolute numeric value of each element.\n \"\"\"\n self._validate_dtypes(numeric_only=True)\n return self.__constructor__(query_compiler=self._query_compiler.abs())\n\n def _set_index(self, new_index):\n \"\"\"\n Set the index for this DataFrame.\n\n Parameters\n ----------\n new_index : pandas.Index\n The new index to set this.\n \"\"\"\n self._query_compiler.index = new_index\n\n def _get_index(self):\n \"\"\"\n Get the index for this DataFrame.\n\n Returns\n -------\n pandas.Index\n The union of all indexes across the partitions.\n \"\"\"\n return self._query_compiler.index\n\n index = property(_get_index, _set_index)\n\n def add(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return addition of `BasePandasDataset` and `other`, element-wise (binary operator `add`).\n \"\"\"\n return self._binary_op(\n \"add\", other, axis=axis, level=level, fill_value=fill_value\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.aggregate_BasePandasDataset.agg.aggregate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.aggregate_BasePandasDataset.agg.aggregate", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 635, "end_line": 650, "span_ids": ["BasePandasDataset.aggregate", "BasePandasDataset:7"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def aggregate(self, func=None, axis=0, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Aggregate using one or more operations over the specified axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n result = None\n\n if axis == 0:\n result = self._aggregate(func, _axis=axis, *args, **kwargs)\n # TODO: handle case when axis == 1\n if result is None:\n kwargs.pop(\"is_transform\", None)\n return self.apply(func, axis=axis, args=args, **kwargs)\n return result\n\n agg = aggregate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._aggregate_BasePandasDataset._aggregate.return.self_apply_func_axis__ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._aggregate_BasePandasDataset._aggregate.return.self_apply_func_axis__ax", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 652, "end_line": 684, "span_ids": ["BasePandasDataset._aggregate"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _aggregate(self, func, *args, **kwargs):\n \"\"\"\n Aggregate using one or more operations over index axis.\n\n Parameters\n ----------\n func : function, str, list or dict\n Function to use for aggregating the data.\n *args : list\n Positional arguments to pass to func.\n **kwargs : dict\n Keyword arguments to pass to func.\n\n Returns\n -------\n scalar or BasePandasDataset\n\n See Also\n --------\n aggregate : Aggregate along any axis.\n \"\"\"\n _axis = kwargs.pop(\"_axis\", 0)\n kwargs.pop(\"_level\", None)\n\n if isinstance(func, str):\n kwargs.pop(\"is_transform\", None)\n return self._string_function(func, *args, **kwargs)\n\n # Dictionaries have complex behavior because they can be renamed here.\n elif func is None or isinstance(func, dict):\n return self._default_to_pandas(\"agg\", func, *args, **kwargs)\n kwargs.pop(\"is_transform\", None)\n return self.apply(func, axis=_axis, args=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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._string_function_BasePandasDataset._string_function.raise_ValueError_is_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._string_function_BasePandasDataset._string_function.raise_ValueError_is_a", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 686, "end_line": 717, "span_ids": ["BasePandasDataset._string_function"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _string_function(self, func, *args, **kwargs):\n \"\"\"\n Execute a function identified by its string name.\n\n Parameters\n ----------\n func : str\n Function name to call on `self`.\n *args : list\n Positional arguments to pass to func.\n **kwargs : dict\n Keyword arguments to pass to func.\n\n Returns\n -------\n object\n Function result.\n \"\"\"\n assert isinstance(func, str)\n f = getattr(self, func, None)\n if f is not None:\n if callable(f):\n return f(*args, **kwargs)\n assert len(args) == 0\n assert (\n len([kwarg for kwarg in kwargs if kwarg not in [\"axis\", \"_level\"]]) == 0\n )\n return f\n f = getattr(np, func, None)\n if f is not None:\n return self._default_to_pandas(\"agg\", func, *args, **kwargs)\n raise ValueError(\"{} is an unknown string function\".format(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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._get_dtypes_BasePandasDataset.align.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._get_dtypes_BasePandasDataset.align.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 719, "end_line": 764, "span_ids": ["BasePandasDataset._get_dtypes", "BasePandasDataset.align"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _get_dtypes(self):\n \"\"\"\n Get dtypes as list.\n\n Returns\n -------\n list\n Either a one-element list that contains `dtype` if object denotes a Series\n or a list that contains `dtypes` if object denotes a DataFrame.\n \"\"\"\n if hasattr(self, \"dtype\"):\n return [self.dtype]\n else:\n return list(self.dtypes)\n\n def align(\n self,\n other,\n join=\"outer\",\n axis=None,\n level=None,\n copy=None,\n fill_value=None,\n method=None,\n limit=None,\n fill_axis=0,\n broadcast_axis=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Align two objects on their axes with the specified join method.\n \"\"\"\n left, right = self._query_compiler.align(\n other._query_compiler,\n join=join,\n axis=axis,\n level=level,\n copy=copy,\n fill_value=fill_value,\n method=method,\n limit=limit,\n fill_axis=fill_axis,\n broadcast_axis=broadcast_axis,\n )\n return self.__constructor__(query_compiler=left), self.__constructor__(\n query_compiler=right\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.all_BasePandasDataset.all.if_axis_is_not_None_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.all_BasePandasDataset.all.if_axis_is_not_None_.else_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 766, "end_line": 809, "span_ids": ["BasePandasDataset.all"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def all(\n self, axis=0, bool_only=None, skipna=True, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return whether all elements are True, potentially over an axis.\n \"\"\"\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n if axis is not None:\n axis = self._get_axis_number(axis)\n if bool_only and axis == 0:\n if hasattr(self, \"dtype\"):\n raise NotImplementedError(\n \"{}.{} does not implement numeric_only.\".format(\n type(self).__name__, \"all\"\n )\n )\n data_for_compute = self[self.columns[self.dtypes == np.bool_]]\n return data_for_compute.all(\n axis=axis, bool_only=False, skipna=skipna, **kwargs\n )\n return self._reduce_dimension(\n self._query_compiler.all(\n axis=axis, bool_only=bool_only, skipna=skipna, **kwargs\n )\n )\n else:\n if bool_only:\n raise ValueError(\"Axis must be 0 or 1 (got {})\".format(axis))\n # Reduce to a scalar if axis is None.\n result = self._reduce_dimension(\n # FIXME: Judging by pandas docs `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n self._query_compiler.all(\n axis=0,\n bool_only=bool_only,\n skipna=skipna,\n **kwargs,\n )\n )\n if isinstance(result, BasePandasDataset):\n return result.all(\n axis=axis, bool_only=bool_only, skipna=skipna, **kwargs\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.any_BasePandasDataset.any.if_axis_is_not_None_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.any_BasePandasDataset.any.if_axis_is_not_None_.else_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 811, "end_line": 852, "span_ids": ["BasePandasDataset.any"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def any(\n self, *, axis=0, bool_only=None, skipna=True, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return whether any element is True, potentially over an axis.\n \"\"\"\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n if axis is not None:\n axis = self._get_axis_number(axis)\n if bool_only and axis == 0:\n if hasattr(self, \"dtype\"):\n raise NotImplementedError(\n \"{}.{} does not implement numeric_only.\".format(\n type(self).__name__, \"all\"\n )\n )\n data_for_compute = self[self.columns[self.dtypes == np.bool_]]\n return data_for_compute.any(\n axis=axis, bool_only=False, skipna=skipna, **kwargs\n )\n return self._reduce_dimension(\n self._query_compiler.any(\n axis=axis, bool_only=bool_only, skipna=skipna, **kwargs\n )\n )\n else:\n if bool_only:\n raise ValueError(\"Axis must be 0 or 1 (got {})\".format(axis))\n # Reduce to a scalar if axis is None.\n result = self._reduce_dimension(\n self._query_compiler.any(\n axis=0,\n bool_only=bool_only,\n skipna=skipna,\n **kwargs,\n )\n )\n if isinstance(result, BasePandasDataset):\n return result.any(\n axis=axis, bool_only=bool_only, skipna=skipna, **kwargs\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.apply_BasePandasDataset.apply.return.query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.apply_BasePandasDataset.apply.return.query_compiler", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 854, "end_line": 903, "span_ids": ["BasePandasDataset.apply"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def apply(\n self,\n func,\n axis,\n broadcast,\n raw,\n reduce,\n result_type,\n convert_dtype,\n args,\n **kwds,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Apply a function along an axis of the `BasePandasDataset`.\n \"\"\"\n\n def error_raiser(msg, exception):\n \"\"\"Convert passed exception to the same type as pandas do and raise it.\"\"\"\n # HACK: to concord with pandas error types by replacing all of the\n # TypeErrors to the AssertionErrors\n exception = exception if exception is not TypeError else AssertionError\n raise exception(msg)\n\n self._validate_function(func, on_invalid=error_raiser)\n axis = self._get_axis_number(axis)\n if isinstance(func, str):\n # if axis != 1 function can be bounded to the Series, which doesn't\n # support axis parameter\n if axis == 1:\n kwds[\"axis\"] = axis\n result = self._string_function(func, *args, **kwds)\n if isinstance(result, BasePandasDataset):\n return result._query_compiler\n return result\n elif isinstance(func, dict):\n if len(self.columns) != len(set(self.columns)):\n warnings.warn(\n \"duplicate column names not supported with apply().\",\n FutureWarning,\n stacklevel=2,\n )\n query_compiler = self._query_compiler.apply(\n func,\n axis,\n args=args,\n raw=raw,\n result_type=result_type,\n **kwds,\n )\n return query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.asfreq_BasePandasDataset.asof.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.asfreq_BasePandasDataset.asof.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 905, "end_line": 947, "span_ids": ["BasePandasDataset.asof", "BasePandasDataset.asfreq"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def asfreq(\n self, freq, method=None, how=None, normalize=False, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Convert time series to specified frequency.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.asfreq(\n freq=freq,\n method=method,\n how=how,\n normalize=normalize,\n fill_value=fill_value,\n )\n )\n\n def asof(self, where, subset=None): # noqa: PR01, RT01, D200\n \"\"\"\n Return the last row(s) without any NaNs before `where`.\n \"\"\"\n scalar = not is_list_like(where)\n if isinstance(where, pandas.Index):\n # Prevent accidental mutation of original:\n where = where.copy()\n else:\n if scalar:\n where = [where]\n where = pandas.Index(where)\n\n if subset is None:\n data = self\n else:\n # Only relevant for DataFrames:\n data = self[subset]\n no_na_index = data.dropna().index\n new_index = pandas.Index([no_na_index.asof(i) for i in where])\n result = self.reindex(new_index)\n result.index = where\n\n if scalar:\n # Need to return a Series:\n result = result.squeeze()\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.astype_BasePandasDataset.astype.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.astype_BasePandasDataset.astype.return.self", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 949, "end_line": 999, "span_ids": ["BasePandasDataset.astype"], "tokens": 504}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def astype(self, dtype, copy=None, errors=\"raise\"): # noqa: PR01, RT01, D200\n \"\"\"\n Cast a Modin object to a specified dtype `dtype`.\n \"\"\"\n if copy is None:\n copy = True\n # dtype can be a series, a dict, or a scalar. If it's series or scalar,\n # convert it to a dict before passing it to the query compiler.\n if isinstance(dtype, (pd.Series, pandas.Series)):\n if not dtype.index.is_unique:\n raise ValueError(\n \"The new Series of types must have a unique index, i.e. \"\n + \"it must be one-to-one mapping from column names to \"\n + \" their new dtypes.\"\n )\n dtype = {column: dtype for column, dtype in dtype.items()}\n # If we got a series or dict originally, dtype is a dict now. Its keys\n # must be column names.\n if isinstance(dtype, dict):\n # avoid materializing columns in lazy mode. the query compiler\n # will handle errors where dtype dict includes keys that are not\n # in columns.\n if (\n not self._query_compiler.lazy_execution\n and not set(dtype.keys()).issubset(set(self._query_compiler.columns))\n and errors == \"raise\"\n ):\n raise KeyError(\n \"Only a column name can be used for the key in \"\n + \"a dtype mappings argument.\"\n )\n col_dtypes = dtype\n else:\n # Assume that the dtype is a scalar.\n col_dtypes = {column: dtype for column in self._query_compiler.columns}\n\n if not copy:\n # If the new types match the old ones, then copying can be avoided\n if self._query_compiler._modin_frame.has_materialized_dtypes:\n frame_dtypes = self._query_compiler._modin_frame.dtypes\n for col in col_dtypes:\n if col_dtypes[col] != frame_dtypes[col]:\n copy = True\n break\n else:\n copy = True\n\n if copy:\n new_query_compiler = self._query_compiler.astype(col_dtypes, errors=errors)\n return self._create_or_update_from_compiler(new_query_compiler)\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.at_BasePandasDataset.at_time.return.self_between_time_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.at_BasePandasDataset.at_time.return.self_between_time_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1001, "end_line": 1019, "span_ids": ["BasePandasDataset.at", "BasePandasDataset.at_time"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @property\n def at(self, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get a single value for a row/column label pair.\n \"\"\"\n from .indexing import _LocIndexer\n\n return _LocIndexer(self)\n\n def at_time(self, time, asof=False, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Select values at particular time of day (e.g., 9:30AM).\n \"\"\"\n if asof:\n # pandas raises NotImplementedError for asof=True, so we do, too.\n raise NotImplementedError(\"'asof' argument is not supported\")\n return self.between_time(\n start_time=time, end_time=time, inclusive=\"both\", axis=axis\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.between_time_BasePandasDataset.between_time.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.between_time_BasePandasDataset.between_time.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1021, "end_line": 1038, "span_ids": ["BasePandasDataset.between_time"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @_inherit_docstrings(\n pandas.DataFrame.between_time, apilink=\"pandas.DataFrame.between_time\"\n )\n def between_time(\n self: \"BasePandasDataset\",\n start_time,\n end_time,\n inclusive=\"both\",\n axis=None,\n ): # noqa: PR01, RT01, D200\n return self._create_or_update_from_compiler(\n self._query_compiler.between_time(\n start_time=pandas.core.tools.times.to_time(start_time),\n end_time=pandas.core.tools.times.to_time(end_time),\n inclusive=inclusive,\n axis=self._get_axis_number(axis),\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.bfill_BasePandasDataset.bool.if_shape_1_and_shap.else_.return.self__to_pandas_bool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.bfill_BasePandasDataset.bool.if_shape_1_and_shap.else_.return.self__to_pandas_bool_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1040, "end_line": 1066, "span_ids": ["BasePandasDataset:9", "BasePandasDataset.bool", "BasePandasDataset.bfill"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def bfill(\n self, *, axis=None, inplace=False, limit=None, downcast=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Synonym for `DataFrame.fillna` with ``method='bfill'``.\n \"\"\"\n return self.fillna(\n method=\"bfill\", axis=axis, limit=limit, downcast=downcast, inplace=inplace\n )\n\n backfill = bfill\n\n def bool(self): # noqa: RT01, D200\n \"\"\"\n Return the bool of a single element `BasePandasDataset`.\n \"\"\"\n shape = self.shape\n if shape != (1,) and shape != (1, 1):\n raise ValueError(\n \"\"\"The PandasObject does not have exactly\n 1 element. Return the bool of a single\n element PandasObject. The truth value is\n ambiguous. Use a.empty, a.item(), a.any()\n or a.all().\"\"\"\n )\n else:\n return self._to_pandas().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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.clip_BasePandasDataset.clip.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.clip_BasePandasDataset.clip.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1068, "end_line": 1095, "span_ids": ["BasePandasDataset.clip"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def clip(\n self, lower=None, upper=None, *, axis=None, inplace=False, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Trim values at input threshold(s).\n \"\"\"\n # validate inputs\n if axis is not None:\n axis = self._get_axis_number(axis)\n self._validate_dtypes(numeric_only=True)\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n axis = numpy_compat.function.validate_clip_with_axis(axis, (), kwargs)\n # any np.nan bounds are treated as None\n if lower is not None and np.any(np.isnan(lower)):\n lower = None\n if upper is not None and np.any(np.isnan(upper)):\n upper = None\n if is_list_like(lower) or is_list_like(upper):\n if axis is None:\n raise ValueError(\"Must specify axis = 0 or 1\")\n lower = self._validate_other(lower, axis)\n upper = self._validate_other(upper, axis)\n # FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n new_query_compiler = self._query_compiler.clip(\n lower=lower, upper=upper, axis=axis, **kwargs\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.combine_BasePandasDataset.copy.return.new_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.combine_BasePandasDataset.copy.return.new_obj", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1097, "end_line": 1119, "span_ids": ["BasePandasDataset.combine", "BasePandasDataset.combine_first", "BasePandasDataset.copy"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def combine(self, other, func, fill_value=None, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Perform combination of `BasePandasDataset`-s according to `func`.\n \"\"\"\n return self._binary_op(\n \"combine\", other, _axis=0, func=func, fill_value=fill_value, **kwargs\n )\n\n def combine_first(self, other): # noqa: PR01, RT01, D200\n \"\"\"\n Update null elements with value in the same location in `other`.\n \"\"\"\n return self._binary_op(\"combine_first\", other, _axis=0)\n\n def copy(self, deep=True): # noqa: PR01, RT01, D200\n \"\"\"\n Make a copy of the object's metadata.\n \"\"\"\n if deep:\n return self.__constructor__(query_compiler=self._query_compiler.copy())\n new_obj = self.__constructor__(query_compiler=self._query_compiler)\n self._add_sibling(new_obj)\n return new_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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.count_BasePandasDataset.count.return.frame__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.count_BasePandasDataset.count.return.frame__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1121, "end_line": 1132, "span_ids": ["BasePandasDataset.count"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def count(self, axis=0, numeric_only=False): # noqa: PR01, RT01, D200\n \"\"\"\n Count non-NA cells for `BasePandasDataset`.\n \"\"\"\n axis = self._get_axis_number(axis)\n # select_dtypes is only implemented on DataFrames, but the numeric_only\n # flag will always be set to false by the Series frontend\n frame = self.select_dtypes([np.number, np.bool_]) if numeric_only else self\n\n return frame._reduce_dimension(\n frame._query_compiler.count(axis=axis, numeric_only=numeric_only)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cummax_BasePandasDataset.cummax.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cummax_BasePandasDataset.cummax.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1134, "end_line": 1147, "span_ids": ["BasePandasDataset.cummax"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def cummax(self, axis=None, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return cumulative maximum over a `BasePandasDataset` axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n if axis == 1:\n self._validate_dtypes(numeric_only=True)\n return self.__constructor__(\n # FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n query_compiler=self._query_compiler.cummax(\n fold_axis=axis, axis=axis, skipna=skipna, **kwargs\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cummin_BasePandasDataset.cummin.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cummin_BasePandasDataset.cummin.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1149, "end_line": 1162, "span_ids": ["BasePandasDataset.cummin"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def cummin(self, axis=None, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return cumulative minimum over a `BasePandasDataset` axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n if axis == 1:\n self._validate_dtypes(numeric_only=True)\n return self.__constructor__(\n # FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n query_compiler=self._query_compiler.cummin(\n fold_axis=axis, axis=axis, skipna=skipna, **kwargs\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cumprod_BasePandasDataset.cumprod.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cumprod_BasePandasDataset.cumprod.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1164, "end_line": 1178, "span_ids": ["BasePandasDataset.cumprod"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def cumprod(\n self, axis=None, skipna=True, *args, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return cumulative product over a `BasePandasDataset` axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n self._validate_dtypes(numeric_only=True)\n return self.__constructor__(\n # FIXME: Judging by pandas docs `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n query_compiler=self._query_compiler.cumprod(\n fold_axis=axis, axis=axis, skipna=skipna, **kwargs\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cumsum_BasePandasDataset.cumsum.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.cumsum_BasePandasDataset.cumsum.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1180, "end_line": 1192, "span_ids": ["BasePandasDataset.cumsum"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def cumsum(self, axis=None, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return cumulative sum over a `BasePandasDataset` axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n self._validate_dtypes(numeric_only=True)\n return self.__constructor__(\n # FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n query_compiler=self._query_compiler.cumsum(\n fold_axis=axis, axis=axis, skipna=skipna, **kwargs\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.describe_BasePandasDataset.describe.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.describe_BasePandasDataset.describe.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1194, "end_line": 1230, "span_ids": ["BasePandasDataset.describe"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def describe(\n self,\n percentiles=None,\n include=None,\n exclude=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Generate descriptive statistics.\n \"\"\"\n # copied from pandas.core.describe.describe_ndframe\n percentiles = refine_percentiles(percentiles)\n data = self\n if self._is_dataframe:\n # include/exclude arguments are ignored for Series\n if (include is None) and (exclude is None):\n # when some numerics are found, keep only numerics\n default_include: list[npt.DTypeLike] = [np.number]\n default_include.append(\"datetime\")\n data = self.select_dtypes(include=default_include)\n if len(data.columns) == 0:\n data = self\n elif include == \"all\":\n if exclude is not None:\n msg = \"exclude must be None when include is 'all'\"\n raise ValueError(msg)\n data = self\n else:\n data = self.select_dtypes(\n include=include,\n exclude=exclude,\n )\n if data.empty:\n # Match pandas error from concatenting empty list of series descriptions.\n raise ValueError(\"No objects to concatenate\")\n return self.__constructor__(\n query_compiler=data._query_compiler.describe(percentiles=percentiles)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.diff_BasePandasDataset.diff.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.diff_BasePandasDataset.diff.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1232, "end_line": 1248, "span_ids": ["BasePandasDataset.diff"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def diff(self, periods=1, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n First discrete difference of element.\n \"\"\"\n # Attempting to match pandas error behavior here\n if not isinstance(periods, int):\n raise ValueError(f\"periods must be an int. got {type(periods)} instead\")\n\n # Attempting to match pandas error behavior here\n for dtype in self._get_dtypes():\n if not is_numeric_dtype(dtype):\n raise TypeError(f\"unsupported operand type for -: got {dtype}\")\n\n axis = self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.diff(axis=axis, periods=periods)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.drop_BasePandasDataset.drop.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.drop_BasePandasDataset.drop.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1250, "end_line": 1319, "span_ids": ["BasePandasDataset.drop"], "tokens": 542}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def drop(\n self,\n labels=None,\n *,\n axis=0,\n index=None,\n columns=None,\n level=None,\n inplace=False,\n errors=\"raise\",\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Drop specified labels from `BasePandasDataset`.\n \"\"\"\n # TODO implement level\n if level is not None:\n return self._default_to_pandas(\n \"drop\",\n labels=labels,\n axis=axis,\n index=index,\n columns=columns,\n level=level,\n inplace=inplace,\n errors=errors,\n )\n\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n if labels is not None:\n if index is not None or columns is not None:\n raise ValueError(\"Cannot specify both 'labels' and 'index'/'columns'\")\n axis_name = pandas.DataFrame._get_axis_name(axis)\n axes = {axis_name: labels}\n elif index is not None or columns is not None:\n axes = {\"index\": index}\n if self.ndim == 2:\n axes[\"columns\"] = columns\n else:\n raise ValueError(\n \"Need to specify at least one of 'labels', 'index' or 'columns'\"\n )\n\n for axis in [\"index\", \"columns\"]:\n if axis not in axes:\n axes[axis] = None\n elif axes[axis] is not None:\n if not is_list_like(axes[axis]):\n axes[axis] = [axes[axis]]\n # In case of lazy execution we should bypass these error checking components\n # because they can force the materialization of the row or column labels.\n if self._query_compiler.lazy_execution:\n continue\n if errors == \"raise\":\n non_existent = pandas.Index(axes[axis]).difference(\n getattr(self, axis)\n )\n if len(non_existent):\n raise KeyError(f\"labels {non_existent} not contained in axis\")\n else:\n axes[axis] = [\n obj for obj in axes[axis] if obj in getattr(self, axis)\n ]\n # If the length is zero, we will just do nothing\n if not len(axes[axis]):\n axes[axis] = None\n\n new_query_compiler = self._query_compiler.drop(\n index=axes[\"index\"], columns=axes[\"columns\"], errors=errors\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.dropna_BasePandasDataset.dropna.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.dropna_BasePandasDataset.dropna.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1321, "end_line": 1362, "span_ids": ["BasePandasDataset.dropna"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def dropna(\n self,\n *,\n axis: Axis = 0,\n how: str | NoDefault = no_default,\n thresh: int | NoDefault = no_default,\n subset: IndexLabel = None,\n inplace: bool = False,\n ignore_index: bool = False,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Remove missing values.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n\n if is_list_like(axis):\n raise TypeError(\"supplying multiple axes to axis is no longer supported.\")\n\n axis = self._get_axis_number(axis)\n if how is not None and how not in [\"any\", \"all\", no_default]:\n raise ValueError(\"invalid how option: %s\" % how)\n if how is None and thresh is None:\n raise TypeError(\"must specify how or thresh\")\n if subset is not None:\n if axis == 1:\n indices = self.index.get_indexer_for(subset)\n check = indices == -1\n if check.any():\n raise KeyError(list(np.compress(check, subset)))\n else:\n indices = self.columns.get_indexer_for(subset)\n check = indices == -1\n if check.any():\n raise KeyError(list(np.compress(check, subset)))\n new_query_compiler = self._query_compiler.dropna(\n axis=axis, how=how, thresh=thresh, subset=subset\n )\n if ignore_index:\n new_query_compiler.index = pandas.RangeIndex(\n stop=len(new_query_compiler.index)\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.droplevel_BasePandasDataset.droplevel.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.droplevel_BasePandasDataset.droplevel.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1364, "end_line": 1396, "span_ids": ["BasePandasDataset.droplevel"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def droplevel(self, level, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return `BasePandasDataset` with requested index / column level(s) removed.\n \"\"\"\n axis = self._get_axis_number(axis)\n result = self.copy()\n if axis == 0:\n index_columns = result.index.names.copy()\n if is_integer(level):\n level = index_columns[level]\n elif is_list_like(level):\n level = [\n index_columns[lev] if is_integer(lev) else lev for lev in level\n ]\n if is_list_like(level):\n for lev in level:\n index_columns.remove(lev)\n else:\n index_columns.remove(level)\n if len(result.columns.names) > 1:\n # In this case, we are dealing with a MultiIndex column, so we need to\n # be careful when dropping the additional index column.\n if is_list_like(level):\n drop_labels = [(lev, \"\") for lev in level]\n else:\n drop_labels = [(level, \"\")]\n result = result.reset_index().drop(columns=drop_labels)\n else:\n result = result.reset_index().drop(columns=level)\n result = result.set_index(index_columns)\n else:\n result.columns = self.columns.droplevel(level)\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.drop_duplicates_BasePandasDataset.drop_duplicates.if_inplace_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.drop_duplicates_BasePandasDataset.drop_duplicates.if_inplace_.else_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1398, "end_line": 1423, "span_ids": ["BasePandasDataset.drop_duplicates"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def drop_duplicates(\n self, keep=\"first\", inplace=False, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return `BasePandasDataset` with duplicate rows removed.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n ignore_index = kwargs.get(\"ignore_index\", False)\n subset = kwargs.get(\"subset\", None)\n if subset is not None:\n if is_list_like(subset):\n if not isinstance(subset, list):\n subset = list(subset)\n else:\n subset = [subset]\n df = self[subset]\n else:\n df = self\n duplicated = df.duplicated(keep=keep)\n result = self[~duplicated]\n if ignore_index:\n result.index = pandas.RangeIndex(stop=len(result))\n if inplace:\n self._update_inplace(result._query_compiler)\n else:\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.eq_BasePandasDataset.explode.return.exploded": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.eq_BasePandasDataset.explode.return.exploded", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1425, "end_line": 1440, "span_ids": ["BasePandasDataset.explode", "BasePandasDataset.eq"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def eq(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get equality of `BasePandasDataset` and `other`, element-wise (binary operator `eq`).\n \"\"\"\n return self._binary_op(\"eq\", other, axis=axis, level=level, dtypes=np.bool_)\n\n def explode(self, column, ignore_index: bool = False): # noqa: PR01, RT01, D200\n \"\"\"\n Transform each element of a list-like to a row.\n \"\"\"\n exploded = self.__constructor__(\n query_compiler=self._query_compiler.explode(column)\n )\n if ignore_index:\n exploded = exploded.reset_index(drop=True)\n return exploded", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.ewm_BasePandasDataset.ewm.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.ewm_BasePandasDataset.ewm.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1442, "end_line": 1470, "span_ids": ["BasePandasDataset.ewm"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def ewm(\n self,\n com: \"float | None\" = None,\n span: \"float | None\" = None,\n halflife: \"float | TimedeltaConvertibleTypes | None\" = None,\n alpha: \"float | None\" = None,\n min_periods: \"int | None\" = 0,\n adjust: bool = True,\n ignore_na: bool = False,\n axis: \"Axis\" = 0,\n times: \"str | np.ndarray | BasePandasDataset | None\" = None,\n method: \"str\" = \"single\",\n ) -> pandas.core.window.ewm.ExponentialMovingWindow: # noqa: PR01, RT01, D200\n \"\"\"\n Provide exponentially weighted (EW) calculations.\n \"\"\"\n return self._default_to_pandas(\n \"ewm\",\n com=com,\n span=span,\n halflife=halflife,\n alpha=alpha,\n min_periods=min_periods,\n adjust=adjust,\n ignore_na=ignore_na,\n axis=axis,\n times=times,\n method=method,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.expanding_BasePandasDataset.pad.ffill": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.expanding_BasePandasDataset.pad.ffill", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1472, "end_line": 1497, "span_ids": ["BasePandasDataset.expanding", "BasePandasDataset.ffill", "BasePandasDataset:11"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def expanding(\n self, min_periods=1, axis=0, method=\"single\"\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Provide expanding window calculations.\n \"\"\"\n from .window import Expanding\n\n return Expanding(\n self,\n min_periods=min_periods,\n axis=axis,\n method=method,\n )\n\n def ffill(\n self, *, axis=None, inplace=False, limit=None, downcast=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Synonym for `DataFrame.fillna` with ``method='ffill'``.\n \"\"\"\n return self.fillna(\n method=\"ffill\", axis=axis, limit=limit, downcast=downcast, inplace=inplace\n )\n\n pad = ffill", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.fillna_BasePandasDataset.fillna.if_method_is_not_None_and.raise_ValueError_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.fillna_BasePandasDataset.fillna.if_method_is_not_None_and.raise_ValueError_msg_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1499, "end_line": 1570, "span_ids": ["BasePandasDataset.fillna"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def fillna(\n self,\n squeeze_self,\n squeeze_value,\n value=None,\n method=None,\n axis=None,\n inplace=False,\n limit=None,\n downcast=None,\n ):\n \"\"\"\n Fill NA/NaN values using the specified method.\n\n Parameters\n ----------\n squeeze_self : bool\n If True then self contains a Series object, if False then self contains\n a DataFrame object.\n squeeze_value : bool\n If True then value contains a Series object, if False then value contains\n a DataFrame object.\n value : scalar, dict, Series, or DataFrame, default: None\n Value to use to fill holes (e.g. 0), alternately a\n dict/Series/DataFrame of values specifying which value to use for\n each index (for a Series) or column (for a DataFrame). Values not\n in the dict/Series/DataFrame will not be filled. This value cannot\n be a list.\n method : {'backfill', 'bfill', 'pad', 'ffill', None}, default: None\n Method to use for filling holes in reindexed Series\n pad / ffill: propagate last valid observation forward to next valid\n backfill / bfill: use next valid observation to fill gap.\n axis : {None, 0, 1}, default: None\n Axis along which to fill missing values.\n inplace : bool, default: False\n If True, fill in-place. Note: this will modify any\n other views on this object (e.g., a no-copy slice for a column in a\n DataFrame).\n limit : int, default: None\n If method is specified, this is the maximum number of consecutive\n NaN values to forward/backward fill. In other words, if there is\n a gap with more than this number of consecutive NaNs, it will only\n be partially filled. If method is not specified, this is the\n maximum number of entries along the entire axis where NaNs will be\n filled. Must be greater than 0 if not None.\n downcast : dict, default: None\n A dict of item->dtype of what to downcast if possible,\n or the string 'infer' which will try to downcast to an appropriate\n equal type (e.g. float64 to int64 if possible).\n\n Returns\n -------\n Series, DataFrame or None\n Object with missing values filled or None if ``inplace=True``.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n axis = self._get_axis_number(axis)\n if isinstance(value, (list, tuple)):\n raise TypeError(\n '\"value\" parameter must be a scalar or dict, but '\n + f'you passed a \"{type(value).__name__}\"'\n )\n if value is None and method is None:\n raise ValueError(\"must specify a fill method or value\")\n if value is not None and method is not None:\n raise ValueError(\"cannot specify both a fill method and value\")\n if method is not None and method not in [\"backfill\", \"bfill\", \"pad\", \"ffill\"]:\n expecting = \"pad (ffill) or backfill (bfill)\"\n msg = \"Invalid fill method. Expecting {expecting}. Got {method}\".format(\n expecting=expecting, method=method\n )\n raise ValueError(msg)\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.fillna.if_limit_is_not_None__BasePandasDataset.fillna.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.fillna.if_limit_is_not_None__BasePandasDataset.fillna.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1571, "end_line": 1590, "span_ids": ["BasePandasDataset.fillna"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def fillna(\n self,\n squeeze_self,\n squeeze_value,\n value=None,\n method=None,\n axis=None,\n inplace=False,\n limit=None,\n downcast=None,\n ):\n # ... other code\n if limit is not None:\n if not isinstance(limit, int):\n raise ValueError(\"Limit must be an integer\")\n elif limit <= 0:\n raise ValueError(\"Limit must be greater than 0\")\n\n if isinstance(value, BasePandasDataset):\n value = value._query_compiler\n\n new_query_compiler = self._query_compiler.fillna(\n squeeze_self=squeeze_self,\n squeeze_value=squeeze_value,\n value=value,\n method=method,\n axis=axis,\n inplace=False,\n limit=limit,\n downcast=downcast,\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.filter_BasePandasDataset.filter.return.self_self_columns_bool_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.filter_BasePandasDataset.filter.return.self_self_columns_bool_ar", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1592, "end_line": 1628, "span_ids": ["BasePandasDataset.filter"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def filter(\n self, items=None, like=None, regex=None, axis=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Subset the `BasePandasDataset` rows or columns according to the specified index labels.\n \"\"\"\n nkw = count_not_none(items, like, regex)\n if nkw > 1:\n raise TypeError(\n \"Keyword arguments `items`, `like`, or `regex` are mutually exclusive\"\n )\n if nkw == 0:\n raise TypeError(\"Must pass either `items`, `like`, or `regex`\")\n if axis is None:\n axis = \"columns\" # This is the default info axis for dataframes\n\n axis = self._get_axis_number(axis)\n labels = self.columns if axis else self.index\n\n if items is not None:\n bool_arr = labels.isin(items)\n elif like is not None:\n\n def f(x):\n return like in str(x)\n\n bool_arr = labels.map(f).tolist()\n else:\n\n def f(x):\n return matcher.search(str(x)) is not None\n\n matcher = re.compile(regex)\n bool_arr = labels.map(f).tolist()\n if not axis:\n return self[bool_arr]\n return self[self.columns[bool_arr]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.first_BasePandasDataset.iat.return._iLocIndexer_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.first_BasePandasDataset.iat.return._iLocIndexer_self_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1630, "end_line": 1689, "span_ids": ["BasePandasDataset.get", "BasePandasDataset.iat", "BasePandasDataset.first_valid_index", "BasePandasDataset.gt", "BasePandasDataset.ge", "BasePandasDataset.first", "BasePandasDataset.floordiv", "BasePandasDataset.head"], "tokens": 581}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def first(self, offset): # noqa: PR01, RT01, D200\n \"\"\"\n Select initial periods of time series data based on a date offset.\n \"\"\"\n return self._create_or_update_from_compiler(\n self._query_compiler.first(offset=to_offset(offset))\n )\n\n def first_valid_index(self): # noqa: RT01, D200\n \"\"\"\n Return index for first non-NA value or None, if no non-NA value is found.\n \"\"\"\n return self._query_compiler.first_valid_index()\n\n def floordiv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get integer division of `BasePandasDataset` and `other`, element-wise (binary operator `floordiv`).\n \"\"\"\n return self._binary_op(\n \"floordiv\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def ge(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get greater than or equal comparison of `BasePandasDataset` and `other`, element-wise (binary operator `ge`).\n \"\"\"\n return self._binary_op(\"ge\", other, axis=axis, level=level, dtypes=np.bool_)\n\n def get(self, key, default=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get item from object for given key.\n \"\"\"\n # Match pandas behavior here\n try:\n return self.__getitem__(key)\n except (KeyError, ValueError, IndexError):\n return default\n\n def gt(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get greater than comparison of `BasePandasDataset` and `other`, element-wise (binary operator `gt`).\n \"\"\"\n return self._binary_op(\"gt\", other, axis=axis, level=level, dtypes=np.bool_)\n\n def head(self, n=5): # noqa: PR01, RT01, D200\n \"\"\"\n Return the first `n` rows.\n \"\"\"\n return self.iloc[:n]\n\n @property\n def iat(self, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get a single value for a row/column pair by integer position.\n \"\"\"\n from .indexing import _iLocIndexer\n\n return _iLocIndexer(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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.idxmax_BasePandasDataset.idxmax.return.self__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.idxmax_BasePandasDataset.idxmax.return.self__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1691, "end_line": 1702, "span_ids": ["BasePandasDataset.idxmax"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def idxmax(self, axis=0, skipna=True, numeric_only=False): # noqa: PR01, RT01, D200\n \"\"\"\n Return index of first occurrence of maximum over requested axis.\n \"\"\"\n if not all(d != np.dtype(\"O\") for d in self._get_dtypes()):\n raise TypeError(\"reduce operation 'argmax' not allowed for this dtype\")\n axis = self._get_axis_number(axis)\n return self._reduce_dimension(\n self._query_compiler.idxmax(\n axis=axis, skipna=skipna, numeric_only=numeric_only\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.idxmin_BasePandasDataset.infer_objects.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.idxmin_BasePandasDataset.infer_objects.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1704, "end_line": 1724, "span_ids": ["BasePandasDataset.infer_objects", "BasePandasDataset.idxmin"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def idxmin(self, axis=0, skipna=True, numeric_only=False): # noqa: PR01, RT01, D200\n \"\"\"\n Return index of first occurrence of minimum over requested axis.\n \"\"\"\n if not all(d != np.dtype(\"O\") for d in self._get_dtypes()):\n raise TypeError(\"reduce operation 'argmin' not allowed for this dtype\")\n axis = self._get_axis_number(axis)\n return self._reduce_dimension(\n self._query_compiler.idxmin(\n axis=axis, skipna=skipna, numeric_only=numeric_only\n )\n )\n\n def infer_objects(self, copy=None): # noqa: PR01, RT01, D200\n \"\"\"\n Attempt to infer better dtypes for object columns.\n \"\"\"\n new_query_compiler = self._query_compiler.infer_objects()\n return self._create_or_update_from_compiler(\n new_query_compiler, inplace=False if copy is None else not copy\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.convert_dtypes_BasePandasDataset.convert_dtypes.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.convert_dtypes_BasePandasDataset.convert_dtypes.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1726, "end_line": 1747, "span_ids": ["BasePandasDataset.convert_dtypes"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def convert_dtypes(\n self,\n infer_objects: bool = True,\n convert_string: bool = True,\n convert_integer: bool = True,\n convert_boolean: bool = True,\n convert_floating: bool = True,\n dtype_backend: DtypeBackend = \"numpy_nullable\",\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Convert columns to best possible dtypes using dtypes supporting ``pd.NA``.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.convert_dtypes(\n infer_objects=infer_objects,\n convert_string=convert_string,\n convert_integer=convert_integer,\n convert_boolean=convert_boolean,\n convert_floating=convert_floating,\n dtype_backend=dtype_backend,\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.isin_BasePandasDataset.loc.return._LocIndexer_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.isin_BasePandasDataset.loc.return._LocIndexer_self_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1749, "end_line": 1819, "span_ids": ["BasePandasDataset.isin", "BasePandasDataset.kurt", "BasePandasDataset.isna", "BasePandasDataset.lt", "BasePandasDataset:13", "BasePandasDataset.loc", "BasePandasDataset.iloc", "BasePandasDataset:15", "BasePandasDataset.le", "BasePandasDataset.last_valid_index", "BasePandasDataset.last"], "tokens": 648}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def isin(self, values, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Whether elements in `BasePandasDataset` are contained in `values`.\n \"\"\"\n from .series import Series\n\n ignore_indices = isinstance(values, Series)\n values = getattr(values, \"_query_compiler\", values)\n return self.__constructor__(\n query_compiler=self._query_compiler.isin(\n values=values, ignore_indices=ignore_indices, **kwargs\n )\n )\n\n def isna(self): # noqa: RT01, D200\n \"\"\"\n Detect missing values.\n \"\"\"\n return self.__constructor__(query_compiler=self._query_compiler.isna())\n\n isnull = isna\n\n @property\n def iloc(self): # noqa: RT01, D200\n \"\"\"\n Purely integer-location based indexing for selection by position.\n \"\"\"\n from .indexing import _iLocIndexer\n\n return _iLocIndexer(self)\n\n @_inherit_docstrings(pandas.DataFrame.kurt, apilink=\"pandas.DataFrame.kurt\")\n def kurt(self, axis=0, skipna=True, numeric_only=False, **kwargs):\n return self._stat_operation(\"kurt\", axis, skipna, numeric_only, **kwargs)\n\n kurtosis = kurt\n\n def last(self, offset): # noqa: PR01, RT01, D200\n \"\"\"\n Select final periods of time series data based on a date offset.\n \"\"\"\n return self._create_or_update_from_compiler(\n self._query_compiler.last(offset=to_offset(offset))\n )\n\n def last_valid_index(self): # noqa: RT01, D200\n \"\"\"\n Return index for last non-NA value or None, if no non-NA value is found.\n \"\"\"\n return self._query_compiler.last_valid_index()\n\n def le(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get less than or equal comparison of `BasePandasDataset` and `other`, element-wise (binary operator `le`).\n \"\"\"\n return self._binary_op(\"le\", other, axis=axis, level=level, dtypes=np.bool_)\n\n def lt(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get less than comparison of `BasePandasDataset` and `other`, element-wise (binary operator `lt`).\n \"\"\"\n return self._binary_op(\"lt\", other, axis=axis, level=level, dtypes=np.bool_)\n\n @property\n def loc(self): # noqa: RT01, D200\n \"\"\"\n Get a group of rows and columns by label(s) or a boolean array.\n \"\"\"\n from .indexing import _LocIndexer\n\n return _LocIndexer(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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.mask_BasePandasDataset.mask.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.mask_BasePandasDataset.mask.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1821, "end_line": 1842, "span_ids": ["BasePandasDataset.mask"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def mask(\n self,\n cond,\n other=no_default,\n *,\n inplace: bool = False,\n axis: Optional[Axis] = None,\n level: Optional[Level] = None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Replace values where the condition is True.\n \"\"\"\n return self._create_or_update_from_compiler(\n self._query_compiler.mask(\n cond,\n other=other,\n inplace=False,\n axis=axis,\n level=level,\n ),\n inplace=inplace,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.max_BasePandasDataset.max.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.max_BasePandasDataset.max.return.res", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1844, "end_line": 1875, "span_ids": ["BasePandasDataset.max"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def max(\n self,\n axis: Axis = 0,\n skipna=True,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the maximum of the values over the requested axis.\n \"\"\"\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n orig_axis = axis\n axis = self._get_axis_number(axis)\n data = self._validate_dtypes_min_max(axis, numeric_only)\n res = data._reduce_dimension(\n data._query_compiler.max(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n **kwargs,\n )\n )\n if orig_axis is None:\n res = res._reduce_dimension(\n res._query_compiler.max(\n axis=0,\n skipna=skipna,\n numeric_only=False,\n **kwargs,\n )\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.min_BasePandasDataset.min.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.min_BasePandasDataset.min.return.res", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1877, "end_line": 1908, "span_ids": ["BasePandasDataset.min"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def min(\n self,\n axis: Axis = 0,\n skipna: bool = True,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the minimum of the values over the requested axis.\n \"\"\"\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n orig_axis = axis\n axis = self._get_axis_number(axis)\n data = self._validate_dtypes_min_max(axis, numeric_only)\n res = data._reduce_dimension(\n data._query_compiler.min(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n **kwargs,\n )\n )\n if orig_axis is None:\n res = res._reduce_dimension(\n res._query_compiler.min(\n axis=0,\n skipna=skipna,\n numeric_only=False,\n **kwargs,\n )\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._stat_operation_BasePandasDataset._stat_operation.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._stat_operation_BasePandasDataset._stat_operation.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1910, "end_line": 1972, "span_ids": ["BasePandasDataset._stat_operation"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _stat_operation(\n self,\n op_name: str,\n axis: Union[int, str],\n skipna: bool,\n numeric_only: Optional[bool] = False,\n **kwargs,\n ):\n \"\"\"\n Do common statistic reduce operations under frame.\n\n Parameters\n ----------\n op_name : str\n Name of method to apply.\n axis : int or str\n Axis to apply method on.\n skipna : bool\n Exclude NA/null values when computing the result.\n numeric_only : bool, default: False\n Include only float, int, boolean columns. If None, will attempt\n to use everything, then use only numeric data.\n **kwargs : dict\n Additional keyword arguments to pass to `op_name`.\n\n Returns\n -------\n scalar, Series or DataFrame\n `scalar` - self is Series and level is not specified.\n `Series` - self is Series and level is specified, or\n self is DataFrame and level is not specified.\n `DataFrame` - self is DataFrame and level is specified.\n \"\"\"\n axis = self._get_axis_number(axis) if axis is not None else None\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n if op_name == \"median\":\n numpy_compat.function.validate_median((), kwargs)\n elif op_name in (\"sem\", \"var\", \"std\"):\n val_kwargs = {k: v for k, v in kwargs.items() if k != \"ddof\"}\n numpy_compat.function.validate_stat_ddof_func((), val_kwargs, fname=op_name)\n else:\n numpy_compat.function.validate_stat_func((), kwargs, fname=op_name)\n\n if not numeric_only:\n self._validate_dtypes(numeric_only=True)\n\n data = (\n self._get_numeric_data(axis if axis is not None else 0)\n if numeric_only\n else self\n )\n result_qc = getattr(data._query_compiler, op_name)(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n **kwargs,\n )\n return (\n self._reduce_dimension(result_qc)\n if isinstance(result_qc, type(self._query_compiler))\n # scalar case\n else result_qc\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.memory_usage_BasePandasDataset.nunique.return.self__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.memory_usage_BasePandasDataset.nunique.return.self__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1974, "end_line": 2036, "span_ids": ["BasePandasDataset:17", "BasePandasDataset.mode", "BasePandasDataset.notna", "BasePandasDataset.ne", "BasePandasDataset.memory_usage", "BasePandasDataset.nunique", "BasePandasDataset:19", "BasePandasDataset.mod", "BasePandasDataset.mul"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def memory_usage(self, index=True, deep=False): # noqa: PR01, RT01, D200\n \"\"\"\n Return the memory usage of the `BasePandasDataset`.\n \"\"\"\n return self._reduce_dimension(\n self._query_compiler.memory_usage(index=index, deep=deep)\n )\n\n def mod(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get modulo of `BasePandasDataset` and `other`, element-wise (binary operator `mod`).\n \"\"\"\n return self._binary_op(\n \"mod\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def mode(self, axis=0, numeric_only=False, dropna=True): # noqa: PR01, RT01, D200\n \"\"\"\n Get the mode(s) of each element along the selected axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.mode(\n axis=axis, numeric_only=numeric_only, dropna=dropna\n )\n )\n\n def mul(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get multiplication of `BasePandasDataset` and `other`, element-wise (binary operator `mul`).\n \"\"\"\n return self._binary_op(\n \"mul\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n multiply = mul\n\n def ne(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get Not equal comparison of `BasePandasDataset` and `other`, element-wise (binary operator `ne`).\n \"\"\"\n return self._binary_op(\"ne\", other, axis=axis, level=level, dtypes=np.bool_)\n\n def notna(self): # noqa: RT01, D200\n \"\"\"\n Detect existing (non-missing) values.\n \"\"\"\n return self.__constructor__(query_compiler=self._query_compiler.notna())\n\n notnull = notna\n\n def nunique(self, axis=0, dropna=True): # noqa: PR01, RT01, D200\n \"\"\"\n Return number of unique elements in the `BasePandasDataset`.\n \"\"\"\n axis = self._get_axis_number(axis)\n return self._reduce_dimension(\n self._query_compiler.nunique(axis=axis, dropna=dropna)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.pct_change_BasePandasDataset.pct_change.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.pct_change_BasePandasDataset.pct_change.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2038, "end_line": 2061, "span_ids": ["BasePandasDataset.pct_change"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def pct_change(\n self, periods=1, fill_method=\"pad\", limit=None, freq=None, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Percentage change between the current and a prior element.\n \"\"\"\n # Attempting to match pandas error behavior here\n if not isinstance(periods, int):\n raise ValueError(f\"periods must be an int. got {type(periods)} instead\")\n\n # Attempting to match pandas error behavior here\n for dtype in self._get_dtypes():\n if not is_numeric_dtype(dtype):\n raise TypeError(f\"unsupported operand type for /: got {dtype}\")\n\n return self.__constructor__(\n query_compiler=self._query_compiler.pct_change(\n periods=periods,\n fill_method=fill_method,\n limit=limit,\n freq=freq,\n **kwargs,\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.pipe_BasePandasDataset.pow.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.pipe_BasePandasDataset.pow.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2063, "end_line": 2085, "span_ids": ["BasePandasDataset.pipe", "BasePandasDataset.pow", "BasePandasDataset.pop"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def pipe(self, func, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Apply chainable functions that expect `BasePandasDataset`.\n \"\"\"\n return pipe(self, func, *args, **kwargs)\n\n def pop(self, item): # noqa: PR01, RT01, D200\n \"\"\"\n Return item and drop from frame. Raise KeyError if not found.\n \"\"\"\n result = self[item]\n del self[item]\n return result\n\n def pow(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get exponential power of `BasePandasDataset` and `other`, element-wise (binary operator `pow`).\n \"\"\"\n return self._binary_op(\n \"pow\", other, axis=axis, level=level, fill_value=fill_value\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.quantile_BasePandasDataset.quantile.if_isinstance_q_pandas_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.quantile_BasePandasDataset.quantile.if_isinstance_q_pandas_.else_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2087, "end_line": 2147, "span_ids": ["BasePandasDataset.quantile"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def quantile(\n self, q, axis, numeric_only, interpolation, method\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return values at the given quantile over requested axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n\n def check_dtype(t):\n return is_numeric_dtype(t) or is_datetime_or_timedelta_dtype(t)\n\n if not numeric_only:\n # If not numeric_only and columns, then check all columns are either\n # numeric, timestamp, or timedelta\n if not axis and not all(check_dtype(t) for t in self._get_dtypes()):\n raise TypeError(\"can't multiply sequence by non-int of type 'float'\")\n # If over rows, then make sure that all dtypes are equal for not\n # numeric_only\n elif axis:\n for i in range(1, len(self._get_dtypes())):\n pre_dtype = self._get_dtypes()[i - 1]\n curr_dtype = self._get_dtypes()[i]\n if not is_dtype_equal(pre_dtype, curr_dtype):\n raise TypeError(\n \"Cannot compare type '{0}' with type '{1}'\".format(\n pre_dtype, curr_dtype\n )\n )\n else:\n # Normally pandas returns this near the end of the quantile, but we\n # can't afford the overhead of running the entire operation before\n # we error.\n if not any(is_numeric_dtype(t) for t in self._get_dtypes()):\n raise ValueError(\"need at least one array to concatenate\")\n\n # check that all qs are between 0 and 1\n validate_percentile(q)\n axis = self._get_axis_number(axis)\n if isinstance(q, (pandas.Series, np.ndarray, pandas.Index, list)):\n return self.__constructor__(\n query_compiler=self._query_compiler.quantile_for_list_of_values(\n q=q,\n axis=axis,\n numeric_only=numeric_only,\n interpolation=interpolation,\n method=method,\n )\n )\n else:\n result = self._reduce_dimension(\n self._query_compiler.quantile_for_single_value(\n q=q,\n axis=axis,\n numeric_only=numeric_only,\n interpolation=interpolation,\n method=method,\n )\n )\n if isinstance(result, BasePandasDataset):\n result.name = q\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rank_BasePandasDataset.rank.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rank_BasePandasDataset.rank.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2149, "end_line": 2169, "span_ids": ["BasePandasDataset.rank"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @_inherit_docstrings(pandas.DataFrame.rank, apilink=\"pandas.DataFrame.rank\")\n def rank(\n self,\n axis=0,\n method: str = \"average\",\n numeric_only=False,\n na_option: str = \"keep\",\n ascending: bool = True,\n pct: bool = False,\n ):\n axis = self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.rank(\n axis=axis,\n method=method,\n numeric_only=numeric_only,\n na_option=na_option,\n ascending=ascending,\n pct=pct,\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset._copy_index_metadata_BasePandasDataset._ensure_index.return.ensure_index_index_like_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset._copy_index_metadata_BasePandasDataset._ensure_index.return.ensure_index_index_like_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2171, "end_line": 2197, "span_ids": ["BasePandasDataset._copy_index_metadata", "BasePandasDataset._ensure_index"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def _copy_index_metadata(self, source, destination): # noqa: PR01, RT01, D200\n \"\"\"\n Copy Index metadata from `source` to `destination` inplace.\n \"\"\"\n if hasattr(source, \"name\") and hasattr(destination, \"name\"):\n destination.name = source.name\n if hasattr(source, \"names\") and hasattr(destination, \"names\"):\n destination.names = source.names\n return destination\n\n def _ensure_index(self, index_like, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Ensure that we have an index from some index-like object.\n \"\"\"\n if (\n self._query_compiler.has_multiindex(axis=axis)\n and not isinstance(index_like, pandas.Index)\n and is_list_like(index_like)\n and len(index_like) > 0\n and isinstance(index_like[0], tuple)\n ):\n try:\n return pandas.MultiIndex.from_tuples(index_like)\n except TypeError:\n # not all tuples\n pass\n return ensure_index(index_like)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reindex_BasePandasDataset.reindex.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reindex_BasePandasDataset.reindex.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2199, "end_line": 2227, "span_ids": ["BasePandasDataset.reindex"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def reindex(\n self,\n index=None,\n columns=None,\n copy=True,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Conform `BasePandasDataset` to new index with optional filling logic.\n \"\"\"\n new_query_compiler = None\n if index is not None:\n if not isinstance(index, pandas.Index) or not index.equals(self.index):\n new_query_compiler = self._query_compiler.reindex(\n axis=0, labels=index, **kwargs\n )\n if new_query_compiler is None:\n new_query_compiler = self._query_compiler\n final_query_compiler = None\n if columns is not None:\n if not isinstance(index, pandas.Index) or not columns.equals(self.columns):\n final_query_compiler = new_query_compiler.reindex(\n axis=1, labels=columns, **kwargs\n )\n if final_query_compiler is None:\n final_query_compiler = new_query_compiler\n return self._create_or_update_from_compiler(\n final_query_compiler, inplace=False if copy is None else not copy\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rename_axis_BasePandasDataset.rename_axis.if_mapper_is_not_no_defau.else_.if_not_inplace_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rename_axis_BasePandasDataset.rename_axis.if_mapper_is_not_no_defau.else_.if_not_inplace_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2229, "end_line": 2293, "span_ids": ["BasePandasDataset.rename_axis"], "tokens": 471}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def rename_axis(\n self,\n mapper=no_default,\n *,\n index=no_default,\n columns=no_default,\n axis=0,\n copy=None,\n inplace=False,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Set the name of the axis for the index or columns.\n \"\"\"\n axes = {\"index\": index, \"columns\": columns}\n\n if copy is None:\n copy = True\n\n if axis is not None:\n axis = self._get_axis_number(axis)\n\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n\n if mapper is not no_default:\n # Use v0.23 behavior if a scalar or list\n non_mapper = is_scalar(mapper) or (\n is_list_like(mapper) and not is_dict_like(mapper)\n )\n if non_mapper:\n return self._set_axis_name(mapper, axis=axis, inplace=inplace)\n else:\n raise ValueError(\"Use `.rename` to alter labels with a mapper.\")\n else:\n # Use new behavior. Means that index and/or columns is specified\n result = self if inplace else self.copy(deep=copy)\n\n for axis in range(self.ndim):\n v = axes.get(pandas.DataFrame._get_axis_name(axis))\n if v is no_default:\n continue\n non_mapper = is_scalar(v) or (is_list_like(v) and not is_dict_like(v))\n if non_mapper:\n newnames = v\n else:\n\n def _get_rename_function(mapper):\n if isinstance(mapper, (dict, BasePandasDataset)):\n\n def f(x):\n if x in mapper:\n return mapper[x]\n else:\n return x\n\n else:\n f = mapper\n\n return f\n\n f = _get_rename_function(v)\n curnames = self.index.names if axis == 0 else self.columns.names\n newnames = [f(name) for name in curnames]\n result._set_axis_name(newnames, axis=axis, inplace=True)\n if not inplace:\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reorder_levels_BasePandasDataset.resample.return.Resampler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reorder_levels_BasePandasDataset.resample.return.Resampler_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2295, "end_line": 2335, "span_ids": ["BasePandasDataset.reorder_levels", "BasePandasDataset.resample"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def reorder_levels(self, order, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Rearrange index levels using input order.\n \"\"\"\n axis = self._get_axis_number(axis)\n new_labels = self.axes[axis].reorder_levels(order)\n return self.set_axis(new_labels, axis=axis)\n\n def resample(\n self,\n rule,\n axis: Axis = 0,\n closed: Optional[str] = None,\n label: Optional[str] = None,\n convention: str = \"start\",\n kind: Optional[str] = None,\n on: Level = None,\n level: Level = None,\n origin: Union[str, TimestampConvertibleTypes] = \"start_day\",\n offset: Optional[TimedeltaConvertibleTypes] = None,\n group_keys=False,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Resample time-series data.\n \"\"\"\n from .resample import Resampler\n\n return Resampler(\n dataframe=self,\n rule=rule,\n axis=axis,\n closed=closed,\n label=label,\n convention=convention,\n kind=kind,\n on=on,\n level=level,\n origin=origin,\n offset=offset,\n group_keys=group_keys,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reset_index_BasePandasDataset.reset_index.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.reset_index_BasePandasDataset.reset_index.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2337, "end_line": 2370, "span_ids": ["BasePandasDataset.reset_index"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def reset_index(\n self,\n level: IndexLabel = None,\n *,\n drop: bool = False,\n inplace: bool = False,\n col_level: Hashable = 0,\n col_fill: Hashable = \"\",\n allow_duplicates=no_default,\n names: Hashable | Sequence[Hashable] = None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Reset the index, or a level of it.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n # Error checking for matching pandas. Pandas does not allow you to\n # insert a dropped index into a DataFrame if these columns already\n # exist.\n if (\n not drop\n and not self._query_compiler.lazy_execution\n and not self._query_compiler.has_multiindex()\n and all(n in self.columns for n in [\"level_0\", \"index\"])\n ):\n raise ValueError(\"cannot insert level_0, already exists\")\n new_query_compiler = self._query_compiler.reset_index(\n drop=drop,\n level=level,\n col_level=col_level,\n col_fill=col_fill,\n allow_duplicates=allow_duplicates,\n names=names,\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.radd_BasePandasDataset.rmul.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.radd_BasePandasDataset.rmul.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2372, "end_line": 2410, "span_ids": ["BasePandasDataset.rfloordiv", "BasePandasDataset.rmul", "BasePandasDataset.radd", "BasePandasDataset.rmod"], "tokens": 408}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def radd(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return addition of `BasePandasDataset` and `other`, element-wise (binary operator `radd`).\n \"\"\"\n return self._binary_op(\n \"radd\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def rfloordiv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get integer division of `BasePandasDataset` and `other`, element-wise (binary operator `rfloordiv`).\n \"\"\"\n return self._binary_op(\n \"rfloordiv\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def rmod(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get modulo of `BasePandasDataset` and `other`, element-wise (binary operator `rmod`).\n \"\"\"\n return self._binary_op(\n \"rmod\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def rmul(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get Multiplication of dataframe and other, element-wise (binary operator `rmul`).\n \"\"\"\n return self._binary_op(\n \"rmul\", other, axis=axis, level=level, fill_value=fill_value\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rolling_BasePandasDataset.rolling.return.Rolling_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rolling_BasePandasDataset.rolling.return.Rolling_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2412, "end_line": 2455, "span_ids": ["BasePandasDataset.rolling"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def rolling(\n self,\n window,\n min_periods: int | None = None,\n center: bool = False,\n win_type: str | None = None,\n on: str | None = None,\n axis: Axis = 0,\n closed: str | None = None,\n step: int | None = None,\n method: str = \"single\",\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Provide rolling window calculations.\n \"\"\"\n if win_type is not None:\n from .window import Window\n\n return Window(\n self,\n window=window,\n min_periods=min_periods,\n center=center,\n win_type=win_type,\n on=on,\n axis=axis,\n closed=closed,\n step=step,\n method=method,\n )\n from .window import Rolling\n\n return Rolling(\n self,\n window=window,\n min_periods=min_periods,\n center=center,\n win_type=win_type,\n on=on,\n axis=axis,\n closed=closed,\n step=step,\n method=method,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.round_BasePandasDataset.round.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.round_BasePandasDataset.round.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2457, "end_line": 2465, "span_ids": ["BasePandasDataset.round"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def round(self, decimals=0, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Round a `BasePandasDataset` to a variable number of decimal places.\n \"\"\"\n # FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility\n # purpose and does not affect the result, we shouldn't pass them to the query compiler.\n return self.__constructor__(\n query_compiler=self._query_compiler.round(decimals=decimals, **kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rpow_BasePandasDataset.rdiv.rtruediv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.rpow_BasePandasDataset.rdiv.rtruediv", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2467, "end_line": 2497, "span_ids": ["BasePandasDataset.rpow", "BasePandasDataset.rsub", "BasePandasDataset:21", "BasePandasDataset.rtruediv"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def rpow(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get exponential power of `BasePandasDataset` and `other`, element-wise (binary operator `rpow`).\n \"\"\"\n return self._binary_op(\n \"rpow\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def rsub(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get subtraction of `BasePandasDataset` and `other`, element-wise (binary operator `rsub`).\n \"\"\"\n return self._binary_op(\n \"rsub\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n def rtruediv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get floating division of `BasePandasDataset` and `other`, element-wise (binary operator `rtruediv`).\n \"\"\"\n return self._binary_op(\n \"rtruediv\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n rdiv = rtruediv", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sample_BasePandasDataset.sample.if_n_0_.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sample_BasePandasDataset.sample.if_n_0_.raise_ValueError_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2499, "end_line": 2579, "span_ids": ["BasePandasDataset.sample"], "tokens": 752}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def sample(\n self,\n n: int | None = None,\n frac: float | None = None,\n replace: bool = False,\n weights=None,\n random_state: RandomState | None = None,\n axis: Axis | None = None,\n ignore_index: bool = False,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return a random sample of items from an axis of object.\n \"\"\"\n axis = self._get_axis_number(axis)\n if axis:\n axis_labels = self.columns\n axis_length = len(axis_labels)\n else:\n # Getting rows requires indices instead of labels. RangeIndex provides this.\n axis_labels = pandas.RangeIndex(len(self.index))\n axis_length = len(axis_labels)\n if weights is not None:\n # Index of the weights Series should correspond to the index of the\n # Dataframe in order to sample\n if isinstance(weights, BasePandasDataset):\n weights = weights.reindex(self.axes[axis])\n # If weights arg is a string, the weights used for sampling will\n # the be values in the column corresponding to that string\n if isinstance(weights, str):\n if axis == 0:\n try:\n weights = self[weights]\n except KeyError:\n raise KeyError(\"String passed to weights not a valid column\")\n else:\n raise ValueError(\n \"Strings can only be passed to \"\n + \"weights when sampling from rows on \"\n + \"a DataFrame\"\n )\n weights = pandas.Series(weights, dtype=\"float64\")\n\n if len(weights) != axis_length:\n raise ValueError(\n \"Weights and axis to be sampled must be of same length\"\n )\n if (weights == np.inf).any() or (weights == -np.inf).any():\n raise ValueError(\"weight vector may not include `inf` values\")\n if (weights < 0).any():\n raise ValueError(\"weight vector many not include negative values\")\n # weights cannot be NaN when sampling, so we must set all nan\n # values to 0\n weights = weights.fillna(0)\n # If passed in weights are not equal to 1, renormalize them\n # otherwise numpy sampling function will error\n weights_sum = weights.sum()\n if weights_sum != 1:\n if weights_sum != 0:\n weights = weights / weights_sum\n else:\n raise ValueError(\"Invalid weights: weights sum to zero\")\n weights = weights.values\n\n if n is None and frac is None:\n # default to n = 1 if n and frac are both None (in accordance with\n # pandas specification)\n n = 1\n elif n is not None and frac is None and n % 1 != 0:\n # n must be an integer\n raise ValueError(\"Only integers accepted as `n` values\")\n elif n is None and frac is not None:\n # compute the number of samples based on frac\n n = int(round(frac * axis_length))\n elif n is not None and frac is not None:\n # Pandas specification does not allow both n and frac to be passed\n # in\n raise ValueError(\"Please enter a value for `frac` OR `n`, not both\")\n if n < 0:\n raise ValueError(\n \"A negative number of rows requested. Please provide positive value.\"\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sample.None_4_BasePandasDataset.sample.None_6.else_.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sample.None_4_BasePandasDataset.sample.None_6.else_.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2580, "end_line": 2623, "span_ids": ["BasePandasDataset.sample"], "tokens": 482}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def sample(\n self,\n n: int | None = None,\n frac: float | None = None,\n replace: bool = False,\n weights=None,\n random_state: RandomState | None = None,\n axis: Axis | None = None,\n ignore_index: bool = False,\n ):\n # ... other code\n if n == 0:\n # This returns an empty object, and since it is a weird edge case that\n # doesn't need to be distributed, we default to pandas for n=0.\n # We don't need frac to be set to anything since n is already 0.\n return self._default_to_pandas(\n \"sample\",\n n=n,\n frac=None,\n replace=replace,\n weights=weights,\n random_state=random_state,\n axis=axis,\n ignore_index=ignore_index,\n )\n if random_state is not None:\n # Get a random number generator depending on the type of\n # random_state that is passed in\n if isinstance(random_state, int):\n random_num_gen = np.random.RandomState(random_state)\n elif isinstance(random_state, np.random.RandomState):\n random_num_gen = random_state\n else:\n # random_state must be an int or a numpy RandomState object\n raise ValueError(\n \"Please enter an `int` OR a \"\n + \"np.random.RandomState for random_state\"\n )\n # choose random numbers and then get corresponding labels from\n # chosen axis\n sample_indices = random_num_gen.choice(\n np.arange(0, axis_length), size=n, replace=replace, p=weights\n )\n samples = axis_labels[sample_indices]\n else:\n # randomly select labels from chosen axis\n samples = np.random.choice(\n a=axis_labels, size=n, replace=replace, p=weights\n )\n if axis:\n query_compiler = self._query_compiler.getitem_column_array(samples)\n return self.__constructor__(query_compiler=query_compiler)\n else:\n query_compiler = self._query_compiler.getitem_row_array(samples)\n return self.__constructor__(query_compiler=query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sem_BasePandasDataset.flags.return.self__default_to_pandas_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sem_BasePandasDataset.flags.return.self__default_to_pandas_l", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2625, "end_line": 2694, "span_ids": ["BasePandasDataset.median", "BasePandasDataset.mean", "BasePandasDataset.set_flags", "BasePandasDataset.sem", "BasePandasDataset.set_axis", "BasePandasDataset.flags"], "tokens": 499}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def sem(\n self,\n axis: Optional[Axis] = None,\n skipna: bool = True,\n ddof: int = 1,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return unbiased standard error of the mean over requested axis.\n \"\"\"\n return self._stat_operation(\n \"sem\", axis, skipna, numeric_only, ddof=ddof, **kwargs\n )\n\n def mean(\n self,\n axis: Axis = 0,\n skipna=True,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the mean of the values over the requested axis.\n \"\"\"\n return self._stat_operation(\"mean\", axis, skipna, numeric_only, **kwargs)\n\n def median(\n self,\n axis: Axis = 0,\n skipna=True,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the mean of the values over the requested axis.\n \"\"\"\n return self._stat_operation(\"median\", axis, skipna, numeric_only, **kwargs)\n\n def set_axis(\n self,\n labels,\n *,\n axis: Axis = 0,\n copy=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Assign desired index to given axis.\n \"\"\"\n if copy is None:\n copy = True\n obj = self.copy() if copy else self\n setattr(obj, pandas.DataFrame._get_axis_name(axis), labels)\n return obj\n\n def set_flags(\n self, *, copy: bool = False, allows_duplicate_labels: Optional[bool] = None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return a new `BasePandasDataset` with updated flags.\n \"\"\"\n return self._default_to_pandas(\n pandas.DataFrame.set_flags,\n copy=copy,\n allows_duplicate_labels=allows_duplicate_labels,\n )\n\n @property\n def flags(self):\n return self._default_to_pandas(lambda df: df.flags)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.shift_BasePandasDataset.skew.return.self__stat_operation_ske": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.shift_BasePandasDataset.skew.return.self__stat_operation_ske", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2696, "end_line": 2726, "span_ids": ["BasePandasDataset.shift", "BasePandasDataset.skew"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def shift(\n self,\n periods: int = 1,\n freq=None,\n axis: Axis = 0,\n fill_value: Hashable = no_default,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Shift index by desired number of periods with an optional time `freq`.\n \"\"\"\n if periods == 0:\n # Check obvious case first\n return self.copy()\n return self._create_or_update_from_compiler(\n new_query_compiler=self._query_compiler.shift(\n periods, freq, axis, fill_value\n ),\n inplace=False,\n )\n\n def skew(\n self,\n axis: Axis = 0,\n skipna: bool = True,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return unbiased skew over requested axis.\n \"\"\"\n return self._stat_operation(\"skew\", axis, skipna, numeric_only, **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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sort_index_BasePandasDataset.sort_index.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sort_index_BasePandasDataset.sort_index.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2728, "end_line": 2762, "span_ids": ["BasePandasDataset.sort_index"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def sort_index(\n self,\n *,\n axis=0,\n level=None,\n ascending=True,\n inplace=False,\n kind=\"quicksort\",\n na_position=\"last\",\n sort_remaining=True,\n ignore_index: bool = False,\n key: Optional[IndexKeyFunc] = None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Sort object by labels (along an axis).\n \"\"\"\n # pandas throws this exception. See pandas issie #39434\n if ascending is None:\n raise ValueError(\n \"the `axis` parameter is not supported in the pandas implementation of argsort()\"\n )\n axis = self._get_axis_number(axis)\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n new_query_compiler = self._query_compiler.sort_index(\n axis=axis,\n level=level,\n ascending=ascending,\n inplace=inplace,\n kind=kind,\n na_position=na_position,\n sort_remaining=sort_remaining,\n ignore_index=ignore_index,\n key=key,\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sort_values_BasePandasDataset.sort_values.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.sort_values_BasePandasDataset.sort_values.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2764, "end_line": 2800, "span_ids": ["BasePandasDataset.sort_values"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def sort_values(\n self,\n by,\n *,\n axis=0,\n ascending=True,\n inplace: bool = False,\n kind=\"quicksort\",\n na_position=\"last\",\n ignore_index: bool = False,\n key: Optional[IndexKeyFunc] = None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Sort by the values along either axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n ascending = validate_ascending(ascending)\n if axis == 0:\n result = self._query_compiler.sort_rows_by_column_values(\n by,\n ascending=ascending,\n kind=kind,\n na_position=na_position,\n ignore_index=ignore_index,\n key=key,\n )\n else:\n result = self._query_compiler.sort_columns_by_row_values(\n by,\n ascending=ascending,\n kind=kind,\n na_position=na_position,\n ignore_index=ignore_index,\n key=key,\n )\n return self._create_or_update_from_compiler(result, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.std_BasePandasDataset.to_clipboard.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.std_BasePandasDataset.to_clipboard.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2802, "end_line": 2873, "span_ids": ["BasePandasDataset.tail", "BasePandasDataset:23", "BasePandasDataset.swapaxes", "BasePandasDataset.swaplevel", "BasePandasDataset.std", "BasePandasDataset.to_clipboard", "BasePandasDataset.take", "BasePandasDataset.sub"], "tokens": 637}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def std(\n self,\n axis: Optional[Axis] = None,\n skipna: bool = True,\n ddof: int = 1,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return sample standard deviation over requested axis.\n \"\"\"\n return self._stat_operation(\n \"std\", axis, skipna, numeric_only, ddof=ddof, **kwargs\n )\n\n def sub(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get subtraction of `BasePandasDataset` and `other`, element-wise (binary operator `sub`).\n \"\"\"\n return self._binary_op(\n \"sub\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n subtract = sub\n\n def swapaxes(self, axis1, axis2, copy=None): # noqa: PR01, RT01, D200\n \"\"\"\n Interchange axes and swap values axes appropriately.\n \"\"\"\n if copy is None:\n copy = True\n axis1 = self._get_axis_number(axis1)\n axis2 = self._get_axis_number(axis2)\n if axis1 != axis2:\n return self.transpose()\n if copy:\n return self.copy()\n return self\n\n def swaplevel(self, i=-2, j=-1, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Swap levels `i` and `j` in a `MultiIndex`.\n \"\"\"\n axis = self._get_axis_number(axis)\n idx = self.index if axis == 0 else self.columns\n return self.set_axis(idx.swaplevel(i, j), axis=axis)\n\n def tail(self, n=5): # noqa: PR01, RT01, D200\n \"\"\"\n Return the last `n` rows.\n \"\"\"\n if n != 0:\n return self.iloc[-n:]\n return self.iloc[len(self.index) :]\n\n def take(self, indices, axis=0, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return the elements in the given *positional* indices along an axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n slice_obj = indices if axis == 0 else (slice(None), indices)\n return self.iloc[slice_obj]\n\n def to_clipboard(\n self, excel=True, sep=None, **kwargs\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Copy object to the system clipboard.\n \"\"\"\n return self._default_to_pandas(\"to_clipboard\", excel=excel, sep=sep, **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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_csv_BasePandasDataset.to_csv.return.FactoryDispatcher_to_csv_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_csv_BasePandasDataset.to_csv.return.FactoryDispatcher_to_csv_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2875, "end_line": 2926, "span_ids": ["BasePandasDataset.to_csv"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_csv(\n self,\n path_or_buf=None,\n sep=\",\",\n na_rep=\"\",\n float_format=None,\n columns=None,\n header=True,\n index=True,\n index_label=None,\n mode=\"w\",\n encoding=None,\n compression=\"infer\",\n quoting=None,\n quotechar='\"',\n lineterminator=None,\n chunksize=None,\n date_format=None,\n doublequote=True,\n escapechar=None,\n decimal=\".\",\n errors: str = \"strict\",\n storage_options: StorageOptions = None,\n ): # pragma: no cover\n from modin.core.execution.dispatching.factories.dispatcher import (\n FactoryDispatcher,\n )\n\n return FactoryDispatcher.to_csv(\n self._query_compiler,\n path_or_buf=path_or_buf,\n sep=sep,\n na_rep=na_rep,\n float_format=float_format,\n columns=columns,\n header=header,\n index=index,\n index_label=index_label,\n mode=mode,\n encoding=encoding,\n compression=compression,\n quoting=quoting,\n quotechar=quotechar,\n lineterminator=lineterminator,\n chunksize=chunksize,\n date_format=date_format,\n doublequote=doublequote,\n escapechar=escapechar,\n decimal=decimal,\n errors=errors,\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_excel_BasePandasDataset.to_excel.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_excel_BasePandasDataset.to_excel.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2928, "end_line": 2966, "span_ids": ["BasePandasDataset.to_excel"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_excel(\n self,\n excel_writer,\n sheet_name=\"Sheet1\",\n na_rep=\"\",\n float_format=None,\n columns=None,\n header=True,\n index=True,\n index_label=None,\n startrow=0,\n startcol=0,\n engine=None,\n merge_cells=True,\n inf_rep=\"inf\",\n freeze_panes=None,\n storage_options: StorageOptions = None,\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Write object to an Excel sheet.\n \"\"\"\n return self._default_to_pandas(\n \"to_excel\",\n excel_writer,\n sheet_name=sheet_name,\n na_rep=na_rep,\n float_format=float_format,\n columns=columns,\n header=header,\n index=index,\n index_label=index_label,\n startrow=startrow,\n startcol=startcol,\n engine=engine,\n merge_cells=merge_cells,\n inf_rep=inf_rep,\n freeze_panes=freeze_panes,\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_dict_BasePandasDataset.to_hdf.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_dict_BasePandasDataset.to_hdf.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2968, "end_line": 2979, "span_ids": ["BasePandasDataset.to_hdf", "BasePandasDataset.to_dict"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_dict(self, orient=\"dict\", into=dict, index=True):\n return self._query_compiler.dataframe_to_dict(orient, into, index)\n\n def to_hdf(\n self, path_or_buf, key, format=\"table\", **kwargs\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Write the contained data to an HDF5 file using HDFStore.\n \"\"\"\n return self._default_to_pandas(\n \"to_hdf\", path_or_buf, key, format=format, **kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_json_BasePandasDataset.to_json.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_json_BasePandasDataset.to_json.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2981, "end_line": 3015, "span_ids": ["BasePandasDataset.to_json"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_json(\n self,\n path_or_buf=None,\n orient=None,\n date_format=None,\n double_precision=10,\n force_ascii=True,\n date_unit=\"ms\",\n default_handler=None,\n lines=False,\n compression=\"infer\",\n index=True,\n indent=None,\n storage_options: StorageOptions = None,\n mode=\"w\",\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Convert the object to a JSON string.\n \"\"\"\n return self._default_to_pandas(\n \"to_json\",\n path_or_buf,\n orient=orient,\n date_format=date_format,\n double_precision=double_precision,\n force_ascii=force_ascii,\n date_unit=date_unit,\n default_handler=default_handler,\n lines=lines,\n compression=compression,\n index=index,\n indent=indent,\n storage_options=storage_options,\n mode=mode,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_latex_BasePandasDataset.to_latex.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_latex_BasePandasDataset.to_latex.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3017, "end_line": 3067, "span_ids": ["BasePandasDataset.to_latex"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_latex(\n self,\n buf=None,\n columns=None,\n header=True,\n index=True,\n na_rep=\"NaN\",\n formatters=None,\n float_format=None,\n sparsify=None,\n index_names=True,\n bold_rows=False,\n column_format=None,\n longtable=None,\n escape=None,\n encoding=None,\n decimal=\".\",\n multicolumn=None,\n multicolumn_format=None,\n multirow=None,\n caption=None,\n label=None,\n position=None,\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Render object to a LaTeX tabular, longtable, or nested table.\n \"\"\"\n return self._default_to_pandas(\n \"to_latex\",\n buf=buf,\n columns=columns,\n header=header,\n index=index,\n na_rep=na_rep,\n formatters=formatters,\n float_format=float_format,\n sparsify=sparsify,\n index_names=index_names,\n bold_rows=bold_rows,\n column_format=column_format,\n longtable=longtable,\n escape=escape,\n encoding=encoding,\n decimal=decimal,\n multicolumn=multicolumn,\n multicolumn_format=multicolumn_format,\n multirow=multirow,\n caption=caption,\n label=label,\n position=position,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_markdown_BasePandasDataset.to_markdown.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_markdown_BasePandasDataset.to_markdown.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3069, "end_line": 3087, "span_ids": ["BasePandasDataset.to_markdown"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_markdown(\n self,\n buf=None,\n mode: str = \"wt\",\n index: bool = True,\n storage_options: StorageOptions = None,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Print `BasePandasDataset` in Markdown-friendly format.\n \"\"\"\n return self._default_to_pandas(\n \"to_markdown\",\n buf=buf,\n mode=mode,\n index=index,\n storage_options=storage_options,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_pickle_BasePandasDataset.to_pickle.to_pickle_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_pickle_BasePandasDataset.to_pickle.to_pickle_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3089, "end_line": 3107, "span_ids": ["BasePandasDataset.to_pickle"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_pickle(\n self,\n path,\n compression: CompressionOptions = \"infer\",\n protocol: int = pkl.HIGHEST_PROTOCOL,\n storage_options: StorageOptions = None,\n ): # pragma: no cover # noqa: PR01, D200\n \"\"\"\n Pickle (serialize) object to file.\n \"\"\"\n from modin.pandas import to_pickle\n\n to_pickle(\n self,\n path,\n compression=compression,\n protocol=protocol,\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_numpy_BasePandasDataset.to_period.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_numpy_BasePandasDataset.to_period.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3109, "end_line": 3135, "span_ids": ["BasePandasDataset.to_period", "BasePandasDataset.to_numpy"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_numpy(\n self, dtype=None, copy=False, na_value=no_default\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Convert the `BasePandasDataset` to a NumPy array.\n \"\"\"\n from modin.config import ExperimentalNumPyAPI\n\n if ExperimentalNumPyAPI.get():\n from ..numpy.arr import array\n\n return array(self, copy=copy)\n\n return self._query_compiler.to_numpy(\n dtype=dtype,\n copy=copy,\n na_value=na_value,\n )\n\n # TODO(williamma12): When this gets implemented, have the series one call this.\n def to_period(\n self, freq=None, axis=0, copy=None\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Convert `BasePandasDataset` from DatetimeIndex to PeriodIndex.\n \"\"\"\n return self._default_to_pandas(\"to_period\", freq=freq, axis=axis, copy=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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_string_BasePandasDataset.to_string.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_string_BasePandasDataset.to_string.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3137, "end_line": 3182, "span_ids": ["BasePandasDataset.to_string"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_string(\n self,\n buf=None,\n columns=None,\n col_space=None,\n header=True,\n index=True,\n na_rep=\"NaN\",\n formatters=None,\n float_format=None,\n sparsify=None,\n index_names=True,\n justify=None,\n max_rows=None,\n min_rows=None,\n max_cols=None,\n show_dimensions=False,\n decimal=\".\",\n line_width=None,\n max_colwidth=None,\n encoding=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Render a `BasePandasDataset` to a console-friendly tabular output.\n \"\"\"\n return self._default_to_pandas(\n \"to_string\",\n buf=buf,\n columns=columns,\n col_space=col_space,\n header=header,\n index=index,\n na_rep=na_rep,\n formatters=formatters,\n float_format=float_format,\n sparsify=sparsify,\n index_names=index_names,\n justify=justify,\n max_rows=max_rows,\n max_cols=max_cols,\n show_dimensions=show_dimensions,\n decimal=decimal,\n line_width=line_width,\n max_colwidth=max_colwidth,\n encoding=encoding,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_sql_BasePandasDataset.to_sql.FactoryDispatcher_to_sql_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.to_sql_BasePandasDataset.to_sql.FactoryDispatcher_to_sql_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3184, "end_line": 3227, "span_ids": ["BasePandasDataset.to_sql"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def to_sql(\n self,\n name,\n con,\n schema=None,\n if_exists=\"fail\",\n index=True,\n index_label=None,\n chunksize=None,\n dtype=None,\n method=None,\n ): # noqa: PR01, D200\n \"\"\"\n Write records stored in a `BasePandasDataset` to a SQL database.\n \"\"\"\n new_query_compiler = self._query_compiler\n # writing the index to the database by inserting it to the DF\n if index:\n new_query_compiler = new_query_compiler.reset_index()\n if index_label is not None:\n if not is_list_like(index_label):\n index_label = [index_label]\n new_query_compiler.columns = list(index_label) + list(\n new_query_compiler.columns[len(index_label) :]\n )\n # so pandas._to_sql will not write the index to the database as well\n index = False\n\n from modin.core.execution.dispatching.factories.dispatcher import (\n FactoryDispatcher,\n )\n\n FactoryDispatcher.to_sql(\n new_query_compiler,\n name=name,\n con=con,\n schema=schema,\n if_exists=if_exists,\n index=index,\n index_label=index_label,\n chunksize=chunksize,\n dtype=dtype,\n method=method,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.None_4_BasePandasDataset.div.divide.truediv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.None_4_BasePandasDataset.div.divide.truediv", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3229, "end_line": 3256, "span_ids": ["BasePandasDataset.truediv", "BasePandasDataset.to_sql", "BasePandasDataset.to_timestamp", "BasePandasDataset.to_xarray", "BasePandasDataset:25"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n # TODO(williamma12): When this gets implemented, have the series one call this.\n def to_timestamp(\n self, freq=None, how=\"start\", axis=0, copy=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Cast to DatetimeIndex of timestamps, at *beginning* of period.\n \"\"\"\n return self._default_to_pandas(\n \"to_timestamp\", freq=freq, how=how, axis=axis, copy=copy\n )\n\n def to_xarray(self): # noqa: PR01, RT01, D200\n \"\"\"\n Return an xarray object from the `BasePandasDataset`.\n \"\"\"\n return self._default_to_pandas(\"to_xarray\")\n\n def truediv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get floating division of `BasePandasDataset` and `other`, element-wise (binary operator `truediv`).\n \"\"\"\n return self._binary_op(\n \"truediv\", other, axis=axis, level=level, fill_value=fill_value\n )\n\n div = divide = truediv", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.truncate_BasePandasDataset.truncate.return.self_iloc_slice_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.truncate_BasePandasDataset.truncate.return.self_iloc_slice_obj_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3258, "end_line": 3276, "span_ids": ["BasePandasDataset.truncate"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def truncate(\n self, before=None, after=None, axis=None, copy=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Truncate a `BasePandasDataset` before and after some index value.\n \"\"\"\n axis = self._get_axis_number(axis)\n if (\n not self.axes[axis].is_monotonic_increasing\n and not self.axes[axis].is_monotonic_decreasing\n ):\n raise ValueError(\"truncate requires a sorted index\")\n\n if before is not None and after is not None and before > after:\n raise ValueError(f\"Truncate: {after} must be after {before}\")\n\n s = slice(*self.axes[axis].slice_locs(before, after))\n slice_obj = s if axis == 0 else (slice(None), s)\n return self.iloc[slice_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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.transform_BasePandasDataset.tz_convert.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.transform_BasePandasDataset.tz_convert.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3278, "end_line": 3307, "span_ids": ["BasePandasDataset.tz_convert", "BasePandasDataset.transform"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def transform(self, func, axis=0, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Call ``func`` on self producing a `BasePandasDataset` with the same axis shape as self.\n \"\"\"\n kwargs[\"is_transform\"] = True\n self._validate_function(func)\n try:\n result = self.agg(func, axis=axis, *args, **kwargs)\n except TypeError:\n raise\n except Exception as err:\n raise ValueError(\"Transform function failed\") from err\n try:\n assert len(result) == len(self)\n except Exception:\n raise ValueError(\"transforms cannot produce aggregated results\")\n return result\n\n def tz_convert(self, tz, axis=0, level=None, copy=None): # noqa: PR01, RT01, D200\n \"\"\"\n Convert tz-aware axis to target time zone.\n \"\"\"\n if copy is None:\n copy = True\n return self._create_or_update_from_compiler(\n self._query_compiler.tz_convert(\n tz, axis=self._get_axis_number(axis), level=level, copy=copy\n ),\n inplace=(not copy),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.tz_localize_BasePandasDataset.tz_localize.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.tz_localize_BasePandasDataset.tz_localize.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3309, "end_line": 3327, "span_ids": ["BasePandasDataset.tz_localize"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def tz_localize(\n self, tz, axis=0, level=None, copy=None, ambiguous=\"raise\", nonexistent=\"raise\"\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Localize tz-naive index of a `BasePandasDataset` to target time zone.\n \"\"\"\n if copy is None:\n copy = True\n return self._create_or_update_from_compiler(\n self._query_compiler.tz_localize(\n tz,\n axis=self._get_axis_number(axis),\n level=level,\n copy=copy,\n ambiguous=ambiguous,\n nonexistent=nonexistent,\n ),\n inplace=(not copy),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.interpolate_BasePandasDataset.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.interpolate_BasePandasDataset.None_12", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3329, "end_line": 3362, "span_ids": ["BasePandasDataset.interpolate"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def interpolate(\n self,\n method=\"linear\",\n *,\n axis=0,\n limit=None,\n inplace=False,\n limit_direction: Optional[str] = None,\n limit_area=None,\n downcast=None,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n return self._create_or_update_from_compiler(\n self._query_compiler.interpolate(\n method=method,\n axis=axis,\n limit=limit,\n inplace=False,\n limit_direction=limit_direction,\n limit_area=limit_area,\n downcast=downcast,\n **kwargs,\n ),\n inplace=inplace,\n )\n\n # TODO: uncomment the following lines when #3331 issue will be closed\n # @prepend_to_notes(\n # \"\"\"\n # In comparison with pandas, Modin's ``value_counts`` returns Series with ``MultiIndex``\n # only if multiple columns were passed via the `subset` parameter, otherwise, the resulted\n # Series's index will be a regular single dimensional ``Index``.\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.value_counts_BasePandasDataset.value_counts.return.counted_values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.value_counts_BasePandasDataset.value_counts.return.counted_values", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3363, "end_line": 3389, "span_ids": ["BasePandasDataset.value_counts"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n @_inherit_docstrings(\n pandas.DataFrame.value_counts, apilink=\"pandas.DataFrame.value_counts\"\n )\n def value_counts(\n self,\n subset: Sequence[Hashable] | None = None,\n normalize: bool = False,\n sort: bool = True,\n ascending: bool = False,\n dropna: bool = True,\n ):\n if subset is None:\n subset = self._query_compiler.columns\n counted_values = self.groupby(by=subset, dropna=dropna, observed=True).size()\n if sort:\n counted_values.sort_values(ascending=ascending, inplace=True)\n if normalize:\n counted_values = counted_values / counted_values.sum()\n # TODO: uncomment when strict compability mode will be implemented:\n # https://github.com/modin-project/modin/issues/3411\n # if STRICT_COMPABILITY and not isinstance(counted_values.index, MultiIndex):\n # counted_values.index = pandas.MultiIndex.from_arrays(\n # [counted_values.index], names=counted_values.index.names\n # )\n # https://pandas.pydata.org/pandas-docs/version/2.0/whatsnew/v2.0.0.html#value-counts-sets-the-resulting-name-to-count\n counted_values.name = \"proportion\" if normalize else \"count\"\n return counted_values", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.var_BasePandasDataset.__eq__.return.self_eq_other_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.var_BasePandasDataset.__eq__.return.self_eq_other_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3391, "end_line": 3483, "span_ids": ["BasePandasDataset.__array__", "BasePandasDataset.__deepcopy__", "BasePandasDataset.__eq__", "BasePandasDataset.__rand__", "BasePandasDataset.var", "BasePandasDataset.__abs__", "BasePandasDataset.__copy__", "BasePandasDataset.__and__"], "tokens": 551}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def var(\n self,\n axis: Optional[Axis] = None,\n skipna: bool = True,\n ddof: int = 1,\n numeric_only=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return unbiased variance over requested axis.\n \"\"\"\n return self._stat_operation(\n \"var\", axis, skipna, numeric_only, ddof=ddof, **kwargs\n )\n\n def __abs__(self):\n \"\"\"\n Return a `BasePandasDataset` with absolute numeric value of each element.\n\n Returns\n -------\n BasePandasDataset\n Object containing the absolute value of each element.\n \"\"\"\n return self.abs()\n\n @_doc_binary_op(\n operation=\"union\", bin_op=\"and\", right=\"other\", **_doc_binary_op_kwargs\n )\n def __and__(self, other):\n return self._binary_op(\"__and__\", other, axis=0)\n\n @_doc_binary_op(\n operation=\"union\", bin_op=\"rand\", right=\"other\", **_doc_binary_op_kwargs\n )\n def __rand__(self, other):\n return self._binary_op(\"__rand__\", other, axis=0)\n\n def __array__(self, dtype=None):\n \"\"\"\n Return the values as a NumPy array.\n\n Parameters\n ----------\n dtype : str or np.dtype, optional\n The dtype of returned array.\n\n Returns\n -------\n arr : np.ndarray\n NumPy representation of Modin object.\n \"\"\"\n arr = self.to_numpy(dtype)\n return arr\n\n def __copy__(self, deep=True):\n \"\"\"\n Return the copy of the `BasePandasDataset`.\n\n Parameters\n ----------\n deep : bool, default: True\n Whether the copy should be deep or not.\n\n Returns\n -------\n BasePandasDataset\n \"\"\"\n return self.copy(deep=deep)\n\n def __deepcopy__(self, memo=None):\n \"\"\"\n Return the deep copy of the `BasePandasDataset`.\n\n Parameters\n ----------\n memo : Any, optional\n Deprecated parameter.\n\n Returns\n -------\n BasePandasDataset\n \"\"\"\n return self.copy(deep=True)\n\n @_doc_binary_op(\n operation=\"equality comparison\",\n bin_op=\"eq\",\n right=\"other\",\n **_doc_binary_op_kwargs,\n )\n def __eq__(self, other):\n return self.eq(other)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__finalize___BasePandasDataset.__ge__.return.self_ge_right_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__finalize___BasePandasDataset.__ge__.return.self_ge_right_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3485, "end_line": 3513, "span_ids": ["BasePandasDataset.__finalize__", "BasePandasDataset.__ge__"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def __finalize__(self, other, method=None, **kwargs):\n \"\"\"\n Propagate metadata from `other` to `self`.\n\n Parameters\n ----------\n other : BasePandasDataset\n The object from which to get the attributes that we are going\n to propagate.\n method : str, optional\n A passed method name providing context on where `__finalize__`\n was called.\n **kwargs : dict\n Additional keywords arguments to be passed to `__finalize__`.\n\n Returns\n -------\n BasePandasDataset\n \"\"\"\n return self._default_to_pandas(\"__finalize__\", other, method=method, **kwargs)\n\n @_doc_binary_op(\n operation=\"greater than or equal comparison\",\n bin_op=\"ge\",\n right=\"right\",\n **_doc_binary_op_kwargs,\n )\n def __ge__(self, right):\n return self.ge(right)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__getitem___BasePandasDataset.__getitem__.if_indexer_is_not_None_.else_.return.self__getitem_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__getitem___BasePandasDataset.__getitem__.if_indexer_is_not_None_.else_.return.self__getitem_key_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3515, "end_line": 3539, "span_ids": ["BasePandasDataset.__getitem__"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def __getitem__(self, key):\n \"\"\"\n Retrieve dataset according to `key`.\n\n Parameters\n ----------\n key : callable, scalar, slice, str or tuple\n The global row index to retrieve data from.\n\n Returns\n -------\n BasePandasDataset\n Located dataset.\n \"\"\"\n if not self._query_compiler.lazy_execution and len(self) == 0:\n return self._default_to_pandas(\"__getitem__\", key)\n # see if we can slice the rows\n # This lets us reuse code in pandas to error check\n indexer = None\n if isinstance(key, slice):\n indexer = self.index._convert_slice_indexer(key, kind=\"getitem\")\n if indexer is not None:\n return self._getitem_slice(indexer)\n else:\n return self._getitem(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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.xs_BasePandasDataset.xs.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.xs_BasePandasDataset.xs.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3541, "end_line": 3625, "span_ids": ["BasePandasDataset.xs"], "tokens": 650}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n def xs(\n self,\n key,\n axis=0,\n level=None,\n drop_level: bool = True,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return cross-section from the Series/DataFrame.\n \"\"\"\n axis = self._get_axis_number(axis)\n labels = self.columns if axis else self.index\n\n if isinstance(key, list):\n # deprecated in pandas, to be removed in 2.0\n warnings.warn(\n \"Passing lists as key for xs is deprecated and will be removed in a \"\n + \"future version. Pass key as a tuple instead.\",\n FutureWarning,\n )\n\n if level is not None:\n if not isinstance(labels, pandas.MultiIndex):\n raise TypeError(\"Index must be a MultiIndex\")\n loc, new_ax = labels.get_loc_level(key, level=level, drop_level=drop_level)\n\n # create the tuple of the indexer\n _indexer = [slice(None)] * self.ndim\n _indexer[axis] = loc\n indexer = tuple(_indexer)\n\n result = self.iloc[indexer]\n setattr(result, self._pandas_class._get_axis_name(axis), new_ax)\n return result\n\n if axis == 1:\n if drop_level:\n return self[key]\n index = self.columns\n else:\n index = self.index\n\n new_index = None\n if isinstance(index, pandas.MultiIndex):\n loc, new_index = index._get_loc_level(key, level=0)\n if not drop_level:\n if is_integer(loc):\n new_index = index[loc : loc + 1]\n else:\n new_index = index[loc]\n else:\n loc = index.get_loc(key)\n\n if isinstance(loc, np.ndarray):\n if loc.dtype == np.bool_:\n (loc,) = loc.nonzero()\n # Note: pandas uses self._take_with_is_copy here\n return self.take(loc, axis=axis)\n\n if not is_scalar(loc):\n new_index = index[loc]\n\n if is_scalar(loc) and axis == 0:\n # In this case loc should be an integer\n if self.ndim == 1:\n # if we encounter an array-like and we only have 1 dim\n # that means that their are list/ndarrays inside the Series!\n # so just return them (pandas GH 6394)\n return self.iloc[loc]\n\n result = self.iloc[loc]\n elif is_scalar(loc):\n result = self.iloc[:, slice(loc, loc + 1)]\n elif axis == 1:\n result = self.iloc[:, loc]\n else:\n result = self.iloc[loc]\n if new_index is None:\n raise RuntimeError(\n \"`new_index` variable shouldn't be equal to None here, something went wrong.\"\n )\n result.index = new_index\n\n # Note: pandas does result._set_is_copy here\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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__hash___BasePandasDataset._getitem_slice.return.self_iloc_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__hash___BasePandasDataset._getitem_slice.return.self_iloc_key_", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3627, "end_line": 3663, "span_ids": ["BasePandasDataset:28", "BasePandasDataset._setitem_slice", "BasePandasDataset._getitem_slice"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n __hash__ = None\n\n def _setitem_slice(self, key: slice, value):\n \"\"\"\n Set rows specified by `key` slice with `value`.\n\n Parameters\n ----------\n key : location or index-based slice\n Key that points rows to modify.\n value : object\n Value to assing to the rows.\n \"\"\"\n indexer = self.index._convert_slice_indexer(key, kind=\"getitem\")\n self.iloc[indexer] = value\n\n def _getitem_slice(self, key: slice):\n \"\"\"\n Get rows specified by `key` slice.\n\n Parameters\n ----------\n key : location or index-based slice\n Key that points to rows to retrieve.\n\n Returns\n -------\n modin.pandas.BasePandasDataset\n Selected rows.\n \"\"\"\n if is_full_grab_slice(\n key,\n # Avoid triggering shape computation for lazy executions\n sequence_len=(None if self._query_compiler.lazy_execution else len(self)),\n ):\n return self.copy()\n return self.iloc[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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__gt___BasePandasDataset.__invert__.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__gt___BasePandasDataset.__invert__.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3665, "end_line": 3689, "span_ids": ["BasePandasDataset.__invert__", "BasePandasDataset.__gt__"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @_doc_binary_op(\n operation=\"greater than comparison\",\n bin_op=\"gt\",\n right=\"right\",\n **_doc_binary_op_kwargs,\n )\n def __gt__(self, right):\n return self.gt(right)\n\n def __invert__(self):\n \"\"\"\n Apply bitwise inverse to each element of the `BasePandasDataset`.\n\n Returns\n -------\n BasePandasDataset\n New BasePandasDataset containing bitwise inverse to each value.\n \"\"\"\n if not all(is_numeric_dtype(d) for d in self._get_dtypes()):\n raise TypeError(\n \"bad operand type for unary ~: '{}'\".format(\n next(d for d in self._get_dtypes() if not is_numeric_dtype(d))\n )\n )\n return self.__constructor__(query_compiler=self._query_compiler.invert())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__le___BasePandasDataset.__rxor__.return.self__binary_op___rxor__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__le___BasePandasDataset.__rxor__.return.self__binary_op___rxor__", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3691, "end_line": 3824, "span_ids": ["BasePandasDataset.__ne__", "BasePandasDataset.__neg__", "BasePandasDataset.__matmul__", "BasePandasDataset.__le__", "BasePandasDataset.__or__", "BasePandasDataset.__sizeof__", "BasePandasDataset.__str__", "BasePandasDataset.__len__", "BasePandasDataset:30", "BasePandasDataset.__rxor__", "BasePandasDataset.__xor__", "BasePandasDataset.__ror__", "BasePandasDataset.__lt__", "BasePandasDataset.__nonzero__"], "tokens": 762}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @_doc_binary_op(\n operation=\"less than or equal comparison\",\n bin_op=\"le\",\n right=\"right\",\n **_doc_binary_op_kwargs,\n )\n def __le__(self, right):\n return self.le(right)\n\n def __len__(self):\n \"\"\"\n Return length of info axis.\n\n Returns\n -------\n int\n \"\"\"\n return len(self.index)\n\n @_doc_binary_op(\n operation=\"less than comparison\",\n bin_op=\"lt\",\n right=\"right\",\n **_doc_binary_op_kwargs,\n )\n def __lt__(self, right):\n return self.lt(right)\n\n def __matmul__(self, other):\n \"\"\"\n Compute the matrix multiplication between the `BasePandasDataset` and `other`.\n\n Parameters\n ----------\n other : BasePandasDataset or array-like\n The other object to compute the matrix product with.\n\n Returns\n -------\n BasePandasDataset, np.ndarray or scalar\n \"\"\"\n return self.dot(other)\n\n @_doc_binary_op(\n operation=\"not equal comparison\",\n bin_op=\"ne\",\n right=\"other\",\n **_doc_binary_op_kwargs,\n )\n def __ne__(self, other):\n return self.ne(other)\n\n def __neg__(self):\n \"\"\"\n Change the sign for every value of self.\n\n Returns\n -------\n BasePandasDataset\n \"\"\"\n self._validate_dtypes(numeric_only=True)\n return self.__constructor__(query_compiler=self._query_compiler.negative())\n\n def __nonzero__(self):\n \"\"\"\n Evaluate `BasePandasDataset` as boolean object.\n\n Raises\n ------\n ValueError\n Always since truth value for self is ambiguous.\n \"\"\"\n raise ValueError(\n f\"The truth value of a {self.__class__.__name__} is ambiguous. \"\n + \"Use a.empty, a.bool(), a.item(), a.any() or a.all().\"\n )\n\n __bool__ = __nonzero__\n\n @_doc_binary_op(\n operation=\"disjunction\",\n bin_op=\"or\",\n right=\"other\",\n **_doc_binary_op_kwargs,\n )\n def __or__(self, other):\n return self._binary_op(\"__or__\", other, axis=0)\n\n @_doc_binary_op(\n operation=\"disjunction\",\n bin_op=\"ror\",\n right=\"other\",\n **_doc_binary_op_kwargs,\n )\n def __ror__(self, other):\n return self._binary_op(\"__ror__\", other, axis=0)\n\n def __sizeof__(self):\n \"\"\"\n Generate the total memory usage for an `BasePandasDataset`.\n\n Returns\n -------\n int\n \"\"\"\n return self._query_compiler.sizeof()\n\n def __str__(self): # pragma: no cover\n \"\"\"\n Return str(self).\n\n Returns\n -------\n str\n \"\"\"\n return repr(self)\n\n @_doc_binary_op(\n operation=\"exclusive disjunction\",\n bin_op=\"xor\",\n right=\"other\",\n **_doc_binary_op_kwargs,\n )\n def __xor__(self, other):\n return self._binary_op(\"__xor__\", other, axis=0)\n\n @_doc_binary_op(\n operation=\"exclusive disjunction\",\n bin_op=\"rxor\",\n right=\"other\",\n **_doc_binary_op_kwargs,\n )\n def __rxor__(self, other):\n return self._binary_op(\"__rxor__\", other, axis=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_modin-project__modin/modin/pandas/base.py_BasePandasDataset.size_BasePandasDataset._repartition.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.size_BasePandasDataset._repartition.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3826, "end_line": 3865, "span_ids": ["BasePandasDataset.size", "BasePandasDataset._repartition", "BasePandasDataset.values"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @property\n def size(self): # noqa: RT01, D200\n \"\"\"\n Return an int representing the number of elements in this `BasePandasDataset` object.\n \"\"\"\n return len(self._query_compiler.index) * len(self._query_compiler.columns)\n\n @property\n def values(self): # noqa: RT01, D200\n \"\"\"\n Return a NumPy representation of the `BasePandasDataset`.\n \"\"\"\n return self.to_numpy()\n\n def _repartition(self, axis: Optional[int] = None):\n \"\"\"\n Repartitioning Modin objects to get ideal partitions inside.\n\n Allows to improve performance where the query compiler can't improve\n yet by doing implicit repartitioning.\n\n Parameters\n ----------\n axis : {0, 1, None}, optional\n The axis along which the repartitioning occurs.\n `None` is used for repartitioning along both axes.\n\n Returns\n -------\n DataFrame or Series\n The repartitioned dataframe or series, depending on the original type.\n \"\"\"\n allowed_axis_values = (0, 1, None)\n if axis not in allowed_axis_values:\n raise ValueError(\n f\"Passed `axis` parameter: {axis}, but should be one of {allowed_axis_values}\"\n )\n return self.__constructor__(\n query_compiler=self._query_compiler.repartition(axis=axis)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__getattribute___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/base.py_BasePandasDataset.__getattribute___", "embedding": null, "metadata": {"file_path": "modin/pandas/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3867, "end_line": 3899, "span_ids": ["BasePandasDataset.__getattribute__", "impl:9"], "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": "@_inherit_docstrings(pandas.DataFrame, apilink=[\"pandas.DataFrame\", \"pandas.Series\"])\nclass BasePandasDataset(ClassLogger):\n\n @disable_logging\n def __getattribute__(self, item):\n \"\"\"\n Return item from the `BasePandasDataset`.\n\n Parameters\n ----------\n item : hashable\n Item to get.\n\n Returns\n -------\n Any\n \"\"\"\n attr = super().__getattribute__(item)\n if item not in _DEFAULT_BEHAVIOUR and not self._query_compiler.lazy_execution:\n # We default to pandas on empty DataFrames. This avoids a large amount of\n # pain in underlying implementation and returns a result immediately rather\n # than dealing with the edge cases that empty DataFrames have.\n if callable(attr) and self.empty and hasattr(self._pandas_class, item):\n\n def default_handler(*args, **kwargs):\n return self._default_to_pandas(item, *args, **kwargs)\n\n return default_handler\n return attr\n\n\nif IsExperimental.get():\n from modin.experimental.cloud.meta_magic import make_wrapped_class\n\n make_wrapped_class(BasePandasDataset, \"make_base_dataset_wrapper\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_from___future___import_an_CachedAccessor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_from___future___import_an_CachedAccessor", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 66, "span_ids": ["docstring"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations\nimport pandas\nfrom pandas.core.common import apply_if_callable, get_cython_func\nfrom pandas.core.dtypes.common import (\n infer_dtype_from_object,\n is_dict_like,\n is_list_like,\n is_numeric_dtype,\n)\nfrom pandas.core.indexes.frozen import FrozenList\nfrom pandas.util._validators import validate_bool_kwarg\nfrom pandas.io.formats.info import DataFrameInfo\nfrom pandas._libs.lib import no_default, NoDefault\nfrom pandas._typing import (\n CompressionOptions,\n WriteBuffer,\n FilePath,\n StorageOptions,\n)\n\nimport datetime\nimport re\nimport itertools\nimport functools\nimport numpy as np\nimport sys\nfrom typing import IO, Optional, Union, Iterator, Hashable, Sequence\nimport warnings\n\nfrom modin.pandas import Categorical\nfrom modin.error_message import ErrorMessage\nfrom modin.utils import (\n _inherit_docstrings,\n to_pandas,\n hashable,\n MODIN_UNNAMED_SERIES_LABEL,\n try_cast_to_pandas,\n)\nfrom modin.config import IsExperimental, PersistentPickle\nfrom .utils import (\n from_pandas,\n from_non_pandas,\n broadcast_item,\n cast_function_modin2pandas,\n SET_DATAFRAME_ATTRIBUTE_WARNING,\n)\nfrom .iterator import PartitionIterator\nfrom .series import Series\nfrom .base import BasePandasDataset, _ATTRS_NO_LOOKUP\nfrom .groupby import DataFrameGroupBy\nfrom .accessor import CachedAccessor, SparseFrameAccessor", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame_DataFrame._pandas_class.pandas_DataFrame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame_DataFrame._pandas_class.pandas_DataFrame", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 115, "span_ids": ["DataFrame"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n \"\"\"\n Modin distributed representation of ``pandas.DataFrame``.\n\n Internally, the data can be divided into partitions along both columns and rows\n in order to parallelize computations and utilize the user's hardware as much as possible.\n\n Inherit common for ``DataFrame``-s and ``Series`` functionality from the\n `BasePandasDataset` class.\n\n Parameters\n ----------\n data : DataFrame, Series, pandas.DataFrame, ndarray, Iterable or dict, optional\n Dict can contain ``Series``, arrays, constants, dataclass or list-like objects.\n If data is a dict, column order follows insertion-order.\n index : Index or array-like, optional\n Index to use for resulting frame. Will default to ``RangeIndex`` if no\n indexing information part of input data and no index provided.\n columns : Index or array-like, optional\n Column labels to use for resulting frame. Will default to\n ``RangeIndex`` if no column labels are provided.\n dtype : str, np.dtype, or pandas.ExtensionDtype, optional\n Data type to force. Only a single dtype is allowed. If None, infer.\n copy : bool, default: False\n Copy data from inputs. Only affects ``pandas.DataFrame`` / 2d ndarray input.\n query_compiler : BaseQueryCompiler, optional\n A query compiler object to create the ``DataFrame`` from.\n\n Notes\n -----\n ``DataFrame`` can be created either from passed `data` or `query_compiler`. If both\n parameters are provided, data source will be prioritized in the next order:\n\n 1) Modin ``DataFrame`` or ``Series`` passed with `data` parameter.\n 2) Query compiler from the `query_compiler` parameter.\n 3) Various pandas/NumPy/Python data structures passed with `data` parameter.\n\n The last option is less desirable since import of such data structures is very\n inefficient, please use previously created Modin structures from the fist two\n options or import data using highly efficient Modin IO tools (for example\n ``pd.read_csv``).\n \"\"\"\n\n _pandas_class = pandas.DataFrame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__init___DataFrame.__init__.if_isinstance_data_Data.else_.self._query_compiler.query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__init___DataFrame.__init__.if_isinstance_data_Data.else_.self._query_compiler.query_compiler", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 235, "span_ids": ["DataFrame.__init__"], "tokens": 1048}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __init__(\n self,\n data=None,\n index=None,\n columns=None,\n dtype=None,\n copy=None,\n query_compiler=None,\n ):\n from modin.numpy import array\n\n # Siblings are other dataframes that share the same query compiler. We\n # use this list to update inplace when there is a shallow copy.\n self._siblings = []\n if isinstance(data, (DataFrame, Series)):\n self._query_compiler = data._query_compiler.copy()\n if index is not None and any(i not in data.index for i in index):\n raise NotImplementedError(\n \"Passing non-existant columns or index values to constructor not\"\n + \" yet implemented.\"\n )\n if isinstance(data, Series):\n # We set the column name if it is not in the provided Series\n if data.name is None:\n self.columns = [0] if columns is None else columns\n # If the columns provided are not in the named Series, pandas clears\n # the DataFrame and sets columns to the columns provided.\n elif columns is not None and data.name not in columns:\n self._query_compiler = from_pandas(\n pandas.DataFrame(columns=columns)\n )._query_compiler\n if index is not None:\n self._query_compiler = data.loc[index]._query_compiler\n elif columns is None and index is None:\n data._add_sibling(self)\n else:\n if columns is not None and any(i not in data.columns for i in columns):\n raise NotImplementedError(\n \"Passing non-existant columns or index values to constructor not\"\n + \" yet implemented.\"\n )\n if index is None:\n index = slice(None)\n if columns is None:\n columns = slice(None)\n self._query_compiler = data.loc[index, columns]._query_compiler\n elif isinstance(data, array):\n self._query_compiler = data._query_compiler.copy()\n if copy is not None and not copy:\n data._add_sibling(self)\n if columns is not None and not isinstance(columns, pandas.Index):\n columns = pandas.Index(columns)\n if columns is not None:\n obj_with_new_columns = self.set_axis(columns, axis=1, copy=False)\n self._update_inplace(obj_with_new_columns._query_compiler)\n if index is not None:\n obj_with_new_index = self.set_axis(index, axis=0, copy=False)\n self._update_inplace(obj_with_new_index._query_compiler)\n if dtype is not None:\n casted_obj = self.astype(dtype, copy=False)\n self._query_compiler = casted_obj._query_compiler\n # Check type of data and use appropriate constructor\n elif query_compiler is None:\n distributed_frame = from_non_pandas(data, index, columns, dtype)\n if distributed_frame is not None:\n self._query_compiler = distributed_frame._query_compiler\n return\n\n warnings.warn(\n \"Distributing {} object. This may take some time.\".format(type(data))\n )\n if isinstance(data, pandas.Index):\n pass\n elif (\n is_list_like(data)\n and not is_dict_like(data)\n and not isinstance(data, np.ndarray)\n ):\n old_dtype = getattr(data, \"dtype\", None)\n values = [\n obj._to_pandas() if isinstance(obj, Series) else obj for obj in data\n ]\n try:\n data = type(data)(values, dtype=old_dtype)\n except TypeError:\n data = values\n elif is_dict_like(data) and not isinstance(\n data, (pandas.Series, Series, pandas.DataFrame, DataFrame)\n ):\n if columns is not None:\n data = {key: value for key, value in data.items() if key in columns}\n\n if len(data) and all(isinstance(v, Series) for v in data.values()):\n from .general import concat\n\n new_qc = concat(\n data.values(), axis=1, keys=data.keys()\n )._query_compiler\n\n if dtype is not None:\n new_qc = new_qc.astype({col: dtype for col in new_qc.columns})\n if index is not None:\n new_qc = new_qc.reindex(axis=0, labels=index)\n if columns is not None:\n new_qc = new_qc.reindex(axis=1, labels=columns)\n\n self._query_compiler = new_qc\n return\n\n data = {\n k: v._to_pandas() if isinstance(v, Series) else v\n for k, v in data.items()\n }\n pandas_df = pandas.DataFrame(\n data=data, index=index, columns=columns, dtype=dtype, copy=copy\n )\n self._query_compiler = from_pandas(pandas_df)._query_compiler\n else:\n self._query_compiler = query_compiler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__repr___DataFrame.__repr__.if_len_self_index_num_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__repr___DataFrame.__repr__.if_len_self_index_num_.else_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 254, "span_ids": ["DataFrame.__repr__"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __repr__(self):\n \"\"\"\n Return a string representation for a particular ``DataFrame``.\n\n Returns\n -------\n str\n \"\"\"\n num_rows = pandas.get_option(\"display.max_rows\") or len(self.index)\n num_cols = pandas.get_option(\"display.max_columns\") or len(self.columns)\n result = repr(self._build_repr_df(num_rows, num_cols))\n if len(self.index) > num_rows or len(self.columns) > num_cols:\n # The split here is so that we don't repr pandas row lengths.\n return result.rsplit(\"\\n\\n\", 1)[0] + \"\\n\\n[{0} rows x {1} columns]\".format(\n len(self.index), len(self.columns)\n )\n else:\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame._repr_html__DataFrame._repr_html_.if_len_self_index_num_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._repr_html__DataFrame._repr_html_.if_len_self_index_num_.else_.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 278, "span_ids": ["DataFrame._repr_html_"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _repr_html_(self): # pragma: no cover\n \"\"\"\n Return a html representation for a particular ``DataFrame``.\n\n Returns\n -------\n str\n \"\"\"\n num_rows = pandas.get_option(\"display.max_rows\") or 60\n num_cols = pandas.get_option(\"display.max_columns\") or 20\n\n # We use pandas _repr_html_ to get a string of the HTML representation\n # of the dataframe.\n result = self._build_repr_df(num_rows, num_cols)._repr_html_()\n if len(self.index) > num_rows or len(self.columns) > num_cols:\n # We split so that we insert our correct dataframe dimensions.\n return result.split(\"

\")[\n 0\n ] + \"

{0} rows x {1} columns

\\n\".format(\n len(self.index), len(self.columns)\n )\n else:\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame._get_columns_DataFrame.applymap.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._get_columns_DataFrame.applymap.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 383, "span_ids": ["DataFrame.applymap", "DataFrame.add_prefix", "DataFrame:5", "DataFrame.add_suffix", "DataFrame.dtypes", "DataFrame._set_columns", "DataFrame.duplicated", "DataFrame.axes", "DataFrame.shape", "DataFrame.ndim", "DataFrame.drop_duplicates", "DataFrame.empty", "DataFrame._get_columns"], "tokens": 775}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _get_columns(self):\n \"\"\"\n Get the columns for this ``DataFrame``.\n\n Returns\n -------\n pandas.Index\n The union of all indexes across the partitions.\n \"\"\"\n return self._query_compiler.columns\n\n def _set_columns(self, new_columns):\n \"\"\"\n Set the columns for this ``DataFrame``.\n\n Parameters\n ----------\n new_columns : list-like, Index\n The new index to set.\n \"\"\"\n self._query_compiler.columns = new_columns\n\n columns = property(_get_columns, _set_columns)\n\n @property\n def ndim(self): # noqa: RT01, D200\n \"\"\"\n Return the number of dimensions of the underlying data, by definition 2.\n \"\"\"\n return 2\n\n def drop_duplicates(\n self, subset=None, *, keep=\"first\", inplace=False, ignore_index=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return ``DataFrame`` with duplicate rows removed.\n \"\"\"\n return super(DataFrame, self).drop_duplicates(\n subset=subset, keep=keep, inplace=inplace, ignore_index=ignore_index\n )\n\n @property\n def dtypes(self): # noqa: RT01, D200\n \"\"\"\n Return the dtypes in the ``DataFrame``.\n \"\"\"\n return self._query_compiler.dtypes\n\n def duplicated(self, subset=None, keep=\"first\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return boolean ``Series`` denoting duplicate rows.\n \"\"\"\n df = self[subset] if subset is not None else self\n new_qc = df._query_compiler.duplicated(keep=keep)\n duplicates = self._reduce_dimension(new_qc)\n return duplicates\n\n @property\n def empty(self): # noqa: RT01, D200\n \"\"\"\n Indicate whether ``DataFrame`` is empty.\n \"\"\"\n return len(self.columns) == 0 or len(self.index) == 0\n\n @property\n def axes(self): # noqa: RT01, D200\n \"\"\"\n Return a list representing the axes of the ``DataFrame``.\n \"\"\"\n return [self.index, self.columns]\n\n @property\n def shape(self): # noqa: RT01, D200\n \"\"\"\n Return a tuple representing the dimensionality of the ``DataFrame``.\n \"\"\"\n return len(self.index), len(self.columns)\n\n def add_prefix(self, prefix, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Prefix labels with string `prefix`.\n \"\"\"\n axis = 1 if axis is None else self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.add_prefix(prefix, axis)\n )\n\n def add_suffix(self, suffix, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Suffix labels with string `suffix`.\n \"\"\"\n axis = 1 if axis is None else self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.add_suffix(suffix, axis)\n )\n\n def applymap(self, func, na_action: Optional[str] = None, **kwargs):\n if not callable(func):\n raise ValueError(\"'{0}' object is not callable\".format(type(func)))\n return self.__constructor__(\n query_compiler=self._query_compiler.applymap(\n func, na_action=na_action, **kwargs\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.apply_DataFrame.apply.return.output_type_query_compile": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.apply_DataFrame.apply.return.output_type_query_compile", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 385, "end_line": 423, "span_ids": ["DataFrame.apply"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def apply(\n self, func, axis=0, raw=False, result_type=None, args=(), **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Apply a function along an axis of the ``DataFrame``.\n \"\"\"\n func = cast_function_modin2pandas(func)\n axis = self._get_axis_number(axis)\n query_compiler = super(DataFrame, self).apply(\n func,\n axis=axis,\n broadcast=None,\n raw=raw,\n reduce=None,\n result_type=result_type,\n convert_dtype=None,\n args=args,\n **kwargs,\n )\n if not isinstance(query_compiler, type(self._query_compiler)):\n # A scalar was returned\n return query_compiler\n\n if result_type == \"reduce\":\n output_type = Series\n elif result_type == \"broadcast\":\n output_type = DataFrame\n # the 'else' branch also handles 'result_type == \"expand\"' since it makes the output type\n # depend on the `func` result (Series for a scalar, DataFrame for list-like)\n else:\n reduced_index = pandas.Index([MODIN_UNNAMED_SERIES_LABEL])\n if query_compiler.get_axis(axis).equals(\n reduced_index\n ) or query_compiler.get_axis(axis ^ 1).equals(reduced_index):\n output_type = Series\n else:\n output_type = DataFrame\n\n return output_type(query_compiler=query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.groupby_DataFrame.groupby.return.DataFrameGroupBy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.groupby_DataFrame.groupby.return.DataFrameGroupBy_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 540, "span_ids": ["DataFrame.groupby"], "tokens": 898}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def groupby(\n self,\n by=None,\n axis=0,\n level=None,\n as_index=True,\n sort=True,\n group_keys=True,\n observed=False,\n dropna: bool = True,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Group ``DataFrame`` using a mapper or by a ``Series`` of columns.\n \"\"\"\n axis = self._get_axis_number(axis)\n idx_name = None\n # Drop here indicates whether or not to drop the data column before doing the\n # groupby. The typical pandas behavior is to drop when the data came from this\n # dataframe. When a string, Series directly from this dataframe, or list of\n # strings is passed in, the data used for the groupby is dropped before the\n # groupby takes place.\n drop = False\n\n return_tuple_when_iterating = False\n if (\n not isinstance(by, (pandas.Series, Series))\n and is_list_like(by)\n and len(by) == 1\n ):\n by = by[0]\n return_tuple_when_iterating = True\n\n if callable(by):\n by = self.index.map(by)\n elif hashable(by) and not isinstance(by, (pandas.Grouper, FrozenList)):\n drop = by in self.columns\n idx_name = by\n if by is not None and by in self._query_compiler.get_index_names(axis):\n # In this case we pass the string value of the name through to the\n # partitions. This is more efficient than broadcasting the values.\n level, by = by, None\n elif level is None:\n by = self.__getitem__(by)._query_compiler\n elif isinstance(by, Series):\n drop = by._parent is self\n idx_name = by.name\n by = by._query_compiler\n elif isinstance(by, pandas.Grouper):\n drop = by.key in self\n elif is_list_like(by):\n # fastpath for multi column groupby\n if axis == 0 and all(\n (\n (hashable(o) and (o in self))\n or isinstance(o, Series)\n or (isinstance(o, pandas.Grouper) and o.key in self)\n or (is_list_like(o) and len(o) == len(self.axes[axis]))\n )\n for o in by\n ):\n has_external = False\n processed_by = []\n\n for current_by in by:\n if isinstance(current_by, pandas.Grouper):\n processed_by.append(current_by)\n has_external = True\n elif hashable(current_by):\n processed_by.append(current_by)\n elif isinstance(current_by, Series):\n if current_by._parent is self:\n processed_by.append(current_by.name)\n else:\n processed_by.append(current_by._query_compiler)\n has_external = True\n else:\n has_external = True\n processed_by.append(current_by)\n\n by = processed_by\n\n if not has_external:\n by = self[processed_by]._query_compiler\n\n drop = True\n else:\n mismatch = len(by) != len(self.axes[axis])\n if mismatch and all(\n hashable(obj)\n and (\n obj in self or obj in self._query_compiler.get_index_names(axis)\n )\n for obj in by\n ):\n # In the future, we will need to add logic to handle this, but for now\n # we default to pandas in this case.\n pass\n elif mismatch and any(\n hashable(obj) and obj not in self.columns for obj in by\n ):\n names = [o.name if isinstance(o, Series) else o for o in by]\n raise KeyError(next(x for x in names if x not in self))\n return DataFrameGroupBy(\n self,\n by,\n axis,\n level,\n as_index,\n sort,\n group_keys,\n idx_name,\n observed=observed,\n drop=drop,\n dropna=dropna,\n return_tuple_when_iterating=return_tuple_when_iterating,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.keys_DataFrame.assign.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.keys_DataFrame.assign.return.df", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 585, "span_ids": ["DataFrame.assign", "DataFrame.add", "DataFrame.transpose", "DataFrame:7", "DataFrame.keys"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def keys(self): # noqa: RT01, D200\n \"\"\"\n Get columns of the ``DataFrame``.\n \"\"\"\n return self.columns\n\n def transpose(self, copy=False, *args): # noqa: PR01, RT01, D200\n \"\"\"\n Transpose index and columns.\n \"\"\"\n # FIXME: Judging by pandas docs `*args` serves only compatibility purpose\n # and does not affect the result, we shouldn't pass it to the query compiler.\n return self.__constructor__(\n query_compiler=self._query_compiler.transpose(*args)\n )\n\n T = property(transpose)\n\n def add(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get addition of ``DataFrame`` and `other`, element-wise (binary operator `add`).\n \"\"\"\n return self._binary_op(\n \"add\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n def assign(self, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Assign new columns to a ``DataFrame``.\n \"\"\"\n df = self.copy()\n for k, v in kwargs.items():\n if callable(v):\n df[k] = v(df)\n else:\n df[k] = v\n return df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.boxplot_DataFrame.combine.return.super_DataFrame_self_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.boxplot_DataFrame.combine.return.super_DataFrame_self_co", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 587, "end_line": 626, "span_ids": ["DataFrame.boxplot", "DataFrame.combine"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def boxplot(\n self,\n column=None,\n by=None,\n ax=None,\n fontsize=None,\n rot=0,\n grid=True,\n figsize=None,\n layout=None,\n return_type=None,\n backend=None,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Make a box plot from ``DataFrame`` columns.\n \"\"\"\n return to_pandas(self).boxplot(\n column=column,\n by=by,\n ax=ax,\n fontsize=fontsize,\n rot=rot,\n grid=grid,\n figsize=figsize,\n layout=layout,\n return_type=return_type,\n backend=backend,\n **kwargs,\n )\n\n def combine(\n self, other, func, fill_value=None, overwrite=True\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Perform column-wise combine with another ``DataFrame``.\n \"\"\"\n return super(DataFrame, self).combine(\n other, func, fill_value=fill_value, overwrite=overwrite\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.compare_DataFrame.compare.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.compare_DataFrame.compare.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 628, "end_line": 650, "span_ids": ["DataFrame.compare"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def compare(\n self,\n other,\n align_axis=1,\n keep_shape: bool = False,\n keep_equal: bool = False,\n result_names=(\"self\", \"other\"),\n ) -> \"DataFrame\": # noqa: PR01, RT01, D200\n \"\"\"\n Compare to another ``DataFrame`` and show the differences.\n \"\"\"\n if not isinstance(other, DataFrame):\n raise TypeError(f\"Cannot compare DataFrame to {type(other)}\")\n other = self._validate_other(other, 0, compare_index=True)\n return self.__constructor__(\n query_compiler=self._query_compiler.compare(\n other,\n align_axis=align_axis,\n keep_shape=keep_shape,\n keep_equal=keep_equal,\n result_names=result_names,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.corr_DataFrame.corrwith.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.corr_DataFrame.corrwith.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 652, "end_line": 682, "span_ids": ["DataFrame.corr", "DataFrame.corrwith"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def corr(\n self, method=\"pearson\", min_periods=1, numeric_only=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Compute pairwise correlation of columns, excluding NA/null values.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.corr(\n method=method,\n min_periods=min_periods,\n numeric_only=numeric_only,\n )\n )\n\n def corrwith(\n self, other, axis=0, drop=False, method=\"pearson\", numeric_only=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Compute pairwise correlation.\n \"\"\"\n if not isinstance(other, (Series, DataFrame)):\n raise TypeError(f\"unsupported type: {type(other)}\")\n return self.__constructor__(\n query_compiler=self._query_compiler.corrwith(\n other=other._query_compiler,\n axis=axis,\n drop=drop,\n method=method,\n numeric_only=numeric_only,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.cov_DataFrame.cov.return.cov_df___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.cov_DataFrame.cov.return.cov_df___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 684, "end_line": 707, "span_ids": ["DataFrame.cov"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def cov(\n self, min_periods=None, ddof: Optional[int] = 1, numeric_only=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Compute pairwise covariance of columns, excluding NA/null values.\n \"\"\"\n cov_df = self\n if numeric_only:\n cov_df = self.drop(\n columns=[\n i for i in self.dtypes.index if not is_numeric_dtype(self.dtypes[i])\n ]\n )\n\n if min_periods is not None and min_periods > len(cov_df):\n result = np.empty((cov_df.shape[1], cov_df.shape[1]))\n result.fill(np.nan)\n return cov_df.__constructor__(result)\n\n return cov_df.__constructor__(\n query_compiler=cov_df._query_compiler.cov(\n min_periods=min_periods, ddof=ddof\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.dot_DataFrame.dot.return.self__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.dot_DataFrame.dot.return.self__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 709, "end_line": 745, "span_ids": ["DataFrame.dot"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def dot(self, other): # noqa: PR01, RT01, D200\n \"\"\"\n Compute the matrix multiplication between the ``DataFrame`` and `other`.\n \"\"\"\n if isinstance(other, BasePandasDataset):\n common = self.columns.union(other.index)\n if len(common) > len(self.columns) or len(common) > len(other.index):\n raise ValueError(\"Matrices are not aligned\")\n\n qc = other.reindex(index=common)._query_compiler\n if isinstance(other, DataFrame):\n return self.__constructor__(\n query_compiler=self._query_compiler.dot(\n qc, squeeze_self=False, squeeze_other=False\n )\n )\n else:\n return self._reduce_dimension(\n query_compiler=self._query_compiler.dot(\n qc, squeeze_self=False, squeeze_other=True\n )\n )\n\n other = np.asarray(other)\n if self.shape[1] != other.shape[0]:\n raise ValueError(\n \"Dot product shape mismatch, {} vs {}\".format(self.shape, other.shape)\n )\n\n if len(other.shape) > 1:\n return self.__constructor__(\n query_compiler=self._query_compiler.dot(other, squeeze_self=False)\n )\n\n return self._reduce_dimension(\n query_compiler=self._query_compiler.dot(other, squeeze_self=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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.eq_DataFrame.equals.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.eq_DataFrame.equals.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 747, "end_line": 766, "span_ids": ["DataFrame.eq", "DataFrame.equals"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def eq(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Perform equality comparison of ``DataFrame`` and `other` (binary operator `eq`).\n \"\"\"\n return self._binary_op(\n \"eq\", other, axis=axis, level=level, broadcast=isinstance(other, Series)\n )\n\n def equals(self, other): # noqa: PR01, RT01, D200\n \"\"\"\n Test whether two objects contain the same elements.\n \"\"\"\n if isinstance(other, pandas.DataFrame):\n # Copy into a Modin DataFrame to simplify logic below\n other = self.__constructor__(other)\n return (\n self.index.equals(other.index)\n and self.columns.equals(other.columns)\n and self.eq(other).all().all()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._update_var_dicts_in_kwargs_DataFrame._update_var_dicts_in_kwargs.if_global_dict_.kwargs_global_dict_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._update_var_dicts_in_kwargs_DataFrame._update_var_dicts_in_kwargs.if_global_dict_.kwargs_global_dict_g", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 768, "end_line": 803, "span_ids": ["DataFrame._update_var_dicts_in_kwargs"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _update_var_dicts_in_kwargs(self, expr, kwargs):\n \"\"\"\n Copy variables with \"@\" prefix in `local_dict` and `global_dict` keys of kwargs.\n\n Parameters\n ----------\n expr : str\n The expression string to search variables with \"@\" prefix.\n kwargs : dict\n See the documentation for eval() for complete details on the keyword arguments accepted by query().\n \"\"\"\n if \"@\" not in expr:\n return\n frame = sys._getframe()\n try:\n f_locals = frame.f_back.f_back.f_back.f_back.f_locals\n f_globals = frame.f_back.f_back.f_back.f_back.f_globals\n finally:\n del frame\n local_names = set(re.findall(r\"@([\\w]+)\", expr))\n local_dict = {}\n global_dict = {}\n\n for name in local_names:\n for dct_out, dct_in in ((local_dict, f_locals), (global_dict, f_globals)):\n try:\n dct_out[name] = dct_in[name]\n except KeyError:\n pass\n\n if local_dict:\n local_dict.update(kwargs.get(\"local_dict\") or {})\n kwargs[\"local_dict\"] = local_dict\n if global_dict:\n global_dict.update(kwargs.get(\"global_dict\") or {})\n kwargs[\"global_dict\"] = global_dict", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.eval_DataFrame.eval.if_return_type_type_se.else_.return.getattr_sys_modules_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.eval_DataFrame.eval.if_return_type_type_se.else_.return.getattr_sys_modules_self_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 805, "end_line": 825, "span_ids": ["DataFrame.eval"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def eval(self, expr, inplace=False, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Evaluate a string describing operations on ``DataFrame`` columns.\n \"\"\"\n self._validate_eval_query(expr, **kwargs)\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n self._update_var_dicts_in_kwargs(expr, kwargs)\n new_query_compiler = self._query_compiler.eval(expr, **kwargs)\n return_type = type(\n pandas.DataFrame(columns=self.columns)\n .astype(self.dtypes)\n .eval(expr, **kwargs)\n ).__name__\n if return_type == type(self).__name__:\n return self._create_or_update_from_compiler(new_query_compiler, inplace)\n else:\n if inplace:\n raise ValueError(\"Cannot operate inplace if there is no assignment\")\n return getattr(sys.modules[self.__module__], return_type)(\n query_compiler=new_query_compiler\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.fillna_DataFrame.fillna.return.super_DataFrame_self_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.fillna_DataFrame.fillna.return.super_DataFrame_self_fi", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 827, "end_line": 849, "span_ids": ["DataFrame.fillna"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def fillna(\n self,\n value=None,\n *,\n method=None,\n axis=None,\n inplace=False,\n limit=None,\n downcast=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Fill NA/NaN values using the specified method.\n \"\"\"\n return super(DataFrame, self).fillna(\n squeeze_self=False,\n squeeze_value=isinstance(value, Series),\n value=value,\n method=method,\n axis=axis,\n inplace=inplace,\n limit=limit,\n downcast=downcast,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.floordiv_DataFrame.from_dict.return.from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.floordiv_DataFrame.from_dict.return.from_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 851, "end_line": 878, "span_ids": ["DataFrame.from_dict", "DataFrame.floordiv"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def floordiv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get integer division of ``DataFrame`` and `other`, element-wise (binary operator `floordiv`).\n \"\"\"\n return self._binary_op(\n \"floordiv\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n @classmethod\n def from_dict(\n cls, data, orient=\"columns\", dtype=None, columns=None\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Construct ``DataFrame`` from dict of array-like or dicts.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`from_dict`\")\n return from_pandas(\n pandas.DataFrame.from_dict(\n data, orient=orient, dtype=dtype, columns=columns\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.from_records_DataFrame.from_records.return.from_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.from_records_DataFrame.from_records.return.from_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 880, "end_line": 903, "span_ids": ["DataFrame.from_records"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n @classmethod\n def from_records(\n cls,\n data,\n index=None,\n exclude=None,\n columns=None,\n coerce_float=False,\n nrows=None,\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Convert structured or record ndarray to ``DataFrame``.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`from_records`\")\n return from_pandas(\n pandas.DataFrame.from_records(\n data,\n index=index,\n exclude=exclude,\n columns=columns,\n coerce_float=coerce_float,\n nrows=nrows,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.ge_DataFrame.gt.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.ge_DataFrame.gt.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 905, "end_line": 919, "span_ids": ["DataFrame.ge", "DataFrame.gt"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def ge(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get greater than or equal comparison of ``DataFrame`` and `other`, element-wise (binary operator `ge`).\n \"\"\"\n return self._binary_op(\n \"ge\", other, axis=axis, level=level, broadcast=isinstance(other, Series)\n )\n\n def gt(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get greater than comparison of ``DataFrame`` and `other`, element-wise (binary operator `ge`).\n \"\"\"\n return self._binary_op(\n \"gt\", other, axis=axis, level=level, broadcast=isinstance(other, Series)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.hist_DataFrame.hist.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.hist_DataFrame.hist.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 921, "end_line": 957, "span_ids": ["DataFrame.hist"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def hist(\n self,\n column=None,\n by=None,\n grid=True,\n xlabelsize=None,\n xrot=None,\n ylabelsize=None,\n yrot=None,\n ax=None,\n sharex=False,\n sharey=False,\n figsize=None,\n layout=None,\n bins=10,\n **kwds,\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Make a histogram of the ``DataFrame``.\n \"\"\"\n return self._default_to_pandas(\n pandas.DataFrame.hist,\n column=column,\n by=by,\n grid=grid,\n xlabelsize=xlabelsize,\n xrot=xrot,\n ylabelsize=ylabelsize,\n yrot=yrot,\n ax=ax,\n sharex=sharex,\n sharey=sharey,\n figsize=figsize,\n layout=layout,\n bins=bins,\n **kwds,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.info_DataFrame.info.info_render_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.info_DataFrame.info.info_render_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 959, "end_line": 979, "span_ids": ["DataFrame.info"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def info(\n self,\n verbose: Optional[bool] = None,\n buf: Optional[IO[str]] = None,\n max_cols: Optional[int] = None,\n memory_usage: Optional[Union[bool, str]] = None,\n show_counts: Optional[bool] = None,\n ): # noqa: PR01, D200\n \"\"\"\n Print a concise summary of the ``DataFrame``.\n \"\"\"\n info = DataFrameInfo(\n data=self,\n memory_usage=memory_usage,\n )\n info.render(\n buf=buf,\n max_cols=max_cols,\n verbose=verbose,\n show_counts=show_counts,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.insert_DataFrame.insert.self__update_inplace_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.insert_DataFrame.insert.self__update_inplace_new_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 981, "end_line": 1042, "span_ids": ["DataFrame.insert"], "tokens": 545}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def insert(\n self, loc, column, value, allow_duplicates=no_default\n ): # noqa: PR01, D200\n \"\"\"\n Insert column into ``DataFrame`` at specified location.\n \"\"\"\n if (\n isinstance(value, (DataFrame, pandas.DataFrame))\n or isinstance(value, np.ndarray)\n and len(value.shape) > 1\n ):\n if value.shape[1] != 1:\n raise ValueError(\n f\"Expected a 1D array, got an array with shape {value.shape}\"\n )\n value = value.squeeze(axis=1)\n if not self._query_compiler.lazy_execution and len(self.index) == 0:\n if not hasattr(value, \"index\"):\n try:\n value = pandas.Series(value)\n except (TypeError, ValueError, IndexError):\n raise ValueError(\n \"Cannot insert into a DataFrame with no defined index \"\n + \"and a value that cannot be converted to a \"\n + \"Series\"\n )\n new_index = value.index.copy()\n new_columns = self.columns.insert(loc, column)\n new_query_compiler = self.__constructor__(\n value, index=new_index, columns=new_columns\n )._query_compiler\n elif len(self.columns) == 0 and loc == 0:\n new_index = self.index\n new_query_compiler = self.__constructor__(\n data=value,\n columns=[column],\n index=None if len(new_index) == 0 else new_index,\n )._query_compiler\n else:\n if (\n is_list_like(value)\n and not isinstance(value, (pandas.Series, Series))\n and len(value) != len(self.index)\n ):\n raise ValueError(\n \"Length of values ({}) does not match length of index ({})\".format(\n len(value), len(self.index)\n )\n )\n if allow_duplicates is not True and column in self.columns:\n raise ValueError(f\"cannot insert {column}, already exists\")\n if not -len(self.columns) <= loc <= len(self.columns):\n raise IndexError(\n f\"index {loc} is out of bounds for axis 0 with size {len(self.columns)}\"\n )\n elif loc < 0:\n raise ValueError(\"unbounded slice\")\n if isinstance(value, Series):\n value = value._query_compiler\n new_query_compiler = self._query_compiler.insert(loc, column, value)\n\n self._update_inplace(new_query_compiler=new_query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.isin_DataFrame.itertuples.for_v_in_partition_iterat.yield_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.isin_DataFrame.itertuples.for_v_in_partition_iterat.yield_v", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1044, "end_line": 1087, "span_ids": ["DataFrame.items", "DataFrame.isin", "DataFrame.iterrows", "DataFrame.itertuples"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def isin(self, values): # noqa: PR01, RT01, D200\n \"\"\"\n Whether elements in `DataFrame` are contained in `values`.\n \"\"\"\n return super(DataFrame, self).isin(values)\n\n def iterrows(self): # noqa: D200\n \"\"\"\n Iterate over ``DataFrame`` rows as (index, ``Series``) pairs.\n \"\"\"\n\n def iterrow_builder(s):\n \"\"\"Return tuple of the given `s` parameter name and the parameter themself.\"\"\"\n return s.name, s\n\n partition_iterator = PartitionIterator(self, 0, iterrow_builder)\n for v in partition_iterator:\n yield v\n\n def items(self): # noqa: D200\n \"\"\"\n Iterate over (column name, ``Series``) pairs.\n \"\"\"\n\n def items_builder(s):\n \"\"\"Return tuple of the given `s` parameter name and the parameter themself.\"\"\"\n return s.name, s\n\n partition_iterator = PartitionIterator(self, 1, items_builder)\n for v in partition_iterator:\n yield v\n\n def itertuples(self, index=True, name=\"Pandas\"): # noqa: PR01, D200\n \"\"\"\n Iterate over ``DataFrame`` rows as ``namedtuple``-s.\n \"\"\"\n\n def itertuples_builder(s):\n \"\"\"Return the next ``namedtuple``.\"\"\"\n return next(s._to_pandas().to_frame().T.itertuples(index=index, name=name))\n\n partition_iterator = PartitionIterator(self, 0, itertuples_builder)\n for v in partition_iterator:\n yield v", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.join_DataFrame.join.return.new_frame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.join_DataFrame.join.return.new_frame", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1089, "end_line": 1164, "span_ids": ["DataFrame.join"], "tokens": 510}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def join(\n self,\n other,\n on=None,\n how=\"left\",\n lsuffix=\"\",\n rsuffix=\"\",\n sort=False,\n validate=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Join columns of another ``DataFrame``.\n \"\"\"\n if on is not None and not isinstance(other, (Series, DataFrame)):\n raise ValueError(\n \"Joining multiple DataFrames only supported for joining on index\"\n )\n if validate is not None:\n return self._default_to_pandas(\n pandas.DataFrame.join,\n other,\n on=on,\n how=how,\n lsuffix=lsuffix,\n rsuffix=rsuffix,\n sort=sort,\n validate=validate,\n )\n\n if isinstance(other, Series):\n if other.name is None:\n raise ValueError(\"Other Series must have a name\")\n other = self.__constructor__({other.name: other})\n if on is not None:\n return self.__constructor__(\n query_compiler=self._query_compiler.join(\n other._query_compiler,\n on=on,\n how=how,\n lsuffix=lsuffix,\n rsuffix=rsuffix,\n sort=sort,\n validate=validate,\n )\n )\n if isinstance(other, DataFrame):\n # Joining the empty DataFrames with either index or columns is\n # fast. It gives us proper error checking for the edge cases that\n # would otherwise require a lot more logic.\n new_columns = (\n pandas.DataFrame(columns=self.columns)\n .join(\n pandas.DataFrame(columns=other.columns),\n lsuffix=lsuffix,\n rsuffix=rsuffix,\n )\n .columns\n )\n other = [other]\n else:\n new_columns = (\n pandas.DataFrame(columns=self.columns)\n .join(\n [pandas.DataFrame(columns=obj.columns) for obj in other],\n lsuffix=lsuffix,\n rsuffix=rsuffix,\n )\n .columns\n )\n new_frame = self.__constructor__(\n query_compiler=self._query_compiler.concat(\n 1, [obj._query_compiler for obj in other], join=how, sort=sort\n )\n )\n new_frame.columns = new_columns\n return new_frame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.isetitem_DataFrame.lt.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.isetitem_DataFrame.lt.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1166, "end_line": 1187, "span_ids": ["DataFrame.lt", "DataFrame.isetitem", "DataFrame.le"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def isetitem(self, loc, value):\n return self._default_to_pandas(\n pandas.DataFrame.isetitem,\n loc=loc,\n value=value,\n )\n\n def le(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get less than or equal comparison of ``DataFrame`` and `other`, element-wise (binary operator `le`).\n \"\"\"\n return self._binary_op(\n \"le\", other, axis=axis, level=level, broadcast=isinstance(other, Series)\n )\n\n def lt(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get less than comparison of ``DataFrame`` and `other`, element-wise (binary operator `le`).\n \"\"\"\n return self._binary_op(\n \"lt\", other, axis=axis, level=level, broadcast=isinstance(other, Series)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.melt_DataFrame.melt.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.melt_DataFrame.melt.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1189, "end_line": 1219, "span_ids": ["DataFrame.melt"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def melt(\n self,\n id_vars=None,\n value_vars=None,\n var_name=None,\n value_name=\"value\",\n col_level=None,\n ignore_index=True,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Unpivot a ``DataFrame`` from wide to long format, optionally leaving identifiers set.\n \"\"\"\n if id_vars is None:\n id_vars = []\n if not is_list_like(id_vars):\n id_vars = [id_vars]\n if value_vars is None:\n value_vars = self.columns.difference(id_vars)\n if var_name is None:\n columns_name = self._query_compiler.get_index_name(axis=1)\n var_name = columns_name if columns_name is not None else \"variable\"\n return self.__constructor__(\n query_compiler=self._query_compiler.melt(\n id_vars=id_vars,\n value_vars=value_vars,\n var_name=var_name,\n value_name=value_name,\n col_level=col_level,\n ignore_index=ignore_index,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.merge_DataFrame.merge.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.merge_DataFrame.merge.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1221, "end_line": 1273, "span_ids": ["DataFrame.merge"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def merge(\n self,\n right,\n how=\"inner\",\n on=None,\n left_on=None,\n right_on=None,\n left_index=False,\n right_index=False,\n sort=False,\n suffixes=(\"_x\", \"_y\"),\n copy=None,\n indicator=False,\n validate=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Merge ``DataFrame`` or named ``Series`` objects with a database-style join.\n \"\"\"\n if copy is None:\n copy = True\n if isinstance(right, Series):\n if right.name is None:\n raise ValueError(\"Cannot merge a Series without a name\")\n else:\n right = right.to_frame()\n if not isinstance(right, DataFrame):\n raise TypeError(\n f\"Can only merge Series or DataFrame objects, a {type(right)} was passed\"\n )\n\n # If we are joining on the index and we are using\n # default parameters we can map this to a join\n if left_index and right_index and not indicator:\n return self.join(\n right, how=how, lsuffix=suffixes[0], rsuffix=suffixes[1], sort=sort\n )\n\n return self.__constructor__(\n query_compiler=self._query_compiler.merge(\n right._query_compiler,\n how=how,\n on=on,\n left_on=left_on,\n right_on=right_on,\n left_index=left_index,\n right_index=right_index,\n sort=sort,\n suffixes=suffixes,\n copy=copy,\n indicator=indicator,\n validate=validate,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.mod_DataFrame.nsmallest.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.mod_DataFrame.nsmallest.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1275, "end_line": 1346, "span_ids": ["DataFrame.nlargest", "DataFrame.rmul", "DataFrame.ne", "DataFrame.mul", "DataFrame:9", "DataFrame.mod", "DataFrame.nsmallest"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def mod(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get modulo of ``DataFrame`` and `other`, element-wise (binary operator `mod`).\n \"\"\"\n return self._binary_op(\n \"mod\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n def mul(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get multiplication of ``DataFrame`` and `other`, element-wise (binary operator `mul`).\n \"\"\"\n return self._binary_op(\n \"mul\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n multiply = mul\n\n def rmul(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get multiplication of ``DataFrame`` and `other`, element-wise (binary operator `mul`).\n \"\"\"\n return self._binary_op(\n \"rmul\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n def ne(self, other, axis=\"columns\", level=None): # noqa: PR01, RT01, D200\n \"\"\"\n Get not equal comparison of ``DataFrame`` and `other`, element-wise (binary operator `ne`).\n \"\"\"\n return self._binary_op(\n \"ne\", other, axis=axis, level=level, broadcast=isinstance(other, Series)\n )\n\n def nlargest(self, n, columns, keep=\"first\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return the first `n` rows ordered by `columns` in descending order.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.nlargest(n, columns, keep)\n )\n\n def nsmallest(self, n, columns, keep=\"first\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return the first `n` rows ordered by `columns` in ascending order.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.nsmallest(\n n=n, columns=columns, keep=keep\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.unstack_DataFrame.unstack.if_not_is_multiindex_or_.else_.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.unstack_DataFrame.unstack.if_not_is_multiindex_or_.else_.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1348, "end_line": 1363, "span_ids": ["DataFrame.unstack"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def unstack(self, level=-1, fill_value=None): # noqa: PR01, RT01, D200\n \"\"\"\n Pivot a level of the (necessarily hierarchical) index labels.\n \"\"\"\n # This ensures that non-pandas MultiIndex objects are caught.\n is_multiindex = len(self.index.names) > 1\n if not is_multiindex or (\n is_multiindex and is_list_like(level) and len(level) == self.index.nlevels\n ):\n return self._reduce_dimension(\n query_compiler=self._query_compiler.unstack(level, fill_value)\n )\n else:\n return self.__constructor__(\n query_compiler=self._query_compiler.unstack(level, fill_value)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pivot_DataFrame.pivot.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pivot_DataFrame.pivot.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1365, "end_line": 1389, "span_ids": ["DataFrame.pivot"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def pivot(\n self, *, columns, index=NoDefault, values=NoDefault\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return reshaped ``DataFrame`` organized by given index / column values.\n \"\"\"\n if index is NoDefault:\n index = None\n if values is NoDefault:\n values = None\n\n # if values is not specified, it should be the remaining columns not in\n # index or columns\n if values is None:\n values = list(self.columns)\n if index:\n values = [v for v in values if v not in index]\n if columns:\n values = [v for v in values if v not in columns]\n\n return self.__constructor__(\n query_compiler=self._query_compiler.pivot(\n index=index, columns=columns, values=values\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pivot_table_DataFrame.pivot_table.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pivot_table_DataFrame.pivot_table.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1391, "end_line": 1425, "span_ids": ["DataFrame.pivot_table"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def pivot_table(\n self,\n values=None,\n index=None,\n columns=None,\n aggfunc=\"mean\",\n fill_value=None,\n margins=False,\n dropna=True,\n margins_name=\"All\",\n observed=False,\n sort=True,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Create a spreadsheet-style pivot table as a ``DataFrame``.\n \"\"\"\n # Convert callable to a string aggregation name if possible\n if hashable(aggfunc):\n aggfunc = get_cython_func(aggfunc) or aggfunc\n\n result = self.__constructor__(\n query_compiler=self._query_compiler.pivot_table(\n index=index,\n values=values,\n columns=columns,\n aggfunc=aggfunc,\n fill_value=fill_value,\n margins=margins,\n dropna=dropna,\n margins_name=margins_name,\n observed=observed,\n sort=sort,\n )\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.plot_DataFrame.plot.return.self__to_pandas_plot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.plot_DataFrame.plot.return.self__to_pandas_plot", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1423, "end_line": 1460, "span_ids": ["DataFrame.plot"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n @property\n def plot(\n self,\n x=None,\n y=None,\n kind=\"line\",\n ax=None,\n subplots=False,\n sharex=None,\n sharey=False,\n layout=None,\n figsize=None,\n use_index=True,\n title=None,\n grid=None,\n legend=True,\n style=None,\n logx=False,\n logy=False,\n loglog=False,\n xticks=None,\n yticks=None,\n xlim=None,\n ylim=None,\n rot=None,\n fontsize=None,\n colormap=None,\n table=False,\n yerr=None,\n xerr=None,\n secondary_y=False,\n sort_columns=False,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Make plots of ``DataFrame``.\n \"\"\"\n return self._to_pandas().plot", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pow_DataFrame.pow.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.pow_DataFrame.pow.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1462, "end_line": 1479, "span_ids": ["DataFrame.pow"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def pow(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get exponential power of ``DataFrame`` and `other`, element-wise (binary operator `pow`).\n \"\"\"\n if isinstance(other, Series):\n return self._default_to_pandas(\n \"pow\", other, axis=axis, level=level, fill_value=fill_value\n )\n return self._binary_op(\n \"pow\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.prod_DataFrame.prod.return.data__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.prod_DataFrame.prod.return.data__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1481, "end_line": 1525, "span_ids": ["DataFrame.prod"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def prod(\n self,\n axis=None,\n skipna=True,\n numeric_only=False,\n min_count=0,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the product of the values over the requested axis.\n \"\"\"\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n axis = self._get_axis_number(axis)\n\n axis_to_apply = self.columns if axis else self.index\n if (\n skipna is not False\n and numeric_only is False\n and min_count > len(axis_to_apply)\n ):\n new_index = self.columns if not axis else self.index\n return Series(\n [np.nan] * len(new_index), index=new_index, dtype=np.dtype(\"object\")\n )\n\n data = self._validate_dtypes_sum_prod_mean(axis, numeric_only, ignore_axis=True)\n if min_count > 1:\n return data._reduce_dimension(\n data._query_compiler.prod_min_count(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\n )\n )\n return data._reduce_dimension(\n data._query_compiler.prod(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.product_DataFrame.query.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.product_DataFrame.query.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1527, "end_line": 1553, "span_ids": ["DataFrame.quantile", "DataFrame:11", "DataFrame.query"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n product = prod\n\n def quantile(\n self,\n q=0.5,\n axis=0,\n numeric_only=False,\n interpolation=\"linear\",\n method=\"single\",\n ):\n return super(DataFrame, self).quantile(\n q=q,\n axis=axis,\n numeric_only=numeric_only,\n interpolation=interpolation,\n method=method,\n )\n\n def query(self, expr, inplace=False, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Query the columns of a ``DataFrame`` with a boolean expression.\n \"\"\"\n self._update_var_dicts_in_kwargs(expr, kwargs)\n self._validate_eval_query(expr, **kwargs)\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n new_query_compiler = self._query_compiler.query(expr, **kwargs)\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rename_DataFrame.rename.if_not_inplace_.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rename_DataFrame.rename.if_not_inplace_.return.obj", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1555, "end_line": 1602, "span_ids": ["DataFrame.rename"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def rename(\n self,\n mapper=None,\n index=None,\n columns=None,\n axis=None,\n copy=None,\n inplace=False,\n level=None,\n errors=\"ignore\",\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Alter axes labels.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n if mapper is None and index is None and columns is None:\n raise TypeError(\"must pass an index to rename\")\n # We have to do this with the args because of how rename handles kwargs. It\n # doesn't ignore None values passed in, so we have to filter them ourselves.\n args = locals()\n kwargs = {k: v for k, v in args.items() if v is not None and k != \"self\"}\n # inplace should always be true because this is just a copy, and we will use the\n # results after.\n kwargs[\"inplace\"] = False\n if axis is not None:\n axis = self._get_axis_number(axis)\n if index is not None or (mapper is not None and axis == 0):\n new_index = pandas.DataFrame(index=self.index).rename(**kwargs).index\n else:\n new_index = None\n if columns is not None or (mapper is not None and axis == 1):\n new_columns = (\n pandas.DataFrame(columns=self.columns).rename(**kwargs).columns\n )\n else:\n new_columns = None\n\n if inplace:\n obj = self\n else:\n obj = self.copy()\n if new_index is not None:\n obj.index = new_index\n if new_columns is not None:\n obj.columns = new_columns\n\n if not inplace:\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.reindex_DataFrame.reindex.return.super_DataFrame_self_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.reindex_DataFrame.reindex.return.super_DataFrame_self_re", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1604, "end_line": 1632, "span_ids": ["DataFrame.reindex"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def reindex(\n self,\n labels=None,\n *,\n index=None,\n columns=None,\n axis=None,\n method=None,\n copy=None,\n level=None,\n fill_value=np.nan,\n limit=None,\n tolerance=None,\n ): # noqa: PR01, RT01, D200\n axis = self._get_axis_number(axis)\n if axis == 0 and labels is not None:\n index = labels\n elif labels is not None:\n columns = labels\n return super(DataFrame, self).reindex(\n index=index,\n columns=columns,\n method=method,\n copy=copy,\n level=level,\n fill_value=fill_value,\n limit=limit,\n tolerance=tolerance,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.replace_DataFrame.replace.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.replace_DataFrame.replace.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1634, "end_line": 1656, "span_ids": ["DataFrame.replace"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def replace(\n self,\n to_replace=None,\n value=no_default,\n *,\n inplace: bool = False,\n limit=None,\n regex: bool = False,\n method: str | NoDefault = no_default,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Replace values given in `to_replace` with `value`.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n new_query_compiler = self._query_compiler.replace(\n to_replace=to_replace,\n value=value,\n inplace=False,\n limit=limit,\n regex=regex,\n method=method,\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rfloordiv_DataFrame.rfloordiv.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rfloordiv_DataFrame.rfloordiv.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1658, "end_line": 1671, "span_ids": ["DataFrame.rfloordiv"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def rfloordiv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get integer division of ``DataFrame`` and `other`, element-wise (binary operator `rfloordiv`).\n \"\"\"\n return self._binary_op(\n \"rfloordiv\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.radd_DataFrame.rmod.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.radd_DataFrame.rmod.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1673, "end_line": 1701, "span_ids": ["DataFrame.rmod", "DataFrame.radd"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def radd(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get addition of ``DataFrame`` and `other`, element-wise (binary operator `radd`).\n \"\"\"\n return self._binary_op(\n \"radd\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n def rmod(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get modulo of ``DataFrame`` and `other`, element-wise (binary operator `rmod`).\n \"\"\"\n return self._binary_op(\n \"rmod\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rpow_DataFrame.rpow.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rpow_DataFrame.rpow.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1703, "end_line": 1720, "span_ids": ["DataFrame.rpow"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def rpow(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get exponential power of ``DataFrame`` and `other`, element-wise (binary operator `rpow`).\n \"\"\"\n if isinstance(other, Series):\n return self._default_to_pandas(\n \"rpow\", other, axis=axis, level=level, fill_value=fill_value\n )\n return self._binary_op(\n \"rpow\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rsub_DataFrame.rdiv.rtruediv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.rsub_DataFrame.rdiv.rtruediv", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1722, "end_line": 1752, "span_ids": ["DataFrame.rsub", "DataFrame.rtruediv", "DataFrame:13"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def rsub(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get subtraction of ``DataFrame`` and `other`, element-wise (binary operator `rsub`).\n \"\"\"\n return self._binary_op(\n \"rsub\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n def rtruediv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get floating division of ``DataFrame`` and `other`, element-wise (binary operator `rtruediv`).\n \"\"\"\n return self._binary_op(\n \"rtruediv\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n rdiv = rtruediv", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.select_dtypes_DataFrame.select_dtypes.return.self_drop_columns_self_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.select_dtypes_DataFrame.select_dtypes.return.self_drop_columns_self_co", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1754, "end_line": 1791, "span_ids": ["DataFrame.select_dtypes"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def select_dtypes(self, include=None, exclude=None): # noqa: PR01, RT01, D200\n \"\"\"\n Return a subset of the ``DataFrame``'s columns based on the column dtypes.\n \"\"\"\n # Validates arguments for whether both include and exclude are None or\n # if they are disjoint. Also invalidates string dtypes.\n pandas.DataFrame().select_dtypes(include, exclude)\n\n if include and not is_list_like(include):\n include = [include]\n elif include is None:\n include = []\n if exclude and not is_list_like(exclude):\n exclude = [exclude]\n elif exclude is None:\n exclude = []\n\n sel = tuple(map(set, (include, exclude)))\n include, exclude = map(lambda x: set(map(infer_dtype_from_object, x)), sel)\n include_these = pandas.Series(not bool(include), index=self.columns)\n exclude_these = pandas.Series(not bool(exclude), index=self.columns)\n\n def is_dtype_instance_mapper(column, dtype):\n return column, functools.partial(issubclass, dtype.type)\n\n for column, f in itertools.starmap(\n is_dtype_instance_mapper, self.dtypes.items()\n ):\n if include: # checks for the case of empty include or exclude\n include_these[column] = any(map(f, include))\n if exclude:\n exclude_these[column] = not any(map(f, exclude))\n\n dtype_indexer = include_these & exclude_these\n indicate = [\n i for i in range(len(dtype_indexer.values)) if not dtype_indexer.values[i]\n ]\n return self.drop(columns=self.columns[indicate], inplace=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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.set_index_DataFrame.set_index.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.set_index_DataFrame.set_index.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1793, "end_line": 1858, "span_ids": ["DataFrame.set_index"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def set_index(\n self, keys, *, drop=True, append=False, inplace=False, verify_integrity=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Set the ``DataFrame`` index using existing columns.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n if not isinstance(keys, list):\n keys = [keys]\n\n if any(\n isinstance(col, (pandas.Index, Series, np.ndarray, list, Iterator))\n for col in keys\n ):\n if inplace:\n frame = self\n else:\n frame = self.copy()\n if drop:\n keys = [k if is_list_like(k) else frame.pop(k) for k in keys]\n keys = try_cast_to_pandas(keys)\n # These are single-threaded objects, so we might as well let pandas do the\n # calculation so that it matches.\n frame.index = (\n pandas.DataFrame(index=self.index)\n .set_index(keys, append=append, verify_integrity=verify_integrity)\n .index\n )\n if not inplace:\n return frame\n else:\n return\n\n missing = []\n for col in keys:\n # everything else gets tried as a key;\n # see https://github.com/pandas-dev/pandas/issues/24969\n try:\n found = col in self.columns\n except TypeError as err:\n raise TypeError(\n 'The parameter \"keys\" may be a column key, one-dimensional '\n + \"array, or a list containing only valid column keys and \"\n + f\"one-dimensional arrays. Received column of type {type(col)}\"\n ) from err\n else:\n if not found:\n missing.append(col)\n # If the missing column is a \"primitive\", return the errors.\n # Otherwise we let the query compiler figure out what to do with\n # the keys\n if missing and not hasattr(missing[0], \"__dict__\"):\n # The keys are a primitive type\n raise KeyError(f\"None of {missing} are in the columns\")\n\n new_query_compiler = self._query_compiler.set_index_from_columns(\n keys, drop=drop, append=append\n )\n\n if verify_integrity and not new_query_compiler.index.is_unique:\n duplicates = new_query_compiler.index[\n new_query_compiler.index.duplicated()\n ].unique()\n raise ValueError(f\"Index has duplicate keys: {duplicates}\")\n\n return self._create_or_update_from_compiler(new_query_compiler, inplace=inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.sparse_DataFrame.squeeze.if_axis_0_and_len_self.else_.return.self_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.sparse_DataFrame.squeeze.if_axis_0_and_len_self.else_.return.self_copy_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1860, "end_line": 1874, "span_ids": ["DataFrame:15", "DataFrame.squeeze"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n sparse = CachedAccessor(\"sparse\", SparseFrameAccessor)\n\n def squeeze(self, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Squeeze 1 dimensional axis objects into scalars.\n \"\"\"\n axis = self._get_axis_number(axis) if axis is not None else None\n if axis is None and (len(self.columns) == 1 or len(self.index) == 1):\n return Series(query_compiler=self._query_compiler).squeeze()\n if axis == 1 and len(self.columns) == 1:\n return Series(query_compiler=self._query_compiler)\n if axis == 0 and len(self.index) == 1:\n return Series(query_compiler=self.T._query_compiler)\n else:\n return self.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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.stack_DataFrame.subtract.sub": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.stack_DataFrame.subtract.sub", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1876, "end_line": 1908, "span_ids": ["DataFrame:17", "DataFrame.sub", "DataFrame.stack"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def stack(self, level=-1, dropna=True): # noqa: PR01, RT01, D200\n \"\"\"\n Stack the prescribed level(s) from columns to index.\n \"\"\"\n # This ensures that non-pandas MultiIndex objects are caught.\n is_multiindex = len(self.columns.names) > 1\n if not is_multiindex or (\n is_multiindex and is_list_like(level) and len(level) == self.columns.nlevels\n ):\n return self._reduce_dimension(\n query_compiler=self._query_compiler.stack(level, dropna)\n )\n else:\n return self.__constructor__(\n query_compiler=self._query_compiler.stack(level, dropna)\n )\n\n def sub(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get subtraction of ``DataFrame`` and `other`, element-wise (binary operator `sub`).\n \"\"\"\n return self._binary_op(\n \"sub\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )\n\n subtract = 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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.sum_DataFrame.sum.return.data__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.sum_DataFrame.sum.return.data__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1910, "end_line": 1955, "span_ids": ["DataFrame.sum"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def sum(\n self,\n axis=None,\n skipna=True,\n numeric_only=False,\n min_count=0,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n \"\"\"\n Return the sum of the values over the requested axis.\n \"\"\"\n axis = self._get_axis_number(axis)\n axis_to_apply = self.columns if axis else self.index\n if (\n skipna is not False\n and numeric_only is False\n and min_count > len(axis_to_apply)\n ):\n new_index = self.columns if not axis else self.index\n return Series(\n [np.nan] * len(new_index), index=new_index, dtype=np.dtype(\"object\")\n )\n\n data = self._validate_dtypes_sum_prod_mean(\n axis, numeric_only, ignore_axis=False\n )\n if min_count > 1:\n return data._reduce_dimension(\n data._query_compiler.sum_min_count(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\n )\n )\n return data._reduce_dimension(\n data._query_compiler.sum(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_feather_DataFrame.to_orc.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_feather_DataFrame.to_orc.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1957, "end_line": 2000, "span_ids": ["DataFrame.to_orc", "DataFrame.to_feather", "DataFrame.to_gbq"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_feather(self, path, **kwargs): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Write a ``DataFrame`` to the binary Feather format.\n \"\"\"\n return self._default_to_pandas(pandas.DataFrame.to_feather, path, **kwargs)\n\n def to_gbq(\n self,\n destination_table,\n project_id=None,\n chunksize=None,\n reauth=False,\n if_exists=\"fail\",\n auth_local_webserver=True,\n table_schema=None,\n location=None,\n progress_bar=True,\n credentials=None,\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Write a ``DataFrame`` to a Google BigQuery table.\n \"\"\"\n return self._default_to_pandas(\n pandas.DataFrame.to_gbq,\n destination_table,\n project_id=project_id,\n chunksize=chunksize,\n reauth=reauth,\n if_exists=if_exists,\n auth_local_webserver=auth_local_webserver,\n table_schema=table_schema,\n location=location,\n progress_bar=progress_bar,\n credentials=credentials,\n )\n\n def to_orc(self, path=None, *, engine=\"pyarrow\", index=None, engine_kwargs=None):\n return self._default_to_pandas(\n pandas.DataFrame.to_orc,\n path=path,\n engine=engine,\n index=index,\n engine_kwargs=engine_kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_html_DataFrame.to_html.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_html_DataFrame.to_html.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2002, "end_line": 2056, "span_ids": ["DataFrame.to_html"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_html(\n self,\n buf=None,\n columns=None,\n col_space=None,\n header=True,\n index=True,\n na_rep=\"NaN\",\n formatters=None,\n float_format=None,\n sparsify=None,\n index_names=True,\n justify=None,\n max_rows=None,\n max_cols=None,\n show_dimensions=False,\n decimal=\".\",\n bold_rows=True,\n classes=None,\n escape=True,\n notebook=False,\n border=None,\n table_id=None,\n render_links=False,\n encoding=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Render a ``DataFrame`` as an HTML table.\n \"\"\"\n return self._default_to_pandas(\n pandas.DataFrame.to_html,\n buf=buf,\n columns=columns,\n col_space=col_space,\n header=header,\n index=index,\n na_rep=na_rep,\n formatters=formatters,\n float_format=float_format,\n sparsify=sparsify,\n index_names=index_names,\n justify=justify,\n max_rows=max_rows,\n max_cols=max_cols,\n show_dimensions=show_dimensions,\n decimal=decimal,\n bold_rows=bold_rows,\n classes=classes,\n escape=escape,\n notebook=notebook,\n border=border,\n table_id=table_id,\n render_links=render_links,\n encoding=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_parquet_DataFrame.to_parquet.return.FactoryDispatcher_to_parq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_parquet_DataFrame.to_parquet.return.FactoryDispatcher_to_parq", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2058, "end_line": 2081, "span_ids": ["DataFrame.to_parquet"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_parquet(\n self,\n path=None,\n engine=\"auto\",\n compression=\"snappy\",\n index=None,\n partition_cols=None,\n storage_options: StorageOptions = None,\n **kwargs,\n ):\n from modin.core.execution.dispatching.factories.dispatcher import (\n FactoryDispatcher,\n )\n\n return FactoryDispatcher.to_parquet(\n self._query_compiler,\n path=path,\n engine=engine,\n compression=compression,\n index=index,\n partition_cols=partition_cols,\n storage_options=storage_options,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_period_DataFrame.to_records.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_period_DataFrame.to_records.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2083, "end_line": 2102, "span_ids": ["DataFrame.to_records", "DataFrame.to_period"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_period(\n self, freq=None, axis=0, copy=None\n ): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Convert ``DataFrame`` from ``DatetimeIndex`` to ``PeriodIndex``.\n \"\"\"\n return super(DataFrame, self).to_period(freq=freq, axis=axis, copy=copy)\n\n def to_records(\n self, index=True, column_dtypes=None, index_dtypes=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Convert ``DataFrame`` to a NumPy record array.\n \"\"\"\n return self._default_to_pandas(\n pandas.DataFrame.to_records,\n index=index,\n column_dtypes=column_dtypes,\n index_dtypes=index_dtypes,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_stata_DataFrame.to_stata.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_stata_DataFrame.to_stata.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2104, "end_line": 2134, "span_ids": ["DataFrame.to_stata"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_stata(\n self,\n path: FilePath | WriteBuffer[bytes],\n *,\n convert_dates: dict[Hashable, str] | None = None,\n write_index: bool = True,\n byteorder: str | None = None,\n time_stamp: datetime.datetime | None = None,\n data_label: str | None = None,\n variable_labels: dict[Hashable, str] | None = None,\n version: int | None = 114,\n convert_strl: Sequence[Hashable] | None = None,\n compression: CompressionOptions = \"infer\",\n storage_options: StorageOptions = None,\n value_labels: dict[Hashable, dict[float | int, str]] | None = None,\n ):\n return self._default_to_pandas(\n pandas.DataFrame.to_stata,\n path,\n convert_dates=convert_dates,\n write_index=write_index,\n byteorder=byteorder,\n time_stamp=time_stamp,\n data_label=data_label,\n variable_labels=variable_labels,\n version=version,\n convert_strl=convert_strl,\n compression=compression,\n storage_options=storage_options,\n value_labels=value_labels,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_xml_DataFrame.to_xml.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_xml_DataFrame.to_xml.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2136, "end_line": 2175, "span_ids": ["DataFrame.to_xml"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_xml(\n self,\n path_or_buffer=None,\n index=True,\n root_name=\"data\",\n row_name=\"row\",\n na_rep=None,\n attr_cols=None,\n elem_cols=None,\n namespaces=None,\n prefix=None,\n encoding=\"utf-8\",\n xml_declaration=True,\n pretty_print=True,\n parser=\"lxml\",\n stylesheet=None,\n compression=\"infer\",\n storage_options=None,\n ):\n return self.__constructor__(\n query_compiler=self._query_compiler.default_to_pandas(\n pandas.DataFrame.to_xml,\n path_or_buffer=path_or_buffer,\n index=index,\n root_name=root_name,\n row_name=row_name,\n na_rep=na_rep,\n attr_cols=attr_cols,\n elem_cols=elem_cols,\n namespaces=namespaces,\n prefix=prefix,\n encoding=encoding,\n xml_declaration=xml_declaration,\n pretty_print=pretty_print,\n parser=parser,\n stylesheet=stylesheet,\n compression=compression,\n storage_options=storage_options,\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_timestamp_DataFrame.truediv.return.self__binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.to_timestamp_DataFrame.truediv.return.self__binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2177, "end_line": 2200, "span_ids": ["DataFrame.to_timestamp", "DataFrame.truediv"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def to_timestamp(\n self, freq=None, how=\"start\", axis=0, copy=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Cast to DatetimeIndex of timestamps, at *beginning* of period.\n \"\"\"\n return super(DataFrame, self).to_timestamp(\n freq=freq, how=how, axis=axis, copy=copy\n )\n\n def truediv(\n self, other, axis=\"columns\", level=None, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get floating division of ``DataFrame`` and `other`, element-wise (binary operator `truediv`).\n \"\"\"\n return self._binary_op(\n \"truediv\",\n other,\n axis=axis,\n level=level,\n fill_value=fill_value,\n broadcast=isinstance(other, Series),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.div_DataFrame.update.self__update_inplace_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.div_DataFrame.update.self__update_inplace_new_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2202, "end_line": 2219, "span_ids": ["DataFrame.update", "DataFrame:19"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n div = divide = truediv\n\n def update(\n self, other, join=\"left\", overwrite=True, filter_func=None, errors=\"ignore\"\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Modify in place using non-NA values from another ``DataFrame``.\n \"\"\"\n if not isinstance(other, DataFrame):\n other = self.__constructor__(other)\n query_compiler = self._query_compiler.df_update(\n other._query_compiler,\n join=join,\n overwrite=overwrite,\n filter_func=filter_func,\n errors=errors,\n )\n self._update_inplace(new_query_compiler=query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.where_DataFrame.where.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.where_DataFrame.where.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2221, "end_line": 2308, "span_ids": ["DataFrame.where"], "tokens": 769}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def where(\n self,\n cond,\n other=no_default,\n *,\n inplace=False,\n axis=None,\n level=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Replace values where the condition is False.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n if isinstance(other, Series) and axis is None:\n raise ValueError(\"Must specify axis=0 or 1\")\n if level is not None:\n if isinstance(other, DataFrame):\n other = other._query_compiler.to_pandas()\n if isinstance(cond, DataFrame):\n cond = cond._query_compiler.to_pandas()\n new_query_compiler = self._default_to_pandas(\n pandas.DataFrame.where,\n cond,\n other=other,\n inplace=False,\n axis=axis,\n level=level,\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)\n cond = cond(self) if callable(cond) else cond\n\n if not isinstance(cond, DataFrame):\n if not hasattr(cond, \"shape\"):\n cond = np.asanyarray(cond)\n if cond.shape != self.shape:\n raise ValueError(\"Array conditional must be same shape as self\")\n cond = self.__constructor__(cond, index=self.index, columns=self.columns)\n if isinstance(other, DataFrame):\n other = other._query_compiler\n else:\n \"\"\"\n Only infer the axis number when ``other`` will be made into a\n series. When ``other`` is a dataframe, axis=None has a meaning\n distinct from 0 and 1, e.g. at pandas 1.4.3:\n\n import pandas as pd\n df = pd.DataFrame([[1,2], [3, 4]], index=[1, 0])\n cond = pd.DataFrame([[True,False], [False, True]], columns=[1, 0])\n other = pd.DataFrame([[5,6], [7,8]], columns=[1, 0])\n\n print(df.where(cond, other, axis=None))\n 0 1\n 1 1 7\n 0 6 4\n\n print(df.where(cond, other, axis=0))\n\n 0 1\n 1 1 8\n 0 5 4\n\n print(df.where(cond, other, axis=1))\n\n 0 1\n 1 1 5\n 0 8 4\n \"\"\"\n # _get_axis_number interprets no_default as None, but where doesn't\n # accept no_default.\n if axis == no_default:\n raise ValueError(\n \"No axis named NoDefault.no_default for object type DataFrame\"\n )\n axis = self._get_axis_number(axis)\n if isinstance(other, Series):\n other = other.reindex(\n self.index if axis == 0 else self.columns\n )._query_compiler\n if other._shape_hint is None:\n # To make the query compiler recognizable as a Series at lower levels\n other._shape_hint = \"column\"\n elif is_list_like(other):\n index = self.index if axis == 0 else self.columns\n other = pandas.Series(other, index=index)\n query_compiler = self._query_compiler.where(\n cond._query_compiler, other, axis=axis, level=level\n )\n return self._create_or_update_from_compiler(query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._getitem_column_DataFrame._getitem_column.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._getitem_column_DataFrame._getitem_column.return.s", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2310, "end_line": 2332, "span_ids": ["DataFrame._getitem_column"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _getitem_column(self, key):\n \"\"\"\n Get column specified by `key`.\n\n Parameters\n ----------\n key : hashable\n Key that points to column to retrieve.\n\n Returns\n -------\n Series\n Selected column.\n \"\"\"\n if key not in self.keys():\n raise KeyError(\"{}\".format(key))\n s = self.__constructor__(\n query_compiler=self._query_compiler.getitem_column_array([key])\n ).squeeze(axis=1)\n if isinstance(s, Series):\n s._parent = self\n s._parent_axis = 1\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__getattr___DataFrame.__getattr__.try_.except_AttributeError_as_.raise_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__getattr___DataFrame.__getattr__.try_.except_AttributeError_as_.raise_err", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2334, "end_line": 2357, "span_ids": ["DataFrame.__getattr__"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __getattr__(self, key):\n \"\"\"\n Return item identified by `key`.\n\n Parameters\n ----------\n key : hashable\n Key to get.\n\n Returns\n -------\n Any\n\n Notes\n -----\n First try to use `__getattribute__` method. If it fails\n try to get `key` from ``DataFrame`` fields.\n \"\"\"\n try:\n return object.__getattribute__(self, key)\n except AttributeError as err:\n if key not in _ATTRS_NO_LOOKUP and key in self.columns:\n return self[key]\n raise err", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__setattr___DataFrame.__setattr__.object___setattr___self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__setattr___DataFrame.__setattr__.object___setattr___self_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2359, "end_line": 2396, "span_ids": ["DataFrame.__setattr__"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __setattr__(self, key, value):\n \"\"\"\n Set attribute `value` identified by `key`.\n\n Parameters\n ----------\n key : hashable\n Key to set.\n value : Any\n Value to set.\n \"\"\"\n # While we let users assign to a column labeled \"x\" with \"df.x\" , there\n # are some attributes that we should assume are NOT column names and\n # therefore should follow the default Python object assignment\n # behavior. These are:\n # - anything in self.__dict__. This includes any attributes that the\n # user has added to the dataframe with, e.g., `df.c = 3`, and\n # any attribute that Modin has added to the frame, e.g.\n # `_query_compiler` and `_siblings`\n # - `_query_compiler`, which Modin initializes before it appears in\n # __dict__\n # - `_siblings`, which Modin initializes before it appears in __dict__\n # - `_cache`, which pandas.cache_readonly uses to cache properties\n # before it appears in __dict__.\n if key in (\"_query_compiler\", \"_siblings\", \"_cache\") or key in self.__dict__:\n pass\n elif key in self and key not in dir(self):\n self.__setitem__(key, value)\n # Note: return immediately so we don't keep this `key` as dataframe state.\n # `__getattr__` will return the columns not present in `dir(self)`, so we do not need\n # to manually track this state in the `dir`.\n return\n elif is_list_like(value) and key not in [\"index\", \"columns\"]:\n warnings.warn(\n SET_DATAFRAME_ATTRIBUTE_WARNING,\n UserWarning,\n )\n object.__setattr__(self, key, value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__setitem___DataFrame.__setitem__.if_not_self__query_compil.else_.self__update_inplace_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__setitem___DataFrame.__setitem__.if_not_self__query_compil.else_.self__update_inplace_self", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2398, "end_line": 2504, "span_ids": ["DataFrame.__setitem__"], "tokens": 886}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __setitem__(self, key, value):\n \"\"\"\n Set attribute `value` identified by `key`.\n\n Parameters\n ----------\n key : Any\n Key to set.\n value : Any\n Value to set.\n\n Returns\n -------\n None\n \"\"\"\n if isinstance(key, slice):\n return self._setitem_slice(key, value)\n\n if hashable(key) and key not in self.columns:\n if isinstance(value, Series) and len(self.columns) == 0:\n # Note: column information is lost when assigning a query compiler\n prev_index = self.columns\n self._query_compiler = value._query_compiler.copy()\n # Now that the data is appended, we need to update the column name for\n # that column to `key`, otherwise the name could be incorrect.\n self.columns = prev_index.insert(0, key)\n return\n # Do new column assignment after error checks and possible value modifications\n self.insert(loc=len(self.columns), column=key, value=value)\n return\n\n if not hashable(key):\n if isinstance(key, DataFrame) or isinstance(key, np.ndarray):\n if isinstance(key, np.ndarray):\n if key.shape != self.shape:\n raise ValueError(\"Array must be same shape as DataFrame\")\n key = self.__constructor__(key, columns=self.columns)\n return self.mask(key, value, inplace=True)\n\n if isinstance(key, list) and all((x in self.columns for x in key)):\n if is_list_like(value):\n if not (hasattr(value, \"shape\") and hasattr(value, \"ndim\")):\n value = np.array(value)\n if len(key) != value.shape[-1]:\n raise ValueError(\"Columns must be same length as key\")\n item = broadcast_item(\n self,\n slice(None),\n key,\n value,\n need_columns_reindex=False,\n )\n new_qc = self._query_compiler.write_items(\n slice(None), self.columns.get_indexer_for(key), item\n )\n self._update_inplace(new_qc)\n # self.loc[:, key] = value\n return\n elif (\n isinstance(key, list)\n and isinstance(value, type(self))\n # Mixed case is more complicated, it's defaulting to pandas for now\n and all((x not in self.columns for x in key))\n ):\n if len(key) != len(value.columns):\n raise ValueError(\"Columns must be same length as key\")\n\n # Aligning the value's columns with the key\n if not np.array_equal(value.columns, key):\n value = value.set_axis(key, axis=1)\n\n new_qc = self._query_compiler.insert_item(\n axis=1,\n loc=len(self.columns),\n value=value._query_compiler,\n how=\"left\",\n )\n self._update_inplace(new_qc)\n return\n\n def setitem_unhashable_key(df, value):\n df[key] = value\n return df\n\n return self._update_inplace(\n self._default_to_pandas(setitem_unhashable_key, value)._query_compiler\n )\n if is_list_like(value):\n if isinstance(value, (pandas.DataFrame, DataFrame)):\n value = value[value.columns[0]].values\n elif isinstance(value, np.ndarray):\n assert (\n len(value.shape) < 3\n ), \"Shape of new values must be compatible with manager shape\"\n value = value.T.reshape(-1)\n if len(self) > 0:\n value = value[: len(self)]\n if not isinstance(value, (Series, Categorical, np.ndarray)):\n value = list(value)\n\n if not self._query_compiler.lazy_execution and len(self.index) == 0:\n new_self = self.__constructor__({key: value}, columns=self.columns)\n self._update_inplace(new_self._query_compiler)\n else:\n if isinstance(value, Series):\n value = value._query_compiler\n self._update_inplace(self._query_compiler.setitem(0, key, value))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__iter___DataFrame.__rdiv__.rdiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__iter___DataFrame.__rdiv__.rdiv", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2506, "end_line": 2581, "span_ids": ["DataFrame.__delitem__", "DataFrame:22", "DataFrame.__contains__", "DataFrame.__round__", "DataFrame.__iter__"], "tokens": 518}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __iter__(self):\n \"\"\"\n Iterate over info axis.\n\n Returns\n -------\n iterable\n Iterator of the columns names.\n \"\"\"\n return iter(self.columns)\n\n def __contains__(self, key):\n \"\"\"\n Check if `key` in the ``DataFrame.columns``.\n\n Parameters\n ----------\n key : hashable\n Key to check the presence in the columns.\n\n Returns\n -------\n bool\n \"\"\"\n return self.columns.__contains__(key)\n\n def __round__(self, decimals=0):\n \"\"\"\n Round each value in a ``DataFrame`` to the given number of decimals.\n\n Parameters\n ----------\n decimals : int, default: 0\n Number of decimal places to round to.\n\n Returns\n -------\n DataFrame\n \"\"\"\n return self.round(decimals)\n\n def __delitem__(self, key):\n \"\"\"\n Delete item identified by `key` label.\n\n Parameters\n ----------\n key : hashable\n Key to delete.\n \"\"\"\n if key not in self:\n raise KeyError(key)\n self._update_inplace(new_query_compiler=self._query_compiler.delitem(key))\n\n __add__ = add\n __iadd__ = add # pragma: no cover\n __radd__ = radd\n __mul__ = mul\n __imul__ = mul # pragma: no cover\n __rmul__ = rmul\n __pow__ = pow\n __ipow__ = pow # pragma: no cover\n __rpow__ = rpow\n __sub__ = sub\n __isub__ = sub # pragma: no cover\n __rsub__ = rsub\n __floordiv__ = floordiv\n __ifloordiv__ = floordiv # pragma: no cover\n __rfloordiv__ = rfloordiv\n __truediv__ = truediv\n __itruediv__ = truediv # pragma: no cover\n __rtruediv__ = rtruediv\n __mod__ = mod\n __imod__ = mod # pragma: no cover\n __rmod__ = rmod\n __rdiv__ = rdiv", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__dataframe___DataFrame.__dataframe__.return.self__query_compiler_to_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.__dataframe___DataFrame.__dataframe__.return.self__query_compiler_to_d", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2583, "end_line": 2610, "span_ids": ["DataFrame.__dataframe__"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def __dataframe__(self, nan_as_null: bool = False, allow_copy: bool = True):\n \"\"\"\n Get a Modin DataFrame that implements the dataframe exchange protocol.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n nan_as_null : bool, default: False\n A keyword intended for the consumer to tell the producer\n to overwrite null values in the data with ``NaN`` (or ``NaT``).\n This currently has no effect; once support for nullable extension\n dtypes is added, this value should be propagated to columns.\n allow_copy : bool, default: True\n A keyword that defines whether or not the library is allowed\n to make a copy of the data. For example, copying data would be necessary\n if a library supports strided buffers, given that this protocol\n specifies contiguous buffers. Currently, if the flag is set to ``False``\n and a copy is needed, a ``RuntimeError`` will be raised.\n\n Returns\n -------\n ProtocolDataframe\n A dataframe object following the dataframe protocol specification.\n \"\"\"\n return self._query_compiler.to_dataframe(\n nan_as_null=nan_as_null, allow_copy=allow_copy\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.attrs_DataFrame.reindex_like.return.self_reindex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame.attrs_DataFrame.reindex_like.return.self_reindex_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2612, "end_line": 2654, "span_ids": ["DataFrame.attrs", "DataFrame.style", "DataFrame.reindex_like"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n @property\n def attrs(self): # noqa: RT01, D200\n \"\"\"\n Return dictionary of global attributes of this dataset.\n \"\"\"\n\n def attrs(df):\n return df.attrs\n\n return self._default_to_pandas(attrs)\n\n @property\n def style(self): # noqa: RT01, D200\n \"\"\"\n Return a Styler object.\n \"\"\"\n\n def style(df):\n \"\"\"Define __name__ attr because properties do not have it.\"\"\"\n return df.style\n\n return self._default_to_pandas(style)\n\n def reindex_like(\n self: \"DataFrame\",\n other,\n method=None,\n copy: Optional[bool] = None,\n limit=None,\n tolerance=None,\n ) -> \"DataFrame\":\n if copy is None:\n copy = True\n # docs say \"Same as calling .reindex(index=other.index, columns=other.columns,...).\":\n # https://pandas.pydata.org/pandas-docs/version/1.4/reference/api/pandas.DataFrame.reindex_like.html\n return self.reindex(\n index=other.index,\n columns=other.columns,\n method=method,\n copy=copy,\n limit=limit,\n tolerance=tolerance,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._create_or_update_from_compiler_DataFrame._create_or_update_from_compiler.if_not_inplace_.else_.self__update_inplace_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._create_or_update_from_compiler_DataFrame._create_or_update_from_compiler.if_not_inplace_.else_.self__update_inplace_new_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2656, "end_line": 2679, "span_ids": ["DataFrame._create_or_update_from_compiler"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _create_or_update_from_compiler(self, new_query_compiler, inplace=False):\n \"\"\"\n Return or update a ``DataFrame`` with given `new_query_compiler`.\n\n Parameters\n ----------\n new_query_compiler : PandasQueryCompiler\n QueryCompiler to use to manage the data.\n inplace : bool, default: False\n Whether or not to perform update or creation inplace.\n\n Returns\n -------\n DataFrame or None\n None if update was done, ``DataFrame`` otherwise.\n \"\"\"\n assert (\n isinstance(new_query_compiler, type(self._query_compiler))\n or type(new_query_compiler) in self._query_compiler.__class__.__bases__\n ), \"Invalid Query Compiler object: {}\".format(type(new_query_compiler))\n if not inplace:\n return self.__constructor__(query_compiler=new_query_compiler)\n else:\n self._update_inplace(new_query_compiler=new_query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._get_numeric_data_DataFrame._get_numeric_data.return.self_drop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._get_numeric_data_DataFrame._get_numeric_data.return.self_drop_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2681, "end_line": 2703, "span_ids": ["DataFrame._get_numeric_data"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _get_numeric_data(self, axis: int):\n \"\"\"\n Grab only numeric data from ``DataFrame``.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to inspect on having numeric types only.\n\n Returns\n -------\n DataFrame\n ``DataFrame`` with numeric data.\n \"\"\"\n # Pandas ignores `numeric_only` if `axis` is 1, but we do have to drop\n # non-numeric columns if `axis` is 0.\n if axis != 0:\n return self\n return self.drop(\n columns=[\n i for i in self.dtypes.index if not is_numeric_dtype(self.dtypes[i])\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_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_DataFrame._validate_dtypes.for_t_in_self_dtypes_.if_numeric_only_and_not_i.elif_not_numeric_only_and.raise_TypeError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_DataFrame._validate_dtypes.for_t_in_self_dtypes_.if_numeric_only_and_not_i.elif_not_numeric_only_and.raise_TypeError_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2705, "end_line": 2723, "span_ids": ["DataFrame._validate_dtypes"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _validate_dtypes(self, numeric_only=False):\n \"\"\"\n Check that all the dtypes are the same.\n\n Parameters\n ----------\n numeric_only : bool, default: False\n Whether or not to allow only numeric data.\n If True and non-numeric data is found, exception\n will be raised.\n \"\"\"\n dtype = self.dtypes[0]\n for t in self.dtypes:\n if numeric_only and not is_numeric_dtype(t):\n raise TypeError(\"{0} is not a numeric data type\".format(t))\n elif not numeric_only and t != dtype:\n raise TypeError(\n \"Cannot compare type '{0}' with type '{1}'\".format(t, dtype)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_min_max_DataFrame._validate_dtypes_min_max.return.self__get_numeric_data_ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_min_max_DataFrame._validate_dtypes_min_max.return.self__get_numeric_data_ax", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2725, "end_line": 2761, "span_ids": ["DataFrame._validate_dtypes_min_max"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _validate_dtypes_min_max(self, axis, numeric_only):\n \"\"\"\n Validate data dtype for `min` and `max` methods.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to validate over.\n numeric_only : bool\n Whether or not to allow only numeric data.\n If True and non-numeric data is found, exception.\n\n Returns\n -------\n DataFrame\n \"\"\"\n # If our DataFrame has both numeric and non-numeric dtypes then\n # comparisons between these types do not make sense and we must raise a\n # TypeError. The exception to this rule is when there are datetime and\n # timedelta objects, in which case we proceed with the comparison\n # without ignoring any non-numeric types. We must check explicitly if\n # numeric_only is False because if it is None, it will default to True\n # if the operation fails with mixed dtypes.\n if (\n axis\n and numeric_only is False\n and np.unique([is_numeric_dtype(dtype) for dtype in self.dtypes]).size == 2\n ):\n # check if there are columns with dtypes datetime or timedelta\n if all(\n dtype != np.dtype(\"datetime64[ns]\")\n and dtype != np.dtype(\"timedelta64[ns]\")\n for dtype in self.dtypes\n ):\n raise TypeError(\"Cannot compare Numeric and Non-Numeric Types\")\n\n return self._get_numeric_data(axis) if numeric_only else 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_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_sum_prod_mean_DataFrame._validate_dtypes_sum_prod_mean.return.self__get_numeric_data_ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._validate_dtypes_sum_prod_mean_DataFrame._validate_dtypes_sum_prod_mean.return.self__get_numeric_data_ax", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2763, "end_line": 2812, "span_ids": ["DataFrame._validate_dtypes_sum_prod_mean"], "tokens": 472}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _validate_dtypes_sum_prod_mean(self, axis, numeric_only, ignore_axis=False):\n \"\"\"\n Validate data dtype for `sum`, `prod` and `mean` methods.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to validate over.\n numeric_only : bool\n Whether or not to allow only numeric data.\n If True and non-numeric data is found, exception\n will be raised.\n ignore_axis : bool, default: False\n Whether or not to ignore `axis` parameter.\n\n Returns\n -------\n DataFrame\n \"\"\"\n # We cannot add datetime types, so if we are summing a column with\n # dtype datetime64 and cannot ignore non-numeric types, we must throw a\n # TypeError.\n if (\n not axis\n and numeric_only is False\n and any(dtype == np.dtype(\"datetime64[ns]\") for dtype in self.dtypes)\n ):\n raise TypeError(\"Cannot add Timestamp Types\")\n\n # If our DataFrame has both numeric and non-numeric dtypes then\n # operations between these types do not make sense and we must raise a\n # TypeError. The exception to this rule is when there are datetime and\n # timedelta objects, in which case we proceed with the comparison\n # without ignoring any non-numeric types. We must check explicitly if\n # numeric_only is False because if it is None, it will default to True\n # if the operation fails with mixed dtypes.\n if (\n (axis or ignore_axis)\n and numeric_only is False\n and np.unique([is_numeric_dtype(dtype) for dtype in self.dtypes]).size == 2\n ):\n # check if there are columns with dtypes datetime or timedelta\n if all(\n dtype != np.dtype(\"datetime64[ns]\")\n and dtype != np.dtype(\"timedelta64[ns]\")\n for dtype in self.dtypes\n ):\n raise TypeError(\"Cannot operate on Numeric and Non-Numeric Types\")\n\n return self._get_numeric_data(axis) if numeric_only else 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_modin-project__modin/modin/pandas/dataframe.py_DataFrame._to_pandas_DataFrame._validate_eval_query.None_1.if_parser_in_kwargs_and._pragma_no_cover": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._to_pandas_DataFrame._validate_eval_query.None_1.if_parser_in_kwargs_and._pragma_no_cover", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2814, "end_line": 2843, "span_ids": ["DataFrame._to_pandas", "DataFrame._validate_eval_query"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _to_pandas(self):\n \"\"\"\n Convert Modin ``DataFrame`` to pandas ``DataFrame``.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n return self._query_compiler.to_pandas()\n\n def _validate_eval_query(self, expr, **kwargs):\n \"\"\"\n Validate the arguments of ``eval`` and ``query`` functions.\n\n Parameters\n ----------\n expr : str\n The expression to evaluate. This string cannot contain any\n Python statements, only Python expressions.\n **kwargs : dict\n Optional arguments of ``eval`` and ``query`` functions.\n \"\"\"\n if isinstance(expr, str) and expr == \"\":\n raise ValueError(\"expr cannot be an empty string\")\n\n if isinstance(expr, str) and \"not\" in expr:\n if \"parser\" in kwargs and kwargs[\"parser\"] == \"python\":\n ErrorMessage.not_implemented(\n \"'Not' nodes are not implemented.\"\n ) # pragma: no cover", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._reduce_dimension_DataFrame._set_axis_name.if_not_inplace_.return.renamed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._reduce_dimension_DataFrame._set_axis_name.if_not_inplace_.return.renamed", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2845, "end_line": 2885, "span_ids": ["DataFrame._set_axis_name", "DataFrame._reduce_dimension"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _reduce_dimension(self, query_compiler):\n \"\"\"\n Reduce the dimension of data from the `query_compiler`.\n\n Parameters\n ----------\n query_compiler : BaseQueryCompiler\n Query compiler to retrieve the data.\n\n Returns\n -------\n Series\n \"\"\"\n return Series(query_compiler=query_compiler)\n\n def _set_axis_name(self, name, axis=0, inplace=False):\n \"\"\"\n Alter the name or names of the axis.\n\n Parameters\n ----------\n name : str or list of str\n Name for the Index, or list of names for the MultiIndex.\n axis : str or int, default: 0\n The axis to set the label.\n 0 or 'index' for the index, 1 or 'columns' for the columns.\n inplace : bool, default: False\n Whether to modify `self` directly or return a copy.\n\n Returns\n -------\n DataFrame or None\n \"\"\"\n axis = self._get_axis_number(axis)\n renamed = self if inplace else self.copy()\n if axis == 0:\n renamed.index = renamed.index.set_names(name)\n else:\n renamed.columns = renamed.columns.set_names(name)\n if not inplace:\n return renamed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._to_datetime_DataFrame._getitem.if_isinstance_key_Series.else_.return.self__getitem_column_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._to_datetime_DataFrame._getitem.if_isinstance_key_Series.else_.return.self__getitem_column_key_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2887, "end_line": 2941, "span_ids": ["DataFrame._to_datetime", "DataFrame._getitem"], "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": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n def _to_datetime(self, **kwargs):\n \"\"\"\n Convert `self` to datetime.\n\n Parameters\n ----------\n **kwargs : dict\n Optional arguments to use during query compiler's\n `to_datetime` invocation.\n\n Returns\n -------\n Series of datetime64 dtype\n \"\"\"\n return self._reduce_dimension(\n query_compiler=self._query_compiler.to_datetime(**kwargs)\n )\n\n def _getitem(self, key):\n \"\"\"\n Get the data specified by `key` for this ``DataFrame``.\n\n Parameters\n ----------\n key : callable, Series, DataFrame, np.ndarray, pandas.Index or list\n Data identifiers to retrieve.\n\n Returns\n -------\n Series or DataFrame\n Retrieved data.\n \"\"\"\n key = apply_if_callable(key, self)\n # Shortcut if key is an actual column\n is_mi_columns = self._query_compiler.has_multiindex(axis=1)\n try:\n if key in self.columns and not is_mi_columns:\n return self._getitem_column(key)\n except (KeyError, ValueError, TypeError):\n pass\n if isinstance(key, Series):\n return self.__constructor__(\n query_compiler=self._query_compiler.getitem_array(key._query_compiler)\n )\n elif isinstance(key, (np.ndarray, pandas.Index, list)):\n return self.__constructor__(\n query_compiler=self._query_compiler.getitem_array(key)\n )\n elif isinstance(key, DataFrame):\n return self.where(key)\n elif is_mi_columns:\n return self._default_to_pandas(pandas.DataFrame.__getitem__, key)\n # return self._getitem_multilevel(key)\n else:\n return self._getitem_column(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_modin-project__modin/modin/pandas/dataframe.py_DataFrame._Persistance_support_met_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/dataframe.py_DataFrame._Persistance_support_met_", "embedding": null, "metadata": {"file_path": "modin/pandas/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2943, "end_line": 2993, "span_ids": ["impl", "DataFrame.__reduce__", "DataFrame._inflate_full", "DataFrame._inflate_light", "DataFrame._getitem"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.DataFrame, excluded=[pandas.DataFrame.__init__], apilink=\"pandas.DataFrame\"\n)\nclass DataFrame(BasePandasDataset):\n\n # Persistance support methods - BEGIN\n @classmethod\n def _inflate_light(cls, query_compiler):\n \"\"\"\n Re-creates the object from previously-serialized lightweight representation.\n\n The method is used for faster but not disk-storable persistence.\n\n Parameters\n ----------\n query_compiler : BaseQueryCompiler\n Query compiler to use for object re-creation.\n\n Returns\n -------\n DataFrame\n New ``DataFrame`` based on the `query_compiler`.\n \"\"\"\n return cls(query_compiler=query_compiler)\n\n @classmethod\n def _inflate_full(cls, pandas_df):\n \"\"\"\n Re-creates the object from previously-serialized disk-storable representation.\n\n Parameters\n ----------\n pandas_df : pandas.DataFrame\n Data to use for object re-creation.\n\n Returns\n -------\n DataFrame\n New ``DataFrame`` based on the `pandas_df`.\n \"\"\"\n return cls(data=from_pandas(pandas_df))\n\n def __reduce__(self):\n self._query_compiler.finalize()\n if PersistentPickle.get():\n return self._inflate_full, (self._to_pandas(),)\n return self._inflate_light, (self._query_compiler,)\n\n # Persistance support methods - END\n\n\nif IsExperimental.get():\n from modin.experimental.cloud.meta_magic import make_wrapped_class\n\n make_wrapped_class(DataFrame, \"make_dataframe_wrapper\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pandas_notnull.notna": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pandas_notnull.notna", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 61, "span_ids": ["impl:3", "impl", "docstring", "isna", "notna"], "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": "import pandas\nimport numpy as np\n\nfrom typing import Hashable, Iterable, Mapping, Union, Optional\nfrom pandas.core.dtypes.common import is_list_like\nfrom pandas._libs.lib import no_default, NoDefault\nfrom pandas._typing import DtypeBackend\n\nfrom modin.error_message import ErrorMessage\nfrom .base import BasePandasDataset\nfrom .dataframe import DataFrame\nfrom .series import Series\nfrom modin.utils import to_pandas\nfrom modin.core.storage_formats.base.query_compiler import BaseQueryCompiler\nfrom modin.utils import _inherit_docstrings\nfrom modin.logging import enable_logging\n\n\n@_inherit_docstrings(pandas.isna, apilink=\"pandas.isna\")\n@enable_logging\ndef isna(obj): # noqa: PR01, RT01, D200\n \"\"\"\n Detect missing values for an array-like object.\n \"\"\"\n if isinstance(obj, BasePandasDataset):\n return obj.isna()\n else:\n return pandas.isna(obj)\n\n\nisnull = isna\n\n\n@_inherit_docstrings(pandas.notna, apilink=\"pandas.notna\")\n@enable_logging\ndef notna(obj): # noqa: PR01, RT01, D200\n \"\"\"\n Detect non-missing values for an array-like object.\n \"\"\"\n if isinstance(obj, BasePandasDataset):\n return obj.notna()\n else:\n return pandas.notna(obj)\n\n\nnotnull = notna", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_merge.return.left_merge_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_merge.return.left_merge_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 108, "span_ids": ["merge"], "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": "@_inherit_docstrings(pandas.merge, apilink=\"pandas.merge\")\n@enable_logging\ndef merge(\n left,\n right,\n how: str = \"inner\",\n on=None,\n left_on=None,\n right_on=None,\n left_index: bool = False,\n right_index: bool = False,\n sort: bool = False,\n suffixes=(\"_x\", \"_y\"),\n copy: Optional[bool] = None,\n indicator: bool = False,\n validate=None,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Merge DataFrame or named Series objects with a database-style join.\n \"\"\"\n if isinstance(left, Series):\n if left.name is None:\n raise ValueError(\"Cannot merge a Series without a name\")\n else:\n left = left.to_frame()\n\n if not isinstance(left, DataFrame):\n raise TypeError(\n f\"Can only merge Series or DataFrame objects, a {type(left)} was passed\"\n )\n\n return left.merge(\n right,\n how=how,\n on=on,\n left_on=left_on,\n right_on=right_on,\n left_index=left_index,\n right_index=right_index,\n sort=sort,\n suffixes=suffixes,\n copy=copy,\n indicator=indicator,\n validate=validate,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_ordered_merge_ordered.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_ordered_merge_ordered.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 146, "span_ids": ["merge_ordered"], "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": "@_inherit_docstrings(pandas.merge_ordered, apilink=\"pandas.merge_ordered\")\n@enable_logging\ndef merge_ordered(\n left,\n right,\n on=None,\n left_on=None,\n right_on=None,\n left_by=None,\n right_by=None,\n fill_method=None,\n suffixes=(\"_x\", \"_y\"),\n how: str = \"outer\",\n) -> DataFrame: # noqa: PR01, RT01, D200\n \"\"\"\n Perform a merge for ordered data with optional filling/interpolation.\n \"\"\"\n for operand in (left, right):\n if not isinstance(operand, (Series, DataFrame)):\n raise TypeError(\n f\"Can only merge Series or DataFrame objects, a {type(operand)} was passed\"\n )\n\n return DataFrame(\n query_compiler=left._query_compiler.merge_ordered(\n right._query_compiler,\n on=on,\n left_on=left_on,\n right_on=right_on,\n left_by=left_by,\n right_by=right_by,\n fill_method=fill_method,\n suffixes=suffixes,\n how=how,\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_modin-project__modin/modin/pandas/general.py_merge_asof_merge_asof.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_merge_asof_merge_asof.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 216, "span_ids": ["merge_asof"], "tokens": 487}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.merge_asof, apilink=\"pandas.merge_asof\")\n@enable_logging\ndef merge_asof(\n left,\n right,\n on=None,\n left_on=None,\n right_on=None,\n left_index: bool = False,\n right_index: bool = False,\n by=None,\n left_by=None,\n right_by=None,\n suffixes=(\"_x\", \"_y\"),\n tolerance=None,\n allow_exact_matches: bool = True,\n direction: str = \"backward\",\n) -> DataFrame: # noqa: PR01, RT01, D200\n \"\"\"\n Perform a merge by key distance.\n \"\"\"\n if not isinstance(left, DataFrame):\n raise ValueError(\n \"can not merge DataFrame with instance of type {}\".format(type(right))\n )\n ErrorMessage.default_to_pandas(\"`merge_asof`\")\n\n # As of Pandas 1.2 these should raise an error; before that it did\n # something likely random:\n if (\n (on and (left_index or right_index))\n or (left_on and left_index)\n or (right_on and right_index)\n ):\n raise ValueError(\"Can't combine left/right_index with left/right_on or on.\")\n\n if on is not None:\n if left_on is not None or right_on is not None:\n raise ValueError(\"If 'on' is set, 'left_on' and 'right_on' can't be set.\")\n left_on = on\n right_on = on\n\n if by is not None:\n if left_by is not None or right_by is not None:\n raise ValueError(\"Can't have both 'by' and 'left_by' or 'right_by'\")\n left_by = right_by = by\n\n if left_on is None and not left_index:\n raise ValueError(\"Must pass on, left_on, or left_index=True\")\n\n if right_on is None and not right_index:\n raise ValueError(\"Must pass on, right_on, or right_index=True\")\n\n return DataFrame(\n query_compiler=left._query_compiler.merge_asof(\n right._query_compiler,\n left_on,\n right_on,\n left_index,\n right_index,\n left_by,\n right_by,\n suffixes,\n tolerance,\n allow_exact_matches,\n direction,\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_modin-project__modin/modin/pandas/general.py_pivot_table_pivot_table.return.data_pivot_table_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pivot_table_pivot_table.return.data_pivot_table_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 249, "span_ids": ["pivot_table"], "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": "@_inherit_docstrings(pandas.pivot_table, apilink=\"pandas.pivot_table\")\n@enable_logging\ndef pivot_table(\n data,\n values=None,\n index=None,\n columns=None,\n aggfunc=\"mean\",\n fill_value=None,\n margins=False,\n dropna=True,\n margins_name=\"All\",\n observed=False,\n sort=True,\n):\n if not isinstance(data, DataFrame):\n raise ValueError(\n \"can not create pivot table with instance of type {}\".format(type(data))\n )\n\n return data.pivot_table(\n values=values,\n index=index,\n columns=columns,\n aggfunc=aggfunc,\n fill_value=fill_value,\n margins=margins,\n dropna=dropna,\n margins_name=margins_name,\n sort=sort,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pivot_pivot.return.data_pivot_index_index_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_pivot_pivot.return.data_pivot_index_index_c", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 262, "span_ids": ["pivot"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.pivot, apilink=\"pandas.pivot\")\n@enable_logging\ndef pivot(\n data, *, columns, index=NoDefault, values=NoDefault\n): # noqa: PR01, RT01, D200\n \"\"\"\n Return reshaped DataFrame organized by given index / column values.\n \"\"\"\n if not isinstance(data, DataFrame):\n raise ValueError(\"can not pivot with instance of type {}\".format(type(data)))\n return data.pivot(index=index, columns=columns, values=values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_numeric_to_numeric.return.arg__to_numeric_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_numeric_to_numeric.return.arg__to_numeric_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 265, "end_line": 282, "span_ids": ["to_numeric"], "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": "@_inherit_docstrings(pandas.to_numeric, apilink=\"pandas.to_numeric\")\n@enable_logging\ndef to_numeric(\n arg,\n errors=\"raise\",\n downcast=None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Convert argument to a numeric type.\n \"\"\"\n if not isinstance(arg, Series):\n return pandas.to_numeric(\n arg, errors=errors, downcast=downcast, dtype_backend=dtype_backend\n )\n return arg._to_numeric(\n errors=errors, downcast=downcast, dtype_backend=dtype_backend\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_qcut_qcut.return.x__qcut_q_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_qcut_qcut.return.x__qcut_q_kwargs_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 285, "end_line": 301, "span_ids": ["qcut"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.qcut, apilink=\"pandas.qcut\")\n@enable_logging\ndef qcut(\n x, q, labels=None, retbins=False, precision=3, duplicates=\"raise\"\n): # noqa: PR01, RT01, D200\n \"\"\"\n Quantile-based discretization function.\n \"\"\"\n kwargs = {\n \"labels\": labels,\n \"retbins\": retbins,\n \"precision\": precision,\n \"duplicates\": duplicates,\n }\n if not isinstance(x, Series):\n return pandas.qcut(x, q, **kwargs)\n return x._qcut(q, **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_modin-project__modin/modin/pandas/general.py_cut_cut.return._wrap_in_series_object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_cut_cut.return._wrap_in_series_object_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 355, "span_ids": ["cut"], "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": "@_inherit_docstrings(pandas.cut, apilink=\"pandas.cut\")\n@enable_logging\ndef cut(\n x,\n bins,\n right: bool = True,\n labels=None,\n retbins: bool = False,\n precision: int = 3,\n include_lowest: bool = False,\n duplicates: str = \"raise\",\n ordered: bool = True,\n):\n if isinstance(x, DataFrame):\n raise ValueError(\"Input array must be 1 dimensional\")\n if not isinstance(x, Series):\n ErrorMessage.default_to_pandas(\n reason=f\"pd.cut is not supported on objects of type {type(x)}\"\n )\n import pandas\n\n return pandas.cut(\n x,\n bins,\n right=right,\n labels=labels,\n retbins=retbins,\n precision=precision,\n include_lowest=include_lowest,\n duplicates=duplicates,\n ordered=ordered,\n )\n\n def _wrap_in_series_object(qc_result):\n if isinstance(qc_result, type(x._query_compiler)):\n return Series(query_compiler=qc_result)\n if isinstance(qc_result, (tuple, list)):\n return tuple([_wrap_in_series_object(result) for result in qc_result])\n return qc_result\n\n return _wrap_in_series_object(\n x._query_compiler.cut(\n bins,\n right=right,\n labels=labels,\n retbins=retbins,\n precision=precision,\n include_lowest=include_lowest,\n duplicates=duplicates,\n ordered=ordered,\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_modin-project__modin/modin/pandas/general.py_unique_value_counts.return.Series_values_value_coun": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_unique_value_counts.return.Series_values_value_coun", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 358, "end_line": 401, "span_ids": ["value_counts", "unique"], "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": "@_inherit_docstrings(pandas.unique, apilink=\"pandas.unique\")\n@enable_logging\ndef unique(values): # noqa: PR01, RT01, D200\n \"\"\"\n Return unique values based on a hash table.\n \"\"\"\n return Series(values).unique()\n\n\n# Adding docstring since pandas docs don't have web section for this function.\n@enable_logging\ndef value_counts(\n values, sort=True, ascending=False, normalize=False, bins=None, dropna=True\n):\n \"\"\"\n Compute a histogram of the counts of non-null values.\n\n Parameters\n ----------\n values : ndarray (1-d)\n Values to perform computation.\n sort : bool, default: True\n Sort by values.\n ascending : bool, default: False\n Sort in ascending order.\n normalize : bool, default: False\n If True then compute a relative histogram.\n bins : integer, optional\n Rather than count values, group them into half-open bins,\n convenience for pd.cut, only works with numeric data.\n dropna : bool, default: True\n Don't include counts of NaN.\n\n Returns\n -------\n Series\n \"\"\"\n return Series(values).value_counts(\n sort=sort,\n ascending=ascending,\n normalize=normalize,\n bins=bins,\n dropna=dropna,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_concat_concat.if_keys_is_None_and_isins.keys.list_objs_keys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_concat_concat.if_keys_is_None_and_isins.keys.list_objs_keys_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 404, "end_line": 500, "span_ids": ["concat"], "tokens": 771}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.concat, apilink=\"pandas.concat\")\n@enable_logging\ndef concat(\n objs: \"Iterable[DataFrame | Series] | Mapping[Hashable, DataFrame | Series]\",\n *,\n axis=0,\n join=\"outer\",\n ignore_index: bool = False,\n keys=None,\n levels=None,\n names=None,\n verify_integrity: bool = False,\n sort: bool = False,\n copy: Optional[bool] = None,\n) -> \"DataFrame | Series\": # noqa: PR01, RT01, D200\n \"\"\"\n Concatenate Modin objects along a particular axis.\n \"\"\"\n if isinstance(objs, (pandas.Series, Series, DataFrame, str, pandas.DataFrame)):\n raise TypeError(\n \"first argument must be an iterable of pandas \"\n + \"objects, you passed an object of type \"\n + f'\"{type(objs).__name__}\"'\n )\n axis = pandas.DataFrame()._get_axis_number(axis)\n if isinstance(objs, dict):\n input_list_of_objs = list(objs.values())\n else:\n input_list_of_objs = list(objs)\n if len(input_list_of_objs) == 0:\n raise ValueError(\"No objects to concatenate\")\n\n list_of_objs = [obj for obj in input_list_of_objs if obj is not None]\n\n if len(list_of_objs) == 0:\n raise ValueError(\"All objects passed were None\")\n try:\n type_check = next(\n obj\n for obj in list_of_objs\n if not isinstance(obj, (pandas.Series, Series, pandas.DataFrame, DataFrame))\n )\n except StopIteration:\n type_check = None\n if type_check is not None:\n raise ValueError(\n 'cannot concatenate object of type \"{0}\"; only '\n + \"modin.pandas.Series \"\n + \"and modin.pandas.DataFrame objs are \"\n + \"valid\",\n type(type_check),\n )\n all_series = all(isinstance(obj, Series) for obj in list_of_objs)\n if all_series and axis == 0:\n return Series(\n query_compiler=list_of_objs[0]._query_compiler.concat(\n axis,\n [o._query_compiler for o in list_of_objs[1:]],\n join=join,\n join_axes=None,\n ignore_index=ignore_index,\n keys=None,\n levels=None,\n names=None,\n verify_integrity=False,\n copy=True,\n sort=sort,\n )\n )\n if join == \"outer\":\n # Filter out empties\n list_of_objs = [\n obj\n for obj in list_of_objs\n if (\n isinstance(obj, (Series, pandas.Series))\n or (isinstance(obj, DataFrame) and obj._query_compiler.lazy_execution)\n or sum(obj.shape) > 0\n )\n ]\n elif join != \"inner\":\n raise ValueError(\n \"Only can inner (intersect) or outer (union) join the other axis\"\n )\n # We have the weird Series and axis check because, when concatenating a\n # dataframe to a series on axis=0, pandas ignores the name of the series,\n # and this check aims to mirror that (possibly buggy) functionality\n list_of_objs = [\n obj._query_compiler\n if isinstance(obj, DataFrame)\n else DataFrame(obj.rename())._query_compiler\n if isinstance(obj, (pandas.Series, Series)) and axis == 0\n else DataFrame(obj)._query_compiler\n for obj in list_of_objs\n ]\n if keys is None and isinstance(objs, dict):\n keys = list(objs.keys())\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_modin-project__modin/modin/pandas/general.py_concat.if_keys_is_not_None__concat.return.result_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_concat.if_keys_is_not_None__concat.return.result_df", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 501, "end_line": 553, "span_ids": ["concat"], "tokens": 477}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.concat, apilink=\"pandas.concat\")\n@enable_logging\ndef concat(\n objs: \"Iterable[DataFrame | Series] | Mapping[Hashable, DataFrame | Series]\",\n *,\n axis=0,\n join=\"outer\",\n ignore_index: bool = False,\n keys=None,\n levels=None,\n names=None,\n verify_integrity: bool = False,\n sort: bool = False,\n copy: Optional[bool] = None,\n) -> \"DataFrame | Series\":\n # ... other code\n if keys is not None:\n if all_series:\n new_idx = keys\n else:\n list_of_objs = [\n list_of_objs[i] for i in range(min(len(list_of_objs), len(keys)))\n ]\n new_idx_labels = {\n k: v.index if axis == 0 else v.columns\n for k, v in zip(keys, list_of_objs)\n }\n tuples = [\n (k, *o) if isinstance(o, tuple) else (k, o)\n for k, obj in new_idx_labels.items()\n for o in obj\n ]\n new_idx = pandas.MultiIndex.from_tuples(tuples)\n if names is not None:\n new_idx.names = names\n else:\n old_name = _determine_name(list_of_objs, axis)\n if old_name is not None:\n new_idx.names = [None] + old_name\n else:\n new_idx = None\n\n if len(list_of_objs) == 0:\n return DataFrame(\n index=input_list_of_objs[0].index.append(\n [f.index for f in input_list_of_objs[1:]]\n )\n )\n\n new_query_compiler = list_of_objs[0].concat(\n axis,\n list_of_objs[1:],\n join=join,\n join_axes=None,\n ignore_index=ignore_index,\n keys=None,\n levels=None,\n names=None,\n verify_integrity=False,\n copy=True,\n sort=sort,\n )\n result_df = DataFrame(query_compiler=new_query_compiler)\n if new_idx is not None:\n if axis == 0:\n result_df.index = new_idx\n else:\n result_df.columns = new_idx\n return result_df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_datetime_to_datetime.return.arg__to_datetime_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_datetime_to_datetime.return.arg__to_datetime_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 556, "end_line": 599, "span_ids": ["to_datetime"], "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": "@_inherit_docstrings(pandas.to_datetime, apilink=\"pandas.to_datetime\")\n@enable_logging\ndef to_datetime(\n arg,\n errors=\"raise\",\n dayfirst=False,\n yearfirst=False,\n utc=False,\n format=None,\n exact=no_default,\n unit=None,\n infer_datetime_format=no_default,\n origin=\"unix\",\n cache=True,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Convert argument to datetime.\n \"\"\"\n if not hasattr(arg, \"_to_datetime\"):\n return pandas.to_datetime(\n arg,\n errors=errors,\n dayfirst=dayfirst,\n yearfirst=yearfirst,\n utc=utc,\n format=format,\n exact=exact,\n unit=unit,\n infer_datetime_format=infer_datetime_format,\n origin=origin,\n cache=cache,\n )\n return arg._to_datetime(\n errors=errors,\n dayfirst=dayfirst,\n yearfirst=yearfirst,\n utc=utc,\n format=format,\n exact=exact,\n unit=unit,\n infer_datetime_format=infer_datetime_format,\n origin=origin,\n cache=cache,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_get_dummies_get_dummies.if_not_isinstance_data_D.else_.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_get_dummies_get_dummies.if_not_isinstance_data_D.else_.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 602, "end_line": 648, "span_ids": ["get_dummies"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.get_dummies, apilink=\"pandas.get_dummies\")\n@enable_logging\ndef get_dummies(\n data,\n prefix=None,\n prefix_sep=\"_\",\n dummy_na=False,\n columns=None,\n sparse=False,\n drop_first=False,\n dtype=None,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Convert categorical variable into dummy/indicator variables.\n \"\"\"\n if sparse:\n raise NotImplementedError(\n \"SparseDataFrame is not implemented. \"\n + \"To contribute to Modin, please visit \"\n + \"github.com/modin-project/modin.\"\n )\n if not isinstance(data, DataFrame):\n ErrorMessage.default_to_pandas(\"`get_dummies` on non-DataFrame\")\n if isinstance(data, Series):\n data = data._to_pandas()\n return DataFrame(\n pandas.get_dummies(\n data,\n prefix=prefix,\n prefix_sep=prefix_sep,\n dummy_na=dummy_na,\n columns=columns,\n sparse=sparse,\n drop_first=drop_first,\n dtype=dtype,\n )\n )\n else:\n new_manager = data._query_compiler.get_dummies(\n columns,\n prefix=prefix,\n prefix_sep=prefix_sep,\n dummy_na=dummy_na,\n drop_first=drop_first,\n dtype=dtype,\n )\n return DataFrame(query_compiler=new_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_modin-project__modin/modin/pandas/general.py_melt_melt.return.frame_melt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_melt_melt.return.frame_melt_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 651, "end_line": 672, "span_ids": ["melt"], "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": "@_inherit_docstrings(pandas.melt, apilink=\"pandas.melt\")\n@enable_logging\ndef melt(\n frame,\n id_vars=None,\n value_vars=None,\n var_name=None,\n value_name=\"value\",\n col_level=None,\n ignore_index: bool = True,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Unpivot a DataFrame from wide to long format, optionally leaving identifiers set.\n \"\"\"\n return frame.melt(\n id_vars=id_vars,\n value_vars=value_vars,\n var_name=var_name,\n value_name=value_name,\n col_level=col_level,\n ignore_index=ignore_index,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_crosstab_crosstab.return.DataFrame_pandas_crosstab": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_crosstab_crosstab.return.DataFrame_pandas_crosstab", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 675, "end_line": 705, "span_ids": ["crosstab"], "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": "@_inherit_docstrings(pandas.crosstab, apilink=\"pandas.crosstab\")\n@enable_logging\ndef crosstab(\n index,\n columns,\n values=None,\n rownames=None,\n colnames=None,\n aggfunc=None,\n margins=False,\n margins_name: str = \"All\",\n dropna: bool = True,\n normalize=False,\n) -> DataFrame: # noqa: PR01, RT01, D200\n \"\"\"\n Compute a simple cross tabulation of two (or more) factors.\n \"\"\"\n ErrorMessage.default_to_pandas(\"`crosstab`\")\n pandas_crosstab = pandas.crosstab(\n index,\n columns,\n values,\n rownames,\n colnames,\n aggfunc,\n margins,\n margins_name,\n dropna,\n normalize,\n )\n return DataFrame(pandas_crosstab)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_None_14_lreshape.return.DataFrame_pandas_lreshape": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_None_14_lreshape.return.DataFrame_pandas_lreshape", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 735, "span_ids": ["lreshape", "crosstab"], "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": "# Adding docstring since pandas docs don't have web section for this function.\n@enable_logging\ndef lreshape(data: DataFrame, groups, dropna=True):\n \"\"\"\n Reshape wide-format data to long. Generalized inverse of ``DataFrame.pivot``.\n\n Accepts a dictionary, `groups`, in which each key is a new column name\n and each value is a list of old column names that will be \"melted\" under\n the new column name as part of the reshape.\n\n Parameters\n ----------\n data : DataFrame\n The wide-format DataFrame.\n groups : dict\n Dictionary in the form: `{new_name : list_of_columns}`.\n dropna : bool, default: True\n Whether include columns whose entries are all NaN or not.\n\n Returns\n -------\n DataFrame\n Reshaped DataFrame.\n \"\"\"\n if not isinstance(data, DataFrame):\n raise ValueError(\"can not lreshape with instance of type {}\".format(type(data)))\n ErrorMessage.default_to_pandas(\"`lreshape`\")\n return DataFrame(pandas.lreshape(to_pandas(data), groups, dropna=dropna))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_wide_to_long_wide_to_long.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_wide_to_long_wide_to_long.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 738, "end_line": 758, "span_ids": ["wide_to_long"], "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": "@_inherit_docstrings(pandas.wide_to_long, apilink=\"pandas.wide_to_long\")\n@enable_logging\ndef wide_to_long(\n df: DataFrame, stubnames, i, j, sep: str = \"\", suffix: str = r\"\\d+\"\n) -> DataFrame: # noqa: PR01, RT01, D200\n \"\"\"\n Unpivot a DataFrame from wide to long format.\n \"\"\"\n if not isinstance(df, DataFrame):\n raise ValueError(\n \"can not wide_to_long with instance of type {}\".format(type(df))\n )\n return DataFrame(\n query_compiler=df._query_compiler.wide_to_long(\n stubnames=stubnames,\n i=i,\n j=j,\n sep=sep,\n suffix=suffix,\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_modin-project__modin/modin/pandas/general.py__determine_name__determine_name.if_np_all_names_names_.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py__determine_name__determine_name.if_np_all_names_names_.else_.return.None", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 761, "end_line": 789, "span_ids": ["_determine_name"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _determine_name(objs: Iterable[BaseQueryCompiler], axis: Union[int, str]):\n \"\"\"\n Determine names of index after concatenation along passed axis.\n\n Parameters\n ----------\n objs : iterable of QueryCompilers\n Objects to concatenate.\n axis : int or str\n The axis to concatenate along.\n\n Returns\n -------\n list with single element\n Computed index name, `None` if it could not be determined.\n \"\"\"\n axis = pandas.DataFrame()._get_axis_number(axis)\n\n def get_names(obj):\n return obj.columns.names if axis else obj.index.names\n\n names = np.array([get_names(obj) for obj in objs])\n\n # saving old name, only if index names of all objs are the same\n if np.all(names == names[0]):\n # we must do this check to avoid this calls `list(str_like_name)`\n return list(names[0]) if is_list_like(names[0]) else [names[0]]\n else:\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_modin-project__modin/modin/pandas/general.py_to_timedelta_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/general.py_to_timedelta_", "embedding": null, "metadata": {"file_path": "modin/pandas/general.py", "file_name": "general.py", "file_type": "text/x-python", "category": "implementation", "start_line": 792, "end_line": 805, "span_ids": ["to_timedelta"], "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": "@_inherit_docstrings(pandas.to_datetime, apilink=\"pandas.to_timedelta\")\n@enable_logging\ndef to_timedelta(arg, unit=None, errors=\"raise\"): # noqa: PR01, RT01, D200\n \"\"\"\n Convert argument to timedelta.\n\n Accepts str, timedelta, list-like or Series for arg parameter.\n Returns a Series if and only if arg is provided as a Series.\n \"\"\"\n if isinstance(arg, Series):\n query_compiler = arg._query_compiler.to_timedelta(unit=unit, errors=errors)\n return Series(query_compiler=query_compiler)\n return pandas.to_timedelta(arg, unit=unit, errors=errors)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_np__DEFAULT_BEHAVIOUR._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_np__DEFAULT_BEHAVIOUR._", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 74, "span_ids": ["docstring"], "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": "import numpy as np\nimport pandas\nfrom pandas.core.apply import reconstruct_func\nfrom pandas.errors import SpecificationError\nimport pandas.core.groupby\nfrom pandas.core.dtypes.common import is_list_like, is_numeric_dtype, is_integer\nfrom pandas._libs.lib import no_default\nimport pandas.core.common as com\nfrom types import BuiltinFunctionType\nfrom collections.abc import Iterable\n\nfrom modin.error_message import ErrorMessage\nfrom modin.logging import ClassLogger\nfrom modin.utils import (\n _inherit_docstrings,\n try_cast_to_pandas,\n wrap_udf_function,\n hashable,\n wrap_into_list,\n MODIN_UNNAMED_SERIES_LABEL,\n)\nfrom modin.pandas.utils import cast_function_modin2pandas\nfrom modin.core.storage_formats.base.query_compiler import BaseQueryCompiler\nfrom modin.core.dataframe.algebra.default2pandas.groupby import GroupBy\nfrom modin.config import IsExperimental\nfrom .series import Series\nfrom .utils import is_label\n\n\n_DEFAULT_BEHAVIOUR = {\n \"__class__\",\n \"__getitem__\",\n \"__init__\",\n \"__iter__\",\n \"_as_index\",\n \"_axis\",\n \"_by\",\n \"_check_index\",\n \"_check_index_name\",\n \"_columns\",\n \"_compute_index_grouped\",\n \"_default_to_pandas\",\n \"_df\",\n \"_drop\",\n \"_groups_cache\",\n \"_idx_name\",\n \"_index\",\n \"_indices_cache\",\n \"_internal_by\",\n \"_internal_by_cache\",\n \"_is_multi_by\",\n \"_iter\",\n \"_kwargs\",\n \"_level\",\n \"_pandas_class\",\n \"_query_compiler\",\n \"_sort\",\n \"_wrap_aggregation\",\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy_DataFrameGroupBy.ngroups.return.len_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy_DataFrameGroupBy.ngroups.return.len_self_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 198, "span_ids": ["DataFrameGroupBy.ngroups", "DataFrameGroupBy.__getattr__", "DataFrameGroupBy.__init__", "DataFrameGroupBy", "DataFrameGroupBy.__override", "DataFrameGroupBy:6"], "tokens": 812}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n _pandas_class = pandas.core.groupby.DataFrameGroupBy\n _return_tuple_when_iterating = False\n\n def __init__(\n self,\n df,\n by,\n axis,\n level,\n as_index,\n sort,\n group_keys,\n idx_name,\n drop,\n **kwargs,\n ):\n self._axis = axis\n self._idx_name = idx_name\n self._df = df\n self._query_compiler = self._df._query_compiler\n self._columns = self._query_compiler.columns\n self._by = by\n self._drop = drop\n # When providing a list of columns of length one to DataFrame.groupby(),\n # the keys that are returned by iterating over the resulting DataFrameGroupBy\n # object will now be tuples of length one (pandas#GH47761)\n self._return_tuple_when_iterating = kwargs.pop(\n \"return_tuple_when_iterating\", False\n )\n\n if (\n level is None\n and is_list_like(by)\n or isinstance(by, type(self._query_compiler))\n ):\n # This tells us whether or not there are multiple columns/rows in the groupby\n self._is_multi_by = (\n isinstance(by, type(self._query_compiler)) and len(by.columns) > 1\n ) or (\n not isinstance(by, type(self._query_compiler))\n and axis == 0\n and all(\n (hashable(obj) and obj in self._query_compiler.columns)\n or isinstance(obj, type(self._query_compiler))\n or is_list_like(obj)\n for obj in self._by\n )\n )\n else:\n self._is_multi_by = False\n self._level = level\n self._kwargs = {\n \"level\": level,\n \"sort\": sort,\n \"as_index\": as_index,\n \"group_keys\": group_keys,\n }\n self._kwargs.update(kwargs)\n\n def __override(self, **kwargs):\n new_kw = dict(\n df=self._df,\n by=self._by,\n axis=self._axis,\n idx_name=self._idx_name,\n drop=self._drop,\n **self._kwargs,\n )\n new_kw.update(kwargs)\n return type(self)(**new_kw)\n\n def __getattr__(self, key):\n \"\"\"\n Alter regular attribute access, looks up the name in the columns.\n\n Parameters\n ----------\n key : str\n Attribute name.\n\n Returns\n -------\n The value of the attribute.\n \"\"\"\n try:\n return object.__getattribute__(self, key)\n except AttributeError as err:\n if key in self._columns:\n return self.__getitem__(key)\n raise err\n\n # TODO: `.__getattribute__` overriding is broken in experimental mode. We should\n # remove this branching one it's fixed:\n # https://github.com/modin-project/modin/issues/5536\n if not IsExperimental.get():\n\n def __getattribute__(self, item):\n attr = super().__getattribute__(item)\n if (\n item not in _DEFAULT_BEHAVIOUR\n and not self._query_compiler.lazy_execution\n ):\n # We default to pandas on empty DataFrames. This avoids a large amount of\n # pain in underlying implementation and returns a result immediately rather\n # than dealing with the edge cases that empty DataFrames have.\n if (\n callable(attr)\n and self._df.empty\n and hasattr(self._pandas_class, item)\n ):\n\n def default_handler(*args, **kwargs):\n return self._default_to_pandas(item, *args, **kwargs)\n\n return default_handler\n return attr\n\n @property\n def ngroups(self):\n return len(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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.skew_DataFrameGroupBy.skew.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.skew_DataFrameGroupBy.skew.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 217, "span_ids": ["DataFrameGroupBy.skew"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def skew(self, axis=no_default, skipna=True, numeric_only=False, **kwargs):\n # default behaviour for aggregations; for the reference see\n # `_op_via_apply` func in pandas==2.0.2\n if axis is None or axis is no_default:\n axis = self._axis\n\n if axis != 0 or not skipna:\n return self._default_to_pandas(\n lambda df: df.skew(\n axis=axis, skipna=skipna, numeric_only=numeric_only, **kwargs\n )\n )\n\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_skew,\n agg_kwargs=kwargs,\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.ffill_DataFrameGroupBy.value_counts.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.ffill_DataFrameGroupBy.value_counts.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 264, "span_ids": ["DataFrameGroupBy.ewm", "DataFrameGroupBy.sem", "DataFrameGroupBy.ffill", "DataFrameGroupBy.value_counts", "DataFrameGroupBy.sample"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def ffill(self, limit=None):\n ErrorMessage.single_warning(\n \".ffill() is implemented using .fillna() in Modin, \"\n + \"which can be impacted by pandas bug https://github.com/pandas-dev/pandas/issues/43412 \"\n + \"on dataframes with duplicated indices\"\n )\n return self.fillna(limit=limit, method=\"ffill\")\n\n def sem(self, ddof=1, numeric_only=False):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_sem,\n agg_kwargs=dict(ddof=ddof),\n numeric_only=numeric_only,\n )\n\n def sample(self, n=None, frac=None, replace=False, weights=None, random_state=None):\n return self._default_to_pandas(\n lambda df: df.sample(\n n=n,\n frac=frac,\n replace=replace,\n weights=weights,\n random_state=random_state,\n )\n )\n\n def ewm(self, *args, **kwargs):\n return self._default_to_pandas(lambda df: df.ewm(*args, **kwargs))\n\n def value_counts(\n self,\n subset=None,\n normalize: bool = False,\n sort: bool = True,\n ascending: bool = False,\n dropna: bool = True,\n ):\n return self._default_to_pandas(\n lambda df: df.value_counts(\n subset=subset,\n normalize=normalize,\n sort=sort,\n ascending=ascending,\n dropna=dropna,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.mean_DataFrameGroupBy.mean.return.self__check_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.mean_DataFrameGroupBy.mean.return.self__check_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 283, "span_ids": ["DataFrameGroupBy.mean"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def mean(self, numeric_only=False, engine=\"cython\", engine_kwargs=None):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.mean(\n numeric_only=numeric_only,\n engine=engine,\n engine_kwargs=engine_kwargs,\n )\n )\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_mean,\n agg_kwargs=dict(\n numeric_only=None if numeric_only is no_default else numeric_only,\n ),\n numeric_only=numeric_only,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.any_DataFrameGroupBy.groups.return.self__groups_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.any_DataFrameGroupBy.groups.return.self__groups_cache", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 285, "end_line": 335, "span_ids": ["DataFrameGroupBy.ohlc", "DataFrameGroupBy.groups", "DataFrameGroupBy.any", "DataFrameGroupBy.__bytes__", "DataFrameGroupBy:7", "DataFrameGroupBy.plot"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def any(self, skipna=True):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_any,\n numeric_only=False,\n agg_kwargs=dict(skipna=skipna),\n )\n\n @property\n def plot(self): # pragma: no cover\n return self._default_to_pandas(lambda df: df.plot)\n\n def ohlc(self):\n from .dataframe import DataFrame\n\n return DataFrame(\n query_compiler=self._query_compiler.groupby_ohlc(\n by=self._by,\n axis=self._axis,\n groupby_kwargs=self._kwargs,\n agg_args=[],\n agg_kwargs={},\n is_df=isinstance(self._df, DataFrame),\n ),\n )\n\n def __bytes__(self):\n \"\"\"\n Convert DataFrameGroupBy object into a python2-style byte string.\n\n Returns\n -------\n bytearray\n Byte array representation of `self`.\n\n Notes\n -----\n Deprecated and removed in pandas and will be likely removed in Modin.\n \"\"\"\n return self._default_to_pandas(lambda df: df.__bytes__())\n\n _groups_cache = no_default\n\n # TODO: since python 3.9:\n # @cached_property\n @property\n def groups(self):\n if self._groups_cache is not no_default:\n return self._groups_cache\n\n self._groups_cache = self._compute_index_grouped(numerical=False)\n return self._groups_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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.min_DataFrameGroupBy.min.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.min_DataFrameGroupBy.min.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 351, "span_ids": ["DataFrameGroupBy.min"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def min(self, numeric_only=False, min_count=-1, engine=None, engine_kwargs=None):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.min(\n numeric_only=numeric_only,\n min_count=min_count,\n engine=engine,\n engine_kwargs=engine_kwargs,\n )\n )\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_min,\n agg_kwargs=dict(min_count=min_count),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.max_DataFrameGroupBy.max.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.max_DataFrameGroupBy.max.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 353, "end_line": 367, "span_ids": ["DataFrameGroupBy.max"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def max(self, numeric_only=False, min_count=-1, engine=None, engine_kwargs=None):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.max(\n numeric_only=numeric_only,\n min_count=min_count,\n engine=engine,\n engine_kwargs=engine_kwargs,\n )\n )\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_max,\n agg_kwargs=dict(min_count=min_count),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.idxmax_DataFrameGroupBy.ndim._ndim_is_always_2_for_Da": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.idxmax_DataFrameGroupBy.ndim._ndim_is_always_2_for_Da", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 405, "span_ids": ["DataFrameGroupBy.idxmax", "DataFrameGroupBy.ndim", "DataFrameGroupBy.idxmin"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def idxmax(self, axis=None, skipna=True, numeric_only=False):\n # default behaviour for aggregations; for the reference see\n # `_op_via_apply` func in pandas==2.0.2\n if axis is None:\n axis = self._axis\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_idxmax,\n agg_kwargs=dict(axis=axis, skipna=skipna),\n numeric_only=numeric_only,\n )\n\n def idxmin(self, axis=None, skipna=True, numeric_only=False):\n # default behaviour for aggregations; for the reference see\n # `_op_via_apply` func in pandas==2.0.2\n if axis is None:\n axis = self._axis\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_idxmin,\n agg_kwargs=dict(axis=axis, skipna=skipna),\n numeric_only=numeric_only,\n )\n\n @property\n def ndim(self):\n \"\"\"\n Return 2.\n\n Returns\n -------\n int\n Returns 2.\n\n Notes\n -----\n Deprecated and removed in pandas and will be likely removed in Modin.\n \"\"\"\n return 2 # ndim is always 2 for DataFrames", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.shift_DataFrameGroupBy.shift._shift.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.shift_DataFrameGroupBy.shift._shift.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 407, "end_line": 431, "span_ids": ["DataFrameGroupBy.shift"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def shift(self, periods=1, freq=None, axis=0, fill_value=None):\n def _shift(data, periods, freq, axis, fill_value, is_set_nan_rows=True):\n from .dataframe import DataFrame\n\n result = data.shift(periods, freq, axis, fill_value)\n\n if (\n is_set_nan_rows\n and isinstance(self._by, BaseQueryCompiler)\n and (\n # Check using `issubset` is effective only in case of MultiIndex\n set(self._by.columns).issubset(list(data.columns))\n if isinstance(self._by.columns, pandas.MultiIndex)\n else len(\n self._by.columns.unique()\n .sort_values()\n .difference(data.columns.unique().sort_values())\n )\n == 0\n )\n and DataFrame(query_compiler=self._by.isna()).any(axis=None)\n ):\n mask_nan_rows = data[self._by.columns].isna().any(axis=1)\n result = result.loc[~mask_nan_rows]\n return result\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.shift.if_freq_is_None_and_axis__DataFrameGroupBy.shift.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.shift.if_freq_is_None_and_axis__DataFrameGroupBy.shift.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 433, "end_line": 459, "span_ids": ["DataFrameGroupBy.shift"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def shift(self, periods=1, freq=None, axis=0, fill_value=None):\n # ... other code\n\n if freq is None and axis == 1 and self._axis == 0:\n result = _shift(self._df, periods, freq, axis, fill_value)\n elif (\n freq is not None\n and axis == 0\n and self._axis == 0\n and isinstance(self._by, BaseQueryCompiler)\n ):\n result = _shift(\n self._df, periods, freq, axis, fill_value, is_set_nan_rows=False\n )\n result = result.dropna(subset=self._by.columns)\n if self._sort:\n result = result.sort_values(list(self._by.columns), axis=axis)\n else:\n result = result.sort_index()\n else:\n result = self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_shift,\n numeric_only=False,\n agg_kwargs=dict(\n periods=periods, freq=freq, axis=axis, fill_value=fill_value\n ),\n )\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.nth_DataFrameGroupBy.nth.return.self__check_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.nth_DataFrameGroupBy.nth.return.self__check_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 461, "end_line": 483, "span_ids": ["DataFrameGroupBy.nth"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def nth(self, n, dropna=None):\n # TODO: what we really should do is create a GroupByNthSelector to mimic\n # pandas behavior and then implement some of these methods there.\n # Adapted error checking from pandas\n if dropna:\n if not is_integer(n):\n raise ValueError(\"dropna option only supported for an integer argument\")\n\n if dropna not in (\"any\", \"all\"):\n # Note: when agg-ing picker doesn't raise this, just returns NaN\n raise ValueError(\n \"For a DataFrame or Series groupby.nth, dropna must be \"\n + \"either None, 'any' or 'all', \"\n + f\"(was passed {dropna}).\"\n )\n\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_nth,\n numeric_only=False,\n agg_kwargs=dict(n=n, dropna=dropna),\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.cumsum_DataFrameGroupBy.indices.return.self__indices_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.cumsum_DataFrameGroupBy.indices.return.self__indices_cache", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 504, "span_ids": ["DataFrameGroupBy.indices", "DataFrameGroupBy:9", "DataFrameGroupBy.cumsum"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def cumsum(self, axis=0, *args, **kwargs):\n return self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_cumsum,\n agg_args=args,\n agg_kwargs=dict(axis=axis, **kwargs),\n )\n )\n\n _indices_cache = no_default\n\n # TODO: since python 3.9:\n # @cached_property\n @property\n def indices(self):\n if self._indices_cache is not no_default:\n return self._indices_cache\n\n self._indices_cache = self._compute_index_grouped(numerical=True)\n return self._indices_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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.pct_change_DataFrameGroupBy.pct_change.return.self__check_index_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.pct_change_DataFrameGroupBy.pct_change.return.self__check_index_name_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 506, "end_line": 540, "span_ids": ["DataFrameGroupBy.pct_change"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n @_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy.pct_change)\n def pct_change(self, periods=1, fill_method=\"ffill\", limit=None, freq=None, axis=0):\n from .dataframe import DataFrame\n\n # Should check for API level errors\n # Attempting to match pandas error behavior here\n if not isinstance(periods, int):\n raise TypeError(f\"periods must be an int. got {type(periods)} instead\")\n\n if isinstance(self._df, Series):\n if not is_numeric_dtype(self._df.dtypes):\n raise TypeError(\n f\"unsupported operand type for -: got {self._df.dtypes}\"\n )\n elif isinstance(self._df, DataFrame) and axis == 0:\n for col, dtype in self._df.dtypes.items():\n # can't calculate change on non-numeric columns, so check for\n # non-numeric columns that are not included in the `by`\n if not is_numeric_dtype(dtype) and not (\n isinstance(self._by, BaseQueryCompiler) and col in self._by.columns\n ):\n raise TypeError(f\"unsupported operand type for -: got {dtype}\")\n\n return self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_pct_change,\n agg_kwargs=dict(\n periods=periods,\n fill_method=fill_method,\n limit=limit,\n freq=freq,\n axis=axis,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.filter_DataFrameGroupBy.cummax.return.self__check_index_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.filter_DataFrameGroupBy.cummax.return.self__check_index_name_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 554, "span_ids": ["DataFrameGroupBy.cummax", "DataFrameGroupBy.filter"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def filter(self, func, dropna=True, *args, **kwargs):\n return self._default_to_pandas(\n lambda df: df.filter(func, dropna=dropna, *args, **kwargs)\n )\n\n def cummax(self, axis=0, numeric_only=False, **kwargs):\n return self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_cummax,\n agg_kwargs=dict(axis=axis, **kwargs),\n numeric_only=numeric_only,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.apply_DataFrameGroupBy.apply.return.self__check_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.apply_DataFrameGroupBy.apply.return.self__check_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 556, "end_line": 570, "span_ids": ["DataFrameGroupBy.apply"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def apply(self, func, *args, **kwargs):\n func = cast_function_modin2pandas(func)\n if not isinstance(func, BuiltinFunctionType):\n func = wrap_udf_function(func)\n\n return self._check_index(\n self._wrap_aggregation(\n qc_method=type(self._query_compiler).groupby_agg,\n numeric_only=False,\n agg_func=func,\n agg_args=args,\n agg_kwargs=kwargs,\n how=\"group_wise\",\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.dtypes_DataFrameGroupBy.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.dtypes_DataFrameGroupBy.None_8", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 572, "end_line": 600, "span_ids": ["DataFrameGroupBy.last", "DataFrameGroupBy.dtypes", "DataFrameGroupBy.first", "DataFrameGroupBy:11"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n @property\n def dtypes(self):\n if self._axis == 1:\n raise ValueError(\"Cannot call dtypes on groupby with axis=1\")\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_dtypes,\n numeric_only=False,\n )\n )\n\n def first(self, numeric_only=False, min_count=-1):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_first,\n agg_kwargs=dict(min_count=min_count),\n numeric_only=numeric_only,\n )\n\n def last(self, numeric_only=False, min_count=-1):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_last,\n agg_kwargs=dict(min_count=min_count),\n numeric_only=numeric_only,\n )\n\n _internal_by_cache = no_default\n\n # TODO: since python 3.9:\n # @cached_property", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._internal_by_DataFrameGroupBy._internal_by.return.internal_by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._internal_by_DataFrameGroupBy._internal_by.return.internal_by", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 601, "end_line": 633, "span_ids": ["DataFrameGroupBy._internal_by"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n @property\n def _internal_by(self):\n \"\"\"\n Get only those components of 'by' that are column labels of the source frame.\n\n Returns\n -------\n tuple of labels\n \"\"\"\n if self._internal_by_cache is not no_default:\n return self._internal_by_cache\n\n internal_by = tuple()\n if self._drop:\n if is_list_like(self._by):\n internal_by_list = []\n for by in self._by:\n if isinstance(by, str):\n internal_by_list.append(by)\n elif isinstance(by, pandas.Grouper):\n internal_by_list.append(by.key)\n internal_by = tuple(internal_by_list)\n elif isinstance(self._by, pandas.Grouper):\n internal_by = tuple([self._by.key])\n else:\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=not isinstance(self._by, BaseQueryCompiler),\n extra_log=f\"When 'drop' is True, 'by' must be either list-like, Grouper, or a QueryCompiler, met: {type(self._by)}.\",\n )\n internal_by = tuple(self._by.columns)\n\n self._internal_by_cache = internal_by\n return internal_by", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.__getitem___DataFrameGroupBy.__getitem__.return.SeriesGroupBy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.__getitem___DataFrameGroupBy.__getitem__.return.SeriesGroupBy_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 635, "end_line": 716, "span_ids": ["DataFrameGroupBy.__getitem__"], "tokens": 740}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def __getitem__(self, key):\n \"\"\"\n Implement indexing operation on a DataFrameGroupBy object.\n\n Parameters\n ----------\n key : list or str\n Names of columns to use as subset of original object.\n\n Returns\n -------\n DataFrameGroupBy or SeriesGroupBy\n Result of indexing operation.\n\n Raises\n ------\n NotImplementedError\n Column lookups on GroupBy with arbitrary Series in by is not yet supported.\n \"\"\"\n # These parameters are common for building the resulted Series or DataFrame groupby object\n kwargs = {\n **self._kwargs.copy(),\n \"by\": self._by,\n \"axis\": self._axis,\n \"idx_name\": self._idx_name,\n }\n # The rules of type deduction for the resulted object is the following:\n # 1. If `key` is a list-like or `as_index is False`, then the resulted object is a DataFrameGroupBy\n # 2. Otherwise, the resulted object is SeriesGroupBy\n # 3. Result type does not depend on the `by` origin\n # Examples:\n # - drop: any, as_index: any, __getitem__(key: list_like) -> DataFrameGroupBy\n # - drop: any, as_index: False, __getitem__(key: any) -> DataFrameGroupBy\n # - drop: any, as_index: True, __getitem__(key: label) -> SeriesGroupBy\n if is_list_like(key):\n make_dataframe = True\n else:\n if self._as_index:\n make_dataframe = False\n else:\n make_dataframe = True\n key = [key]\n if make_dataframe:\n internal_by = frozenset(self._internal_by)\n if len(internal_by.intersection(key)) != 0:\n ErrorMessage.missmatch_with_pandas(\n operation=\"GroupBy.__getitem__\",\n message=(\n \"intersection of the selection and 'by' columns is not yet supported, \"\n + \"to achieve the desired result rewrite the original code from:\\n\"\n + \"df.groupby('by_column')['by_column']\\n\"\n + \"to the:\\n\"\n + \"df.groupby(df['by_column'].copy())['by_column']\"\n ),\n )\n # We need to maintain order of the columns in key, using a set doesn't\n # maintain order.\n # We use dictionaries since they maintain insertion order as of 3.7,\n # and its faster to call dict.update than it is to loop through `key`\n # and select only the elements which aren't in `cols_to_grab`.\n cols_to_grab = dict.fromkeys(self._internal_by)\n cols_to_grab.update(dict.fromkeys(key))\n key = [col for col in cols_to_grab.keys() if col in self._df.columns]\n return DataFrameGroupBy(\n self._df[key],\n drop=self._drop,\n **kwargs,\n )\n if (\n self._is_multi_by\n and isinstance(self._by, list)\n and not all(hashable(o) and o in self._df for o in self._by)\n ):\n raise NotImplementedError(\n \"Column lookups on GroupBy with arbitrary Series in by\"\n + \" is not yet supported.\"\n )\n return SeriesGroupBy(\n self._df[key],\n drop=False,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.cummin_DataFrameGroupBy.prod.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.cummin_DataFrameGroupBy.prod.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 718, "end_line": 740, "span_ids": ["DataFrameGroupBy.cummin", "DataFrameGroupBy.prod", "DataFrameGroupBy.bfill"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def cummin(self, axis=0, numeric_only=False, **kwargs):\n return self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_cummin,\n agg_kwargs=dict(axis=axis, **kwargs),\n numeric_only=numeric_only,\n )\n )\n\n def bfill(self, limit=None):\n ErrorMessage.single_warning(\n \".bfill() is implemented using .fillna() in Modin, \"\n + \"which can be impacted by pandas bug https://github.com/pandas-dev/pandas/issues/43412 \"\n + \"on dataframes with duplicated indices\"\n )\n return self.fillna(limit=limit, method=\"bfill\")\n\n def prod(self, numeric_only=False, min_count=0):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_prod,\n agg_kwargs=dict(min_count=min_count),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.std_DataFrameGroupBy.std.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.std_DataFrameGroupBy.std.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 742, "end_line": 756, "span_ids": ["DataFrameGroupBy.std"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def std(self, ddof=1, engine=None, engine_kwargs=None, numeric_only=False):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.std(\n ddof=ddof,\n engine=engine,\n engine_kwargs=engine_kwargs,\n numeric_only=numeric_only,\n )\n )\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_std,\n agg_kwargs=dict(ddof=ddof),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.aggregate_DataFrameGroupBy.aggregate.do_relabel.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.aggregate_DataFrameGroupBy.aggregate.do_relabel.None", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 758, "end_line": 777, "span_ids": ["DataFrameGroupBy.aggregate"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.aggregate(\n func, *args, engine=engine, engine_kwargs=engine_kwargs, **kwargs\n )\n )\n if self._axis != 0:\n # This is not implemented in pandas,\n # so we throw a different message\n raise NotImplementedError(\"axis other than 0 is not supported\")\n\n if (\n callable(func)\n and isinstance(func, BuiltinFunctionType)\n and func.__name__ in dir(self)\n ):\n func = func.__name__\n\n do_relabel = None\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.aggregate.if_isinstance_func_dict__DataFrameGroupBy.aggregate.return.do_relabel_result_if_do_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.aggregate.if_isinstance_func_dict__DataFrameGroupBy.aggregate.return.do_relabel_result_if_do_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 778, "end_line": 876, "span_ids": ["DataFrameGroupBy.aggregate"], "tokens": 901}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs):\n # ... other code\n if isinstance(func, dict) or func is None:\n relabeling_required, func_dict, new_columns, order = reconstruct_func(\n func, **kwargs\n )\n\n if relabeling_required:\n\n def do_relabel(obj_to_relabel):\n new_order, new_columns_idx = order, pandas.Index(new_columns)\n if not self._as_index:\n nby_cols = len(obj_to_relabel.columns) - len(new_columns_idx)\n new_order = np.concatenate(\n [np.arange(nby_cols), new_order + nby_cols]\n )\n by_cols = obj_to_relabel.columns[:nby_cols]\n if by_cols.nlevels != new_columns_idx.nlevels:\n by_cols = by_cols.remove_unused_levels()\n empty_levels = [\n i\n for i, level in enumerate(by_cols.levels)\n if len(level) == 1 and level[0] == \"\"\n ]\n by_cols = by_cols.droplevel(empty_levels)\n new_columns_idx = by_cols.append(new_columns_idx)\n result = obj_to_relabel.iloc[:, new_order]\n result.columns = new_columns_idx\n return result\n\n if any(isinstance(fn, list) for fn in func_dict.values()):\n # multicolumn case\n # putting functions in a `list` allows to achieve multicolumn in each partition\n func_dict = {\n col: fn if isinstance(fn, list) else [fn]\n for col, fn in func_dict.items()\n }\n if (\n relabeling_required\n and not self._as_index\n and any(col in func_dict for col in self._internal_by)\n ):\n ErrorMessage.missmatch_with_pandas(\n operation=\"GroupBy.aggregate(**dictionary_renaming_aggregation)\",\n message=(\n \"intersection of the columns to aggregate and 'by' is not yet supported when 'as_index=False', \"\n + \"columns with group names of the intersection will not be presented in the result. \"\n + \"To achieve the desired result rewrite the original code from:\\n\"\n + \"df.groupby('by_column', as_index=False).agg(agg_func=('by_column', agg_func))\\n\"\n + \"to the:\\n\"\n + \"df.groupby('by_column').agg(agg_func=('by_column', agg_func)).reset_index()\"\n ),\n )\n\n if any(i not in self._df.columns for i in func_dict.keys()):\n raise SpecificationError(\"nested renamer is not supported\")\n if func is None:\n kwargs = {}\n func = func_dict\n elif is_list_like(func):\n # for list-list aggregation pandas always puts\n # groups as index in the result, ignoring as_index,\n # so we have to reset it to default value\n res = self.__override(as_index=True)._wrap_aggregation(\n qc_method=type(self._query_compiler).groupby_agg,\n numeric_only=False,\n agg_func=func,\n agg_args=args,\n agg_kwargs=kwargs,\n how=\"axis_wise\",\n )\n if not self._kwargs[\"as_index\"]:\n res.reset_index(inplace=True)\n return res\n elif callable(func):\n return self._check_index(\n self._wrap_aggregation(\n qc_method=type(self._query_compiler).groupby_agg,\n numeric_only=False,\n agg_func=func,\n agg_args=args,\n agg_kwargs=kwargs,\n how=\"axis_wise\",\n )\n )\n elif isinstance(func, str):\n # Using \"getattr\" here masks possible AttributeError which we throw\n # in __getattr__, so we should call __getattr__ directly instead.\n agg_func = self.__getattr__(func)\n if callable(agg_func):\n return agg_func(*args, **kwargs)\n\n result = self._wrap_aggregation(\n qc_method=type(self._query_compiler).groupby_agg,\n numeric_only=False,\n agg_func=func,\n agg_args=args,\n agg_kwargs=kwargs,\n how=\"axis_wise\",\n )\n return do_relabel(result) if do_relabel else 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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.agg_DataFrameGroupBy.corrwith.return.self__default_to_pandas_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.agg_DataFrameGroupBy.corrwith.return.self__default_to_pandas_l", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 878, "end_line": 900, "span_ids": ["DataFrameGroupBy.rank", "DataFrameGroupBy:13", "DataFrameGroupBy.corrwith"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n agg = aggregate\n\n def rank(\n self, method=\"average\", ascending=True, na_option=\"keep\", pct=False, axis=0\n ):\n result = self._wrap_aggregation(\n type(self._query_compiler).groupby_rank,\n agg_kwargs=dict(\n method=method,\n ascending=ascending,\n na_option=na_option,\n pct=pct,\n axis=axis,\n ),\n numeric_only=False,\n )\n # pandas does not name the index on rank\n result._query_compiler.set_index_name(None)\n return result\n\n @property\n def corrwith(self):\n return self._default_to_pandas(lambda df: df.corrwith)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.var_DataFrameGroupBy.var.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.var_DataFrameGroupBy.var.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 902, "end_line": 916, "span_ids": ["DataFrameGroupBy.var"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def var(self, ddof=1, engine=None, engine_kwargs=None, numeric_only=False):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.var(\n ddof=ddof,\n engine=engine,\n engine_kwargs=engine_kwargs,\n numeric_only=numeric_only,\n )\n )\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_var,\n agg_kwargs=dict(ddof=ddof),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.get_group_DataFrameGroupBy.all.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.get_group_DataFrameGroupBy.all.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 918, "end_line": 939, "span_ids": ["DataFrameGroupBy.all", "DataFrameGroupBy.__len__", "DataFrameGroupBy.get_group"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def get_group(self, name, obj=None):\n work_object = self.__override(\n df=obj if obj is not None else self._df, as_index=True\n )\n\n return work_object._check_index(\n work_object._wrap_aggregation(\n qc_method=type(work_object._query_compiler).groupby_get_group,\n numeric_only=False,\n agg_kwargs=dict(name=name),\n )\n )\n\n def __len__(self):\n return len(self.indices)\n\n def all(self, skipna=True):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_all,\n numeric_only=False,\n agg_kwargs=dict(skipna=skipna),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.size_DataFrameGroupBy.size.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.size_DataFrameGroupBy.size.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 941, "end_line": 975, "span_ids": ["DataFrameGroupBy.size"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def size(self):\n if self._axis == 1:\n return DataFrameGroupBy(\n self._df.T.iloc[:, [0]],\n self._by,\n 0,\n drop=self._drop,\n idx_name=self._idx_name,\n **self._kwargs,\n ).size()\n work_object = type(self)(\n self._df,\n self._by,\n self._axis,\n drop=False,\n idx_name=None,\n **self._kwargs,\n )\n result = work_object._wrap_aggregation(\n type(work_object._query_compiler).groupby_size,\n numeric_only=False,\n )\n if not isinstance(result, Series):\n result = result.squeeze(axis=1)\n if not self._kwargs.get(\"as_index\") and not isinstance(result, Series):\n result = (\n result.rename(columns={MODIN_UNNAMED_SERIES_LABEL: \"index\"})\n if MODIN_UNNAMED_SERIES_LABEL in result.columns\n else result\n )\n elif isinstance(self._df, Series):\n result.name = self._df.name\n else:\n result.name = None\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.sum_DataFrameGroupBy.describe.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.sum_DataFrameGroupBy.describe.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 977, "end_line": 999, "span_ids": ["DataFrameGroupBy.sum", "DataFrameGroupBy.describe"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def sum(self, numeric_only=False, min_count=0, engine=None, engine_kwargs=None):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.sum(\n numeric_only=numeric_only,\n min_count=min_count,\n engine=engine,\n engine_kwargs=engine_kwargs,\n )\n )\n\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_sum,\n agg_kwargs=dict(min_count=min_count),\n numeric_only=numeric_only,\n )\n\n def describe(self, percentiles=None, include=None, exclude=None):\n return self._default_to_pandas(\n lambda df: df.describe(\n percentiles=percentiles, include=include, exclude=exclude\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.boxplot_DataFrameGroupBy.boxplot.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.boxplot_DataFrameGroupBy.boxplot.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1001, "end_line": 1033, "span_ids": ["DataFrameGroupBy.boxplot"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def boxplot(\n self,\n grouped,\n subplots=True,\n column=None,\n fontsize=None,\n rot=0,\n grid=True,\n ax=None,\n figsize=None,\n layout=None,\n sharex=False,\n sharey=True,\n backend=None,\n **kwargs,\n ):\n return self._default_to_pandas(\n lambda df: df.boxplot(\n grouped,\n subplots=subplots,\n column=column,\n fontsize=fontsize,\n rot=rot,\n grid=grid,\n ax=ax,\n figsize=figsize,\n layout=layout,\n sharex=sharex,\n sharey=sharey,\n backend=backend,\n **kwargs,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.ngroup_DataFrameGroupBy.cov.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.ngroup_DataFrameGroupBy.cov.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1035, "end_line": 1097, "span_ids": ["DataFrameGroupBy.median", "DataFrameGroupBy.head", "DataFrameGroupBy.__iter__", "DataFrameGroupBy.cov", "DataFrameGroupBy.cumprod", "DataFrameGroupBy.nunique", "DataFrameGroupBy.ngroup", "DataFrameGroupBy.resample"], "tokens": 481}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def ngroup(self, ascending=True):\n result = self._wrap_aggregation(\n type(self._query_compiler).groupby_ngroup,\n numeric_only=False,\n agg_kwargs=dict(ascending=ascending),\n )\n if not isinstance(result, Series):\n # The result should always be a Series with name None and type int64\n result = result.squeeze(axis=1)\n # TODO: this might not hold in the future\n result.name = None\n return result\n\n def nunique(self, dropna=True):\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_nunique,\n numeric_only=False,\n agg_kwargs=dict(dropna=dropna),\n )\n )\n\n def resample(self, rule, *args, **kwargs):\n return self._default_to_pandas(lambda df: df.resample(rule, *args, **kwargs))\n\n def median(self, numeric_only=False):\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_median,\n numeric_only=numeric_only,\n )\n )\n\n def head(self, n=5):\n # groupby().head()/.tail() ignore as_index, so override it to True\n work_object = self.__override(as_index=True)\n\n return work_object._check_index(\n work_object._wrap_aggregation(\n type(work_object._query_compiler).groupby_head,\n agg_kwargs=dict(n=n),\n numeric_only=False,\n )\n )\n\n def cumprod(self, axis=0, *args, **kwargs):\n return self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_cumprod,\n agg_args=args,\n agg_kwargs=dict(axis=axis, **kwargs),\n )\n )\n\n def __iter__(self):\n return self._iter.__iter__()\n\n def cov(self, min_periods=None, ddof=1, numeric_only=False):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_cov,\n agg_kwargs=dict(min_periods=min_periods, ddof=ddof),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.transform_DataFrameGroupBy.corr.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.transform_DataFrameGroupBy.corr.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1099, "end_line": 1123, "span_ids": ["DataFrameGroupBy.corr", "DataFrameGroupBy.transform"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def transform(self, func, *args, engine=None, engine_kwargs=None, **kwargs):\n if engine not in (\"cython\", None) and engine_kwargs is not None:\n return self._default_to_pandas(\n lambda df: df.transform(\n func, *args, engine=engine, engine_kwargs=engine_kwargs, **kwargs\n )\n )\n\n return self._check_index_name(\n self._wrap_aggregation(\n qc_method=type(self._query_compiler).groupby_agg,\n numeric_only=False,\n agg_func=func,\n agg_args=args,\n agg_kwargs=kwargs,\n how=\"transform\",\n )\n )\n\n def corr(self, method=\"pearson\", min_periods=1, numeric_only=False):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_corr,\n agg_kwargs=dict(method=method, min_periods=min_periods),\n numeric_only=numeric_only,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.fillna_DataFrameGroupBy.fillna.return.work_object__check_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.fillna_DataFrameGroupBy.fillna.return.work_object__check_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1125, "end_line": 1162, "span_ids": ["DataFrameGroupBy.fillna"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def fillna(\n self,\n value=None,\n method=None,\n axis=None,\n inplace=False,\n limit=None,\n downcast=None,\n ):\n # default behaviour for aggregations; for the reference see\n # `_op_via_apply` func in pandas==2.0.2\n if axis is None or axis is no_default:\n axis = self._axis\n\n new_groupby_kwargs = self._kwargs.copy()\n new_groupby_kwargs[\"as_index\"] = True\n work_object = type(self)(\n df=self._df,\n by=self._by,\n axis=self._axis,\n idx_name=self._idx_name,\n drop=self._drop,\n **new_groupby_kwargs,\n )\n return work_object._check_index_name(\n work_object._wrap_aggregation(\n type(self._query_compiler).groupby_fillna,\n agg_kwargs=dict(\n value=value,\n method=method,\n axis=axis,\n inplace=inplace,\n limit=limit,\n downcast=downcast,\n ),\n numeric_only=False,\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.count_DataFrameGroupBy.rolling.return.self__default_to_pandas_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.count_DataFrameGroupBy.rolling.return.self__default_to_pandas_l", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1164, "end_line": 1202, "span_ids": ["DataFrameGroupBy.cumcount", "DataFrameGroupBy.rolling", "DataFrameGroupBy.tail", "DataFrameGroupBy.count", "DataFrameGroupBy.pipe", "DataFrameGroupBy.expanding"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def count(self):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_count,\n numeric_only=False,\n )\n\n def pipe(self, func, *args, **kwargs):\n return com.pipe(self, func, *args, **kwargs)\n\n def cumcount(self, ascending=True):\n result = self._wrap_aggregation(\n type(self._query_compiler).groupby_cumcount,\n numeric_only=False,\n agg_kwargs=dict(ascending=ascending),\n )\n if not isinstance(result, Series):\n # The result should always be a Series with name None and type int64\n result = result.squeeze(axis=1)\n result.name = None\n return result\n\n def tail(self, n=5):\n # groupby().head()/.tail() ignore as_index, so override it to True\n work_object = self.__override(as_index=True)\n return work_object._check_index(\n work_object._wrap_aggregation(\n type(work_object._query_compiler).groupby_tail,\n agg_kwargs=dict(n=n),\n numeric_only=False,\n )\n )\n\n # expanding and rolling are unique cases and need to likely be handled\n # separately. They do not appear to be commonly used.\n def expanding(self, *args, **kwargs):\n return self._default_to_pandas(lambda df: df.expanding(*args, **kwargs))\n\n def rolling(self, *args, **kwargs):\n return self._default_to_pandas(lambda df: df.rolling(*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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.hist_DataFrameGroupBy.hist.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.hist_DataFrameGroupBy.hist.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1204, "end_line": 1242, "span_ids": ["DataFrameGroupBy.hist"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def hist(\n self,\n column=None,\n by=None,\n grid=True,\n xlabelsize=None,\n xrot=None,\n ylabelsize=None,\n yrot=None,\n ax=None,\n sharex=False,\n sharey=False,\n figsize=None,\n layout=None,\n bins=10,\n backend=None,\n legend=False,\n **kwargs,\n ):\n return self._default_to_pandas(\n lambda df: df.hist(\n column=column,\n by=by,\n grid=grid,\n xlabelsize=xlabelsize,\n xrot=xrot,\n ylabelsize=ylabelsize,\n yrot=yrot,\n ax=ax,\n sharex=sharex,\n sharey=sharey,\n figsize=figsize,\n layout=layout,\n bins=bins,\n backend=backend,\n legend=legend,\n **kwargs,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.quantile_DataFrameGroupBy.quantile.return.self__check_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.quantile_DataFrameGroupBy.quantile.return.self__check_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1244, "end_line": 1257, "span_ids": ["DataFrameGroupBy.quantile"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def quantile(self, q=0.5, interpolation=\"linear\", numeric_only=False):\n # TODO: handle list-like cases properly\n if is_list_like(q):\n return self._default_to_pandas(\n lambda df: df.quantile(q=q, interpolation=interpolation)\n )\n\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_quantile,\n numeric_only=numeric_only,\n agg_kwargs=dict(q=q, interpolation=interpolation),\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.diff_DataFrameGroupBy.diff.return.self__check_index_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.diff_DataFrameGroupBy.diff.return.self__check_index_name_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1259, "end_line": 1289, "span_ids": ["DataFrameGroupBy.diff"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def diff(self, periods=1, axis=0):\n from .dataframe import DataFrame\n\n # Should check for API level errors\n # Attempting to match pandas error behavior here\n if not isinstance(periods, int):\n raise TypeError(f\"periods must be an int. got {type(periods)} instead\")\n\n if isinstance(self._df, Series):\n if not is_numeric_dtype(self._df.dtypes):\n raise TypeError(\n f\"unsupported operand type for -: got {self._df.dtypes}\"\n )\n elif isinstance(self._df, DataFrame) and axis == 0:\n for col, dtype in self._df.dtypes.items():\n # can't calculate diff on non-numeric columns, so check for non-numeric\n # columns that are not included in the `by`\n if not is_numeric_dtype(dtype) and not (\n isinstance(self._by, BaseQueryCompiler) and col in self._by.columns\n ):\n raise TypeError(f\"unsupported operand type for -: got {dtype}\")\n\n return self._check_index_name(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_diff,\n agg_kwargs=dict(\n periods=periods,\n axis=axis,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.take_DataFrameGroupBy._as_index.return.self__kwargs_get_as_inde": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy.take_DataFrameGroupBy._as_index.return.self__kwargs_get_as_inde", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1291, "end_line": 1328, "span_ids": ["DataFrameGroupBy._as_index", "DataFrameGroupBy._index", "DataFrameGroupBy.take", "DataFrameGroupBy._sort"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def take(self, indices, axis=0, **kwargs):\n return self._default_to_pandas(lambda df: df.take(indices, axis=axis, **kwargs))\n\n @property\n def _index(self):\n \"\"\"\n Get index value.\n\n Returns\n -------\n pandas.Index\n Index value.\n \"\"\"\n return self._query_compiler.index\n\n @property\n def _sort(self):\n \"\"\"\n Get sort parameter value.\n\n Returns\n -------\n bool\n Value of sort parameter used to create DataFrameGroupBy object.\n \"\"\"\n return self._kwargs.get(\"sort\")\n\n @property\n def _as_index(self):\n \"\"\"\n Get as_index parameter value.\n\n Returns\n -------\n bool\n Value of as_index parameter used to create DataFrameGroupBy object.\n \"\"\"\n return self._kwargs.get(\"as_index\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._iter_DataFrameGroupBy._iter.if_self__axis_0_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._iter_DataFrameGroupBy._iter.if_self__axis_0_.else_.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1330, "end_line": 1367, "span_ids": ["DataFrameGroupBy._iter"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n @property\n def _iter(self):\n \"\"\"\n Construct a tuple of (group_id, DataFrame) tuples to allow iteration over groups.\n\n Returns\n -------\n generator\n Generator expression of GroupBy object broken down into tuples for iteration.\n \"\"\"\n from .dataframe import DataFrame\n\n indices = self.indices\n group_ids = indices.keys()\n if self._axis == 0:\n return (\n (\n (k,) if self._return_tuple_when_iterating else k,\n DataFrame(\n query_compiler=self._query_compiler.getitem_row_array(\n indices[k]\n )\n ),\n )\n for k in (sorted(group_ids) if self._sort else group_ids)\n )\n else:\n return (\n (\n (k,) if self._return_tuple_when_iterating else k,\n DataFrame(\n query_compiler=self._query_compiler.getitem_column_array(\n indices[k], numeric=True\n )\n ),\n )\n for k in (sorted(group_ids) if self._sort else group_ids)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._compute_index_grouped_DataFrameGroupBy._compute_index_grouped.if_is_multi_by_.else_.if_dropna_.else_.return.groupby_obj_indices_if_nu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._compute_index_grouped_DataFrameGroupBy._compute_index_grouped.if_is_multi_by_.else_.if_dropna_.else_.return.groupby_obj_indices_if_nu", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1369, "end_line": 1459, "span_ids": ["DataFrameGroupBy._compute_index_grouped"], "tokens": 801}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def _compute_index_grouped(self, numerical=False):\n \"\"\"\n Construct an index of group IDs.\n\n Parameters\n ----------\n numerical : bool, default: False\n Whether a group indices should be positional (True) or label-based (False).\n\n Returns\n -------\n dict\n A dict of {group name -> group indices} values.\n\n See Also\n --------\n pandas.core.groupby.GroupBy.groups\n \"\"\"\n # We end up using pure pandas to compute group indices, so raising a warning\n ErrorMessage.default_to_pandas(\"Group indices computation\")\n\n # Splitting level-by and column-by since we serialize them in a different ways\n by = None\n level = []\n if self._level is not None:\n level = self._level\n if not isinstance(level, list):\n level = [level]\n elif isinstance(self._by, list):\n by = []\n for o in self._by:\n if hashable(o) and o in self._query_compiler.get_index_names(\n self._axis\n ):\n level.append(o)\n else:\n by.append(o)\n else:\n by = self._by\n\n is_multi_by = self._is_multi_by or (by is not None and len(level) > 0)\n # `dropna` param is the only one that matters for the group indices result\n dropna = self._kwargs.get(\"dropna\", True)\n\n if isinstance(self._by, BaseQueryCompiler) and is_multi_by:\n by = list(self._by.columns)\n\n if is_multi_by:\n # Because we are doing a collect (to_pandas) here and then groupby, we\n # end up using pandas implementation. Add the warning so the user is\n # aware.\n ErrorMessage.catch_bugs_and_request_email(self._axis == 1)\n if isinstance(by, list) and all(\n is_label(self._df, o, self._axis) for o in by\n ):\n pandas_df = self._df._query_compiler.getitem_column_array(\n by\n ).to_pandas()\n else:\n by = try_cast_to_pandas(by, squeeze=True)\n pandas_df = self._df._to_pandas()\n by = wrap_into_list(by, level)\n groupby_obj = pandas_df.groupby(by=by, dropna=dropna)\n return groupby_obj.indices if numerical else groupby_obj.groups\n else:\n if isinstance(self._by, type(self._query_compiler)):\n by = self._by.to_pandas().squeeze().values\n elif self._by is None:\n index = self._query_compiler.get_axis(self._axis)\n levels_to_drop = [\n i\n for i, name in enumerate(index.names)\n if name not in level and i not in level\n ]\n by = index.droplevel(levels_to_drop)\n if isinstance(by, pandas.MultiIndex):\n by = by.reorder_levels(level)\n else:\n by = self._by\n axis_labels = self._query_compiler.get_axis(self._axis)\n if numerical:\n # Since we want positional indices of the groups, we want to group\n # on a `RangeIndex`, not on the actual index labels\n axis_labels = pandas.RangeIndex(len(axis_labels))\n # `pandas.Index.groupby` doesn't take any parameters except `by`.\n # Have to convert an Index to a Series to be able to process `dropna=False`:\n if dropna:\n return axis_labels.groupby(by)\n else:\n groupby_obj = axis_labels.to_series().groupby(by, dropna=dropna)\n return groupby_obj.indices if numerical else groupby_obj.groups", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._wrap_aggregation_DataFrameGroupBy._wrap_aggregation.return.type_self__df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._wrap_aggregation_DataFrameGroupBy._wrap_aggregation.return.type_self__df_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1461, "end_line": 1519, "span_ids": ["DataFrameGroupBy._wrap_aggregation"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def _wrap_aggregation(\n self,\n qc_method,\n numeric_only=False,\n agg_args=None,\n agg_kwargs=None,\n **kwargs,\n ):\n \"\"\"\n Perform common metadata transformations and apply groupby functions.\n\n Parameters\n ----------\n qc_method : callable\n The query compiler method to call.\n numeric_only : {None, True, False}, default: None\n Specifies whether to aggregate non numeric columns:\n - True: include only numeric columns (including categories that holds a numeric dtype)\n - False: include all columns\n - None: infer the parameter, ``False`` if there are no numeric types in the frame,\n ``True`` otherwise.\n agg_args : list-like, optional\n Positional arguments to pass to the aggregation function.\n agg_kwargs : dict-like, optional\n Keyword arguments to pass to the aggregation function.\n **kwargs : dict\n Keyword arguments to pass to the specified query compiler's method.\n\n Returns\n -------\n DataFrame or Series\n Returns the same type as `self._df`.\n \"\"\"\n agg_args = tuple() if agg_args is None else agg_args\n agg_kwargs = dict() if agg_kwargs is None else agg_kwargs\n\n if numeric_only and self.ndim == 2:\n by_cols = self._internal_by\n mask_cols = [\n col\n for col, dtype in self._query_compiler.dtypes.items()\n if (is_numeric_dtype(dtype) or col in by_cols)\n ]\n groupby_qc = self._query_compiler.getitem_column_array(mask_cols)\n else:\n groupby_qc = self._query_compiler\n\n return type(self._df)(\n query_compiler=qc_method(\n groupby_qc,\n by=self._by,\n axis=self._axis,\n groupby_kwargs=self._kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=self._drop,\n **kwargs,\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._check_index_DataFrameGroupBy._check_index_name.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._check_index_DataFrameGroupBy._check_index_name.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1521, "end_line": 1557, "span_ids": ["DataFrameGroupBy._check_index_name", "DataFrameGroupBy._check_index"], "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": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def _check_index(self, result):\n \"\"\"\n Check the result of groupby aggregation on the need of resetting index.\n\n Parameters\n ----------\n result : DataFrame\n Group by aggregation result.\n\n Returns\n -------\n DataFrame\n \"\"\"\n if self._by is None and not self._as_index:\n # This is a workaround to align behavior with pandas. In this case pandas\n # resets index, but Modin doesn't do that. More details are in https://github.com/modin-project/modin/issues/3716.\n result.reset_index(drop=True, inplace=True)\n\n return result\n\n def _check_index_name(self, result):\n \"\"\"\n Check the result of groupby aggregation on the need of resetting index name.\n\n Parameters\n ----------\n result : DataFrame\n Group by aggregation result.\n\n Returns\n -------\n DataFrame\n \"\"\"\n if self._by is not None:\n # pandas does not name the index for this case\n result._query_compiler.set_index_name(None)\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_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._default_to_pandas_DataFrameGroupBy._default_to_pandas.return.self__df__default_to_pand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_DataFrameGroupBy._default_to_pandas_DataFrameGroupBy._default_to_pandas.return.self__df__default_to_pand", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1559, "end_line": 1608, "span_ids": ["DataFrameGroupBy._default_to_pandas"], "tokens": 460}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.DataFrameGroupBy)\nclass DataFrameGroupBy(ClassLogger):\n\n def _default_to_pandas(self, f, *args, **kwargs):\n \"\"\"\n Execute function `f` in default-to-pandas way.\n\n Parameters\n ----------\n f : callable or str\n The function to apply to each group.\n *args : list\n Extra positional arguments to pass to `f`.\n **kwargs : dict\n Extra keyword arguments to pass to `f`.\n\n Returns\n -------\n modin.pandas.DataFrame\n A new Modin DataFrame with the result of the pandas function.\n \"\"\"\n if (\n isinstance(self._by, type(self._query_compiler))\n and len(self._by.columns) == 1\n ):\n by = self._by.columns[0] if self._drop else self._by.to_pandas().squeeze()\n # converting QC 'by' to a list of column labels only if this 'by' comes from the self (if drop is True)\n elif self._drop and isinstance(self._by, type(self._query_compiler)):\n by = list(self._by.columns)\n else:\n by = self._by\n\n by = try_cast_to_pandas(by, squeeze=True)\n # Since 'by' may be a 2D query compiler holding columns to group by,\n # to_pandas will also produce a pandas DataFrame containing them.\n # So splitting 2D 'by' into a list of 1D Series using 'GroupBy.validate_by':\n by = GroupBy.validate_by(by)\n\n def groupby_on_multiple_columns(df, *args, **kwargs):\n groupby_obj = df.groupby(by=by, axis=self._axis, **self._kwargs)\n\n if callable(f):\n return f(groupby_obj, *args, **kwargs)\n else:\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=not isinstance(f, str)\n )\n attribute = getattr(groupby_obj, f)\n if callable(attribute):\n return attribute(*args, **kwargs)\n return attribute\n\n return self._df._default_to_pandas(groupby_on_multiple_columns, *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_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy_SeriesGroupBy._iter.if_self__axis_0_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy_SeriesGroupBy._iter.if_self__axis_0_.else_.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1611, "end_line": 1666, "span_ids": ["SeriesGroupBy._iter", "SeriesGroupBy.ndim", "SeriesGroupBy"], "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": "@_inherit_docstrings(pandas.core.groupby.SeriesGroupBy)\nclass SeriesGroupBy(DataFrameGroupBy):\n _pandas_class = pandas.core.groupby.SeriesGroupBy\n\n @property\n def ndim(self):\n \"\"\"\n Return 1.\n\n Returns\n -------\n int\n Returns 1.\n\n Notes\n -----\n Deprecated and removed in pandas and will be likely removed in Modin.\n \"\"\"\n return 1 # ndim is always 1 for Series\n\n @property\n def _iter(self):\n \"\"\"\n Construct a tuple of (group_id, Series) tuples to allow iteration over groups.\n\n Returns\n -------\n generator\n Generator expression of GroupBy object broken down into tuples for iteration.\n \"\"\"\n indices = self.indices\n group_ids = indices.keys()\n if self._axis == 0:\n return (\n (\n k,\n Series(\n query_compiler=self._query_compiler.getitem_row_array(\n indices[k]\n )\n ),\n )\n for k in (sorted(group_ids) if self._sort else group_ids)\n )\n else:\n return (\n (\n k,\n Series(\n query_compiler=self._query_compiler.getitem_column_array(\n indices[k], numeric=True\n )\n ),\n )\n for k in (sorted(group_ids) if self._sort else group_ids)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy._try_get_str_func_SeriesGroupBy._try_get_str_func.return.fn___name___if_callable_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy._try_get_str_func_SeriesGroupBy._try_get_str_func.return.fn___name___if_callable_f", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1668, "end_line": 1692, "span_ids": ["SeriesGroupBy._try_get_str_func"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.SeriesGroupBy)\nclass SeriesGroupBy(DataFrameGroupBy):\n\n def _try_get_str_func(self, fn):\n \"\"\"\n Try to convert a groupby aggregation function to a string or list of such.\n\n Parameters\n ----------\n fn : callable, str, or Iterable\n\n Returns\n -------\n str, list\n If `fn` is a callable, return its name if it's a method of the groupby\n object, otherwise return `fn` itself. If `fn` is a string, return it.\n If `fn` is an Iterable, return a list of _try_get_str_func applied to\n each element of `fn`.\n \"\"\"\n if not isinstance(fn, str) and isinstance(fn, Iterable):\n return [self._try_get_str_func(f) for f in fn]\n if fn is np.max:\n # np.max is called \"amax\", so it's not a method of the groupby object.\n return \"amax\"\n elif fn is np.min:\n # np.min is called \"amin\", so it's not a method of the groupby object.\n return \"amin\"\n return fn.__name__ if callable(fn) and fn.__name__ in dir(self) else fn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.value_counts_SeriesGroupBy.idxmin.return.self__wrap_aggregation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.value_counts_SeriesGroupBy.idxmin.return.self__wrap_aggregation_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1694, "end_line": 1737, "span_ids": ["SeriesGroupBy.corr", "SeriesGroupBy.describe", "SeriesGroupBy.idxmin", "SeriesGroupBy.cov", "SeriesGroupBy.idxmax", "SeriesGroupBy.value_counts"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.groupby.SeriesGroupBy)\nclass SeriesGroupBy(DataFrameGroupBy):\n\n def value_counts(\n self,\n normalize: bool = False,\n sort: bool = True,\n ascending: bool = False,\n bins=None,\n dropna: bool = True,\n ):\n return self._default_to_pandas(\n lambda ser: ser.value_counts(\n normalize=normalize,\n sort=sort,\n ascending=ascending,\n bins=bins,\n dropna=dropna,\n )\n )\n\n def corr(self, other, method=\"pearson\", min_periods=None):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_corr,\n agg_kwargs=dict(other=other, method=method, min_periods=min_periods),\n )\n\n def cov(self, other, min_periods=None, ddof=1):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_cov,\n agg_kwargs=dict(other=other, min_periods=min_periods, ddof=ddof),\n )\n\n def describe(self, **kwargs):\n return self._default_to_pandas(lambda df: df.describe(**kwargs))\n\n def idxmax(self, axis=0, skipna=True):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_idxmax,\n agg_kwargs=dict(axis=axis, skipna=skipna),\n )\n\n def idxmin(self, axis=0, skipna=True):\n return self._wrap_aggregation(\n type(self._query_compiler).groupby_idxmin,\n agg_kwargs=dict(axis=axis, skipna=skipna),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.hist_SeriesGroupBy.hist.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.hist_SeriesGroupBy.hist.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1739, "end_line": 1769, "span_ids": ["SeriesGroupBy.hist"], "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": "@_inherit_docstrings(pandas.core.groupby.SeriesGroupBy)\nclass SeriesGroupBy(DataFrameGroupBy):\n\n def hist(\n self,\n by=None,\n ax=None,\n grid=True,\n xlabelsize=None,\n xrot=None,\n ylabelsize=None,\n yrot=None,\n figsize=None,\n bins=10,\n backend=None,\n legend=False,\n **kwargs,\n ):\n return self._default_to_pandas(\n lambda df: df.hist(\n by=by,\n ax=ax,\n grid=grid,\n xlabelsize=xlabelsize,\n xrot=xrot,\n ylabelsize=ylabelsize,\n yrot=yrot,\n figsize=figsize,\n bins=bins,\n backend=backend,\n legend=legend,\n **kwargs,\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_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.is_monotonic_decreasing_SeriesGroupBy.nsmallest.return.self__check_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.is_monotonic_decreasing_SeriesGroupBy.nsmallest.return.self__check_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1771, "end_line": 1807, "span_ids": ["SeriesGroupBy.nsmallest", "SeriesGroupBy.nlargest", "SeriesGroupBy.is_monotonic_decreasing", "SeriesGroupBy.unique", "SeriesGroupBy.dtype", "SeriesGroupBy.is_monotonic_increasing"], "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": "@_inherit_docstrings(pandas.core.groupby.SeriesGroupBy)\nclass SeriesGroupBy(DataFrameGroupBy):\n\n @property\n def is_monotonic_decreasing(self):\n return self._default_to_pandas(lambda ser: ser.is_monotonic_decreasing)\n\n @property\n def is_monotonic_increasing(self):\n return self._default_to_pandas(lambda ser: ser.is_monotonic_increasing)\n\n @property\n def dtype(self):\n return self._default_to_pandas(lambda ser: ser.dtype)\n\n def unique(self):\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_unique,\n numeric_only=False,\n )\n )\n\n def nlargest(self, n=5, keep=\"first\"):\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_nlargest,\n agg_kwargs=dict(n=n, keep=keep),\n numeric_only=True,\n )\n )\n\n def nsmallest(self, n=5, keep=\"first\"):\n return self._check_index(\n self._wrap_aggregation(\n type(self._query_compiler).groupby_nsmallest,\n agg_kwargs=dict(n=n, keep=keep),\n numeric_only=True,\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.aggregate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/groupby.py_SeriesGroupBy.aggregate_", "embedding": null, "metadata": {"file_path": "modin/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1809, "end_line": 1844, "span_ids": ["SeriesGroupBy.aggregate", "impl:3", "SeriesGroupBy:4"], "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": "@_inherit_docstrings(pandas.core.groupby.SeriesGroupBy)\nclass SeriesGroupBy(DataFrameGroupBy):\n\n def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs):\n engine_default = engine is None and engine_kwargs is None\n if isinstance(func, dict) and engine_default:\n raise SpecificationError(\"nested renamer is not supported\")\n elif is_list_like(func) and engine_default:\n from .dataframe import DataFrame\n\n result = DataFrame(\n query_compiler=self._query_compiler.groupby_agg(\n by=self._by,\n agg_func=func,\n axis=self._axis,\n groupby_kwargs=self._kwargs,\n agg_args=args,\n agg_kwargs=kwargs,\n )\n )\n # query compiler always gives result a multiindex on the axis with the\n # function names, but series always gets a regular index on the columns\n # because there is no need to identify which original column's aggregation\n # the new column represents. alternatively we could give the query compiler\n # a hint that it's for a series, not a dataframe.\n return result.set_axis(labels=self._try_get_str_func(func), axis=1)\n else:\n return super().aggregate(\n func, *args, engine=engine, engine_kwargs=engine_kwargs, **kwargs\n )\n\n agg = aggregate\n\n\nif IsExperimental.get():\n from modin.experimental.cloud.meta_magic import make_wrapped_class\n\n make_wrapped_class(DataFrameGroupBy, \"make_dataframe_groupby_wrapper\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_np_is_tuple.return.isinstance_x_tuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_np_is_tuple.return.isinstance_x_tuple_", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 114, "span_ids": ["compute_sliced_len", "is_slice", "is_tuple", "docstring", "is_2d"], "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 numpy as np\nimport pandas\nimport itertools\nfrom pandas.api.types import is_list_like, is_bool\nfrom pandas.core.dtypes.common import is_integer, is_bool_dtype, is_integer_dtype\nfrom pandas.core.indexing import IndexingError\nfrom modin.error_message import ErrorMessage\nfrom modin.logging import ClassLogger\n\nfrom .dataframe import DataFrame\nfrom .series import Series\nfrom .utils import is_scalar, broadcast_item\n\n\ndef is_slice(x):\n \"\"\"\n Check that argument is an instance of slice.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is a slice, False otherwise.\n \"\"\"\n return isinstance(x, slice)\n\n\ndef compute_sliced_len(slc, sequence_len):\n \"\"\"\n Compute length of sliced object.\n\n Parameters\n ----------\n slc : slice\n Slice object.\n sequence_len : int\n Length of sequence, to which slice will be applied.\n\n Returns\n -------\n int\n Length of object after applying slice object on it.\n \"\"\"\n # This will translate slice to a range, from which we can retrieve length\n return len(range(*slc.indices(sequence_len)))\n\n\ndef is_2d(x):\n \"\"\"\n Check that argument is a list or a slice.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n `True` if argument is a list or slice, `False` otherwise.\n \"\"\"\n return is_list_like(x) or is_slice(x)\n\n\ndef is_tuple(x):\n \"\"\"\n Check that argument is a tuple.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is a tuple, False otherwise.\n \"\"\"\n return isinstance(x, tuple)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_boolean_array_is_boolean_array.return.is_list_like_x_and_all_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_boolean_array_is_boolean_array.return.is_list_like_x_and_all_m", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 135, "span_ids": ["is_boolean_array"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_boolean_array(x):\n \"\"\"\n Check that argument is an array of bool.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is an array of bool, False otherwise.\n \"\"\"\n if isinstance(x, (np.ndarray, Series, pandas.Series, pandas.Index)):\n return is_bool_dtype(x.dtype)\n elif isinstance(x, (DataFrame, pandas.DataFrame)):\n return all(map(is_bool_dtype, x.dtypes))\n return is_list_like(x) and all(map(is_bool, 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_modin-project__modin/modin/pandas/indexing.py_is_integer_array_is_integer_array.return.is_list_like_x_and_all_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_integer_array_is_integer_array.return.is_list_like_x_and_all_m", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 156, "span_ids": ["is_integer_array"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_integer_array(x):\n \"\"\"\n Check that argument is an array of integers.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is an array of integers, False otherwise.\n \"\"\"\n if isinstance(x, (np.ndarray, Series, pandas.Series, pandas.Index)):\n return is_integer_dtype(x.dtype)\n elif isinstance(x, (DataFrame, pandas.DataFrame)):\n return all(map(is_integer_dtype, x.dtypes))\n return is_list_like(x) and all(map(is_integer, 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_modin-project__modin/modin/pandas/indexing.py_is_integer_slice_is_integer_slice.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_integer_slice_is_integer_slice.return.True", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 178, "span_ids": ["is_integer_slice"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_integer_slice(x):\n \"\"\"\n Check that argument is an array of int.\n\n Parameters\n ----------\n x : object\n Object to check.\n\n Returns\n -------\n bool\n True if argument is an array of int, False otherwise.\n \"\"\"\n if not is_slice(x):\n return False\n for pos in [x.start, x.stop, x.step]:\n if not ((pos is None) or is_integer(pos)):\n return False # one position is neither None nor int\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_modin-project__modin/modin/pandas/indexing.py_is_range_like_is_range_like.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_is_range_like_is_range_like.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 202, "span_ids": ["is_range_like"], "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 is_range_like(obj):\n \"\"\"\n Check if the object is range-like.\n\n Objects that are considered range-like have information about the range (start and\n stop positions, and step) and also have to be iterable. Examples of range-like\n objects are: Python range, pandas.RangeIndex.\n\n Parameters\n ----------\n obj : object\n\n Returns\n -------\n bool\n \"\"\"\n return (\n hasattr(obj, \"__iter__\")\n and hasattr(obj, \"start\")\n and hasattr(obj, \"stop\")\n and hasattr(obj, \"step\")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_boolean_mask_to_numeric_boolean_mask_to_numeric.if_isinstance_indexer_n.else_.return.np_fromiter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py_boolean_mask_to_numeric_boolean_mask_to_numeric.if_isinstance_indexer_n.else_.return.np_fromiter_", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 205, "end_line": 228, "span_ids": ["boolean_mask_to_numeric"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def boolean_mask_to_numeric(indexer):\n \"\"\"\n Convert boolean mask to numeric indices.\n\n Parameters\n ----------\n indexer : list-like of booleans\n\n Returns\n -------\n np.ndarray of ints\n Numerical positions of ``True`` elements in the passed `indexer`.\n \"\"\"\n if isinstance(indexer, (np.ndarray, Series, pandas.Series)):\n return np.where(indexer)[0]\n else:\n # It's faster to build the resulting numpy array from the reduced amount of data via\n # `compress` iterator than convert non-numpy-like `indexer` to numpy and apply `np.where`.\n return np.fromiter(\n # `itertools.compress` masks `data` with the `selectors` mask,\n # works about ~10% faster than a pure list comprehension\n itertools.compress(data=range(len(indexer)), selectors=indexer),\n dtype=np.int64,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__ILOC_INT_ONLY_ERROR__compute_ndim.return.ndim": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__ILOC_INT_ONLY_ERROR__compute_ndim.return.ndim", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 265, "span_ids": ["_compute_ndim", "impl"], "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": "_ILOC_INT_ONLY_ERROR = \"\"\"\nLocation based indexing can only have [integer, integer slice (START point is\nINCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types.\n\"\"\"\n\n_one_ellipsis_message = \"indexer may only contain one '...' entry\"\n\n\ndef _compute_ndim(row_loc, col_loc):\n \"\"\"\n Compute the number of dimensions of result from locators.\n\n Parameters\n ----------\n row_loc : list or scalar\n Row locator.\n col_loc : list or scalar\n Column locator.\n\n Returns\n -------\n {0, 1, 2}\n Number of dimensions in located dataset.\n \"\"\"\n row_scalar = is_scalar(row_loc) or is_tuple(row_loc)\n col_scalar = is_scalar(col_loc) or is_tuple(col_loc)\n\n if row_scalar and col_scalar:\n ndim = 0\n elif row_scalar ^ col_scalar:\n ndim = 1\n else:\n ndim = 2\n\n return ndim", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase__LocationIndexerBase._validate_key_length.return.key": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase__LocationIndexerBase._validate_key_length.return.key", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 268, "end_line": 294, "span_ids": ["_LocationIndexerBase._validate_key_length", "_LocationIndexerBase.__init__", "_LocationIndexerBase"], "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 _LocationIndexerBase(ClassLogger):\n \"\"\"\n Base class for location indexer like loc and iloc.\n\n Parameters\n ----------\n modin_df : modin.pandas.DataFrame\n DataFrame to operate on.\n \"\"\"\n\n def __init__(self, modin_df):\n self.df = modin_df\n self.qc = modin_df._query_compiler\n\n def _validate_key_length(self, key: tuple) -> tuple: # noqa: GL08\n # Implementation copied from pandas.\n if len(key) > self.df.ndim:\n if key[0] is Ellipsis:\n # e.g. Series.iloc[..., 3] reduces to just Series.iloc[3]\n key = key[1:]\n if Ellipsis in key:\n raise IndexingError(_one_ellipsis_message)\n return self._validate_key_length(key)\n raise IndexingError(\n f\"Too many indexers: you're trying to pass {len(key)} indexers to the {type(self.df)} having only {self.df.ndim} dimensions.\"\n )\n return 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_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase.__getitem____LocationIndexerBase.__setitem__.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase.__getitem____LocationIndexerBase.__setitem__.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 296, "end_line": 331, "span_ids": ["_LocationIndexerBase.__getitem__", "_LocationIndexerBase.__setitem__"], "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 _LocationIndexerBase(ClassLogger):\n\n def __getitem__(self, key): # pragma: no cover\n \"\"\"\n Retrieve dataset according to `key`.\n\n Parameters\n ----------\n key : callable, scalar, or tuple\n The global row index to retrieve data from.\n\n Returns\n -------\n modin.pandas.DataFrame or modin.pandas.Series\n Located dataset.\n\n See Also\n --------\n pandas.DataFrame.loc\n \"\"\"\n raise NotImplementedError(\"Implemented by subclasses\")\n\n def __setitem__(self, key, item): # pragma: no cover\n \"\"\"\n Assign `item` value to dataset located by `key`.\n\n Parameters\n ----------\n key : callable or tuple\n The global row numbers to assign data to.\n item : modin.pandas.DataFrame, modin.pandas.Series or scalar\n Value that should be assigned to located dataset.\n\n See Also\n --------\n pandas.DataFrame.iloc\n \"\"\"\n raise NotImplementedError(\"Implemented by subclasses\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._get_pandas_object_from_qc_view__LocationIndexerBase._get_pandas_object_from_qc_view.return.res_df_squeeze_axis_axis_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._get_pandas_object_from_qc_view__LocationIndexerBase._get_pandas_object_from_qc_view.return.res_df_squeeze_axis_axis_", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 397, "span_ids": ["_LocationIndexerBase._get_pandas_object_from_qc_view"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocationIndexerBase(ClassLogger):\n\n def _get_pandas_object_from_qc_view(\n self,\n qc_view,\n row_multiindex_full_lookup: bool,\n col_multiindex_full_lookup: bool,\n row_scalar: bool,\n col_scalar: bool,\n ndim: int,\n ):\n \"\"\"\n Convert the query compiler view to the appropriate pandas object.\n\n Parameters\n ----------\n qc_view : BaseQueryCompiler\n Query compiler to convert.\n row_multiindex_full_lookup : bool\n See _multiindex_possibly_contains_key.__doc__.\n col_multiindex_full_lookup : bool\n See _multiindex_possibly_contains_key.__doc__.\n row_scalar : bool\n Whether indexer for rows is scalar.\n col_scalar : bool\n Whether indexer for columns is scalar.\n ndim : {0, 1, 2}\n Number of dimensions in dataset to be retrieved.\n\n Returns\n -------\n modin.pandas.DataFrame or modin.pandas.Series\n The pandas object with the data from the query compiler view.\n\n Notes\n -----\n Usage of `slice(None)` as a lookup is a hack to pass information about\n full-axis grab without computing actual indices that triggers lazy computations.\n Ideally, this API should get rid of using slices as indexers and either use a\n common ``Indexer`` object or range and ``np.ndarray`` only.\n \"\"\"\n if ndim == 2:\n return self.df.__constructor__(query_compiler=qc_view)\n if isinstance(self.df, Series) and not row_scalar:\n return self.df.__constructor__(query_compiler=qc_view)\n\n if isinstance(self.df, Series):\n axis = 0\n elif ndim == 0:\n axis = None\n else:\n # We are in the case where ndim == 1\n # The axis we squeeze on depends on whether we are looking for an exact\n # value or a subset of rows and columns. Knowing if we have a full MultiIndex\n # lookup or scalar lookup can help us figure out whether we need to squeeze\n # on the row or column index.\n axis = (\n None\n if (col_scalar and row_scalar)\n or (row_multiindex_full_lookup and col_multiindex_full_lookup)\n else 1\n if col_scalar or col_multiindex_full_lookup\n else 0\n )\n\n res_df = self.df.__constructor__(query_compiler=qc_view)\n return res_df.squeeze(axis=axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._setitem_positional__LocationIndexerBase._setitem_positional.if_axis_0_.else_.self__write_items_row_loo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._setitem_positional__LocationIndexerBase._setitem_positional.if_axis_0_.else_.self__write_items_row_loo", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 442, "span_ids": ["_LocationIndexerBase._setitem_positional"], "tokens": 498}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocationIndexerBase(ClassLogger):\n\n def _setitem_positional(self, row_lookup, col_lookup, item, axis=None):\n \"\"\"\n Assign `item` value to located dataset.\n\n Parameters\n ----------\n row_lookup : slice or scalar\n The global row index to write item to.\n col_lookup : slice or scalar\n The global col index to write item to.\n item : DataFrame, Series or scalar\n The new item needs to be set. It can be any shape that's\n broadcast-able to the product of the lookup tables.\n axis : {None, 0, 1}, default: None\n If not None, it means that whole axis is used to assign a value.\n 0 means assign to whole column, 1 means assign to whole row.\n If None, it means that partial assignment is done on both axes.\n \"\"\"\n # Convert slices to indices for the purposes of application.\n # TODO (devin-petersohn): Apply to slice without conversion to list\n if isinstance(row_lookup, slice):\n row_lookup = range(len(self.qc.index))[row_lookup]\n if isinstance(col_lookup, slice):\n col_lookup = range(len(self.qc.columns))[col_lookup]\n # This is True when we dealing with assignment of a full column. This case\n # should be handled in a fastpath with `df[col] = item`.\n if axis == 0:\n assert len(col_lookup) == 1\n self.df[self.df.columns[col_lookup][0]] = item\n # This is True when we are assigning to a full row. We want to reuse the setitem\n # mechanism to operate along only one axis for performance reasons.\n elif axis == 1:\n if hasattr(item, \"_query_compiler\"):\n if isinstance(item, DataFrame):\n item = item.squeeze(axis=0)\n item = item._query_compiler\n assert len(row_lookup) == 1\n new_qc = self.qc.setitem(1, self.qc.index[row_lookup[0]], item)\n self.df._create_or_update_from_compiler(new_qc, inplace=True)\n # Assignment to both axes.\n else:\n if not is_scalar(item):\n item = broadcast_item(self.df, row_lookup, col_lookup, item)\n self._write_items(row_lookup, col_lookup, item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._write_items__LocationIndexerBase._write_items.self_df__create_or_update": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._write_items__LocationIndexerBase._write_items.self_df__create_or_update", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 444, "end_line": 458, "span_ids": ["_LocationIndexerBase._write_items"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocationIndexerBase(ClassLogger):\n\n def _write_items(self, row_lookup, col_lookup, item):\n \"\"\"\n Perform remote write and replace blocks.\n\n Parameters\n ----------\n row_lookup : slice or scalar\n The global row index to write item to.\n col_lookup : slice or scalar\n The global col index to write item to.\n item : numpy.ndarray\n The new item value that needs to be assigned to `self`.\n \"\"\"\n new_qc = self.qc.write_items(row_lookup, col_lookup, item)\n self.df._create_or_update_from_compiler(new_qc, inplace=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_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._determine_setitem_axis__LocationIndexerBase._determine_setitem_axis.return.axis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._determine_setitem_axis__LocationIndexerBase._determine_setitem_axis.return.axis", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 460, "end_line": 511, "span_ids": ["_LocationIndexerBase._determine_setitem_axis"], "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 _LocationIndexerBase(ClassLogger):\n\n def _determine_setitem_axis(self, row_lookup, col_lookup, row_scalar, col_scalar):\n \"\"\"\n Determine an axis along which we should do an assignment.\n\n Parameters\n ----------\n row_lookup : slice or list\n Indexer for rows.\n col_lookup : slice or list\n Indexer for columns.\n row_scalar : bool\n Whether indexer for rows is scalar or not.\n col_scalar : bool\n Whether indexer for columns is scalar or not.\n\n Returns\n -------\n int or None\n None if this will be a both axis assignment, number of axis to assign in other cases.\n\n Notes\n -----\n axis = 0: column assignment df[col] = item\n axis = 1: row assignment df.loc[row] = item\n axis = None: assignment along both axes\n \"\"\"\n if self.df.shape == (1, 1):\n return None if not (row_scalar ^ col_scalar) else 1 if row_scalar else 0\n\n def get_axis(axis):\n return self.qc.index if axis == 0 else self.qc.columns\n\n row_lookup_len, col_lookup_len = [\n len(lookup)\n if not isinstance(lookup, slice)\n else compute_sliced_len(lookup, len(get_axis(i)))\n for i, lookup in enumerate([row_lookup, col_lookup])\n ]\n\n if col_lookup_len == 1 and row_lookup_len == 1:\n axis = None\n elif (\n row_lookup_len == len(self.qc.index)\n and col_lookup_len == 1\n and isinstance(self.df, DataFrame)\n ):\n axis = 0\n elif col_lookup_len == len(self.qc.columns) and row_lookup_len == 1:\n axis = 1\n else:\n axis = None\n return axis", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._parse_row_and_column_locators__LocationIndexerBase._parse_row_and_column_locators.return.row_loc_col_loc__comput": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._parse_row_and_column_locators__LocationIndexerBase._parse_row_and_column_locators.return.row_loc_col_loc__comput", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 513, "end_line": 548, "span_ids": ["_LocationIndexerBase._parse_row_and_column_locators"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocationIndexerBase(ClassLogger):\n\n def _parse_row_and_column_locators(self, tup):\n \"\"\"\n Unpack the user input for getitem and setitem and compute ndim.\n\n loc[a] -> ([a], :), 1D\n loc[[a,b]] -> ([a,b], :),\n loc[a,b] -> ([a], [b]), 0D\n\n Parameters\n ----------\n tup : tuple\n User input to unpack.\n\n Returns\n -------\n row_loc : scalar or list\n Row locator(s) as a scalar or List.\n col_list : scalar or list\n Column locator(s) as a scalar or List.\n ndim : {0, 1, 2}\n Number of dimensions of located dataset.\n \"\"\"\n row_loc, col_loc = slice(None), slice(None)\n\n if is_tuple(tup):\n row_loc = tup[0]\n if len(tup) == 2:\n col_loc = tup[1]\n if len(tup) > 2:\n raise IndexingError(\"Too many indexers\")\n else:\n row_loc = tup\n\n row_loc = row_loc(self.df) if callable(row_loc) else row_loc\n col_loc = col_loc(self.df) if callable(col_loc) else col_loc\n return row_loc, col_loc, _compute_ndim(row_loc, col_loc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._HACK_This_method_bypas__LocationIndexerBase._when_QC_API_would_suppo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._HACK_This_method_bypas__LocationIndexerBase._when_QC_API_would_suppo", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 556, "span_ids": ["_LocationIndexerBase._parse_row_and_column_locators"], "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 _LocationIndexerBase(ClassLogger):\n\n # HACK: This method bypasses regular ``loc/iloc.__getitem__`` flow in order to ensure better\n # performance in the case of boolean masking. The only purpose of this method is to compensate\n # for a lack of backend's indexing API, there is no Query Compiler method allowing masking\n # along both axis when any of the indexers is a boolean. That's why rows and columns masking\n # phases are separate in this case.\n # TODO: Remove this method and handle this case naturally via ``loc/iloc.__getitem__`` flow\n # when QC API would support both-axis masking with boolean indexers.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._handle_boolean_masking__LocationIndexerBase._handle_boolean_masking.return.type_self_masked_df_sl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._handle_boolean_masking__LocationIndexerBase._handle_boolean_masking.return.type_self_masked_df_sl", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 557, "end_line": 585, "span_ids": ["_LocationIndexerBase._handle_boolean_masking"], "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 _LocationIndexerBase(ClassLogger):\n def _handle_boolean_masking(self, row_loc, col_loc):\n \"\"\"\n Retrieve dataset according to the boolean mask for rows and an indexer for columns.\n\n In comparison with the regular ``loc/iloc.__getitem__`` flow this method efficiently\n masks rows with a Modin Series boolean mask without materializing it (if the selected\n execution implements such masking).\n\n Parameters\n ----------\n row_loc : modin.pandas.Series of bool dtype\n Boolean mask to index rows with.\n col_loc : object\n An indexer along column axis.\n\n Returns\n -------\n modin.pandas.DataFrame or modin.pandas.Series\n Located dataset.\n \"\"\"\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=not isinstance(row_loc, Series),\n extra_log=f\"Only ``modin.pandas.Series`` boolean masks are acceptable, got: {type(row_loc)}\",\n )\n masked_df = self.df.__constructor__(\n query_compiler=self.qc.getitem_array(row_loc._query_compiler)\n )\n # Passing `slice(None)` as a row indexer since we've just applied it\n return type(self)(masked_df)[(slice(None), col_loc)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._multiindex_possibly_contains_key__LocationIndexerBase._multiindex_possibly_contains_key.return.isinstance_key_tuple_an": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocationIndexerBase._multiindex_possibly_contains_key__LocationIndexerBase._multiindex_possibly_contains_key.return.isinstance_key_tuple_an", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 587, "end_line": 618, "span_ids": ["_LocationIndexerBase._multiindex_possibly_contains_key"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocationIndexerBase(ClassLogger):\n\n def _multiindex_possibly_contains_key(self, axis, key):\n \"\"\"\n Determine if a MultiIndex row/column possibly contains a key.\n\n Check to see if the current DataFrame has a MultiIndex row/column and if it does,\n check to see if the key is potentially a full key-lookup such that the number of\n levels match up with the length of the tuple key.\n\n Parameters\n ----------\n axis : {0, 1}\n 0 for row, 1 for column.\n key : Any\n Lookup key for MultiIndex row/column.\n\n Returns\n -------\n bool\n If the MultiIndex possibly contains the given key.\n\n Notes\n -----\n This function only returns False if we have a partial key lookup. It's\n possible that this function returns True for a key that does NOT exist\n since we only check the length of the `key` tuple to match the number\n of levels in the MultiIndex row/colunmn.\n \"\"\"\n if not self.qc.has_multiindex(axis=axis):\n return False\n\n multiindex = self.df.index if axis == 0 else self.df.columns\n return isinstance(key, tuple) and len(key) == len(multiindex.levels)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer__LocIndexer.__getitem__.return.self__helper_for__getitem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer__LocIndexer.__getitem__.return.self__helper_for__getitem", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 621, "end_line": 671, "span_ids": ["_LocIndexer.__getitem__", "_LocIndexer"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocIndexer(_LocationIndexerBase):\n \"\"\"\n An indexer for modin_df.loc[] functionality.\n\n Parameters\n ----------\n modin_df : modin.pandas.DataFrame\n DataFrame to operate on.\n \"\"\"\n\n def __getitem__(self, key):\n \"\"\"\n Retrieve dataset according to `key`.\n\n Parameters\n ----------\n key : callable, scalar, or tuple\n The global row index to retrieve data from.\n\n Returns\n -------\n modin.pandas.DataFrame or modin.pandas.Series\n Located dataset.\n\n See Also\n --------\n pandas.DataFrame.loc\n \"\"\"\n if self.df.empty:\n return self.df._default_to_pandas(lambda df: df.loc[key])\n if isinstance(key, tuple):\n key = self._validate_key_length(key)\n if (\n isinstance(key, tuple)\n and len(key) == 2\n and all((is_scalar(k) for k in key))\n and self.qc.has_multiindex(axis=0)\n ):\n # __getitem__ has no way to distinguish between\n # loc[('level_one_key', level_two_key')] and\n # loc['level_one_key', 'column_name']. It's possible for both to be valid\n # when we have a multiindex on axis=0, and it seems pandas uses\n # interpretation 1 if that's possible. Do the same.\n locators = self._parse_row_and_column_locators((key, slice(None)))\n try:\n return self._helper_for__getitem__(key, *locators)\n except KeyError:\n pass\n return self._helper_for__getitem__(\n key, *self._parse_row_and_column_locators(key)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._helper_for__getitem____LocIndexer._helper_for__getitem__.if_.if_.elif_not_isinstance_row_l.result.index.result_index_droplevel_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._helper_for__getitem____LocIndexer._helper_for__getitem__.if_.if_.elif_not_isinstance_row_l.result.index.result_index_droplevel_li", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 673, "end_line": 751, "span_ids": ["_LocIndexer._helper_for__getitem__"], "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 _LocIndexer(_LocationIndexerBase):\n\n def _helper_for__getitem__(self, key, row_loc, col_loc, ndim):\n \"\"\"\n Retrieve dataset according to `key`, row_loc, and col_loc.\n\n Parameters\n ----------\n key : callable, scalar, or tuple\n The global row index to retrieve data from.\n row_loc : callable, scalar, or slice\n Row locator(s) as a scalar or List.\n col_loc : callable, scalar, or slice\n Row locator(s) as a scalar or List.\n ndim : int\n The number of dimensions of the returned object.\n\n Returns\n -------\n modin.pandas.DataFrame or modin.pandas.Series\n Located dataset.\n \"\"\"\n row_scalar = is_scalar(row_loc)\n col_scalar = is_scalar(col_loc)\n\n # The thought process here is that we should check to see that we have a full key lookup\n # for a MultiIndex DataFrame. If that's the case, then we should not drop any levels\n # since our resulting intermediate dataframe will have dropped these for us already.\n # Thus, we need to make sure we don't try to drop these levels again. The logic here is\n # kind of hacked together. Ideally, we should handle this properly in the lower-level\n # implementations, but this will have to be engineered properly later.\n row_multiindex_full_lookup = self._multiindex_possibly_contains_key(\n axis=0, key=row_loc\n )\n col_multiindex_full_lookup = self._multiindex_possibly_contains_key(\n axis=1, key=col_loc\n )\n levels_already_dropped = (\n row_multiindex_full_lookup or col_multiindex_full_lookup\n )\n\n if isinstance(row_loc, Series) and is_boolean_array(row_loc):\n return self._handle_boolean_masking(row_loc, col_loc)\n\n qc_view = self.qc.take_2d_labels(row_loc, col_loc)\n result = self._get_pandas_object_from_qc_view(\n qc_view,\n row_multiindex_full_lookup,\n col_multiindex_full_lookup,\n row_scalar,\n col_scalar,\n ndim,\n )\n\n if isinstance(result, Series):\n result._parent = self.df\n result._parent_axis = 0\n\n col_loc_as_list = [col_loc] if col_scalar else col_loc\n row_loc_as_list = [row_loc] if row_scalar else row_loc\n # Pandas drops the levels that are in the `loc`, so we have to as well.\n if (\n isinstance(result, (Series, DataFrame))\n and result._query_compiler.has_multiindex()\n and not levels_already_dropped\n ):\n if (\n isinstance(result, Series)\n and not isinstance(col_loc_as_list, slice)\n and all(\n col_loc_as_list[i] in result.index.levels[i]\n for i in range(len(col_loc_as_list))\n )\n ):\n result.index = result.index.droplevel(list(range(len(col_loc_as_list))))\n elif not isinstance(row_loc_as_list, slice) and all(\n not isinstance(row_loc_as_list[i], slice)\n and row_loc_as_list[i] in result.index.levels[i]\n for i in range(len(row_loc_as_list))\n ):\n result.index = result.index.droplevel(list(range(len(row_loc_as_list))))\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_modin-project__modin/modin/pandas/indexing.py__LocIndexer._helper_for__getitem__.None_3__LocIndexer._helper_for__getitem__.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._helper_for__getitem__.None_3__LocIndexer._helper_for__getitem__.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 752, "end_line": 772, "span_ids": ["_LocIndexer._helper_for__getitem__"], "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 _LocIndexer(_LocationIndexerBase):\n\n def _helper_for__getitem__(self, key, row_loc, col_loc, ndim):\n # ... other code\n if (\n isinstance(result, DataFrame)\n and not isinstance(col_loc_as_list, slice)\n and not levels_already_dropped\n and result._query_compiler.has_multiindex(axis=1)\n and all(\n col_loc_as_list[i] in result.columns.levels[i]\n for i in range(len(col_loc_as_list))\n )\n ):\n result.columns = result.columns.droplevel(list(range(len(col_loc_as_list))))\n # This is done for cases where the index passed in has other state, like a\n # frequency in the case of DateTimeIndex.\n if (\n row_loc is not None\n and isinstance(col_loc, slice)\n and col_loc == slice(None)\n and isinstance(key, pandas.Index)\n ):\n result.index = key\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_modin-project__modin/modin/pandas/indexing.py__LocIndexer.__setitem____LocIndexer.__setitem__.if_ndims_1_and_append_.else_.self__set_item_existing_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer.__setitem____LocIndexer.__setitem__.if_ndims_1_and_append_.else_.self__set_item_existing_l", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 774, "end_line": 816, "span_ids": ["_LocIndexer.__setitem__"], "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 _LocIndexer(_LocationIndexerBase):\n\n def __setitem__(self, key, item):\n \"\"\"\n Assign `item` value to dataset located by `key`.\n\n Parameters\n ----------\n key : callable or tuple\n The global row index to assign data to.\n item : modin.pandas.DataFrame, modin.pandas.Series or scalar\n Value that should be assigned to located dataset.\n\n See Also\n --------\n pandas.DataFrame.loc\n \"\"\"\n if self.df.empty:\n\n def _loc(df):\n df.loc[key] = item\n return df\n\n self.df._update_inplace(\n new_query_compiler=self.df._default_to_pandas(_loc)._query_compiler\n )\n return\n row_loc, col_loc, ndims = self._parse_row_and_column_locators(key)\n append_axis = self._check_missing_loc(row_loc, col_loc)\n if ndims >= 1 and append_axis is not None:\n # We enter this codepath if we're either appending a row or a column\n if append_axis:\n # Appending at least one new column\n if is_scalar(col_loc):\n col_loc = [col_loc]\n self._setitem_with_new_columns(row_loc, col_loc, item)\n else:\n # Appending at most one new row\n if is_scalar(row_loc) or len(row_loc) == 1:\n index = self.qc.index.insert(len(self.qc.index), row_loc)\n self.qc = self.qc.reindex(labels=index, axis=0, fill_value=0)\n self.df._update_inplace(new_query_compiler=self.qc)\n self._set_item_existing_loc(row_loc, col_loc, item)\n else:\n self._set_item_existing_loc(row_loc, col_loc, item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._setitem_with_new_columns__LocIndexer._setitem_with_new_columns.self__set_item_existing_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._setitem_with_new_columns__LocIndexer._setitem_with_new_columns.self__set_item_existing_l", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 818, "end_line": 852, "span_ids": ["_LocIndexer._setitem_with_new_columns"], "tokens": 361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocIndexer(_LocationIndexerBase):\n\n def _setitem_with_new_columns(self, row_loc, col_loc, item):\n \"\"\"\n Assign `item` value to dataset located by `row_loc` and `col_loc` with new columns.\n\n Parameters\n ----------\n row_loc : scalar, slice, list, array or tuple\n Row locator.\n col_loc : scalar, slice, list, array or tuple\n Columns locator.\n item : modin.pandas.DataFrame, modin.pandas.Series or scalar\n Value that should be assigned to located dataset.\n \"\"\"\n if is_list_like(item) and not isinstance(item, (DataFrame, Series)):\n item = np.array(item)\n if len(item.shape) == 1:\n if item.shape[0] != len(col_loc):\n raise ValueError(\n \"Must have equal len keys and value when setting with an iterable\"\n )\n else:\n if item.shape != (len(row_loc), len(col_loc)):\n raise ValueError(\n \"Must have equal len keys and value when setting with an iterable\"\n )\n common_label_loc = np.isin(col_loc, self.qc.columns.values)\n if not all(common_label_loc):\n # In this case we have some new cols and some old ones\n columns = self.qc.columns\n for i in range(len(common_label_loc)):\n if not common_label_loc[i]:\n columns = columns.insert(len(columns), col_loc[i])\n self.qc = self.qc.reindex(labels=columns, axis=1, fill_value=np.NaN)\n self.df._update_inplace(new_query_compiler=self.qc)\n self._set_item_existing_loc(row_loc, np.array(col_loc), item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._set_item_existing_loc__LocIndexer._set_item_existing_loc.self__setitem_positional_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._set_item_existing_loc__LocIndexer._set_item_existing_loc.self__setitem_positional_", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 854, "end_line": 891, "span_ids": ["_LocIndexer._set_item_existing_loc"], "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 _LocIndexer(_LocationIndexerBase):\n\n def _set_item_existing_loc(self, row_loc, col_loc, item):\n \"\"\"\n Assign `item` value to dataset located by `row_loc` and `col_loc` with existing rows and columns.\n\n Parameters\n ----------\n row_loc : scalar, slice, list, array or tuple\n Row locator.\n col_loc : scalar, slice, list, array or tuple\n Columns locator.\n item : modin.pandas.DataFrame, modin.pandas.Series or scalar\n Value that should be assigned to located dataset.\n \"\"\"\n if (\n isinstance(row_loc, Series)\n and is_boolean_array(row_loc)\n and is_scalar(item)\n ):\n new_qc = self.df._query_compiler.setitem_bool(\n row_loc._query_compiler, col_loc, item\n )\n self.df._update_inplace(new_qc)\n return\n\n row_lookup, col_lookup = self.qc.get_positions_from_labels(row_loc, col_loc)\n if isinstance(item, np.ndarray) and is_boolean_array(row_loc):\n # fix for 'test_loc_series'; np.log(Series) returns nd.array instead\n # of Series as it was before (`Series.__array_wrap__` is removed)\n # otherwise incompatible shapes are obtained\n item = item.take(row_lookup)\n self._setitem_positional(\n row_lookup,\n col_lookup,\n item,\n axis=self._determine_setitem_axis(\n row_lookup, col_lookup, is_scalar(row_loc), is_scalar(col_loc)\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_modin-project__modin/modin/pandas/indexing.py__LocIndexer._check_missing_loc__LocIndexer._check_missing_loc.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._check_missing_loc__LocIndexer._check_missing_loc.return.None", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 893, "end_line": 932, "span_ids": ["_LocIndexer._check_missing_loc"], "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": "class _LocIndexer(_LocationIndexerBase):\n\n def _check_missing_loc(self, row_loc, col_loc):\n \"\"\"\n Help `__setitem__` compute whether an axis needs appending.\n\n Parameters\n ----------\n row_loc : scalar, slice, list, array or tuple\n Row locator.\n col_loc : scalar, slice, list, array or tuple\n Columns locator.\n\n Returns\n -------\n int or None :\n 0 if new row, 1 if new column, None if neither.\n \"\"\"\n if is_scalar(row_loc):\n return 0 if row_loc not in self.qc.index else None\n elif isinstance(row_loc, list):\n missing_labels = self._compute_enlarge_labels(\n pandas.Index(row_loc), self.qc.index\n )\n if len(missing_labels) > 1:\n # We cast to list to copy pandas' error:\n # In pandas, we get: KeyError: [a, b,...] not in index\n # If we don't convert to list we get: KeyError: [a b ...] not in index\n raise KeyError(\"{} not in index\".format(list(missing_labels)))\n if (\n not (is_list_like(row_loc) or isinstance(row_loc, slice))\n and row_loc not in self.qc.index\n ):\n return 0\n if (\n isinstance(col_loc, list)\n and len(pandas.Index(col_loc).difference(self.qc.columns)) >= 1\n ):\n return 1\n if is_scalar(col_loc) and col_loc not in self.qc.columns:\n return 1\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_modin-project__modin/modin/pandas/indexing.py__LocIndexer._compute_enlarge_labels__LocIndexer._compute_enlarge_labels.return.nan_labels": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__LocIndexer._compute_enlarge_labels__LocIndexer._compute_enlarge_labels.return.nan_labels", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 934, "end_line": 973, "span_ids": ["_LocIndexer._compute_enlarge_labels"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _LocIndexer(_LocationIndexerBase):\n\n def _compute_enlarge_labels(self, locator, base_index):\n \"\"\"\n Help to _enlarge_axis, compute common labels and extra labels.\n\n Parameters\n ----------\n locator : pandas.Index\n Index from locator.\n base_index : pandas.Index\n Current index.\n\n Returns\n -------\n nan_labels : pandas.Index\n The labels that need to be added.\n \"\"\"\n # base_index_type can be pd.Index or pd.DatetimeIndex\n # depending on user input and pandas behavior\n # See issue #2264\n base_as_index = pandas.Index(list(base_index))\n locator_as_index = pandas.Index(list(locator))\n\n if locator_as_index.inferred_type == \"boolean\":\n if len(locator_as_index) != len(base_as_index):\n raise ValueError(\n f\"Item wrong length {len(locator_as_index)} instead of {len(base_as_index)}!\"\n )\n common_labels = base_as_index[locator_as_index]\n nan_labels = pandas.Index([])\n else:\n common_labels = locator_as_index.intersection(base_as_index)\n nan_labels = locator_as_index.difference(base_as_index)\n\n if len(common_labels) == 0:\n raise KeyError(\n \"None of [{labels}] are in the [{base_index_name}]\".format(\n labels=list(locator_as_index), base_index_name=base_as_index\n )\n )\n return nan_labels", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer__iLocIndexer.__getitem__.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer__iLocIndexer.__getitem__.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 976, "end_line": 1043, "span_ids": ["_iLocIndexer", "_iLocIndexer.__getitem__"], "tokens": 477}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _iLocIndexer(_LocationIndexerBase):\n \"\"\"\n An indexer for modin_df.iloc[] functionality.\n\n Parameters\n ----------\n modin_df : modin.pandas.DataFrame\n DataFrame to operate on.\n \"\"\"\n\n def __getitem__(self, key):\n \"\"\"\n Retrieve dataset according to `key`.\n\n Parameters\n ----------\n key : callable or tuple\n The global row numbers to retrieve data from.\n\n Returns\n -------\n DataFrame or Series\n Located dataset.\n\n See Also\n --------\n pandas.DataFrame.iloc\n \"\"\"\n if self.df.empty:\n return self.df._default_to_pandas(lambda df: df.iloc[key])\n if isinstance(key, tuple):\n key = self._validate_key_length(key)\n row_loc, col_loc, ndim = self._parse_row_and_column_locators(key)\n row_scalar = is_scalar(row_loc)\n col_scalar = is_scalar(col_loc)\n self._check_dtypes(row_loc)\n self._check_dtypes(col_loc)\n\n if isinstance(row_loc, Series) and is_boolean_array(row_loc):\n return self._handle_boolean_masking(row_loc, col_loc)\n\n row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)\n if isinstance(row_lookup, slice):\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=row_lookup != slice(None),\n extra_log=f\"Only None-slices are acceptable as a slice argument in masking, got: {row_lookup}\",\n )\n row_lookup = None\n if isinstance(col_lookup, slice):\n ErrorMessage.catch_bugs_and_request_email(\n failure_condition=col_lookup != slice(None),\n extra_log=f\"Only None-slices are acceptable as a slice argument in masking, got: {col_lookup}\",\n )\n col_lookup = None\n qc_view = self.qc.take_2d_positional(row_lookup, col_lookup)\n result = self._get_pandas_object_from_qc_view(\n qc_view,\n row_multiindex_full_lookup=False,\n col_multiindex_full_lookup=False,\n row_scalar=row_scalar,\n col_scalar=col_scalar,\n ndim=ndim,\n )\n\n if isinstance(result, Series):\n result._parent = self.df\n result._parent_axis = 0\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_modin-project__modin/modin/pandas/indexing.py__iLocIndexer.__setitem____iLocIndexer.__setitem__.self__setitem_positional_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer.__setitem____iLocIndexer.__setitem__.self__setitem_positional_", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1045, "end_line": 1084, "span_ids": ["_iLocIndexer.__setitem__"], "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 _iLocIndexer(_LocationIndexerBase):\n\n def __setitem__(self, key, item):\n \"\"\"\n Assign `item` value to dataset located by `key`.\n\n Parameters\n ----------\n key : callable or tuple\n The global row numbers to assign data to.\n item : modin.pandas.DataFrame, modin.pandas.Series or scalar\n Value that should be assigned to located dataset.\n\n See Also\n --------\n pandas.DataFrame.iloc\n \"\"\"\n if self.df.empty:\n\n def _iloc(df):\n df.iloc[key] = item\n return df\n\n self.df._update_inplace(\n new_query_compiler=self.df._default_to_pandas(_iloc)._query_compiler\n )\n return\n row_loc, col_loc, _ = self._parse_row_and_column_locators(key)\n row_scalar = is_scalar(row_loc)\n col_scalar = is_scalar(col_loc)\n self._check_dtypes(row_loc)\n self._check_dtypes(col_loc)\n\n row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)\n self._setitem_positional(\n row_lookup,\n col_lookup,\n item,\n axis=self._determine_setitem_axis(\n row_lookup, col_lookup, row_scalar, col_scalar\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_modin-project__modin/modin/pandas/indexing.py__iLocIndexer._compute_lookup__iLocIndexer._compute_lookup.return.lookups": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer._compute_lookup__iLocIndexer._compute_lookup.return.lookups", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1086, "end_line": 1149, "span_ids": ["_iLocIndexer._compute_lookup"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _iLocIndexer(_LocationIndexerBase):\n\n def _compute_lookup(self, row_loc, col_loc):\n \"\"\"\n Compute index and column labels from index and column integer locators.\n\n Parameters\n ----------\n row_loc : slice, list, array or tuple\n Row locator.\n col_loc : slice, list, array or tuple\n Columns locator.\n\n Returns\n -------\n row_lookup : slice(None) if full axis grab, pandas.RangeIndex if repetition is detected, numpy.ndarray otherwise\n List of index labels.\n col_lookup : slice(None) if full axis grab, pandas.RangeIndex if repetition is detected, numpy.ndarray otherwise\n List of columns labels.\n\n Notes\n -----\n Usage of `slice(None)` as a resulting lookup is a hack to pass information about\n full-axis grab without computing actual indices that triggers lazy computations.\n Ideally, this API should get rid of using slices as indexers and either use a\n common ``Indexer`` object or range and ``np.ndarray`` only.\n \"\"\"\n lookups = []\n for axis, axis_loc in enumerate((row_loc, col_loc)):\n if is_scalar(axis_loc):\n axis_loc = np.array([axis_loc])\n if isinstance(axis_loc, slice):\n axis_lookup = (\n axis_loc\n if axis_loc == slice(None)\n else pandas.RangeIndex(\n *axis_loc.indices(len(self.qc.get_axis(axis)))\n )\n )\n elif is_range_like(axis_loc):\n axis_lookup = pandas.RangeIndex(\n axis_loc.start, axis_loc.stop, axis_loc.step\n )\n elif is_boolean_array(axis_loc):\n axis_lookup = boolean_mask_to_numeric(axis_loc)\n else:\n if isinstance(axis_loc, pandas.Index):\n axis_loc = axis_loc.values\n elif is_list_like(axis_loc) and not isinstance(axis_loc, np.ndarray):\n # `Index.__getitem__` works much faster with numpy arrays than with python lists,\n # so although we lose some time here on converting to numpy, `Index.__getitem__`\n # speedup covers the loss that we gain here.\n axis_loc = np.array(axis_loc, dtype=np.int64)\n # Relatively fast check allows us to not trigger `self.qc.get_axis()` computation\n # if there're no negative indices and so they don't not depend on the axis length.\n if isinstance(axis_loc, np.ndarray) and not (axis_loc < 0).any():\n axis_lookup = axis_loc\n else:\n axis_lookup = pandas.RangeIndex(len(self.qc.get_axis(axis)))[\n axis_loc\n ]\n\n if isinstance(axis_lookup, pandas.Index) and not is_range_like(axis_lookup):\n axis_lookup = axis_lookup.values\n lookups.append(axis_lookup)\n return lookups", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer._check_dtypes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/indexing.py__iLocIndexer._check_dtypes_", "embedding": null, "metadata": {"file_path": "modin/pandas/indexing.py", "file_name": "indexing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1151, "end_line": 1172, "span_ids": ["_iLocIndexer._check_dtypes"], "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 _iLocIndexer(_LocationIndexerBase):\n\n def _check_dtypes(self, locator):\n \"\"\"\n Check that `locator` is an integer scalar, integer slice, integer list or array of booleans.\n\n Parameters\n ----------\n locator : scalar, list, slice or array\n Object to check.\n\n Raises\n ------\n ValueError\n If check fails.\n \"\"\"\n is_int = is_integer(locator)\n is_int_slice = is_integer_slice(locator)\n is_int_arr = is_integer_array(locator)\n is_bool_arr = is_boolean_array(locator)\n\n if not any([is_int, is_int_slice, is_int_arr, is_bool_arr]):\n raise ValueError(_ILOC_INT_ONLY_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_modin-project__modin/modin/pandas/io.py_from___future___import_an_from_modin_utils_import__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_from___future___import_an_from_modin_utils_import__", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 69, "span_ids": ["docstring"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations\n\nfrom collections import OrderedDict\nimport csv\nimport inspect\nimport pandas\nfrom pandas.io.parsers import TextFileReader\nfrom pandas.io.parsers.readers import _c_parser_defaults\nfrom pandas._libs.lib import no_default, NoDefault\nfrom pandas._typing import (\n CompressionOptions,\n CSVEngine,\n DtypeArg,\n ReadCsvBuffer,\n FilePath,\n StorageOptions,\n IntStrT,\n ReadBuffer,\n IndexLabel,\n ConvertersArg,\n ParseDatesArg,\n XMLParsers,\n DtypeBackend,\n)\nimport pathlib\nimport pickle\nfrom typing import (\n Union,\n IO,\n AnyStr,\n Sequence,\n Dict,\n List,\n Optional,\n Any,\n Literal,\n Hashable,\n Callable,\n Iterable,\n Pattern,\n Iterator,\n)\n\nfrom modin.error_message import ErrorMessage\nfrom modin.logging import ClassLogger, enable_logging\nfrom .dataframe import DataFrame\nfrom .series import Series\nfrom modin.utils import _inherit_docstrings", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py__read__read.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py__read__read.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 99, "span_ids": ["_read"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _read(**kwargs):\n \"\"\"\n Read csv file from local disk.\n\n Parameters\n ----------\n **kwargs : dict\n Keyword arguments in pandas.read_csv.\n\n Returns\n -------\n modin.pandas.DataFrame\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n squeeze = kwargs.pop(\"squeeze\", False)\n pd_obj = FactoryDispatcher.read_csv(**kwargs)\n # This happens when `read_csv` returns a TextFileReader object for iterating through\n if isinstance(pd_obj, TextFileReader):\n reader = pd_obj.read\n pd_obj.read = lambda *args, **kwargs: DataFrame(\n query_compiler=reader(*args, **kwargs)\n )\n return pd_obj\n result = DataFrame(query_compiler=pd_obj)\n if squeeze:\n return result.squeeze(axis=1)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_xml_read_xml.return.DataFrame_pandas_read_xml": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_xml_read_xml.return.DataFrame_pandas_read_xml", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 125, "span_ids": ["read_xml"], "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": "@_inherit_docstrings(pandas.read_xml, apilink=\"pandas.read_xml\")\n@enable_logging\ndef read_xml(\n path_or_buffer: FilePath | ReadBuffer[bytes] | ReadBuffer[str],\n *,\n xpath: str = \"./*\",\n namespaces: dict[str, str] | None = None,\n elems_only: bool = False,\n attrs_only: bool = False,\n names: Sequence[str] | None = None,\n dtype: DtypeArg | None = None,\n converters: ConvertersArg | None = None,\n parse_dates: ParseDatesArg | None = None,\n encoding: str | None = \"utf-8\",\n parser: XMLParsers = \"lxml\",\n stylesheet: FilePath | ReadBuffer[bytes] | ReadBuffer[str] | None = None,\n iterparse: dict[str, list[str]] | None = None,\n compression: CompressionOptions = \"infer\",\n storage_options: StorageOptions = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n) -> DataFrame:\n ErrorMessage.default_to_pandas(\"read_xml\")\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n return DataFrame(pandas.read_xml(**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_modin-project__modin/modin/pandas/io.py_read_csv_read_csv.return._read_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_csv_read_csv.return._read_kwargs_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 196, "span_ids": ["read_csv"], "tokens": 651}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.read_csv, apilink=\"pandas.read_csv\")\n@enable_logging\ndef read_csv(\n filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str],\n *,\n sep: str | None | NoDefault = no_default,\n delimiter: str | None | NoDefault = None,\n # Column and Index Locations and Names\n header: int | Sequence[int] | None | Literal[\"infer\"] = \"infer\",\n names: Sequence[Hashable] | None | NoDefault = no_default,\n index_col: IndexLabel | Literal[False] | None = None,\n usecols=None,\n # General Parsing Configuration\n dtype: DtypeArg | None = None,\n engine: CSVEngine | None = None,\n converters=None,\n true_values=None,\n false_values=None,\n skipinitialspace: bool = False,\n skiprows=None,\n skipfooter: int = 0,\n nrows: int | None = None,\n # NA and Missing Data Handling\n na_values=None,\n keep_default_na: bool = True,\n na_filter: bool = True,\n verbose: bool = False,\n skip_blank_lines: bool = True,\n # Datetime Handling\n parse_dates=None,\n infer_datetime_format: bool = no_default,\n keep_date_col: bool = False,\n date_parser=no_default,\n date_format=None,\n dayfirst: bool = False,\n cache_dates: bool = True,\n # Iteration\n iterator: bool = False,\n chunksize: int | None = None,\n # Quoting, Compression, and File Format\n compression: CompressionOptions = \"infer\",\n thousands: str | None = None,\n decimal: str = \".\",\n lineterminator: str | None = None,\n quotechar: str = '\"',\n quoting: int = csv.QUOTE_MINIMAL,\n doublequote: bool = True,\n escapechar: str | None = None,\n comment: str | None = None,\n encoding: str | None = None,\n encoding_errors: str | None = \"strict\",\n dialect: str | csv.Dialect | None = None,\n # Error Handling\n on_bad_lines=\"error\",\n # Internal\n delim_whitespace: bool = False,\n low_memory=_c_parser_defaults[\"low_memory\"],\n memory_map: bool = False,\n float_precision: Literal[\"high\", \"legacy\"] | None = None,\n storage_options: StorageOptions = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n) -> DataFrame | TextFileReader:\n # ISSUE #2408: parse parameter shared with pandas read_csv and read_table and update with provided args\n _pd_read_csv_signature = {\n val.name for val in inspect.signature(pandas.read_csv).parameters.values()\n }\n _, _, _, f_locals = inspect.getargvalues(inspect.currentframe())\n kwargs = {k: v for k, v in f_locals.items() if k in _pd_read_csv_signature}\n return _read(**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_modin-project__modin/modin/pandas/io.py_read_table_read_table.return._read_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_table_read_table.return._read_kwargs_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 269, "span_ids": ["read_table"], "tokens": 680}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.read_table, apilink=\"pandas.read_table\")\n@enable_logging\ndef read_table(\n filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str],\n *,\n sep: str | None | NoDefault = no_default,\n delimiter: str | None | NoDefault = None,\n # Column and Index Locations and Names\n header: int | Sequence[int] | None | Literal[\"infer\"] = \"infer\",\n names: Sequence[Hashable] | None | NoDefault = no_default,\n index_col: IndexLabel | Literal[False] | None = None,\n usecols=None,\n # General Parsing Configuration\n dtype: DtypeArg | None = None,\n engine: CSVEngine | None = None,\n converters=None,\n true_values=None,\n false_values=None,\n skipinitialspace: bool = False,\n skiprows=None,\n skipfooter: int = 0,\n nrows: int | None = None,\n # NA and Missing Data Handling\n na_values=None,\n keep_default_na: bool = True,\n na_filter: bool = True,\n verbose: bool = False,\n skip_blank_lines: bool = True,\n # Datetime Handling\n parse_dates=False,\n infer_datetime_format: bool = no_default,\n keep_date_col: bool = False,\n date_parser=no_default,\n date_format: str = None,\n dayfirst: bool = False,\n cache_dates: bool = True,\n # Iteration\n iterator: bool = False,\n chunksize: int | None = None,\n # Quoting, Compression, and File Format\n compression: CompressionOptions = \"infer\",\n thousands: str | None = None,\n decimal: str = \".\",\n lineterminator: str | None = None,\n quotechar: str = '\"',\n quoting: int = csv.QUOTE_MINIMAL,\n doublequote: bool = True,\n escapechar: str | None = None,\n comment: str | None = None,\n encoding: str | None = None,\n encoding_errors: str | None = \"strict\",\n dialect: str | csv.Dialect | None = None,\n # Error Handling\n on_bad_lines=\"error\",\n # Internal\n delim_whitespace=False,\n low_memory=_c_parser_defaults[\"low_memory\"],\n memory_map: bool = False,\n float_precision: str | None = None,\n storage_options: StorageOptions = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n) -> DataFrame | TextFileReader:\n # ISSUE #2408: parse parameter shared with pandas read_csv and read_table and update with provided args\n _pd_read_table_signature = {\n val.name for val in inspect.signature(pandas.read_table).parameters.values()\n }\n _, _, _, f_locals = inspect.getargvalues(inspect.currentframe())\n if f_locals.get(\"sep\", sep) is False or f_locals.get(\"sep\", sep) is no_default:\n f_locals[\"sep\"] = \"\\t\"\n kwargs = {k: v for k, v in f_locals.items() if k in _pd_read_table_signature}\n return _read(**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_modin-project__modin/modin/pandas/io.py_read_parquet_read_parquet.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_parquet_read_parquet.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 272, "end_line": 300, "span_ids": ["read_parquet"], "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": "@_inherit_docstrings(pandas.read_parquet, apilink=\"pandas.read_parquet\")\n@enable_logging\ndef read_parquet(\n path,\n engine: str = \"auto\",\n columns: list[str] | None = None,\n storage_options: StorageOptions = None,\n use_nullable_dtypes: bool = no_default,\n dtype_backend=no_default,\n **kwargs,\n) -> DataFrame:\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n if engine == \"fastparquet\" and dtype_backend is not no_default:\n raise ValueError(\n \"The 'dtype_backend' argument is not supported for the fastparquet engine\"\n )\n\n return DataFrame(\n query_compiler=FactoryDispatcher.read_parquet(\n path=path,\n engine=engine,\n columns=columns,\n storage_options=storage_options,\n use_nullable_dtypes=use_nullable_dtypes,\n dtype_backend=dtype_backend,\n **kwargs,\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_modin-project__modin/modin/pandas/io.py_read_json_read_json.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_json_read_json.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 330, "span_ids": ["read_json"], "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": "@_inherit_docstrings(pandas.read_json, apilink=\"pandas.read_json\")\n@enable_logging\ndef read_json(\n path_or_buf,\n *,\n orient: str | None = None,\n typ: Literal[\"frame\", \"series\"] = \"frame\",\n dtype: DtypeArg | None = None,\n convert_axes=None,\n convert_dates: bool | list[str] = True,\n keep_default_dates: bool = True,\n precise_float: bool = False,\n date_unit: str | None = None,\n encoding: str | None = None,\n encoding_errors: str | None = \"strict\",\n lines: bool = False,\n chunksize: int | None = None,\n compression: CompressionOptions = \"infer\",\n nrows: int | None = None,\n storage_options: StorageOptions = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n engine=\"ujson\",\n) -> DataFrame | Series | pandas.io.json._json.JsonReader:\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_json(**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_modin-project__modin/modin/pandas/io.py_read_gbq_read_gbq.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_gbq_read_gbq.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 355, "span_ids": ["read_gbq"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.read_gbq, apilink=\"pandas.read_gbq\")\n@enable_logging\ndef read_gbq(\n query: str,\n project_id: str | None = None,\n index_col: str | None = None,\n col_order: list[str] | None = None,\n reauth: bool = False,\n auth_local_webserver: bool = True,\n dialect: str | None = None,\n location: str | None = None,\n configuration: dict[str, Any] | None = None,\n credentials=None,\n use_bqstorage_api: bool | None = None,\n max_results: int | None = None,\n progress_bar_type: str | None = None,\n) -> DataFrame:\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n kwargs.update(kwargs.pop(\"kwargs\", {}))\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_gbq(**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_modin-project__modin/modin/pandas/io.py_read_html_read_html.return._DataFrame_query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_html_read_html.return._DataFrame_query_compiler", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 358, "end_line": 388, "span_ids": ["read_html"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.read_html, apilink=\"pandas.read_html\")\n@enable_logging\ndef read_html(\n io,\n *,\n match: str | Pattern = \".+\",\n flavor: str | None = None,\n header: int | Sequence[int] | None = None,\n index_col: int | Sequence[int] | None = None,\n skiprows: int | Sequence[int] | slice | None = None,\n attrs: dict[str, str] | None = None,\n parse_dates: bool = False,\n thousands: str | None = \",\",\n encoding: str | None = None,\n decimal: str = \".\",\n converters: dict | None = None,\n na_values: Iterable[object] | None = None,\n keep_default_na: bool = True,\n displayed_only: bool = True,\n extract_links: Literal[None, \"header\", \"footer\", \"body\", \"all\"] = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n) -> list[DataFrame]: # noqa: PR01, RT01, D200\n \"\"\"\n Read HTML tables into a ``DataFrame`` object.\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n qcs = FactoryDispatcher.read_html(**kwargs)\n return [DataFrame(query_compiler=qc) for qc in qcs]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_clipboard_read_clipboard.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_clipboard_read_clipboard.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 391, "end_line": 406, "span_ids": ["read_clipboard"], "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": "@_inherit_docstrings(pandas.read_clipboard, apilink=\"pandas.read_clipboard\")\n@enable_logging\ndef read_clipboard(\n sep=r\"\\s+\",\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n **kwargs,\n): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Read text from clipboard and pass to read_csv.\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n kwargs.update(kwargs.pop(\"kwargs\", {}))\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_clipboard(**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_modin-project__modin/modin/pandas/io.py_read_excel_read_excel.if_isinstance_intermediat.else_.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_excel_read_excel.if_isinstance_intermediat.else_.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 456, "span_ids": ["read_excel"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.read_excel, apilink=\"pandas.read_excel\")\n@enable_logging\ndef read_excel(\n io,\n sheet_name: str | int | list[IntStrT] | None = 0,\n *,\n header: int | Sequence[int] | None = 0,\n names: list[str] | None = None,\n index_col: int | Sequence[int] | None = None,\n usecols: int\n | str\n | Sequence[int]\n | Sequence[str]\n | Callable[[str], bool]\n | None = None,\n dtype: DtypeArg | None = None,\n engine: Literal[(\"xlrd\", \"openpyxl\", \"odf\", \"pyxlsb\")] | None = None,\n converters: dict[str, Callable] | dict[int, Callable] | None = None,\n true_values: Iterable[Hashable] | None = None,\n false_values: Iterable[Hashable] | None = None,\n skiprows: Sequence[int] | int | Callable[[int], object] | None = None,\n nrows: int | None = None,\n na_values=None,\n keep_default_na: bool = True,\n na_filter: bool = True,\n verbose: bool = False,\n parse_dates: list | dict | bool = False,\n date_parser: Union[Callable, NoDefault] = no_default,\n date_format=None,\n thousands: str | None = None,\n decimal: str = \".\",\n comment: str | None = None,\n skipfooter: int = 0,\n storage_options: StorageOptions = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n) -> DataFrame | dict[IntStrT, DataFrame]:\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n intermediate = FactoryDispatcher.read_excel(**kwargs)\n if isinstance(intermediate, (OrderedDict, dict)):\n parsed = type(intermediate)()\n for key in intermediate.keys():\n parsed[key] = DataFrame(query_compiler=intermediate.get(key))\n return parsed\n else:\n return DataFrame(query_compiler=intermediate)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_hdf_read_hdf.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_hdf_read_hdf.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 459, "end_line": 482, "span_ids": ["read_hdf"], "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": "@_inherit_docstrings(pandas.read_hdf, apilink=\"pandas.read_hdf\")\n@enable_logging\ndef read_hdf(\n path_or_buf,\n key=None,\n mode: str = \"r\",\n errors: str = \"strict\",\n where=None,\n start: Optional[int] = None,\n stop: Optional[int] = None,\n columns=None,\n iterator=False,\n chunksize: Optional[int] = None,\n **kwargs,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Read data from the store into DataFrame.\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n kwargs.update(kwargs.pop(\"kwargs\", {}))\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_hdf(**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_modin-project__modin/modin/pandas/io.py_read_feather_read_feather.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_feather_read_feather.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 498, "span_ids": ["read_feather"], "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": "@_inherit_docstrings(pandas.read_feather, apilink=\"pandas.read_feather\")\n@enable_logging\ndef read_feather(\n path,\n columns: Sequence[Hashable] | None = None,\n use_threads: bool = True,\n storage_options: StorageOptions = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n):\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_feather(**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_modin-project__modin/modin/pandas/io.py_read_stata_read_stata.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_stata_read_stata.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 501, "end_line": 522, "span_ids": ["read_stata"], "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": "@_inherit_docstrings(pandas.read_stata)\n@enable_logging\ndef read_stata(\n filepath_or_buffer,\n *,\n convert_dates: bool = True,\n convert_categoricals: bool = True,\n index_col: str | None = None,\n convert_missing: bool = False,\n preserve_dtypes: bool = True,\n columns: Sequence[str] | None = None,\n order_categoricals: bool = True,\n chunksize: int | None = None,\n iterator: bool = False,\n compression: CompressionOptions = \"infer\",\n storage_options: StorageOptions = None,\n) -> DataFrame | pandas.io.stata.StataReader:\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_stata(**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_modin-project__modin/modin/pandas/io.py_read_sas_read_sas.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_sas_read_sas.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 525, "end_line": 552, "span_ids": ["read_sas"], "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": "@_inherit_docstrings(pandas.read_sas, apilink=\"pandas.read_sas\")\n@enable_logging\ndef read_sas(\n filepath_or_buffer,\n *,\n format: str | None = None,\n index: Hashable | None = None,\n encoding: str | None = None,\n chunksize: int | None = None,\n iterator: bool = False,\n compression: CompressionOptions = \"infer\",\n) -> DataFrame | pandas.io.sas.sasreader.ReaderBase: # noqa: PR01, RT01, D200\n \"\"\"\n Read SAS files stored as either XPORT or SAS7BDAT format files.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(\n query_compiler=FactoryDispatcher.read_sas(\n filepath_or_buffer=filepath_or_buffer,\n format=format,\n index=index,\n encoding=encoding,\n chunksize=chunksize,\n iterator=iterator,\n compression=compression,\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_modin-project__modin/modin/pandas/io.py_read_pickle_read_sql.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_pickle_read_sql.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 555, "end_line": 596, "span_ids": ["read_sql", "read_pickle"], "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": "@_inherit_docstrings(pandas.read_pickle, apilink=\"pandas.read_pickle\")\n@enable_logging\ndef read_pickle(\n filepath_or_buffer,\n compression: CompressionOptions = \"infer\",\n storage_options: StorageOptions = None,\n):\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_pickle(**kwargs))\n\n\n@_inherit_docstrings(pandas.read_sql, apilink=\"pandas.read_sql\")\n@enable_logging\ndef read_sql(\n sql,\n con,\n index_col=None,\n coerce_float=True,\n params=None,\n parse_dates=None,\n columns=None,\n chunksize=None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n dtype=None,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Read SQL query or database table into a DataFrame.\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n if kwargs.get(\"chunksize\") is not None:\n ErrorMessage.default_to_pandas(\"Parameters provided [chunksize]\")\n df_gen = pandas.read_sql(**kwargs)\n return (\n DataFrame(query_compiler=FactoryDispatcher.from_pandas(df)) for df in df_gen\n )\n return DataFrame(query_compiler=FactoryDispatcher.read_sql(**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_modin-project__modin/modin/pandas/io.py_read_fwf_read_fwf.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_fwf_read_fwf.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 599, "end_line": 628, "span_ids": ["read_fwf"], "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": "@_inherit_docstrings(pandas.read_fwf, apilink=\"pandas.read_fwf\")\n@enable_logging\ndef read_fwf(\n filepath_or_buffer: Union[str, pathlib.Path, IO[AnyStr]],\n *,\n colspecs=\"infer\",\n widths=None,\n infer_nrows=100,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n **kwds,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Read a table of fixed-width formatted lines into DataFrame.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n from pandas.io.parsers.base_parser import parser_defaults\n\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n kwargs.update(kwargs.pop(\"kwds\", {}))\n target_kwargs = parser_defaults.copy()\n target_kwargs.update(kwargs)\n pd_obj = FactoryDispatcher.read_fwf(**target_kwargs)\n # When `read_fwf` returns a TextFileReader object for iterating through\n if isinstance(pd_obj, TextFileReader):\n reader = pd_obj.read\n pd_obj.read = lambda *args, **kwargs: DataFrame(\n query_compiler=reader(*args, **kwargs)\n )\n return pd_obj\n return DataFrame(query_compiler=pd_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_modin-project__modin/modin/pandas/io.py_read_sql_table_read_sql_table.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_sql_table_read_sql_table.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 631, "end_line": 651, "span_ids": ["read_sql_table"], "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": "@_inherit_docstrings(pandas.read_sql_table, apilink=\"pandas.read_sql_table\")\n@enable_logging\ndef read_sql_table(\n table_name,\n con,\n schema=None,\n index_col=None,\n coerce_float=True,\n parse_dates=None,\n columns=None,\n chunksize=None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Read SQL database table into a DataFrame.\n \"\"\"\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_sql_table(**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_modin-project__modin/modin/pandas/io.py_read_sql_query_read_sql_query.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_sql_query_read_sql_query.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 654, "end_line": 671, "span_ids": ["read_sql_query"], "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": "@_inherit_docstrings(pandas.read_sql_query, apilink=\"pandas.read_sql_query\")\n@enable_logging\ndef read_sql_query(\n sql,\n con,\n index_col: str | list[str] | None = None,\n coerce_float: bool = True,\n params: list[str] | dict[str, str] | None = None,\n parse_dates: list[str] | dict[str, str] | None = None,\n chunksize: int | None = None,\n dtype: DtypeArg | None = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n) -> DataFrame | Iterator[DataFrame]:\n _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())\n\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(query_compiler=FactoryDispatcher.read_sql_query(**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_modin-project__modin/modin/pandas/io.py_to_pickle_to_pickle.return.FactoryDispatcher_to_pick": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_to_pickle_to_pickle.return.FactoryDispatcher_to_pick", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 674, "end_line": 693, "span_ids": ["to_pickle"], "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": "@_inherit_docstrings(pandas.to_pickle)\n@enable_logging\ndef to_pickle(\n obj: Any,\n filepath_or_buffer,\n compression: CompressionOptions = \"infer\",\n protocol: int = pickle.HIGHEST_PROTOCOL,\n storage_options: StorageOptions = None,\n) -> None:\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n if isinstance(obj, DataFrame):\n obj = obj._query_compiler\n return FactoryDispatcher.to_pickle(\n obj,\n filepath_or_buffer=filepath_or_buffer,\n compression=compression,\n protocol=protocol,\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_spss_read_spss.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_spss_read_spss.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 696, "end_line": 716, "span_ids": ["read_spss"], "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": "@_inherit_docstrings(pandas.read_spss, apilink=\"pandas.read_spss\")\n@enable_logging\ndef read_spss(\n path: Union[str, pathlib.Path],\n usecols: Optional[Sequence[str]] = None,\n convert_categoricals: bool = True,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n): # noqa: PR01, RT01, D200\n \"\"\"\n Load an SPSS file from the file path, returning a DataFrame.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n return DataFrame(\n query_compiler=FactoryDispatcher.read_spss(\n path=path,\n usecols=usecols,\n convert_categoricals=convert_categoricals,\n dtype_backend=dtype_backend,\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_modin-project__modin/modin/pandas/io.py_json_normalize_json_normalize.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_json_normalize_json_normalize.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 719, "end_line": 739, "span_ids": ["json_normalize"], "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": "@_inherit_docstrings(pandas.json_normalize, apilink=\"pandas.json_normalize\")\n@enable_logging\ndef json_normalize(\n data: Union[Dict, List[Dict]],\n record_path: Optional[Union[str, List]] = None,\n meta: Optional[Union[str, List[Union[str, List[str]]]]] = None,\n meta_prefix: Optional[str] = None,\n record_prefix: Optional[str] = None,\n errors: Optional[str] = \"raise\",\n sep: str = \".\",\n max_level: Optional[int] = None,\n) -> DataFrame: # noqa: PR01, RT01, D200\n \"\"\"\n Normalize semi-structured JSON data into a flat table.\n \"\"\"\n ErrorMessage.default_to_pandas(\"json_normalize\")\n return DataFrame(\n pandas.json_normalize(\n data, record_path, meta, meta_prefix, record_prefix, errors, sep, max_level\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_modin-project__modin/modin/pandas/io.py_read_orc_read_orc.return.DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_read_orc_read_orc.return.DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 742, "end_line": 756, "span_ids": ["read_orc"], "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": "@_inherit_docstrings(pandas.read_orc, apilink=\"pandas.read_orc\")\n@enable_logging\ndef read_orc(\n path,\n columns: Optional[List[str]] = None,\n dtype_backend: Union[DtypeBackend, NoDefault] = no_default,\n **kwargs,\n) -> DataFrame: # noqa: PR01, RT01, D200\n \"\"\"\n Load an ORC object from the file path, returning a DataFrame.\n \"\"\"\n ErrorMessage.default_to_pandas(\"read_orc\")\n return DataFrame(\n pandas.read_orc(path, columns=columns, dtype_backend=dtype_backend, **kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_HDFStore_HDFStore.__getattribute__.return.method": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_HDFStore_HDFStore.__getattribute__.return.method", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 759, "end_line": 813, "span_ids": ["HDFStore.__getattribute__", "HDFStore"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.HDFStore)\nclass HDFStore(ClassLogger, pandas.HDFStore): # noqa: PR01, D200\n \"\"\"\n Dict-like IO interface for storing pandas objects in PyTables.\n \"\"\"\n\n _return_modin_dataframe = True\n\n def __getattribute__(self, item):\n default_behaviors = [\"__init__\", \"__class__\"]\n method = super(HDFStore, self).__getattribute__(item)\n if item not in default_behaviors:\n if callable(method):\n\n def return_handler(*args, **kwargs):\n \"\"\"\n Replace the default behavior of methods with inplace kwarg.\n\n Returns\n -------\n A Modin DataFrame in place of a pandas DataFrame, or the same\n return type as pandas.HDFStore.\n\n Notes\n -----\n This function will replace all of the arguments passed to\n methods of HDFStore with the pandas equivalent. It will convert\n Modin DataFrame to pandas DataFrame, etc. Currently, pytables\n does not accept Modin DataFrame objects, so we must convert to\n pandas.\n \"\"\"\n from modin.utils import to_pandas\n\n # We don't want to constantly be giving this error message for\n # internal methods.\n if item[0] != \"_\":\n ErrorMessage.default_to_pandas(\"`{}`\".format(item))\n args = [\n to_pandas(arg) if isinstance(arg, DataFrame) else arg\n for arg in args\n ]\n kwargs = {\n k: to_pandas(v) if isinstance(v, DataFrame) else v\n for k, v in kwargs.items()\n }\n obj = super(HDFStore, self).__getattribute__(item)(*args, **kwargs)\n if self._return_modin_dataframe and isinstance(\n obj, pandas.DataFrame\n ):\n return DataFrame(obj)\n return obj\n\n # We replace the method with `return_handler` for inplace operations\n method = return_handler\n return method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_ExcelFile_ExcelFile.__getattribute__.return.method": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py_ExcelFile_ExcelFile.__getattribute__.return.method", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 816, "end_line": 864, "span_ids": ["ExcelFile.__getattribute__", "ExcelFile"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.ExcelFile)\nclass ExcelFile(ClassLogger, pandas.ExcelFile): # noqa: PR01, D200\n \"\"\"\n Class for parsing tabular excel sheets into DataFrame objects.\n \"\"\"\n\n def __getattribute__(self, item):\n default_behaviors = [\"__init__\", \"__class__\"]\n method = super(ExcelFile, self).__getattribute__(item)\n if item not in default_behaviors:\n if callable(method):\n\n def return_handler(*args, **kwargs):\n \"\"\"\n Replace the default behavior of methods with inplace kwarg.\n\n Returns\n -------\n A Modin DataFrame in place of a pandas DataFrame, or the same\n return type as pandas.ExcelFile.\n\n Notes\n -----\n This function will replace all of the arguments passed to\n methods of ExcelFile with the pandas equivalent. It will convert\n Modin DataFrame to pandas DataFrame, etc.\n \"\"\"\n from modin.utils import to_pandas\n\n # We don't want to constantly be giving this error message for\n # internal methods.\n if item[0] != \"_\":\n ErrorMessage.default_to_pandas(\"`{}`\".format(item))\n args = [\n to_pandas(arg) if isinstance(arg, DataFrame) else arg\n for arg in args\n ]\n kwargs = {\n k: to_pandas(v) if isinstance(v, DataFrame) else v\n for k, v in kwargs.items()\n }\n obj = super(ExcelFile, self).__getattribute__(item)(*args, **kwargs)\n if isinstance(obj, pandas.DataFrame):\n return DataFrame(obj)\n return obj\n\n # We replace the method with `return_handler` for inplace operations\n method = return_handler\n return method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py___all___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/io.py___all___", "embedding": null, "metadata": {"file_path": "modin/pandas/io.py", "file_name": "io.py", "file_type": "text/x-python", "category": "implementation", "start_line": 867, "end_line": 893, "span_ids": ["impl"], "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": "__all__ = [\n \"ExcelFile\",\n \"HDFStore\",\n \"json_normalize\",\n \"read_clipboard\",\n \"read_csv\",\n \"read_excel\",\n \"read_feather\",\n \"read_fwf\",\n \"read_gbq\",\n \"read_hdf\",\n \"read_html\",\n \"read_json\",\n \"read_orc\",\n \"read_parquet\",\n \"read_pickle\",\n \"read_sas\",\n \"read_spss\",\n \"read_sql\",\n \"read_sql_query\",\n \"read_sql_table\",\n \"read_stata\",\n \"read_table\",\n \"read_xml\",\n \"to_pickle\",\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/iterator.py_from_collections_abc_impo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/iterator.py_from_collections_abc_impo_", "embedding": null, "metadata": {"file_path": "modin/pandas/iterator.py", "file_name": "iterator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 72, "span_ids": ["PartitionIterator.__iter__", "PartitionIterator", "docstring", "PartitionIterator.__next__", "PartitionIterator.__init__"], "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": "from collections.abc import Iterator\n\n\nclass PartitionIterator(Iterator):\n \"\"\"\n Iterator on partitioned data.\n\n Parameters\n ----------\n df : modin.pandas.DataFrame\n The dataframe to iterate over.\n axis : {0, 1}\n Axis to iterate over.\n func : callable\n The function to get inner iterables from each partition.\n \"\"\"\n\n def __init__(self, df, axis, func):\n self.df = df\n self.axis = axis\n self.index_iter = (\n zip(\n iter(slice(None) for _ in range(len(self.df.columns))),\n range(len(self.df.columns)),\n )\n if axis\n else zip(\n range(len(self.df.index)),\n iter(slice(None) for _ in range(len(self.df.index))),\n )\n )\n self.func = func\n\n def __iter__(self):\n \"\"\"\n Implement iterator interface.\n\n Returns\n -------\n PartitionIterator\n Iterator object.\n \"\"\"\n return self\n\n def __next__(self):\n \"\"\"\n Implement iterator interface.\n\n Returns\n -------\n PartitionIterator\n Incremented iterator object.\n \"\"\"\n key = next(self.index_iter)\n df = self.df.iloc[key]\n return self.func(df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/plotting.py_from_pandas_import_plotti_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/plotting.py_from_pandas_import_plotti_", "embedding": null, "metadata": {"file_path": "modin/pandas/plotting.py", "file_name": "plotting.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 77, "span_ids": ["Plotting.__getattribute__", "Plotting.__dir__", "Plotting", "docstring"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from pandas import plotting as pdplot\n\nfrom modin.utils import instancer, to_pandas\nfrom modin.logging import ClassLogger\nfrom .dataframe import DataFrame\n\n\n@instancer\nclass Plotting(ClassLogger):\n \"\"\"Wrapper of pandas plotting module.\"\"\"\n\n def __dir__(self):\n \"\"\"\n Enable tab completion of plotting library.\n\n Returns\n -------\n list\n List of attributes in `self`.\n \"\"\"\n return dir(pdplot)\n\n def __getattribute__(self, item):\n \"\"\"\n Convert any Modin DataFrames in parameters to pandas so that they can be plotted normally.\n\n Parameters\n ----------\n item : str\n Attribute to look for.\n\n Returns\n -------\n object\n If attribute is found in pandas.plotting, and it is a callable, a wrapper function is\n returned which converts its arguments to pandas and calls a function pandas.plotting.`item`\n on these arguments.\n If attribute is found in pandas.plotting but it is not a callable, returns it.\n Otherwise function tries to look for an attribute in `self`.\n \"\"\"\n if hasattr(pdplot, item):\n func = getattr(pdplot, item)\n if callable(func):\n\n def wrap_func(*args, **kwargs):\n \"\"\"Convert Modin DataFrames to pandas then call the function.\"\"\"\n args = tuple(\n arg if not isinstance(arg, DataFrame) else to_pandas(arg)\n for arg in args\n )\n kwargs = {\n kwd: val if not isinstance(val, DataFrame) else to_pandas(val)\n for kwd, val in kwargs.items()\n }\n return func(*args, **kwargs)\n\n return wrap_func\n else:\n return func\n else:\n return object.__getattribute__(self, item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_np_Resampler.__init__.self.__groups.self__get_groups_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_np_Resampler.__init__.self.__groups.self__get_groups_", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 60, "span_ids": ["Resampler.__init__", "Resampler", "docstring"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pandas\nimport pandas.core.resample\nfrom pandas.core.dtypes.common import is_list_like\nfrom pandas._libs.lib import no_default\nfrom typing import Optional\nfrom modin.logging import ClassLogger\nfrom modin.utils import _inherit_docstrings\nfrom modin.pandas.utils import cast_function_modin2pandas\n\n\n@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n def __init__(\n self,\n dataframe,\n rule,\n axis=0,\n closed=None,\n label=None,\n convention=\"start\",\n kind=None,\n on=None,\n level=None,\n origin=\"start_day\",\n offset=None,\n group_keys=no_default,\n ):\n self._dataframe = dataframe\n self._query_compiler = dataframe._query_compiler\n self.axis = self._dataframe._get_axis_number(axis)\n self.resample_kwargs = {\n \"rule\": rule,\n \"axis\": axis,\n \"closed\": closed,\n \"label\": label,\n \"convention\": convention,\n \"kind\": kind,\n \"on\": on,\n \"level\": level,\n \"origin\": origin,\n \"offset\": offset,\n \"group_keys\": group_keys,\n }\n self.__groups = self._get_groups()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler._get_groups_Resampler._get_groups.return.groups": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler._get_groups_Resampler._get_groups.return.groups", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 85, "span_ids": ["Resampler._get_groups"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def _get_groups(self):\n \"\"\"\n Compute the resampled groups.\n\n Returns\n -------\n PandasGroupby\n Groups as specified by resampling arguments.\n \"\"\"\n df = self._dataframe if self.axis == 0 else self._dataframe.T\n groups = df.groupby(\n pandas.Grouper(\n key=self.resample_kwargs[\"on\"],\n freq=self.resample_kwargs[\"rule\"],\n closed=self.resample_kwargs[\"closed\"],\n label=self.resample_kwargs[\"label\"],\n convention=self.resample_kwargs[\"convention\"],\n level=self.resample_kwargs[\"level\"],\n origin=self.resample_kwargs[\"origin\"],\n offset=self.resample_kwargs[\"offset\"],\n ),\n group_keys=self.resample_kwargs[\"group_keys\"],\n )\n return groups", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.__getitem___Resampler.__getitem__.return._get_new_resampler_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.__getitem___Resampler.__getitem__.return._get_new_resampler_key_", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 121, "span_ids": ["Resampler.__getitem__"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def __getitem__(self, key):\n \"\"\"\n Get ``Resampler`` based on `key` columns of original dataframe.\n\n Parameters\n ----------\n key : str or list\n String or list of selections.\n\n Returns\n -------\n modin.pandas.BasePandasDataset\n New ``Resampler`` based on `key` columns subset\n of the original dataframe.\n \"\"\"\n\n def _get_new_resampler(key):\n subset = self._dataframe[key]\n resampler = type(self)(subset, **self.resample_kwargs)\n return resampler\n\n from .series import Series\n\n if isinstance(\n key, (list, tuple, Series, pandas.Series, pandas.Index, np.ndarray)\n ):\n if len(self._dataframe.columns.intersection(key)) != len(set(key)):\n missed_keys = list(set(key).difference(self._dataframe.columns))\n raise KeyError(f\"Columns not found: {str(sorted(missed_keys))[1:-1]}\")\n return _get_new_resampler(list(key))\n\n if key not in self._dataframe:\n raise KeyError(f\"Column not found: {key}\")\n\n return _get_new_resampler(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_modin-project__modin/modin/pandas/resample.py_Resampler.groups_Resampler.get_group.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.groups_Resampler.get_group.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 140, "span_ids": ["Resampler.indices", "Resampler.groups", "Resampler.get_group"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n @property\n def groups(self):\n return self._query_compiler.default_to_pandas(\n lambda df: pandas.DataFrame.resample(df, **self.resample_kwargs).groups\n )\n\n @property\n def indices(self):\n return self._query_compiler.default_to_pandas(\n lambda df: pandas.DataFrame.resample(df, **self.resample_kwargs).indices\n )\n\n def get_group(self, name, obj=None):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_get_group(\n self.resample_kwargs, name, obj\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_modin-project__modin/modin/pandas/resample.py_Resampler.apply_Resampler.apply.if_is_list_like_func_or_.else_.if_len_dataframe_index_.else_.return.dataframe_squeeze_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.apply_Resampler.apply.if_is_list_like_func_or_.else_.if_len_dataframe_index_.else_.return.dataframe_squeeze_", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 165, "span_ids": ["Resampler.apply"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def apply(self, func, *args, **kwargs):\n func = cast_function_modin2pandas(func)\n from .dataframe import DataFrame\n\n if isinstance(self._dataframe, DataFrame):\n query_comp_op = self._query_compiler.resample_app_df\n else:\n query_comp_op = self._query_compiler.resample_app_ser\n\n dataframe = DataFrame(\n query_compiler=query_comp_op(\n self.resample_kwargs,\n func,\n *args,\n **kwargs,\n )\n )\n if is_list_like(func) or isinstance(self._dataframe, DataFrame):\n return dataframe\n else:\n if len(dataframe.index) == 1:\n return dataframe.iloc[0]\n else:\n return dataframe.squeeze()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.aggregate_Resampler.aggregate.if_is_list_like_func_or_.else_.if_len_dataframe_index_.else_.return.dataframe_squeeze_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.aggregate_Resampler.aggregate.if_is_list_like_func_or_.else_.if_len_dataframe_index_.else_.return.dataframe_squeeze_", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 189, "span_ids": ["Resampler.aggregate"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def aggregate(self, func, *args, **kwargs):\n from .dataframe import DataFrame\n\n if isinstance(self._dataframe, DataFrame):\n query_comp_op = self._query_compiler.resample_agg_df\n else:\n query_comp_op = self._query_compiler.resample_agg_ser\n\n dataframe = DataFrame(\n query_compiler=query_comp_op(\n self.resample_kwargs,\n func,\n *args,\n **kwargs,\n )\n )\n if is_list_like(func) or isinstance(self._dataframe, DataFrame):\n return dataframe\n else:\n if len(dataframe.index) == 1:\n return dataframe.iloc[0]\n else:\n return dataframe.squeeze()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.transform_Resampler.asfreq.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.transform_Resampler.asfreq.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 230, "span_ids": ["Resampler.transform", "Resampler.fillna", "Resampler.bfill", "Resampler.pipe", "Resampler.asfreq", "Resampler.ffill", "Resampler.nearest"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def transform(self, arg, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_transform(\n self.resample_kwargs, arg, *args, **kwargs\n )\n )\n\n def pipe(self, func, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_pipe(\n self.resample_kwargs, func, *args, **kwargs\n )\n )\n\n def ffill(self, limit=None):\n return self.fillna(method=\"ffill\", limit=limit)\n\n def bfill(self, limit=None):\n return self.fillna(method=\"bfill\", limit=limit)\n\n def nearest(self, limit=None):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_nearest(\n self.resample_kwargs, limit\n )\n )\n\n def fillna(self, method, limit=None):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_fillna(\n self.resample_kwargs, method, limit\n )\n )\n\n def asfreq(self, fill_value=None):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_asfreq(\n self.resample_kwargs, fill_value\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.interpolate_Resampler.interpolate.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.interpolate_Resampler.interpolate.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 232, "end_line": 256, "span_ids": ["Resampler.interpolate"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def interpolate(\n self,\n method=\"linear\",\n *,\n axis=0,\n limit=None,\n inplace=False,\n limit_direction: Optional[str] = None,\n limit_area=None,\n downcast=None,\n **kwargs,\n ):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_interpolate(\n self.resample_kwargs,\n method,\n axis=axis,\n limit=limit,\n inplace=inplace,\n limit_direction=limit_direction,\n limit_area=limit_area,\n downcast=downcast,\n **kwargs,\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_modin-project__modin/modin/pandas/resample.py_Resampler.count_Resampler.std.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.count_Resampler.std.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 376, "span_ids": ["Resampler.min", "Resampler.std", "Resampler.size", "Resampler.count", "Resampler.max", "Resampler.ohlc", "Resampler.sem", "Resampler.mean", "Resampler.first", "Resampler.nunique", "Resampler.prod", "Resampler.last", "Resampler.median"], "tokens": 734}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def count(self):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_count(self.resample_kwargs)\n )\n\n def nunique(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_nunique(\n self.resample_kwargs, *args, **kwargs\n )\n )\n\n def first(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_first(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def last(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_last(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def max(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_max(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def mean(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_mean(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def median(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_median(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def min(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_min(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def ohlc(self, *args, **kwargs):\n from .dataframe import DataFrame\n\n if isinstance(self._dataframe, DataFrame):\n return DataFrame(\n query_compiler=self._query_compiler.resample_ohlc_df(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n else:\n return DataFrame(\n query_compiler=self._query_compiler.resample_ohlc_ser(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def prod(self, min_count=0, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_prod(\n self.resample_kwargs, min_count=min_count, *args, **kwargs\n )\n )\n\n def size(self):\n from .series import Series\n\n output_series = Series(\n query_compiler=self._query_compiler.resample_size(self.resample_kwargs)\n )\n if not isinstance(self._dataframe, Series):\n # If input is a DataFrame, rename output Series to None\n return output_series.rename(None)\n return output_series\n\n def sem(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_sem(\n self.resample_kwargs,\n *args,\n **kwargs,\n )\n )\n\n def std(self, ddof=1, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_std(\n self.resample_kwargs, *args, ddof=ddof, **kwargs\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_modin-project__modin/modin/pandas/resample.py_Resampler.sum_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/resample.py_Resampler.sum_", "embedding": null, "metadata": {"file_path": "modin/pandas/resample.py", "file_name": "resample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 398, "span_ids": ["Resampler.quantile", "Resampler.var", "Resampler.sum"], "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": "@_inherit_docstrings(pandas.core.resample.Resampler)\nclass Resampler(ClassLogger):\n\n def sum(self, min_count=0, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_sum(\n self.resample_kwargs, min_count=min_count, *args, **kwargs\n )\n )\n\n def var(self, ddof=1, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_var(\n self.resample_kwargs, *args, ddof=ddof, **kwargs\n )\n )\n\n def quantile(self, q=0.5, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.resample_quantile(\n self.resample_kwargs, q, **kwargs\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_modin-project__modin/modin/pandas/series.py_from___future___import_an_if_TYPE_CHECKING_.DataFrame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_from___future___import_an_if_TYPE_CHECKING_.DataFrame", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 47, "span_ids": ["docstring"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations\nimport numpy as np\nimport pandas\nfrom pandas.io.formats.info import SeriesInfo\nfrom pandas.api.types import is_integer\nfrom pandas.core.common import apply_if_callable, is_bool_indexer\nfrom pandas.util._validators import validate_bool_kwarg\nfrom pandas.core.dtypes.common import (\n is_dict_like,\n is_list_like,\n)\nfrom pandas.core.series import _coerce_method\nfrom pandas._libs.lib import no_default, NoDefault\nfrom pandas._typing import IndexKeyFunc, Axis\nfrom typing import Union, Optional, Hashable, TYPE_CHECKING, IO\nimport warnings\n\nfrom modin.utils import (\n _inherit_docstrings,\n to_pandas,\n MODIN_UNNAMED_SERIES_LABEL,\n)\nfrom modin.config import IsExperimental, PersistentPickle\nfrom .base import BasePandasDataset, _ATTRS_NO_LOOKUP\nfrom .iterator import PartitionIterator\nfrom .utils import from_pandas, is_scalar, _doc_binary_op, cast_function_modin2pandas\nfrom .accessor import CachedAccessor, SparseAccessor\nfrom .series_utils import CategoryMethods, StringMethods, DatetimeProperties\n\n\nif TYPE_CHECKING:\n from .dataframe import DataFrame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series_Series._get_name.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series_Series._get_name.return.name", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 159, "span_ids": ["Series.__init__", "Series._get_name", "Series"], "tokens": 791}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n \"\"\"\n Modin distributed representation of `pandas.Series`.\n\n Internally, the data can be divided into partitions in order to parallelize\n computations and utilize the user's hardware as much as possible.\n\n Inherit common for DataFrames and Series functionality from the\n `BasePandasDataset` class.\n\n Parameters\n ----------\n data : modin.pandas.Series, array-like, Iterable, dict, or scalar value, optional\n Contains data stored in Series. If data is a dict, argument order is\n maintained.\n index : array-like or Index (1d), optional\n Values must be hashable and have the same length as `data`.\n dtype : str, np.dtype, or pandas.ExtensionDtype, optional\n Data type for the output Series. If not specified, this will be\n inferred from `data`.\n name : str, optional\n The name to give to the Series.\n copy : bool, default: False\n Copy input data.\n fastpath : bool, default: False\n `pandas` internal parameter.\n query_compiler : BaseQueryCompiler, optional\n A query compiler object to create the Series from.\n \"\"\"\n\n _pandas_class = pandas.Series\n __array_priority__ = pandas.Series.__array_priority__\n\n def __init__(\n self,\n data=None,\n index=None,\n dtype=None,\n name=None,\n copy=None,\n fastpath=False,\n query_compiler=None,\n ):\n from modin.numpy import array\n\n # Siblings are other dataframes that share the same query compiler. We\n # use this list to update inplace when there is a shallow copy.\n self._siblings = []\n if isinstance(data, type(self)):\n query_compiler = data._query_compiler.copy()\n if index is not None:\n if any(i not in data.index for i in index):\n raise NotImplementedError(\n \"Passing non-existent columns or index values to constructor \"\n + \"not yet implemented.\"\n )\n query_compiler = data.loc[index]._query_compiler\n if isinstance(data, array):\n if data._ndim == 2:\n raise ValueError(\"Data must be 1-dimensional\")\n query_compiler = data._query_compiler.copy()\n if index is not None:\n query_compiler.index = index\n if dtype is not None:\n query_compiler = query_compiler.astype(\n {col_name: dtype for col_name in query_compiler.columns}\n )\n if name is None:\n query_compiler.columns = pandas.Index([MODIN_UNNAMED_SERIES_LABEL])\n if query_compiler is None:\n # Defaulting to pandas\n warnings.warn(\n \"Distributing {} object. This may take some time.\".format(type(data))\n )\n if name is None:\n name = MODIN_UNNAMED_SERIES_LABEL\n if isinstance(data, pandas.Series) and data.name is not None:\n name = data.name\n\n query_compiler = from_pandas(\n pandas.DataFrame(\n pandas.Series(\n data=data,\n index=index,\n dtype=dtype,\n name=name,\n copy=copy,\n fastpath=fastpath,\n )\n )\n )._query_compiler\n self._query_compiler = query_compiler.columnarize()\n if name is not None:\n self.name = name\n\n def _get_name(self):\n \"\"\"\n Get the value of the `name` property.\n\n Returns\n -------\n hashable\n \"\"\"\n name = self._query_compiler.columns[0]\n if name == MODIN_UNNAMED_SERIES_LABEL:\n return None\n return 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_modin-project__modin/modin/pandas/series.py_Series._set_name_Series.__delitem__.self_drop_labels_key_inp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._set_name_Series.__delitem__.self_drop_labels_key_inp", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 269, "span_ids": ["Series.__add__", "Series.__array__", "Series.__delitem__", "Series.__copy__", "Series.__radd__", "Series.__contains__", "Series.__and__", "Series.__rand__", "Series._set_name", "Series:7", "Series.__deepcopy__"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _set_name(self, name):\n \"\"\"\n Set the value of the `name` property.\n\n Parameters\n ----------\n name : hashable\n Name value to set.\n \"\"\"\n if name is None:\n name = MODIN_UNNAMED_SERIES_LABEL\n self._query_compiler.columns = [name]\n\n name = property(_get_name, _set_name)\n _parent = None\n # Parent axis denotes axis that was used to select series in a parent dataframe.\n # If _parent_axis == 0, then it means that index axis was used via df.loc[row]\n # indexing operations and assignments should be done to rows of parent.\n # If _parent_axis == 1 it means that column axis was used via df[column] and assignments\n # should be done to columns of parent.\n _parent_axis = 0\n\n @_doc_binary_op(operation=\"addition\", bin_op=\"add\")\n def __add__(self, right):\n return self.add(right)\n\n @_doc_binary_op(operation=\"addition\", bin_op=\"radd\", right=\"left\")\n def __radd__(self, left):\n return self.radd(left)\n\n @_doc_binary_op(operation=\"union\", bin_op=\"and\", right=\"other\")\n def __and__(self, other):\n if isinstance(other, (list, np.ndarray, pandas.Series)):\n return self._default_to_pandas(pandas.Series.__and__, other)\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).__and__(new_other)\n\n @_doc_binary_op(operation=\"union\", bin_op=\"and\", right=\"other\")\n def __rand__(self, other):\n if isinstance(other, (list, np.ndarray, pandas.Series)):\n return self._default_to_pandas(pandas.Series.__rand__, other)\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).__rand__(new_other)\n\n # add `_inherit_docstrings` decorator to force method link addition.\n @_inherit_docstrings(pandas.Series.__array__, apilink=\"pandas.Series.__array__\")\n def __array__(self, dtype=None): # noqa: PR01, RT01, D200\n \"\"\"\n Return the values as a NumPy array.\n \"\"\"\n return super(Series, self).__array__(dtype).flatten()\n\n def __contains__(self, key):\n \"\"\"\n Check if `key` in the `Series.index`.\n\n Parameters\n ----------\n key : hashable\n Key to check the presence in the index.\n\n Returns\n -------\n bool\n \"\"\"\n return key in self.index\n\n def __copy__(self, deep=True):\n \"\"\"\n Return the copy of the Series.\n\n Parameters\n ----------\n deep : bool, default: True\n Whether the copy should be deep or not.\n\n Returns\n -------\n Series\n \"\"\"\n return self.copy(deep=deep)\n\n def __deepcopy__(self, memo=None):\n \"\"\"\n Return the deep copy of the Series.\n\n Parameters\n ----------\n memo : Any, optional\n Deprecated parameter.\n\n Returns\n -------\n Series\n \"\"\"\n return self.copy(deep=True)\n\n def __delitem__(self, key):\n \"\"\"\n Delete item identified by `key` label.\n\n Parameters\n ----------\n key : hashable\n Key to delete.\n \"\"\"\n if key not in self.keys():\n raise KeyError(key)\n self.drop(labels=key, inplace=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_modin-project__modin/modin/pandas/series.py_Series.__divmod___Series.__rfloordiv__.return.self_rfloordiv_right_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__divmod___Series.__rfloordiv__.return.self_rfloordiv_right_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 294, "span_ids": ["Series.__floordiv__", "Series.__rdivmod__", "Series.__rfloordiv__", "Series.__divmod__"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n @_doc_binary_op(\n operation=\"integer division and modulo\",\n bin_op=\"divmod\",\n returns=\"tuple of two Series\",\n )\n def __divmod__(self, right):\n return self.divmod(right)\n\n @_doc_binary_op(\n operation=\"integer division and modulo\",\n bin_op=\"divmod\",\n right=\"left\",\n returns=\"tuple of two Series\",\n )\n def __rdivmod__(self, left):\n return self.rdivmod(left)\n\n @_doc_binary_op(operation=\"integer division\", bin_op=\"floordiv\")\n def __floordiv__(self, right):\n return self.floordiv(right)\n\n @_doc_binary_op(operation=\"integer division\", bin_op=\"floordiv\")\n def __rfloordiv__(self, right):\n return self.rfloordiv(right)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__getattr___Series.__getattr__.try_.except_AttributeError_as_.raise_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__getattr___Series.__getattr__.try_.except_AttributeError_as_.raise_err", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 296, "end_line": 319, "span_ids": ["Series.__getattr__"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def __getattr__(self, key):\n \"\"\"\n Return item identified by `key`.\n\n Parameters\n ----------\n key : hashable\n Key to get.\n\n Returns\n -------\n Any\n\n Notes\n -----\n First try to use `__getattribute__` method. If it fails\n try to get `key` from `Series` fields.\n \"\"\"\n try:\n return object.__getattribute__(self, key)\n except AttributeError as err:\n if key not in _ATTRS_NO_LOOKUP and key in self.index:\n return self[key]\n raise err", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__float___Series.__rpow__.return.self_rpow_left_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__float___Series.__rpow__.return.self_rpow_left_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 384, "span_ids": ["Series:13", "Series.__pow__", "Series.__mul__", "Series.__or__", "Series.__iter__", "Series.__rxor__", "Series.__rpow__", "Series.__xor__", "Series.__rmul__", "Series.__mod__", "Series.__rmod__", "Series.__ror__"], "tokens": 639}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n __float__ = _coerce_method(float)\n __int__ = _coerce_method(int)\n\n def __iter__(self):\n \"\"\"\n Return an iterator of the values.\n\n Returns\n -------\n iterable\n \"\"\"\n return self._to_pandas().__iter__()\n\n @_doc_binary_op(operation=\"modulo\", bin_op=\"mod\")\n def __mod__(self, right):\n return self.mod(right)\n\n @_doc_binary_op(operation=\"modulo\", bin_op=\"mod\", right=\"left\")\n def __rmod__(self, left):\n return self.rmod(left)\n\n @_doc_binary_op(operation=\"multiplication\", bin_op=\"mul\")\n def __mul__(self, right):\n return self.mul(right)\n\n @_doc_binary_op(operation=\"multiplication\", bin_op=\"mul\", right=\"left\")\n def __rmul__(self, left):\n return self.rmul(left)\n\n @_doc_binary_op(operation=\"disjunction\", bin_op=\"or\", right=\"other\")\n def __or__(self, other):\n if isinstance(other, (list, np.ndarray, pandas.Series)):\n return self._default_to_pandas(pandas.Series.__or__, other)\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).__or__(new_other)\n\n @_doc_binary_op(operation=\"disjunction\", bin_op=\"or\", right=\"other\")\n def __ror__(self, other):\n if isinstance(other, (list, np.ndarray, pandas.Series)):\n return self._default_to_pandas(pandas.Series.__ror__, other)\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).__ror__(new_other)\n\n @_doc_binary_op(operation=\"exclusive or\", bin_op=\"xor\", right=\"other\")\n def __xor__(self, other):\n if isinstance(other, (list, np.ndarray, pandas.Series)):\n return self._default_to_pandas(pandas.Series.__xor__, other)\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).__xor__(new_other)\n\n @_doc_binary_op(operation=\"exclusive or\", bin_op=\"xor\", right=\"other\")\n def __rxor__(self, other):\n if isinstance(other, (list, np.ndarray, pandas.Series)):\n return self._default_to_pandas(pandas.Series.__rxor__, other)\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).__rxor__(new_other)\n\n @_doc_binary_op(operation=\"exponential power\", bin_op=\"pow\")\n def __pow__(self, right):\n return self.pow(right)\n\n @_doc_binary_op(operation=\"exponential power\", bin_op=\"pow\", right=\"left\")\n def __rpow__(self, left):\n return self.rpow(left)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__repr___Series.__repr__.return.temp_str_rsplit_n_max": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__repr___Series.__repr__.return.temp_str_rsplit_n_max", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 386, "end_line": 429, "span_ids": ["Series.__repr__"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def __repr__(self):\n \"\"\"\n Return a string representation for a particular Series.\n\n Returns\n -------\n str\n \"\"\"\n num_rows = pandas.get_option(\"display.max_rows\") or 60\n num_cols = pandas.get_option(\"display.max_columns\") or 20\n temp_df = self._build_repr_df(num_rows, num_cols)\n if isinstance(temp_df, pandas.DataFrame) and not temp_df.empty:\n temp_df = temp_df.iloc[:, 0]\n temp_str = repr(temp_df)\n freq_str = (\n \"Freq: {}, \".format(self.index.freqstr)\n if isinstance(self.index, pandas.DatetimeIndex)\n else \"\"\n )\n if self.name is not None:\n name_str = \"Name: {}, \".format(str(self.name))\n else:\n name_str = \"\"\n if len(self.index) > num_rows:\n len_str = \"Length: {}, \".format(len(self.index))\n else:\n len_str = \"\"\n dtype_str = \"dtype: {}\".format(\n str(self.dtype) + \")\"\n if temp_df.empty\n else temp_str.rsplit(\"dtype: \", 1)[-1]\n )\n if len(self) == 0:\n return \"Series([], {}{}{}\".format(freq_str, name_str, dtype_str)\n maxsplit = 1\n if (\n isinstance(temp_df, pandas.Series)\n and temp_df.name is not None\n and temp_df.dtype == \"category\"\n ):\n maxsplit = 2\n return temp_str.rsplit(\"\\n\", maxsplit)[0] + \"\\n{}{}{}{}\".format(\n freq_str, name_str, len_str, dtype_str\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__round___Series.__itruediv__.__truediv__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.__round___Series.__itruediv__.__truediv__", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 431, "end_line": 484, "span_ids": ["Series.__rsub__", "Series.__rtruediv__", "Series.__round__", "Series:17", "Series.__setitem__", "Series.__truediv__", "Series.__sub__"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def __round__(self, decimals=0):\n \"\"\"\n Round each value in a Series to the given number of decimals.\n\n Parameters\n ----------\n decimals : int, default: 0\n Number of decimal places to round to.\n\n Returns\n -------\n Series\n \"\"\"\n return self._create_or_update_from_compiler(\n self._query_compiler.round(decimals=decimals)\n )\n\n def __setitem__(self, key, value):\n \"\"\"\n Set `value` identified by `key` in the Series.\n\n Parameters\n ----------\n key : hashable\n Key to set.\n value : Any\n Value to set.\n \"\"\"\n if isinstance(key, slice):\n self._setitem_slice(key, value)\n else:\n self.loc[key] = value\n\n @_doc_binary_op(operation=\"subtraction\", bin_op=\"sub\")\n def __sub__(self, right):\n return self.sub(right)\n\n @_doc_binary_op(operation=\"subtraction\", bin_op=\"sub\", right=\"left\")\n def __rsub__(self, left):\n return self.rsub(left)\n\n @_doc_binary_op(operation=\"floating division\", bin_op=\"truediv\")\n def __truediv__(self, right):\n return self.truediv(right)\n\n @_doc_binary_op(operation=\"floating division\", bin_op=\"truediv\", right=\"left\")\n def __rtruediv__(self, left):\n return self.rtruediv(left)\n\n __iadd__ = __add__\n __imul__ = __add__\n __ipow__ = __pow__\n __isub__ = __sub__\n __itruediv__ = __truediv__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.values_Series.values.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.values_Series.values.return.data", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 486, "end_line": 505, "span_ids": ["Series.values"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n @property\n def values(self): # noqa: RT01, D200\n \"\"\"\n Return Series as ndarray or ndarray-like depending on the dtype.\n \"\"\"\n import modin.pandas as pd\n\n if isinstance(\n self.dtype, pandas.core.dtypes.dtypes.ExtensionDtype\n ) and not isinstance(self.dtype, pd.CategoricalDtype):\n return self._default_to_pandas(\"values\")\n\n data = self.to_numpy()\n if isinstance(self.dtype, pd.CategoricalDtype):\n from modin.config import ExperimentalNumPyAPI\n\n if ExperimentalNumPyAPI.get():\n data = data._to_numpy()\n data = pd.Categorical(data, dtype=self.dtype)\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.add_Series.add_suffix.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.add_Series.add_suffix.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 507, "end_line": 543, "span_ids": ["Series.add_prefix", "Series.radd", "Series.add", "Series.add_suffix"], "tokens": 385}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def add(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return Addition of series and other, element-wise (binary operator add).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).add(\n new_other, level=level, fill_value=fill_value, axis=axis\n )\n\n def radd(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return Addition of series and other, element-wise (binary operator radd).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).radd(\n new_other, level=level, fill_value=fill_value, axis=axis\n )\n\n def add_prefix(self, prefix, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Prefix labels with string `prefix`.\n \"\"\"\n axis = 0 if axis is None else self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.add_prefix(prefix, axis=axis)\n )\n\n def add_suffix(self, suffix, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Suffix labels with string `suffix`.\n \"\"\"\n axis = 0 if axis is None else self._get_axis_number(axis)\n return self.__constructor__(\n query_compiler=self._query_compiler.add_suffix(suffix, axis=axis)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.aggregate_Series.agg.aggregate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.aggregate_Series.agg.aggregate", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 545, "end_line": 560, "span_ids": ["Series.aggregate", "Series:27"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def aggregate(self, func=None, axis=0, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Aggregate using one or more operations over the specified axis.\n \"\"\"\n\n def error_raiser(msg, exception):\n \"\"\"Convert passed exception to the same type as pandas do and raise it.\"\"\"\n # HACK: to concord with pandas error types by replacing all of the\n # TypeErrors to the AssertionErrors\n exception = exception if exception is not TypeError else AssertionError\n raise exception(msg)\n\n self._validate_function(func, on_invalid=error_raiser)\n return super(Series, self).aggregate(func, axis, *args, **kwargs)\n\n agg = aggregate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.apply_Series.apply.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.apply_Series.apply.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 562, "end_line": 646, "span_ids": ["Series.apply"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def apply(\n self, func, convert_dtype=True, args=(), **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Invoke function on values of Series.\n \"\"\"\n func = cast_function_modin2pandas(func)\n self._validate_function(func)\n # apply and aggregate have slightly different behaviors, so we have to use\n # each one separately to determine the correct return type. In the case of\n # `agg`, the axis is set, but it is not required for the computation, so we use\n # it to determine which function to run.\n if kwargs.pop(\"axis\", None) is not None:\n apply_func = \"agg\"\n else:\n apply_func = \"apply\"\n\n # This is the simplest way to determine the return type, but there are checks\n # in pandas that verify that some results are created. This is a challenge for\n # empty DataFrames, but fortunately they only happen when the `func` type is\n # a list or a dictionary, which means that the return type won't change from\n # type(self), so we catch that error and use `type(self).__name__` for the return\n # type.\n # We create a \"dummy\" `Series` to do the error checking and determining\n # the return type.\n try:\n return_type = type(\n getattr(\n pandas.Series(self[:1].values, index=self.index[:1]), apply_func\n )(func, *args, **kwargs)\n ).__name__\n except Exception:\n return_type = type(self).__name__\n if (\n isinstance(func, str)\n or is_list_like(func)\n or return_type not in [\"DataFrame\", \"Series\"]\n ):\n # use the explicit non-Compat parent to avoid infinite recursion\n result = super(Series, self).apply(\n func,\n axis=0,\n broadcast=None,\n raw=False,\n reduce=None,\n result_type=None,\n convert_dtype=convert_dtype,\n args=args,\n **kwargs,\n )\n else:\n # handle ufuncs and lambdas\n if kwargs or args and not isinstance(func, np.ufunc):\n\n def f(x):\n return func(x, *args, **kwargs)\n\n else:\n f = func\n with np.errstate(all=\"ignore\"):\n if isinstance(f, np.ufunc):\n return f(self)\n\n # The return_type is only a DataFrame when we have a function\n # return a Series object. This is a very particular case that\n # has to be handled by the underlying pandas.Series apply\n # function and not our default applymap call.\n if return_type == \"DataFrame\":\n result = self._query_compiler.apply_on_series(f)\n else:\n result = self.map(f)._query_compiler\n\n if return_type == \"DataFrame\":\n from .dataframe import DataFrame\n\n result = DataFrame(query_compiler=result)\n elif return_type == \"Series\":\n result = self.__constructor__(query_compiler=result)\n if result.name == self.index[0]:\n result.name = None\n elif isinstance(result, type(self._query_compiler)):\n # sometimes result can be not a query_compiler, but scalar (for example\n # for sum or count functions)\n return result.to_pandas().squeeze()\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_modin-project__modin/modin/pandas/series.py_Series.argmax_Series.combine.return.super_Series_self_combi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.argmax_Series.combine.return.super_Series_self_combi", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 648, "end_line": 696, "span_ids": ["Series.combine", "Series.argmax", "Series.argsort", "Series.between", "Series.autocorr", "Series.argmin"], "tokens": 494}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def argmax(self, axis=None, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return int position of the largest value in the Series.\n \"\"\"\n result = self.idxmax(axis=axis, skipna=skipna, *args, **kwargs)\n if np.isnan(result) or result is pandas.NA:\n result = -1\n return result\n\n def argmin(self, axis=None, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return int position of the smallest value in the Series.\n \"\"\"\n result = self.idxmin(axis=axis, skipna=skipna, *args, **kwargs)\n if np.isnan(result) or result is pandas.NA:\n result = -1\n return result\n\n def argsort(self, axis=0, kind=\"quicksort\", order=None): # noqa: PR01, RT01, D200\n \"\"\"\n Return the integer indices that would sort the Series values.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.argsort(\n axis=axis, kind=kind, order=order\n )\n )\n\n def autocorr(self, lag=1): # noqa: PR01, RT01, D200\n \"\"\"\n Compute the lag-N autocorrelation.\n \"\"\"\n return self.corr(self.shift(lag))\n\n def between(self, left, right, inclusive: str = \"both\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return boolean Series equivalent to left <= series <= right.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.between(left, right, inclusive)\n )\n\n def combine(self, other, func, fill_value=None): # noqa: PR01, RT01, D200\n \"\"\"\n Combine the Series with a Series or scalar according to `func`.\n \"\"\"\n return super(Series, self).combine(\n other, lambda s1, s2: s1.combine(s2, func, fill_value=fill_value)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.compare_Series.compare.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.compare_Series.compare.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 698, "end_line": 724, "span_ids": ["Series.compare"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def compare(\n self,\n other: Series,\n align_axis: Union[str, int] = 1,\n keep_shape: bool = False,\n keep_equal: bool = False,\n result_names: tuple = (\"self\", \"other\"),\n ) -> \"Series\": # noqa: PR01, RT01, D200\n \"\"\"\n Compare to another Series and show the differences.\n \"\"\"\n if not isinstance(other, Series):\n raise TypeError(f\"Cannot compare Series to {type(other)}\")\n result = self.to_frame().compare(\n other.to_frame(),\n align_axis=align_axis,\n keep_shape=keep_shape,\n keep_equal=keep_equal,\n result_names=result_names,\n )\n if align_axis == \"columns\" or align_axis == 1:\n # Pandas.DataFrame.Compare returns a dataframe with a multidimensional index object as the\n # columns so we have to change column object back.\n result.columns = pandas.Index([\"self\", \"other\"])\n else:\n result = result.squeeze().rename(None)\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_modin-project__modin/modin/pandas/series.py_Series.corr_Series.corr.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.corr_Series.corr.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 726, "end_line": 774, "span_ids": ["Series.corr"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def corr(self, other, method=\"pearson\", min_periods=None): # noqa: PR01, RT01, D200\n \"\"\"\n Compute correlation with `other` Series, excluding missing values.\n \"\"\"\n if method == \"pearson\":\n this, other = self.align(other, join=\"inner\", copy=False)\n this = self.__constructor__(this)\n other = self.__constructor__(other)\n\n if len(this) == 0:\n return np.nan\n if len(this) != len(other):\n raise ValueError(\"Operands must have same size\")\n\n if min_periods is None:\n min_periods = 1\n\n valid = this.notna() & other.notna()\n if not valid.all():\n this = this[valid]\n other = other[valid]\n if len(this) < min_periods:\n return np.nan\n\n this = this.astype(dtype=\"float64\")\n other = other.astype(dtype=\"float64\")\n this -= this.mean()\n other -= other.mean()\n\n other = other.__constructor__(query_compiler=other._query_compiler.conj())\n result = this * other / (len(this) - 1)\n result = np.array([result.sum()])\n\n stddev_this = ((this * this) / (len(this) - 1)).sum()\n stddev_other = ((other * other) / (len(other) - 1)).sum()\n\n stddev_this = np.array([np.sqrt(stddev_this)])\n stddev_other = np.array([np.sqrt(stddev_other)])\n\n result /= stddev_this * stddev_other\n\n np.clip(result.real, -1, 1, out=result.real)\n if np.iscomplexobj(result):\n np.clip(result.imag, -1, 1, out=result.imag)\n return result[0]\n\n return self.__constructor__(\n query_compiler=self._query_compiler.series_corr(other, method, min_periods)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.count_Series.cov.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.count_Series.cov.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 776, "end_line": 817, "span_ids": ["Series.count", "Series.cov"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def count(self): # noqa: PR01, RT01, D200\n \"\"\"\n Return number of non-NA/null observations in the Series.\n \"\"\"\n return super(Series, self).count()\n\n def cov(\n self, other, min_periods=None, ddof: Optional[int] = 1\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Compute covariance with Series, excluding missing values.\n \"\"\"\n this, other = self.align(other, join=\"inner\", copy=False)\n this = self.__constructor__(this)\n other = self.__constructor__(other)\n if len(this) == 0:\n return np.nan\n\n if len(this) != len(other):\n raise ValueError(\"Operands must have same size\")\n\n if min_periods is None:\n min_periods = 1\n\n valid = this.notna() & other.notna()\n if not valid.all():\n this = this[valid]\n other = other[valid]\n\n if len(this) < min_periods:\n return np.nan\n\n this = this.astype(dtype=\"float64\")\n other = other.astype(dtype=\"float64\")\n\n this -= this.mean()\n other -= other.mean()\n\n other = other.__constructor__(query_compiler=other._query_compiler.conj())\n result = this * other / (len(this) - ddof)\n result = result.sum()\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_modin-project__modin/modin/pandas/series.py_Series.describe_Series.diff.return.super_Series_self_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.describe_Series.diff.return.super_Series_self_diff_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 819, "end_line": 839, "span_ids": ["Series.diff", "Series.describe"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def describe(\n self,\n percentiles=None,\n include=None,\n exclude=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Generate descriptive statistics.\n \"\"\"\n # Pandas ignores the `include` and `exclude` for Series for some reason.\n return super(Series, self).describe(\n percentiles=percentiles,\n include=None,\n exclude=None,\n )\n\n def diff(self, periods=1): # noqa: PR01, RT01, D200\n \"\"\"\n First discrete difference of element.\n \"\"\"\n return super(Series, self).diff(periods=periods, axis=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_modin-project__modin/modin/pandas/series.py_Series.divmod_Series.divmod.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.divmod_Series.divmod.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 841, "end_line": 852, "span_ids": ["Series.divmod"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def divmod(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return Integer division and modulo of series and `other`, element-wise (binary operator `divmod`).\n \"\"\"\n division, modulo = self._query_compiler.divmod(\n other=other, level=level, fill_value=fill_value, axis=axis\n )\n return self.__constructor__(query_compiler=division), self.__constructor__(\n query_compiler=modulo\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.dot_Series.dot.return.self__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.dot_Series.dot.return.self__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 854, "end_line": 890, "span_ids": ["Series.dot"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def dot(self, other): # noqa: PR01, RT01, D200\n \"\"\"\n Compute the dot product between the Series and the columns of `other`.\n \"\"\"\n if isinstance(other, BasePandasDataset):\n common = self.index.union(other.index)\n if len(common) > len(self.index) or len(common) > len(other.index):\n raise ValueError(\"Matrices are not aligned\")\n\n qc = other.reindex(index=common)._query_compiler\n if isinstance(other, Series):\n return self._reduce_dimension(\n query_compiler=self._query_compiler.dot(\n qc, squeeze_self=True, squeeze_other=True\n )\n )\n else:\n return self.__constructor__(\n query_compiler=self._query_compiler.dot(\n qc, squeeze_self=True, squeeze_other=False\n )\n )\n\n other = np.asarray(other)\n if self.shape[0] != other.shape[0]:\n raise ValueError(\n \"Dot product shape mismatch, {} vs {}\".format(self.shape, other.shape)\n )\n\n if len(other.shape) > 1:\n return (\n self._query_compiler.dot(other, squeeze_self=True).to_numpy().squeeze()\n )\n\n return self._reduce_dimension(\n query_compiler=self._query_compiler.dot(other, squeeze_self=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_modin-project__modin/modin/pandas/series.py_Series.drop_duplicates_Series.factorize.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.drop_duplicates_Series.factorize.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 892, "end_line": 952, "span_ids": ["Series.explode", "Series.factorize", "Series.eq", "Series.equals", "Series.drop_duplicates", "Series.dropna", "Series.duplicated"], "tokens": 542}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def drop_duplicates(\n self, *, keep=\"first\", inplace=False, ignore_index=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return Series with duplicate values removed.\n \"\"\"\n return super(Series, self).drop_duplicates(\n keep=keep, inplace=inplace, ignore_index=ignore_index\n )\n\n def dropna(\n self, *, axis=0, inplace=False, how=None, ignore_index=False\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return a new Series with missing values removed.\n \"\"\"\n return super(Series, self).dropna(\n axis=axis, inplace=inplace, ignore_index=ignore_index\n )\n\n def duplicated(self, keep=\"first\"): # noqa: PR01, RT01, D200\n \"\"\"\n Indicate duplicate Series values.\n \"\"\"\n return self.to_frame().duplicated(keep=keep)\n\n def eq(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return Equal to of series and `other`, element-wise (binary operator `eq`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).eq(new_other, level=level, axis=axis)\n\n def equals(self, other): # noqa: PR01, RT01, D200\n \"\"\"\n Test whether two objects contain the same elements.\n \"\"\"\n return (\n self.name == other.name\n and self.index.equals(other.index)\n and self.eq(other).all()\n )\n\n def explode(self, ignore_index: bool = False): # noqa: PR01, RT01, D200\n \"\"\"\n Transform each element of a list-like to a row.\n \"\"\"\n return super(Series, self).explode(\n MODIN_UNNAMED_SERIES_LABEL if self.name is None else self.name,\n ignore_index=ignore_index,\n )\n\n def factorize(self, sort=False, use_na_sentinel=True): # noqa: PR01, RT01, D200\n \"\"\"\n Encode the object as an enumerated type or categorical variable.\n \"\"\"\n return self._default_to_pandas(\n pandas.Series.factorize,\n sort=sort,\n use_na_sentinel=use_na_sentinel,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.fillna_Series.fillna.return.super_Series_self_filln": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.fillna_Series.fillna.return.super_Series_self_filln", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 954, "end_line": 981, "span_ids": ["Series.fillna"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def fillna(\n self,\n value=None,\n *,\n method=None,\n axis=None,\n inplace=False,\n limit=None,\n downcast=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Fill NaNs inside of a Series object.\n \"\"\"\n if isinstance(value, BasePandasDataset) and not isinstance(value, Series):\n raise TypeError(\n '\"value\" parameter must be a scalar, dict or Series, but '\n + f'you passed a \"{type(value).__name__}\"'\n )\n return super(Series, self).fillna(\n squeeze_self=True,\n squeeze_value=isinstance(value, Series),\n value=value,\n method=method,\n axis=axis,\n inplace=inplace,\n limit=limit,\n downcast=downcast,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.floordiv_Series.ge.return.super_Series_new_self_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.floordiv_Series.ge.return.super_Series_new_self_g", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 983, "end_line": 999, "span_ids": ["Series.floordiv", "Series.ge"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def floordiv(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Get Integer division of dataframe and `other`, element-wise (binary operator `floordiv`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).floordiv(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n def ge(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return greater than or equal to of series and `other`, element-wise (binary operator `ge`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).ge(new_other, level=level, axis=axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.groupby_Series.groupby.return.SeriesGroupBy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.groupby_Series.groupby.return.SeriesGroupBy_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1001, "end_line": 1038, "span_ids": ["Series.groupby"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def groupby(\n self,\n by=None,\n axis=0,\n level=None,\n as_index=True,\n sort=True,\n group_keys=True,\n observed=False,\n dropna: bool = True,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Group Series using a mapper or by a Series of columns.\n \"\"\"\n from .groupby import SeriesGroupBy\n\n if not as_index:\n raise TypeError(\"as_index=False only valid with DataFrame\")\n # SeriesGroupBy expects a query compiler object if it is available\n if isinstance(by, Series):\n by = by._query_compiler\n elif callable(by):\n by = by(self.index)\n elif by is None and level is None:\n raise TypeError(\"You have to supply one of 'by' and 'level'\")\n return SeriesGroupBy(\n self,\n by,\n axis,\n level,\n as_index,\n sort,\n group_keys,\n idx_name=None,\n observed=observed,\n drop=False,\n dropna=dropna,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.gt_Series.hist.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.gt_Series.hist.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1040, "end_line": 1075, "span_ids": ["Series.gt", "Series.hist"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def gt(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return greater than of series and `other`, element-wise (binary operator `gt`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).gt(new_other, level=level, axis=axis)\n\n def hist(\n self,\n by=None,\n ax=None,\n grid=True,\n xlabelsize=None,\n xrot=None,\n ylabelsize=None,\n yrot=None,\n figsize=None,\n bins=10,\n **kwds,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Draw histogram of the input series using matplotlib.\n \"\"\"\n return self._default_to_pandas(\n pandas.Series.hist,\n by=by,\n ax=ax,\n grid=grid,\n xlabelsize=xlabelsize,\n xrot=xrot,\n ylabelsize=ylabelsize,\n yrot=yrot,\n figsize=figsize,\n bins=bins,\n **kwds,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.idxmax_Series.lt.return.super_Series_new_self_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.idxmax_Series.lt.return.super_Series_new_self_l", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1077, "end_line": 1150, "span_ids": ["Series.keys", "Series.item", "Series.idxmin", "Series.lt", "Series.items", "Series.isin", "Series.le", "Series.info", "Series.idxmax"], "tokens": 675}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def idxmax(self, axis=0, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return the row label of the maximum value.\n \"\"\"\n if skipna is None:\n skipna = True\n return super(Series, self).idxmax(axis=axis, skipna=skipna, *args, **kwargs)\n\n def idxmin(self, axis=0, skipna=True, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return the row label of the minimum value.\n \"\"\"\n if skipna is None:\n skipna = True\n return super(Series, self).idxmin(axis=axis, skipna=skipna, *args, **kwargs)\n\n def info(\n self,\n verbose: bool | None = None,\n buf: IO[str] | None = None,\n max_cols: int | None = None,\n memory_usage: bool | str | None = None,\n show_counts: bool = True,\n ):\n return SeriesInfo(self, memory_usage).render(\n buf=buf,\n max_cols=max_cols,\n verbose=verbose,\n show_counts=show_counts,\n )\n\n def isin(self, values): # noqa: PR01, RT01, D200\n \"\"\"\n Whether elements in `Series` are contained in `values`.\n \"\"\"\n return super(Series, self).isin(values, shape_hint=\"column\")\n\n def item(self): # noqa: RT01, D200\n \"\"\"\n Return the first element of the underlying data as a Python scalar.\n \"\"\"\n return self[0]\n\n def items(self): # noqa: D200\n \"\"\"\n Lazily iterate over (index, value) tuples.\n \"\"\"\n\n def item_builder(s):\n return s.name, s.squeeze()\n\n partition_iterator = PartitionIterator(self.to_frame(), 0, item_builder)\n for v in partition_iterator:\n yield v\n\n def keys(self): # noqa: RT01, D200\n \"\"\"\n Return alias for index.\n \"\"\"\n return self.index\n\n def le(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return less than or equal to of series and `other`, element-wise (binary operator `le`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).le(new_other, level=level, axis=axis)\n\n def lt(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return less than of series and `other`, element-wise (binary operator `lt`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).lt(new_other, level=level, axis=axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.map_Series.map.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.map_Series.map.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1152, "end_line": 1176, "span_ids": ["Series.map"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def map(self, arg, na_action=None): # noqa: PR01, RT01, D200\n \"\"\"\n Map values of Series according to input correspondence.\n \"\"\"\n if isinstance(arg, type(self)):\n # HACK: if we don't cast to pandas, then the execution engine will try to\n # propagate the distributed Series to workers and most likely would have\n # some performance problems.\n # TODO: A better way of doing so could be passing this `arg` as a query compiler\n # and broadcast accordingly.\n arg = arg._to_pandas()\n\n if not callable(arg) and hasattr(arg, \"get\"):\n mapper = arg\n\n def arg(s):\n return mapper.get(s, np.nan)\n\n return self.__constructor__(\n query_compiler=self._query_compiler.applymap(\n lambda s: arg(s)\n if pandas.isnull(s) is not True or na_action is None\n else s\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_modin-project__modin/modin/pandas/series.py_Series.memory_usage_Series.ne.return.super_Series_new_self_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.memory_usage_Series.ne.return.super_Series_new_self_n", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1178, "end_line": 1226, "span_ids": ["Series.ne", "Series.rmul", "Series:29", "Series.mul", "Series.memory_usage", "Series.mode", "Series.mod"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def memory_usage(self, index=True, deep=False): # noqa: PR01, RT01, D200\n \"\"\"\n Return the memory usage of the Series.\n \"\"\"\n return super(Series, self).memory_usage(index=index, deep=deep).sum()\n\n def mod(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return Modulo of series and `other`, element-wise (binary operator `mod`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).mod(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n def mode(self, dropna=True): # noqa: PR01, RT01, D200\n \"\"\"\n Return the mode(s) of the Series.\n \"\"\"\n return super(Series, self).mode(numeric_only=False, dropna=dropna)\n\n def mul(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return multiplication of series and `other`, element-wise (binary operator `mul`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).mul(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n multiply = mul\n\n def rmul(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return multiplication of series and `other`, element-wise (binary operator `mul`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).rmul(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n def ne(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return not equal to of series and `other`, element-wise (binary operator `ne`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).ne(new_other, level=level, axis=axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.nlargest_Series.nlargest.return.Series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.nlargest_Series.nlargest.return.Series_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1228, "end_line": 1239, "span_ids": ["Series.nlargest"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def nlargest(self, n=5, keep=\"first\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return the largest `n` elements.\n \"\"\"\n if len(self._query_compiler.columns) == 0:\n # pandas returns empty series when requested largest/smallest from empty series\n return self.__constructor__(data=[], dtype=float)\n return Series(\n query_compiler=self._query_compiler.nlargest(\n n=n, columns=self.name, keep=keep\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_modin-project__modin/modin/pandas/series.py_Series.nsmallest_Series.nsmallest.return.self___constructor___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.nsmallest_Series.nsmallest.return.self___constructor___", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1241, "end_line": 1252, "span_ids": ["Series.nsmallest"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def nsmallest(self, n=5, keep=\"first\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return the smallest `n` elements.\n \"\"\"\n if len(self._query_compiler.columns) == 0:\n # pandas returns empty series when requested largest/smallest from empty series\n return self.__constructor__(data=[], dtype=float)\n return self.__constructor__(\n query_compiler=self._query_compiler.nsmallest(\n n=n, columns=self.name, keep=keep\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_modin-project__modin/modin/pandas/series.py_Series.shift_Series.shift.return.super_type_self_self_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.shift_Series.shift.return.super_type_self_self_s", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1254, "end_line": 1264, "span_ids": ["Series.shift"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def shift(\n self, periods=1, freq=None, axis=0, fill_value=None\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Shift index by desired number of periods with an optional time `freq`.\n \"\"\"\n if axis == 1:\n raise ValueError(f\"No axis named {axis} for object type {type(self)}\")\n return super(type(self), self).shift(\n periods=periods, freq=freq, axis=axis, fill_value=fill_value\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.unstack_Series.unstack.return.result_droplevel_0_axis_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.unstack_Series.unstack.return.result_droplevel_0_axis_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1266, "end_line": 1282, "span_ids": ["Series.unstack"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def unstack(self, level=-1, fill_value=None): # noqa: PR01, RT01, D200\n \"\"\"\n Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.\n \"\"\"\n from .dataframe import DataFrame\n\n # We can't unstack a Series object, if we don't have a MultiIndex.\n if len(self.index.names) > 1:\n result = DataFrame(\n query_compiler=self._query_compiler.unstack(level, fill_value)\n )\n else:\n raise ValueError(\n f\"index must be a MultiIndex to unstack, {type(self.index)} was passed\"\n )\n\n return result.droplevel(0, axis=1) if result.columns.nlevels > 1 else 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_modin-project__modin/modin/pandas/series.py_Series.plot_Series.pow.return.super_Series_new_self_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.plot_Series.pow.return.super_Series_new_self_p", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1284, "end_line": 1324, "span_ids": ["Series.pow", "Series.plot"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n @property\n def plot(\n self,\n kind=\"line\",\n ax=None,\n figsize=None,\n use_index=True,\n title=None,\n grid=None,\n legend=False,\n style=None,\n logx=False,\n logy=False,\n loglog=False,\n xticks=None,\n yticks=None,\n xlim=None,\n ylim=None,\n rot=None,\n fontsize=None,\n colormap=None,\n table=False,\n yerr=None,\n xerr=None,\n label=None,\n secondary_y=False,\n **kwds,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Make plot of Series.\n \"\"\"\n return self._to_pandas().plot\n\n def pow(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return exponential power of series and `other`, element-wise (binary operator `pow`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).pow(\n new_other, level=level, fill_value=None, axis=axis\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.prod_Series.prod.return.data__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.prod_Series.prod.return.data__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1326, "end_line": 1360, "span_ids": ["Series.prod"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n @_inherit_docstrings(pandas.Series.prod, apilink=\"pandas.Series.prod\")\n def prod(\n self,\n axis=None,\n skipna=True,\n numeric_only=False,\n min_count=0,\n **kwargs,\n ):\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n axis = self._get_axis_number(axis)\n new_index = self.columns if axis else self.index\n if min_count > len(new_index):\n return np.nan\n\n data = self._validate_dtypes_sum_prod_mean(axis, numeric_only, ignore_axis=True)\n if min_count > 1:\n return data._reduce_dimension(\n data._query_compiler.prod_min_count(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\n )\n )\n return data._reduce_dimension(\n data._query_compiler.prod(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\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_modin-project__modin/modin/pandas/series.py_Series.product_Series.reindex.return.super_Series_self_reind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.product_Series.reindex.return.super_Series_self_reind", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1362, "end_line": 1398, "span_ids": ["Series.ravel", "Series.reindex", "Series:31"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n product = prod\n\n def ravel(self, order=\"C\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return the flattened underlying data as an ndarray.\n \"\"\"\n data = self._query_compiler.to_numpy().flatten(order=order)\n if isinstance(self.dtype, pandas.CategoricalDtype):\n data = pandas.Categorical(data, dtype=self.dtype)\n\n return data\n\n @_inherit_docstrings(pandas.Series.reindex, apilink=\"pandas.Series.reindex\")\n def reindex(\n self,\n index=None,\n *,\n axis: Axis = None,\n method: str = None,\n copy: Optional[bool] = None,\n level=None,\n fill_value=None,\n limit: int = None,\n tolerance=None,\n ): # noqa: PR01, RT01, D200\n if fill_value is None:\n fill_value = np.nan\n return super(Series, self).reindex(\n index=index,\n columns=None,\n method=method,\n level=level,\n copy=copy,\n limit=limit,\n tolerance=tolerance,\n fill_value=fill_value,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rename_Series.repeat.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rename_Series.repeat.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1400, "end_line": 1439, "span_ids": ["Series.repeat", "Series.rename"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def rename(\n self,\n index=None,\n *,\n axis=None,\n copy=None,\n inplace=False,\n level=None,\n errors=\"ignore\",\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Alter Series index labels or name.\n \"\"\"\n non_mapping = is_scalar(index) or (\n is_list_like(index) and not is_dict_like(index)\n )\n if non_mapping:\n if inplace:\n self.name = index\n else:\n self_cp = self.copy()\n self_cp.name = index\n return self_cp\n else:\n from .dataframe import DataFrame\n\n result = DataFrame(self.copy()).rename(index=index).squeeze(axis=1)\n result.name = self.name\n return result\n\n def repeat(self, repeats, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Repeat elements of a Series.\n \"\"\"\n if (isinstance(repeats, int) and repeats == 0) or (\n is_list_like(repeats) and len(repeats) == 1 and repeats[0] == 0\n ):\n return self.__constructor__()\n\n return self.__constructor__(query_compiler=self._query_compiler.repeat(repeats))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.reset_index_Series.reset_index.if_drop_and_level_is_None.else_.return.DataFrame_obj_reset_inde": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.reset_index_Series.reset_index.if_drop_and_level_is_None.else_.return.DataFrame_obj_reset_inde", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1441, "end_line": 1483, "span_ids": ["Series.reset_index"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def reset_index(\n self,\n level=None,\n *,\n drop=False,\n name=no_default,\n inplace=False,\n allow_duplicates=False,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Generate a new Series with the index reset.\n \"\"\"\n if name is no_default:\n # For backwards compatibility, keep columns as [0] instead of\n # [None] when self.name is None\n name = 0 if self.name is None else self.name\n\n if drop and level is None:\n new_idx = pandas.RangeIndex(len(self.index))\n if inplace:\n self.index = new_idx\n else:\n result = self.copy()\n result.index = new_idx\n return result\n elif not drop and inplace:\n raise TypeError(\n \"Cannot reset_index inplace on a Series to create a DataFrame\"\n )\n else:\n obj = self.copy()\n obj.name = name\n from .dataframe import DataFrame\n\n return DataFrame(obj).reset_index(\n level=level,\n drop=drop,\n inplace=inplace,\n col_level=0,\n col_fill=\"\",\n allow_duplicates=allow_duplicates,\n names=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rdivmod_Series.rdivmod.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rdivmod_Series.rdivmod.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1485, "end_line": 1496, "span_ids": ["Series.rdivmod"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def rdivmod(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return integer division and modulo of series and `other`, element-wise (binary operator `rdivmod`).\n \"\"\"\n division, modulo = self._query_compiler.rdivmod(\n other=other, level=level, fill_value=fill_value, axis=axis\n )\n return self.__constructor__(query_compiler=division), self.__constructor__(\n query_compiler=modulo\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rfloordiv_Series.rfloordiv.return.super_Series_new_self_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rfloordiv_Series.rfloordiv.return.super_Series_new_self_r", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1498, "end_line": 1507, "span_ids": ["Series.rfloordiv"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def rfloordiv(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return integer division of series and `other`, element-wise (binary operator `rfloordiv`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).rfloordiv(\n new_other, level=level, fill_value=None, axis=axis\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rmod_Series.rsub.return.super_Series_new_self_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rmod_Series.rsub.return.super_Series_new_self_r", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1509, "end_line": 1540, "span_ids": ["Series.rsub", "Series.rmod", "Series.rpow"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def rmod(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return modulo of series and `other`, element-wise (binary operator `rmod`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).rmod(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n def rpow(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return exponential power of series and `other`, element-wise (binary operator `rpow`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).rpow(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n def rsub(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return subtraction of series and `other`, element-wise (binary operator `rsub`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).rsub(\n new_other, level=level, fill_value=None, axis=axis\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rtruediv_Series.rtruediv.return.super_Series_new_self_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rtruediv_Series.rtruediv.return.super_Series_new_self_r", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1542, "end_line": 1551, "span_ids": ["Series.rtruediv"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def rtruediv(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return floating division of series and `other`, element-wise (binary operator `rtruediv`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).rtruediv(\n new_other, level=level, fill_value=None, axis=axis\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rdiv_Series.reorder_levels.return.super_Series_self_reord": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.rdiv_Series.reorder_levels.return.super_Series_self_reord", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1553, "end_line": 1571, "span_ids": ["Series:33", "Series.reorder_levels", "Series.quantile"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n rdiv = rtruediv\n\n def quantile(self, q=0.5, interpolation=\"linear\"): # noqa: PR01, RT01, D200\n \"\"\"\n Return value at the given quantile.\n \"\"\"\n return super(Series, self).quantile(\n q=q,\n axis=0,\n numeric_only=False,\n interpolation=interpolation,\n method=\"single\",\n )\n\n def reorder_levels(self, order): # noqa: PR01, RT01, D200\n \"\"\"\n Rearrange index levels using input order.\n \"\"\"\n return super(Series, self).reorder_levels(order)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.replace_Series.replace.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.replace_Series.replace.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1573, "end_line": 1595, "span_ids": ["Series.replace"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def replace(\n self,\n to_replace=None,\n value=no_default,\n *,\n inplace=False,\n limit=None,\n regex=False,\n method: str | NoDefault = no_default,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Replace values given in `to_replace` with `value`.\n \"\"\"\n inplace = validate_bool_kwarg(inplace, \"inplace\")\n new_query_compiler = self._query_compiler.replace(\n to_replace=to_replace,\n value=value,\n inplace=False,\n limit=limit,\n regex=regex,\n method=method,\n )\n return self._create_or_update_from_compiler(new_query_compiler, inplace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.searchsorted_Series.searchsorted.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.searchsorted_Series.searchsorted.return.result", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1597, "end_line": 1628, "span_ids": ["Series.searchsorted"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def searchsorted(self, value, side=\"left\", sorter=None): # noqa: PR01, RT01, D200\n \"\"\"\n Find indices where elements should be inserted to maintain order.\n \"\"\"\n searchsorted_qc = self._query_compiler\n if sorter is not None:\n # `iloc` method works slowly (https://github.com/modin-project/modin/issues/1903),\n # so _default_to_pandas is used for now\n # searchsorted_qc = self.iloc[sorter].reset_index(drop=True)._query_compiler\n # sorter = None\n return self._default_to_pandas(\n pandas.Series.searchsorted, value, side=side, sorter=sorter\n )\n # searchsorted should return item number irrespective of Series index, so\n # Series.index is always set to pandas.RangeIndex, which can be easily processed\n # on the query_compiler level\n if not isinstance(searchsorted_qc.index, pandas.RangeIndex):\n searchsorted_qc = searchsorted_qc.reset_index(drop=True)\n\n result = self.__constructor__(\n query_compiler=searchsorted_qc.searchsorted(\n value=value, side=side, sorter=sorter\n )\n ).squeeze()\n\n # matching Pandas output\n if not is_scalar(value) and not is_list_like(result):\n result = np.array([result])\n elif isinstance(result, type(self)):\n result = result.to_numpy()\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_modin-project__modin/modin/pandas/series.py_Series.sort_values_Series.sort_values.return.self__create_or_update_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.sort_values_Series.sort_values.return.self__create_or_update_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1630, "end_line": 1665, "span_ids": ["Series.sort_values"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def sort_values(\n self,\n *,\n axis=0,\n ascending=True,\n inplace=False,\n kind=\"quicksort\",\n na_position=\"last\",\n ignore_index: bool = False,\n key: Optional[IndexKeyFunc] = None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Sort by the values.\n \"\"\"\n from .dataframe import DataFrame\n\n # When we convert to a DataFrame, the name is automatically converted to 0 if it\n # is None, so we do this to avoid a KeyError.\n by = self.name if self.name is not None else 0\n result = (\n DataFrame(self.copy())\n .sort_values(\n by=by,\n ascending=ascending,\n inplace=False,\n kind=kind,\n na_position=na_position,\n ignore_index=ignore_index,\n key=key,\n )\n .squeeze(axis=1)\n )\n result.name = self.name\n return self._create_or_update_from_compiler(\n result._query_compiler, inplace=inplace\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.cat_Series.subtract.sub": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.cat_Series.subtract.sub", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1667, "end_line": 1693, "span_ids": ["Series:35", "Series.sub", "Series.squeeze", "Series:43"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n cat = CachedAccessor(\"cat\", CategoryMethods)\n sparse = CachedAccessor(\"sparse\", SparseAccessor)\n str = CachedAccessor(\"str\", StringMethods)\n dt = CachedAccessor(\"dt\", DatetimeProperties)\n\n def squeeze(self, axis=None): # noqa: PR01, RT01, D200\n \"\"\"\n Squeeze 1 dimensional axis objects into scalars.\n \"\"\"\n if axis is not None:\n # Validate `axis`\n pandas.Series._get_axis_number(axis)\n if len(self.index) == 1:\n return self._reduce_dimension(self._query_compiler)\n else:\n return self.copy()\n\n def sub(self, other, level=None, fill_value=None, axis=0): # noqa: PR01, RT01, D200\n \"\"\"\n Return subtraction of Series and `other`, element-wise (binary operator `sub`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).sub(\n new_other, level=level, fill_value=None, axis=axis\n )\n\n subtract = 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_modin-project__modin/modin/pandas/series.py_Series.sum_Series.sum.return.data__reduce_dimension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.sum_Series.sum.return.data__reduce_dimension_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1695, "end_line": 1734, "span_ids": ["Series.sum"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def sum(\n self,\n axis=None,\n skipna=True,\n numeric_only=False,\n min_count=0,\n **kwargs,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the sum of the values.\n \"\"\"\n validate_bool_kwarg(skipna, \"skipna\", none_allowed=False)\n axis = self._get_axis_number(axis)\n\n new_index = self.columns if axis else self.index\n if min_count > len(new_index):\n return np.nan\n\n data = self._validate_dtypes_sum_prod_mean(\n axis, numeric_only, ignore_axis=False\n )\n if min_count > 1:\n return data._reduce_dimension(\n data._query_compiler.sum_min_count(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\n )\n )\n return data._reduce_dimension(\n data._query_compiler.sum(\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n **kwargs,\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_modin-project__modin/modin/pandas/series.py_Series.swaplevel_Series.to_list.return.self__query_compiler_to_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.swaplevel_Series.to_list.return.self__query_compiler_to_l", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1736, "end_line": 1777, "span_ids": ["Series.to_dict", "Series.to_list", "Series.swaplevel", "Series.to_frame", "Series.take"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def swaplevel(self, i=-2, j=-1, copy=None): # noqa: PR01, RT01, D200\n \"\"\"\n Swap levels `i` and `j` in a `MultiIndex`.\n \"\"\"\n copy = True if copy is None else copy\n obj = self.copy() if copy else self\n return super(Series, obj).swaplevel(i, j, axis=0)\n\n def take(self, indices, axis=0, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return the elements in the given positional indices along an axis.\n \"\"\"\n return super(Series, self).take(indices, axis=axis, **kwargs)\n\n def to_dict(self, into=dict): # pragma: no cover # noqa: PR01, RT01, D200\n \"\"\"\n Convert Series to {label -> value} dict or dict-like object.\n \"\"\"\n return self._query_compiler.series_to_dict(into)\n\n def to_frame(\n self, name: Hashable = no_default\n ) -> \"DataFrame\": # noqa: PR01, RT01, D200\n \"\"\"\n Convert Series to {label -> value} dict or dict-like object.\n \"\"\"\n from .dataframe import DataFrame\n\n if name is None:\n name = no_default\n\n self_cp = self.copy()\n if name is not no_default:\n self_cp.name = name\n\n return DataFrame(self_cp)\n\n def to_list(self): # noqa: RT01, D200\n \"\"\"\n Return a list of the values.\n \"\"\"\n return self._query_compiler.to_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_modin-project__modin/modin/pandas/series.py_Series.to_numpy_Series.to_period.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.to_numpy_Series.to_period.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1779, "end_line": 1810, "span_ids": ["Series.to_numpy", "Series.to_period", "Series:45"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def to_numpy(\n self, dtype=None, copy=False, na_value=no_default, **kwargs\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return the NumPy ndarray representing the values in this Series or Index.\n \"\"\"\n from modin.config import ExperimentalNumPyAPI\n\n if not ExperimentalNumPyAPI.get():\n return (\n super(Series, self)\n .to_numpy(\n dtype=dtype,\n copy=copy,\n na_value=na_value,\n )\n .flatten()\n )\n else:\n from ..numpy.arr import array\n\n return array(self, copy=copy)\n\n tolist = to_list\n\n # TODO(williamma12): When we implement to_timestamp, have this call the version\n # in base.py\n def to_period(self, freq=None, copy=None): # noqa: PR01, RT01, D200\n \"\"\"\n Cast to PeriodArray/Index at a particular frequency.\n \"\"\"\n return self._default_to_pandas(\"to_period\", freq=freq, copy=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_modin-project__modin/modin/pandas/series.py_Series.to_string_Series.to_string.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.to_string_Series.to_string.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1812, "end_line": 1839, "span_ids": ["Series.to_string"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def to_string(\n self,\n buf=None,\n na_rep=\"NaN\",\n float_format=None,\n header=True,\n index=True,\n length=False,\n dtype=False,\n name=False,\n max_rows=None,\n min_rows=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Render a string representation of the Series.\n \"\"\"\n return self._default_to_pandas(\n pandas.Series.to_string,\n buf=buf,\n na_rep=na_rep,\n float_format=float_format,\n header=header,\n index=index,\n length=length,\n dtype=dtype,\n name=name,\n max_rows=max_rows,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.None_9_Series.T.property_transpose_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.None_9_Series.T.property_transpose_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1841, "end_line": 1855, "span_ids": ["Series:47", "Series.to_string", "Series.transpose", "Series.to_timestamp"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n # TODO(williamma12): When we implement to_timestamp, have this call the version\n # in base.py\n def to_timestamp(self, freq=None, how=\"start\", copy=None): # noqa: PR01, RT01, D200\n \"\"\"\n Cast to DatetimeIndex of Timestamps, at beginning of period.\n \"\"\"\n return self._default_to_pandas(\"to_timestamp\", freq=freq, how=how, copy=copy)\n\n def transpose(self, *args, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Return the transpose, which is by definition `self`.\n \"\"\"\n return self\n\n T = property(transpose)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.truediv_Series.truediv.return.super_Series_new_self_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.truediv_Series.truediv.return.super_Series_new_self_t", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1857, "end_line": 1866, "span_ids": ["Series.truediv"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def truediv(\n self, other, level=None, fill_value=None, axis=0\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return floating division of series and `other`, element-wise (binary operator `truediv`).\n \"\"\"\n new_self, new_other = self._prepare_inter_op(other)\n return super(Series, new_self).truediv(\n new_other, level=level, fill_value=None, axis=axis\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.div_Series.update.self__update_inplace_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.div_Series.update.self__update_inplace_new_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1868, "end_line": 1885, "span_ids": ["Series.update", "Series.unique", "Series:49"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n div = divide = truediv\n\n def unique(self): # noqa: RT01, D200\n \"\"\"\n Return unique values of Series object.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.unique()\n ).to_numpy()\n\n def update(self, other): # noqa: PR01, D200\n \"\"\"\n Modify Series in place using values from passed Series.\n \"\"\"\n if not isinstance(other, Series):\n other = self.__constructor__(other)\n query_compiler = self._query_compiler.series_update(other._query_compiler)\n self._update_inplace(new_query_compiler=query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.value_counts_Series.value_counts.return.counted_values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.value_counts_Series.value_counts.return.counted_values", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1887, "end_line": 1912, "span_ids": ["Series.value_counts"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def value_counts(\n self, normalize=False, sort=True, ascending=False, bins=None, dropna=True\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Return a Series containing counts of unique values.\n \"\"\"\n if bins is not None:\n # Potentially we could implement `cut` function from pandas API, which\n # bins values into intervals, and then we can just count them as regular values.\n # TODO #1333: new_self = self.__constructor__(pd.cut(self, bins, include_lowest=True), dtype=\"interval\")\n return self._default_to_pandas(\n pandas.Series.value_counts,\n normalize=normalize,\n sort=sort,\n ascending=ascending,\n bins=bins,\n dropna=dropna,\n )\n counted_values = super(Series, self).value_counts(\n subset=self,\n normalize=normalize,\n sort=sort,\n ascending=ascending,\n dropna=dropna,\n )\n return counted_values", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.view_Series.where.return.self__default_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.view_Series.where.return.self__default_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1914, "end_line": 1946, "span_ids": ["Series.where", "Series.view"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def view(self, dtype=None): # noqa: PR01, RT01, D200\n \"\"\"\n Create a new view of the Series.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.series_view(dtype=dtype)\n )\n\n def where(\n self,\n cond,\n other=no_default,\n *,\n inplace=False,\n axis=None,\n level=None,\n ): # noqa: PR01, RT01, D200\n \"\"\"\n Replace values where the condition is False.\n \"\"\"\n # TODO: probably need to remove this conversion to pandas\n if isinstance(other, Series):\n other = to_pandas(other)\n # TODO: add error checking like for dataframe where, then forward to\n # same query compiler method\n return self._default_to_pandas(\n pandas.Series.where,\n cond,\n other=other,\n inplace=inplace,\n axis=axis,\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_modin-project__modin/modin/pandas/series.py_Series.attrs_Series.shape.return._len_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.attrs_Series.shape.return._len_self_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1948, "end_line": 2046, "span_ids": ["Series.is_monotonic_decreasing", "Series:52", "Series.shape", "Series.axes", "Series.attrs", "Series.is_monotonic_increasing", "Series.nunique", "Series.empty", "Series.ndim", "Series.nbytes", "Series.is_unique", "Series.hasnans", "Series.array", "Series.dtype"], "tokens": 668}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n @property\n def attrs(self): # noqa: RT01, D200\n \"\"\"\n Return dictionary of global attributes of this dataset.\n \"\"\"\n\n def attrs(df):\n return df.attrs\n\n return self._default_to_pandas(attrs)\n\n @property\n def array(self): # noqa: RT01, D200\n \"\"\"\n Return the ExtensionArray of the data backing this Series or Index.\n \"\"\"\n\n def array(df):\n return df.array\n\n return self._default_to_pandas(array)\n\n @property\n def axes(self): # noqa: RT01, D200\n \"\"\"\n Return a list of the row axis labels.\n \"\"\"\n return [self.index]\n\n @property\n def dtype(self): # noqa: RT01, D200\n \"\"\"\n Return the dtype object of the underlying data.\n \"\"\"\n return self._query_compiler.dtypes.squeeze()\n\n dtypes = dtype\n\n @property\n def empty(self): # noqa: RT01, D200\n \"\"\"\n Indicate whether Series is empty.\n \"\"\"\n return len(self.index) == 0\n\n @property\n def hasnans(self): # noqa: RT01, D200\n \"\"\"\n Return True if Series has any nans.\n \"\"\"\n return self.isna().sum() > 0\n\n @property\n def is_monotonic_increasing(self): # noqa: RT01, D200\n \"\"\"\n Return True if values in the Series are monotonic_increasing.\n \"\"\"\n return self._reduce_dimension(self._query_compiler.is_monotonic_increasing())\n\n @property\n def is_monotonic_decreasing(self): # noqa: RT01, D200\n \"\"\"\n Return True if values in the Series are monotonic_decreasing.\n \"\"\"\n return self._reduce_dimension(self._query_compiler.is_monotonic_decreasing())\n\n @property\n def is_unique(self): # noqa: RT01, D200\n \"\"\"\n Return True if values in the Series are unique.\n \"\"\"\n return self.nunique(dropna=False) == len(self)\n\n @property\n def nbytes(self): # noqa: RT01, D200\n \"\"\"\n Return the number of bytes in the underlying data.\n \"\"\"\n return self.memory_usage(index=False)\n\n @property\n def ndim(self): # noqa: RT01, D200\n \"\"\"\n Return the number of dimensions of the underlying data, by definition 1.\n \"\"\"\n return 1\n\n def nunique(self, dropna=True): # noqa: PR01, RT01, D200\n \"\"\"\n Return number of unique elements in the object.\n \"\"\"\n return super(Series, self).nunique(dropna=dropna)\n\n @property\n def shape(self): # noqa: RT01, D200\n \"\"\"\n Return a tuple of the shape of the underlying data.\n \"\"\"\n return (len(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_modin-project__modin/modin/pandas/series.py_Series.reindex_like_Series.reindex_like.return.self_reindex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series.reindex_like_Series.reindex_like.return.self_reindex_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2048, "end_line": 2064, "span_ids": ["Series.reindex_like"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def reindex_like(\n self: \"Series\",\n other,\n method=None,\n copy: Optional[bool] = None,\n limit=None,\n tolerance=None,\n ) -> \"Series\":\n # docs say \"Same as calling .reindex(index=other.index, columns=other.columns,...).\":\n # https://pandas.pydata.org/pandas-docs/version/1.4/reference/api/pandas.Series.reindex_like.html\n return self.reindex(\n index=other.index,\n method=method,\n copy=copy,\n limit=limit,\n tolerance=tolerance,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._to_pandas_Series._reduce_dimension.return.query_compiler_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._to_pandas_Series._reduce_dimension.return.query_compiler_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2066, "end_line": 2137, "span_ids": ["Series._qcut", "Series._to_datetime", "Series._to_numeric", "Series._to_pandas", "Series._reduce_dimension"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _to_pandas(self):\n \"\"\"\n Convert Modin Series to pandas Series.\n\n Returns\n -------\n pandas.Series\n \"\"\"\n df = self._query_compiler.to_pandas()\n series = df[df.columns[0]]\n if self._query_compiler.columns[0] == MODIN_UNNAMED_SERIES_LABEL:\n series.name = None\n return series\n\n def _to_datetime(self, **kwargs):\n \"\"\"\n Convert `self` to datetime.\n\n Parameters\n ----------\n **kwargs : dict\n Optional arguments to use during query compiler's\n `to_datetime` invocation.\n\n Returns\n -------\n datetime\n Series of datetime64 dtype.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.to_datetime(**kwargs)\n )\n\n def _to_numeric(self, **kwargs):\n \"\"\"\n Convert `self` to numeric.\n\n Parameters\n ----------\n **kwargs : dict\n Optional arguments to use during query compiler's\n `to_numeric` invocation.\n\n Returns\n -------\n numeric\n Series of numeric dtype.\n \"\"\"\n return self.__constructor__(\n query_compiler=self._query_compiler.to_numeric(**kwargs)\n )\n\n def _qcut(self, q, **kwargs): # noqa: PR01, RT01, D200\n \"\"\"\n Quantile-based discretization function.\n \"\"\"\n return self._default_to_pandas(pandas.qcut, q, **kwargs)\n\n def _reduce_dimension(self, query_compiler):\n \"\"\"\n Try to reduce the dimension of data from the `query_compiler`.\n\n Parameters\n ----------\n query_compiler : BaseQueryCompiler\n Query compiler to retrieve the data.\n\n Returns\n -------\n pandas.Series or pandas.DataFrame.\n \"\"\"\n return query_compiler.to_pandas().squeeze()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_sum_prod_mean_Series._validate_dtypes_sum_prod_mean.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_sum_prod_mean_Series._validate_dtypes_sum_prod_mean.return.self", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2139, "end_line": 2163, "span_ids": ["Series._validate_dtypes_sum_prod_mean"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _validate_dtypes_sum_prod_mean(self, axis, numeric_only, ignore_axis=False):\n \"\"\"\n Validate data dtype for `sum`, `prod` and `mean` methods.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to validate over.\n numeric_only : bool\n Whether or not to allow only numeric data.\n If True and non-numeric data is found, exception\n will be raised.\n ignore_axis : bool, default: False\n Whether or not to ignore `axis` parameter.\n\n Returns\n -------\n Series\n\n Notes\n -----\n Actually returns unmodified `self` object,\n added for compatibility with Modin DataFrame.\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_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_min_max_Series._validate_dtypes_min_max.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_min_max_Series._validate_dtypes_min_max.return.self", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2165, "end_line": 2186, "span_ids": ["Series._validate_dtypes_min_max"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _validate_dtypes_min_max(self, axis, numeric_only):\n \"\"\"\n Validate data dtype for `min` and `max` methods.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to validate over.\n numeric_only : bool\n Whether or not to allow only numeric data.\n If True and non-numeric data is found, exception.\n\n Returns\n -------\n Series\n\n Notes\n -----\n Actually returns unmodified `self` object,\n added for compatibility with Modin DataFrame.\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_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_Series._get_numeric_data.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._validate_dtypes_Series._get_numeric_data.return.self", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2188, "end_line": 2223, "span_ids": ["Series._get_numeric_data", "Series._validate_dtypes"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _validate_dtypes(self, numeric_only=False):\n \"\"\"\n Check that all the dtypes are the same.\n\n Parameters\n ----------\n numeric_only : bool, default: False\n Whether or not to allow only numeric data.\n If True and non-numeric data is found, exception\n will be raised.\n\n Notes\n -----\n Actually does nothing, added for compatibility with Modin DataFrame.\n \"\"\"\n pass\n\n def _get_numeric_data(self, axis: int):\n \"\"\"\n Grab only numeric data from Series.\n\n Parameters\n ----------\n axis : {0, 1}\n Axis to inspect on having numeric types only.\n\n Returns\n -------\n Series\n\n Notes\n -----\n `numeric_only` parameter is not supported by Series, so this method\n does not do anything. The method is added for compatibility with Modin DataFrame.\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_modin-project__modin/modin/pandas/series.py_Series._update_inplace_Series._update_inplace.if_self__parent_is_not_No.if_self__parent_axis_0.else_.self__parent_self_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._update_inplace_Series._update_inplace.if_self__parent_is_not_No.if_self__parent_axis_0.else_.self__parent_self_name_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2225, "end_line": 2240, "span_ids": ["Series._update_inplace"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _update_inplace(self, new_query_compiler):\n \"\"\"\n Update the current Series in-place using `new_query_compiler`.\n\n Parameters\n ----------\n new_query_compiler : BaseQueryCompiler\n QueryCompiler to use to manage the data.\n \"\"\"\n super(Series, self)._update_inplace(new_query_compiler=new_query_compiler)\n # Propagate changes back to parent so that column in dataframe had the same contents\n if self._parent is not None:\n if self._parent_axis == 0:\n self._parent.loc[self.name] = self\n else:\n self._parent[self.name] = 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_modin-project__modin/modin/pandas/series.py_Series._create_or_update_from_compiler_Series._create_or_update_from_compiler.if_not_inplace_and_new_qu.else_.self__update_inplace_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._create_or_update_from_compiler_Series._create_or_update_from_compiler.if_not_inplace_and_new_qu.else_.self__update_inplace_new_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2242, "end_line": 2270, "span_ids": ["Series._create_or_update_from_compiler"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _create_or_update_from_compiler(self, new_query_compiler, inplace=False):\n \"\"\"\n Return or update a Series with given `new_query_compiler`.\n\n Parameters\n ----------\n new_query_compiler : PandasQueryCompiler\n QueryCompiler to use to manage the data.\n inplace : bool, default: False\n Whether or not to perform update or creation inplace.\n\n Returns\n -------\n Series, DataFrame or None\n None if update was done, Series or DataFrame otherwise.\n \"\"\"\n assert (\n isinstance(new_query_compiler, type(self._query_compiler))\n or type(new_query_compiler) in self._query_compiler.__class__.__bases__\n ), \"Invalid Query Compiler object: {}\".format(type(new_query_compiler))\n if not inplace and new_query_compiler.is_series_like():\n return self.__constructor__(query_compiler=new_query_compiler)\n elif not inplace:\n # This can happen with things like `reset_index` where we can add columns.\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=new_query_compiler)\n else:\n self._update_inplace(new_query_compiler=new_query_compiler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._prepare_inter_op_Series._prepare_inter_op.return.new_self_new_other": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._prepare_inter_op_Series._prepare_inter_op.return.new_self_new_other", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2272, "end_line": 2302, "span_ids": ["Series._prepare_inter_op"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _prepare_inter_op(self, other):\n \"\"\"\n Prepare `self` and `other` for further interaction.\n\n Parameters\n ----------\n other : Series or scalar value\n Another object `self` should interact with.\n\n Returns\n -------\n Series\n Prepared `self`.\n Series\n Prepared `other`.\n \"\"\"\n if isinstance(other, Series):\n names_different = self.name != other.name\n # NB: if we don't need a rename, do the interaction with shallow\n # copies so that we preserve obj.index._id. It's fine to work\n # with shallow copies because we'll discard the copies but keep\n # the result after the interaction opreation. We can't do a rename\n # on shallow copies because we'll mutate the original objects.\n new_self = self.copy(deep=names_different)\n new_other = other.copy(deep=names_different)\n if names_different:\n new_self.name = new_other.name = MODIN_UNNAMED_SERIES_LABEL\n else:\n new_self = self\n new_other = other\n return new_self, new_other", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._getitem_Series._getitem.return.self___constructor___quer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._getitem_Series._getitem.return.self___constructor___quer", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2304, "end_line": 2352, "span_ids": ["Series._getitem"], "tokens": 420}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _getitem(self, key):\n \"\"\"\n Get the data specified by `key` for this Series.\n\n Parameters\n ----------\n key : Any\n Column id to retrieve from Series.\n\n Returns\n -------\n Series\n Series with retrieved data.\n \"\"\"\n key = apply_if_callable(key, self)\n if isinstance(key, Series) and key.dtype == np.bool_:\n # This ends up being significantly faster than looping through and getting\n # each item individually.\n key = key._to_pandas()\n if is_bool_indexer(key):\n return self.__constructor__(\n query_compiler=self._query_compiler.getitem_row_array(\n pandas.RangeIndex(len(self.index))[key]\n )\n )\n # TODO: More efficiently handle `tuple` case for `Series.__getitem__`\n if isinstance(key, tuple):\n return self._default_to_pandas(pandas.Series.__getitem__, key)\n\n if not is_list_like(key):\n reduce_dimension = True\n key = [key]\n else:\n reduce_dimension = False\n # The check for whether or not `key` is in `keys()` will throw a TypeError\n # if the object is not hashable. When that happens, we just assume the\n # key is a list-like of row positions.\n try:\n is_indexer = all(k in self.keys() for k in key)\n except TypeError:\n is_indexer = False\n row_positions = self.index.get_indexer_for(key) if is_indexer else key\n if not all(is_integer(x) for x in row_positions):\n raise KeyError(key[0] if reduce_dimension else key)\n result = self._query_compiler.getitem_row_array(row_positions)\n\n if reduce_dimension:\n return self._reduce_dimension(result)\n return self.__constructor__(query_compiler=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_modin-project__modin/modin/pandas/series.py_Series._repartition_Series._inflate_light.return.cls_query_compiler_query_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._repartition_Series._inflate_light.return.cls_query_compiler_query_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2354, "end_line": 2388, "span_ids": ["Series._repartition", "Series._inflate_light"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n def _repartition(self):\n \"\"\"\n Repartitioning Series to get ideal partitions inside.\n\n Allows to improve performance where the query compiler can't improve\n yet by doing implicit repartitioning.\n\n Returns\n -------\n Series\n The repartitioned Series.\n \"\"\"\n return super()._repartition(axis=0)\n\n # Persistance support methods - BEGIN\n @classmethod\n def _inflate_light(cls, query_compiler, name):\n \"\"\"\n Re-creates the object from previously-serialized lightweight representation.\n\n The method is used for faster but not disk-storable persistence.\n\n Parameters\n ----------\n query_compiler : BaseQueryCompiler\n Query compiler to use for object re-creation.\n name : str\n The name to give to the new object.\n\n Returns\n -------\n Series\n New Series based on the `query_compiler`.\n \"\"\"\n return cls(query_compiler=query_compiler, name=name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._inflate_full_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series.py_Series._inflate_full_", "embedding": null, "metadata": {"file_path": "modin/pandas/series.py", "file_name": "series.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2390, "end_line": 2420, "span_ids": ["Series.__reduce__", "impl:2", "Series._inflate_full"], "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": "@_inherit_docstrings(\n pandas.Series, excluded=[pandas.Series.__init__], apilink=\"pandas.Series\"\n)\nclass Series(BasePandasDataset):\n\n @classmethod\n def _inflate_full(cls, pandas_series):\n \"\"\"\n Re-creates the object from previously-serialized disk-storable representation.\n\n Parameters\n ----------\n pandas_series : pandas.Series\n Data to use for object re-creation.\n\n Returns\n -------\n Series\n New Series based on the `pandas_series`.\n \"\"\"\n return cls(data=pandas_series)\n\n def __reduce__(self):\n self._query_compiler.finalize()\n if PersistentPickle.get():\n return self._inflate_full, (self._to_pandas(),)\n return self._inflate_light, (self._query_compiler, self.name)\n\n # Persistance support methods - END\n\n\nif IsExperimental.get():\n from modin.experimental.cloud.meta_magic import make_wrapped_class\n\n make_wrapped_class(Series, \"make_series_wrapper\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_from_typing_import_TYPE_C_CategoryMethods.as_unordered.return.self__default_to_pandas_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_from_typing_import_TYPE_C_CategoryMethods.as_unordered.return.self__default_to_pandas_p", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 97, "span_ids": ["CategoryMethods.ordered", "CategoryMethods.__init__", "CategoryMethods.remove_categories", "CategoryMethods.reorder_categories", "CategoryMethods.set_categories", "CategoryMethods.as_ordered", "CategoryMethods.remove_unused_categories", "CategoryMethods.categories_2", "CategoryMethods._Series", "CategoryMethods", "CategoryMethods.add_categories", "CategoryMethods.codes", "CategoryMethods.rename_categories", "CategoryMethods.categories", "CategoryMethods.as_unordered", "docstring"], "tokens": 485}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import TYPE_CHECKING\nimport re\n\nimport numpy as np\nimport pandas\nfrom modin.logging import ClassLogger\nfrom modin.utils import _inherit_docstrings\n\nif TYPE_CHECKING:\n from datetime import tzinfo\n from pandas._typing import npt\n\n\n@_inherit_docstrings(pandas.core.arrays.categorical.CategoricalAccessor)\nclass CategoryMethods(ClassLogger):\n def __init__(self, data):\n self._series = data\n self._query_compiler = data._query_compiler\n\n @pandas.util.cache_readonly\n def _Series(self): # noqa: GL08\n # to avoid cyclic import\n from .series import Series\n\n return Series\n\n @property\n def categories(self):\n return self._series.dtype.categories\n\n @categories.setter\n def categories(self, categories):\n def set_categories(series, categories):\n series.cat.categories = categories\n\n self._series._default_to_pandas(set_categories, categories=categories)\n\n @property\n def ordered(self):\n return self._series.dtype.ordered\n\n @property\n def codes(self):\n return self._Series(query_compiler=self._query_compiler.cat_codes())\n\n def rename_categories(self, new_categories):\n return self._default_to_pandas(\n pandas.Series.cat.rename_categories, new_categories\n )\n\n def reorder_categories(self, new_categories, ordered=None):\n return self._default_to_pandas(\n pandas.Series.cat.reorder_categories,\n new_categories,\n ordered=ordered,\n )\n\n def add_categories(self, new_categories):\n return self._default_to_pandas(pandas.Series.cat.add_categories, new_categories)\n\n def remove_categories(self, removals):\n return self._default_to_pandas(pandas.Series.cat.remove_categories, removals)\n\n def remove_unused_categories(self):\n return self._default_to_pandas(pandas.Series.cat.remove_unused_categories)\n\n def set_categories(self, new_categories, ordered=None, rename=False):\n return self._default_to_pandas(\n pandas.Series.cat.set_categories,\n new_categories,\n ordered=ordered,\n rename=rename,\n )\n\n def as_ordered(self):\n return self._default_to_pandas(pandas.Series.cat.as_ordered)\n\n def as_unordered(self):\n return self._default_to_pandas(pandas.Series.cat.as_unordered)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_CategoryMethods._default_to_pandas_CategoryMethods._default_to_pandas.return.self__series__default_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_CategoryMethods._default_to_pandas_CategoryMethods._default_to_pandas.return.self__series__default_to_", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 119, "span_ids": ["CategoryMethods._default_to_pandas"], "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": "@_inherit_docstrings(pandas.core.arrays.categorical.CategoricalAccessor)\nclass CategoryMethods(ClassLogger):\n\n def _default_to_pandas(self, op, *args, **kwargs):\n \"\"\"\n Convert `self` to pandas type and call a pandas cat.`op` on it.\n\n Parameters\n ----------\n op : str\n Name of pandas function.\n *args : list\n Additional positional arguments to be passed in `op`.\n **kwargs : dict\n Additional keywords arguments to be passed in `op`.\n\n Returns\n -------\n object\n Result of operation.\n \"\"\"\n return self._series._default_to_pandas(\n lambda series: op(series.cat, *args, **kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods_StringMethods.cat.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods_StringMethods.cat.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 151, "span_ids": ["StringMethods.casefold", "StringMethods.cat", "StringMethods._Series", "StringMethods.__init__", "StringMethods"], "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": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n def __init__(self, data):\n # Check if dtypes is objects\n\n self._series = data\n self._query_compiler = data._query_compiler\n\n @pandas.util.cache_readonly\n def _Series(self): # noqa: GL08\n # to avoid cyclic import\n from .series import Series\n\n return Series\n\n def casefold(self):\n return self._Series(query_compiler=self._query_compiler.str_casefold())\n\n def cat(self, others=None, sep=None, na_rep=None, join=\"left\"):\n if isinstance(others, self._Series):\n others = others._to_pandas()\n compiler_result = self._query_compiler.str_cat(\n others=others, sep=sep, na_rep=na_rep, join=join\n )\n # if others is None, result is a string. otherwise, it's a series.\n return (\n compiler_result.to_pandas().squeeze()\n if others is None\n else self._Series(query_compiler=compiler_result)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.decode_StringMethods.split.if_expand_.else_.return.self__Series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.decode_StringMethods.split.if_expand_.else_.return.self__Series_", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 172, "span_ids": ["StringMethods.decode", "StringMethods.split"], "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": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n\n def decode(self, encoding, errors=\"strict\"):\n return self._Series(\n query_compiler=self._query_compiler.str_decode(encoding, errors)\n )\n\n def split(self, pat=None, *, n=-1, expand=False, regex=None):\n if expand:\n from .dataframe import DataFrame\n\n return DataFrame(\n query_compiler=self._query_compiler.str_split(\n pat=pat, n=n, expand=True, regex=regex\n )\n )\n else:\n return self._Series(\n query_compiler=self._query_compiler.str_split(\n pat=pat, n=n, expand=expand, regex=regex\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_modin-project__modin/modin/pandas/series_utils.py_StringMethods.rsplit_StringMethods.rsplit.if_expand_.else_.return.self__Series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.rsplit_StringMethods.rsplit.if_expand_.else_.return.self__Series_", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 191, "span_ids": ["StringMethods.rsplit"], "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": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n\n def rsplit(self, pat=None, *, n=-1, expand=False):\n if not pat and pat is not None:\n raise ValueError(\"rsplit() requires a non-empty pattern match.\")\n\n if expand:\n from .dataframe import DataFrame\n\n return DataFrame(\n query_compiler=self._query_compiler.str_rsplit(\n pat=pat, n=n, expand=True\n )\n )\n else:\n return self._Series(\n query_compiler=self._query_compiler.str_rsplit(\n pat=pat, n=n, expand=expand\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_modin-project__modin/modin/pandas/series_utils.py_StringMethods.get_StringMethods.slice_replace.return.self__Series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.get_StringMethods.slice_replace.return.self__Series_", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 276, "span_ids": ["StringMethods.center", "StringMethods.zfill", "StringMethods.slice", "StringMethods.ljust", "StringMethods.pad", "StringMethods.get_dummies", "StringMethods.get", "StringMethods.join", "StringMethods.rjust", "StringMethods.contains", "StringMethods.replace", "StringMethods.slice_replace", "StringMethods.wrap"], "tokens": 739}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n\n def get(self, i):\n return self._Series(query_compiler=self._query_compiler.str_get(i))\n\n def join(self, sep):\n if sep is None:\n raise AttributeError(\"'NoneType' object has no attribute 'join'\")\n return self._Series(query_compiler=self._query_compiler.str_join(sep))\n\n def get_dummies(self, sep=\"|\"):\n return self._Series(query_compiler=self._query_compiler.str_get_dummies(sep))\n\n def contains(self, pat, case=True, flags=0, na=None, regex=True):\n if pat is None and not case:\n raise AttributeError(\"'NoneType' object has no attribute 'upper'\")\n return self._Series(\n query_compiler=self._query_compiler.str_contains(\n pat, case=case, flags=flags, na=na, regex=regex\n )\n )\n\n def replace(self, pat, repl, n=-1, case=None, flags=0, regex=False):\n if not (isinstance(repl, str) or callable(repl)):\n raise TypeError(\"repl must be a string or callable\")\n return self._Series(\n query_compiler=self._query_compiler.str_replace(\n pat, repl, n=n, case=case, flags=flags, regex=regex\n )\n )\n\n def pad(self, width, side=\"left\", fillchar=\" \"):\n if len(fillchar) != 1:\n raise TypeError(\"fillchar must be a character, not str\")\n return self._Series(\n query_compiler=self._query_compiler.str_pad(\n width, side=side, fillchar=fillchar\n )\n )\n\n def center(self, width, fillchar=\" \"):\n if len(fillchar) != 1:\n raise TypeError(\"fillchar must be a character, not str\")\n return self._Series(\n query_compiler=self._query_compiler.str_center(width, fillchar=fillchar)\n )\n\n def ljust(self, width, fillchar=\" \"):\n if len(fillchar) != 1:\n raise TypeError(\"fillchar must be a character, not str\")\n return self._Series(\n query_compiler=self._query_compiler.str_ljust(width, fillchar=fillchar)\n )\n\n def rjust(self, width, fillchar=\" \"):\n if len(fillchar) != 1:\n raise TypeError(\"fillchar must be a character, not str\")\n return self._Series(\n query_compiler=self._query_compiler.str_rjust(width, fillchar=fillchar)\n )\n\n def zfill(self, width):\n return self._Series(query_compiler=self._query_compiler.str_zfill(width))\n\n def wrap(self, width, **kwargs):\n if width <= 0:\n raise ValueError(\"invalid width {} (must be > 0)\".format(width))\n return self._Series(\n query_compiler=self._query_compiler.str_wrap(width, **kwargs)\n )\n\n def slice(self, start=None, stop=None, step=None):\n if step == 0:\n raise ValueError(\"slice step cannot be zero\")\n return self._Series(\n query_compiler=self._query_compiler.str_slice(\n start=start, stop=stop, step=step\n )\n )\n\n def slice_replace(self, start=None, stop=None, repl=None):\n return self._Series(\n query_compiler=self._query_compiler.str_slice_replace(\n start=start, stop=stop, repl=repl\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_modin-project__modin/modin/pandas/series_utils.py_StringMethods.count_StringMethods.repeat.return.self__Series_query_compil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.count_StringMethods.repeat.return.self__Series_query_compil", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 381, "span_ids": ["StringMethods.len", "StringMethods.endswith", "StringMethods.count", "StringMethods.strip", "StringMethods.extract", "StringMethods.rstrip", "StringMethods.removeprefix", "StringMethods.fullmatch", "StringMethods.repeat", "StringMethods.findall", "StringMethods.removesuffix", "StringMethods.partition", "StringMethods.extractall", "StringMethods.lstrip", "StringMethods.match", "StringMethods.startswith", "StringMethods.encode"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n\n def count(self, pat, flags=0):\n if not isinstance(pat, (str, re.Pattern)):\n raise TypeError(\"first argument must be string or compiled pattern\")\n return self._Series(\n query_compiler=self._query_compiler.str_count(pat, flags=flags)\n )\n\n def startswith(self, pat, na=None):\n return self._Series(\n query_compiler=self._query_compiler.str_startswith(pat, na=na)\n )\n\n def encode(self, encoding, errors=\"strict\"):\n return self._Series(\n query_compiler=self._query_compiler.str_encode(encoding, errors)\n )\n\n def endswith(self, pat, na=None):\n return self._Series(\n query_compiler=self._query_compiler.str_endswith(pat, na=na)\n )\n\n def findall(self, pat, flags=0):\n if not isinstance(pat, (str, re.Pattern)):\n raise TypeError(\"first argument must be string or compiled pattern\")\n return self._Series(\n query_compiler=self._query_compiler.str_findall(pat, flags=flags)\n )\n\n def fullmatch(self, pat, case=True, flags=0, na=None):\n if not isinstance(pat, (str, re.Pattern)):\n raise TypeError(\"first argument must be string or compiled pattern\")\n return self._Series(\n query_compiler=self._query_compiler.str_fullmatch(\n pat, case=case, flags=flags, na=na\n )\n )\n\n def match(self, pat, case=True, flags=0, na=None):\n if not isinstance(pat, (str, re.Pattern)):\n raise TypeError(\"first argument must be string or compiled pattern\")\n return self._Series(\n query_compiler=self._query_compiler.str_match(\n pat, case=case, flags=flags, na=na\n )\n )\n\n def extract(self, pat, flags=0, expand=True):\n query_compiler = self._query_compiler.str_extract(\n pat, flags=flags, expand=expand\n )\n from .dataframe import DataFrame\n\n return (\n DataFrame(query_compiler=query_compiler)\n if expand or re.compile(pat).groups > 1\n else self._Series(query_compiler=query_compiler)\n )\n\n def extractall(self, pat, flags=0):\n return self._Series(\n query_compiler=self._query_compiler.str_extractall(pat, flags)\n )\n\n def len(self):\n return self._Series(query_compiler=self._query_compiler.str_len())\n\n def strip(self, to_strip=None):\n return self._Series(\n query_compiler=self._query_compiler.str_strip(to_strip=to_strip)\n )\n\n def rstrip(self, to_strip=None):\n return self._Series(\n query_compiler=self._query_compiler.str_rstrip(to_strip=to_strip)\n )\n\n def lstrip(self, to_strip=None):\n return self._Series(\n query_compiler=self._query_compiler.str_lstrip(to_strip=to_strip)\n )\n\n def partition(self, sep=\" \", expand=True):\n if sep is not None and len(sep) == 0:\n raise ValueError(\"empty separator\")\n\n from .dataframe import DataFrame\n\n return (DataFrame if expand else self._Series)(\n query_compiler=self._query_compiler.str_partition(sep=sep, expand=expand)\n )\n\n def removeprefix(self, prefix):\n return self._Series(\n query_compiler=self._query_compiler.str_removeprefix(prefix)\n )\n\n def removesuffix(self, suffix):\n return self._Series(\n query_compiler=self._query_compiler.str_removesuffix(suffix)\n )\n\n def repeat(self, repeats):\n return self._Series(query_compiler=self._query_compiler.str_repeat(repeats))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.rpartition_StringMethods.__getitem__.return.self__Series_query_compil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods.rpartition_StringMethods.__getitem__.return.self__Series_query_compil", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 478, "span_ids": ["StringMethods.isnumeric", "StringMethods.find", "StringMethods.title", "StringMethods.istitle", "StringMethods.__getitem__", "StringMethods.swapcase", "StringMethods.index", "StringMethods.isdigit", "StringMethods.isalnum", "StringMethods.rindex", "StringMethods.isspace", "StringMethods.capitalize", "StringMethods.lower", "StringMethods.translate", "StringMethods.isupper", "StringMethods.upper", "StringMethods.rpartition", "StringMethods.normalize", "StringMethods.isalpha", "StringMethods.islower", "StringMethods.rfind", "StringMethods.isdecimal"], "tokens": 736}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n\n def rpartition(self, sep=\" \", expand=True):\n if sep is not None and len(sep) == 0:\n raise ValueError(\"empty separator\")\n\n from .dataframe import DataFrame\n\n return (DataFrame if expand else self._Series)(\n query_compiler=self._query_compiler.str_rpartition(sep=sep, expand=expand)\n )\n\n def lower(self):\n return self._Series(query_compiler=self._query_compiler.str_lower())\n\n def upper(self):\n return self._Series(query_compiler=self._query_compiler.str_upper())\n\n def title(self):\n return self._Series(query_compiler=self._query_compiler.str_title())\n\n def find(self, sub, start=0, end=None):\n if not isinstance(sub, str):\n raise TypeError(\n \"expected a string object, not {0}\".format(type(sub).__name__)\n )\n return self._Series(\n query_compiler=self._query_compiler.str_find(sub, start=start, end=end)\n )\n\n def rfind(self, sub, start=0, end=None):\n if not isinstance(sub, str):\n raise TypeError(\n \"expected a string object, not {0}\".format(type(sub).__name__)\n )\n return self._Series(\n query_compiler=self._query_compiler.str_rfind(sub, start=start, end=end)\n )\n\n def index(self, sub, start=0, end=None):\n if not isinstance(sub, str):\n raise TypeError(\n \"expected a string object, not {0}\".format(type(sub).__name__)\n )\n return self._Series(\n query_compiler=self._query_compiler.str_index(sub, start=start, end=end)\n )\n\n def rindex(self, sub, start=0, end=None):\n if not isinstance(sub, str):\n raise TypeError(\n \"expected a string object, not {0}\".format(type(sub).__name__)\n )\n return self._Series(\n query_compiler=self._query_compiler.str_rindex(sub, start=start, end=end)\n )\n\n def capitalize(self):\n return self._Series(query_compiler=self._query_compiler.str_capitalize())\n\n def swapcase(self):\n return self._Series(query_compiler=self._query_compiler.str_swapcase())\n\n def normalize(self, form):\n return self._Series(query_compiler=self._query_compiler.str_normalize(form))\n\n def translate(self, table):\n return self._Series(query_compiler=self._query_compiler.str_translate(table))\n\n def isalnum(self):\n return self._Series(query_compiler=self._query_compiler.str_isalnum())\n\n def isalpha(self):\n return self._Series(query_compiler=self._query_compiler.str_isalpha())\n\n def isdigit(self):\n return self._Series(query_compiler=self._query_compiler.str_isdigit())\n\n def isspace(self):\n return self._Series(query_compiler=self._query_compiler.str_isspace())\n\n def islower(self):\n return self._Series(query_compiler=self._query_compiler.str_islower())\n\n def isupper(self):\n return self._Series(query_compiler=self._query_compiler.str_isupper())\n\n def istitle(self):\n return self._Series(query_compiler=self._query_compiler.str_istitle())\n\n def isnumeric(self):\n return self._Series(query_compiler=self._query_compiler.str_isnumeric())\n\n def isdecimal(self):\n return self._Series(query_compiler=self._query_compiler.str_isdecimal())\n\n def __getitem__(self, key):\n return self._Series(query_compiler=self._query_compiler.str___getitem__(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_modin-project__modin/modin/pandas/series_utils.py_StringMethods._default_to_pandas_StringMethods._default_to_pandas.return.self__series__default_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_StringMethods._default_to_pandas_StringMethods._default_to_pandas.return.self__series__default_to_", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 500, "span_ids": ["StringMethods._default_to_pandas"], "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": "@_inherit_docstrings(pandas.core.strings.accessor.StringMethods)\nclass StringMethods(ClassLogger):\n\n def _default_to_pandas(self, op, *args, **kwargs):\n \"\"\"\n Convert `self` to pandas type and call a pandas str.`op` on it.\n\n Parameters\n ----------\n op : str\n Name of pandas function.\n *args : list\n Additional positional arguments to be passed in `op`.\n **kwargs : dict\n Additional keywords arguments to be passed in `op`.\n\n Returns\n -------\n object\n Result of operation.\n \"\"\"\n return self._series._default_to_pandas(\n lambda series: op(series.str, *args, **kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_DatetimeProperties_DatetimeProperties.unit.return.self__Series_query_compil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_DatetimeProperties_DatetimeProperties.unit.return.self__Series_query_compil", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 630, "span_ids": ["DatetimeProperties:2", "DatetimeProperties.hour", "DatetimeProperties.time", "DatetimeProperties.nanosecond", "DatetimeProperties.microsecond", "DatetimeProperties._Series", "DatetimeProperties.daysinmonth", "DatetimeProperties.days_in_month", "DatetimeProperties", "DatetimeProperties.tz", "DatetimeProperties.date", "DatetimeProperties.is_month_start", "DatetimeProperties.is_leap_year", "DatetimeProperties.unit", "DatetimeProperties.is_quarter_end", "DatetimeProperties.freq", "DatetimeProperties.is_month_end", "DatetimeProperties.day", "DatetimeProperties.second", "DatetimeProperties.year", "DatetimeProperties.dayofyear", "DatetimeProperties.__init__", "DatetimeProperties.is_year_start", "DatetimeProperties.quarter", "DatetimeProperties.is_quarter_start", "DatetimeProperties:4", "DatetimeProperties.minute", "DatetimeProperties.dayofweek", "DatetimeProperties.weekday", "DatetimeProperties.timetz", "DatetimeProperties.month", "DatetimeProperties.is_year_end"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.indexes.accessors.CombinedDatetimelikeProperties)\nclass DatetimeProperties(ClassLogger):\n def __init__(self, data):\n self._series = data\n self._query_compiler = data._query_compiler\n\n @pandas.util.cache_readonly\n def _Series(self): # noqa: GL08\n # to avoid cyclic import\n from .series import Series\n\n return Series\n\n @property\n def date(self):\n return self._Series(query_compiler=self._query_compiler.dt_date())\n\n @property\n def time(self):\n return self._Series(query_compiler=self._query_compiler.dt_time())\n\n @property\n def timetz(self):\n return self._Series(query_compiler=self._query_compiler.dt_timetz())\n\n @property\n def year(self):\n return self._Series(query_compiler=self._query_compiler.dt_year())\n\n @property\n def month(self):\n return self._Series(query_compiler=self._query_compiler.dt_month())\n\n @property\n def day(self):\n return self._Series(query_compiler=self._query_compiler.dt_day())\n\n @property\n def hour(self):\n return self._Series(query_compiler=self._query_compiler.dt_hour())\n\n @property\n def minute(self):\n return self._Series(query_compiler=self._query_compiler.dt_minute())\n\n @property\n def second(self):\n return self._Series(query_compiler=self._query_compiler.dt_second())\n\n @property\n def microsecond(self):\n return self._Series(query_compiler=self._query_compiler.dt_microsecond())\n\n @property\n def nanosecond(self):\n return self._Series(query_compiler=self._query_compiler.dt_nanosecond())\n\n @property\n def dayofweek(self):\n return self._Series(query_compiler=self._query_compiler.dt_dayofweek())\n\n day_of_week = dayofweek\n\n @property\n def weekday(self):\n return self._Series(query_compiler=self._query_compiler.dt_weekday())\n\n @property\n def dayofyear(self):\n return self._Series(query_compiler=self._query_compiler.dt_dayofyear())\n\n day_of_year = dayofyear\n\n @property\n def quarter(self):\n return self._Series(query_compiler=self._query_compiler.dt_quarter())\n\n @property\n def is_month_start(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_month_start())\n\n @property\n def is_month_end(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_month_end())\n\n @property\n def is_quarter_start(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_quarter_start())\n\n @property\n def is_quarter_end(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_quarter_end())\n\n @property\n def is_year_start(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_year_start())\n\n @property\n def is_year_end(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_year_end())\n\n @property\n def is_leap_year(self):\n return self._Series(query_compiler=self._query_compiler.dt_is_leap_year())\n\n @property\n def daysinmonth(self):\n return self._Series(query_compiler=self._query_compiler.dt_daysinmonth())\n\n @property\n def days_in_month(self):\n return self._Series(query_compiler=self._query_compiler.dt_days_in_month())\n\n @property\n def tz(self) -> \"tzinfo | None\":\n dtype = self._series.dtype\n if isinstance(dtype, np.dtype):\n return None\n return dtype.tz\n\n @property\n def freq(self):\n return self._query_compiler.dt_freq().to_pandas().squeeze()\n\n @property\n def unit(self):\n # use `iloc[0]` to return scalar\n return self._Series(query_compiler=self._query_compiler.dt_unit()).iloc[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_modin-project__modin/modin/pandas/series_utils.py_DatetimeProperties.as_unit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/series_utils.py_DatetimeProperties.as_unit_", "embedding": null, "metadata": {"file_path": "modin/pandas/series_utils.py", "file_name": "series_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 632, "end_line": 749, "span_ids": ["DatetimeProperties.start_time", "DatetimeProperties.tz_localize", "DatetimeProperties.to_pytimedelta", "DatetimeProperties.strftime", "DatetimeProperties.to_timestamp", "DatetimeProperties.components", "DatetimeProperties.normalize", "DatetimeProperties.floor", "DatetimeProperties.to_period", "DatetimeProperties.to_pydatetime", "DatetimeProperties.round", "DatetimeProperties.microseconds", "DatetimeProperties.month_name", "DatetimeProperties.tz_convert", "DatetimeProperties.asfreq", "DatetimeProperties.day_name", "DatetimeProperties.qyear", "DatetimeProperties.end_time", "DatetimeProperties.ceil", "DatetimeProperties.nanoseconds", "DatetimeProperties.days", "DatetimeProperties.isocalendar", "DatetimeProperties.seconds", "DatetimeProperties.as_unit", "DatetimeProperties.total_seconds"], "tokens": 831}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(pandas.core.indexes.accessors.CombinedDatetimelikeProperties)\nclass DatetimeProperties(ClassLogger):\n\n def as_unit(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_as_unit(*args, **kwargs)\n )\n\n def to_period(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_to_period(*args, **kwargs)\n )\n\n def asfreq(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_asfreq(*args, **kwargs)\n )\n\n def to_pydatetime(self):\n return self._Series(\n query_compiler=self._query_compiler.dt_to_pydatetime()\n ).to_numpy()\n\n def tz_localize(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_tz_localize(*args, **kwargs)\n )\n\n def tz_convert(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_tz_convert(*args, **kwargs)\n )\n\n def normalize(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_normalize(*args, **kwargs)\n )\n\n def strftime(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_strftime(*args, **kwargs)\n )\n\n def round(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_round(*args, **kwargs)\n )\n\n def floor(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_floor(*args, **kwargs)\n )\n\n def ceil(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_ceil(*args, **kwargs)\n )\n\n def month_name(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_month_name(*args, **kwargs)\n )\n\n def day_name(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_day_name(*args, **kwargs)\n )\n\n def total_seconds(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_total_seconds(*args, **kwargs)\n )\n\n def to_pytimedelta(self) -> \"npt.NDArray[np.object_]\":\n res = self._query_compiler.dt_to_pytimedelta()\n return res.to_numpy()[:, 0]\n\n @property\n def seconds(self):\n return self._Series(query_compiler=self._query_compiler.dt_seconds())\n\n @property\n def days(self):\n return self._Series(query_compiler=self._query_compiler.dt_days())\n\n @property\n def microseconds(self):\n return self._Series(query_compiler=self._query_compiler.dt_microseconds())\n\n @property\n def nanoseconds(self):\n return self._Series(query_compiler=self._query_compiler.dt_nanoseconds())\n\n @property\n def components(self):\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=self._query_compiler.dt_components())\n\n def isocalendar(self):\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=self._query_compiler.dt_isocalendar())\n\n @property\n def qyear(self):\n return self._Series(query_compiler=self._query_compiler.dt_qyear())\n\n @property\n def start_time(self):\n return self._Series(query_compiler=self._query_compiler.dt_start_time())\n\n @property\n def end_time(self):\n return self._Series(query_compiler=self._query_compiler.dt_end_time())\n\n def to_timestamp(self, *args, **kwargs):\n return self._Series(\n query_compiler=self._query_compiler.dt_to_timestamp(*args, **kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/pandas/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/pandas/test/data/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/data/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/pandas/test/data/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/pandas/test/dataframe/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/pandas/test/dataframe/conftest.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/conftest.py_pytest_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 43, "span_ids": ["pytest_collection_modifyitems", "docstring"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom modin.config import StorageFormat\n\n\ndef pytest_collection_modifyitems(items):\n if StorageFormat.get() == \"Hdk\":\n for item in items:\n if item.name in (\n \"test_sum[data0-over_rows_int-skipna_True-True]\",\n \"test_sum[data0-over_rows_str-skipna_True-True]\",\n ):\n item.add_marker(\n pytest.mark.xfail(\n reason=\"https://github.com/intel-ai/hdk/issues/286\"\n )\n )\n elif item.name == \"test_insert_dtypes[category-int_data]\":\n item.add_marker(\n pytest.mark.xfail(\n reason=\"Categorical columns are converted to string due to #1698\"\n )\n )\n elif item.name == \"test_insert_dtypes[int32-float_nan_data]\":\n item.add_marker(\n pytest.mark.xfail(\n reason=\"HDK does not raise IntCastingNaNError on NaN to int cast\"\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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_pytest_pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_pytest_pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 45, "span_ids": ["docstring"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport pandas\nimport matplotlib\nimport modin.pandas as pd\n\nfrom modin.core.dataframe.pandas.partitioning.axis_partition import (\n PandasDataframeAxisPartition,\n)\nfrom modin.pandas.test.utils import (\n df_equals,\n test_data_values,\n test_data_keys,\n eval_general,\n test_data,\n create_test_dfs,\n default_to_pandas_ignore_string,\n CustomIntegerForAddition,\n NonCommutativeMultiplyInteger,\n)\nfrom modin.config import NPartitions, StorageFormat\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom modin.utils import get_current_execution\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_test_math_functions.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_test_math_functions.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 89, "span_ids": ["test_math_functions"], "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": "@pytest.mark.parametrize(\n \"other\",\n [\n lambda df: 4,\n lambda df, axis: df.iloc[0] if axis == \"columns\" else list(df[df.columns[0]]),\n lambda df, axis: {\n label: idx + 1\n for idx, label in enumerate(df.axes[0 if axis == \"rows\" else 1])\n },\n lambda df, axis: {\n label if idx % 2 else f\"random_key{idx}\": idx + 1\n for idx, label in enumerate(df.axes[0 if axis == \"rows\" else 1][::-1])\n },\n ],\n ids=[\n \"scalar\",\n \"series_or_list\",\n \"dictionary_keys_equal_columns\",\n \"dictionary_keys_unequal_columns\",\n ],\n)\n@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\n \"op\",\n [\n *(\"add\", \"radd\", \"sub\", \"rsub\", \"mod\", \"rmod\", \"pow\", \"rpow\"),\n *(\"truediv\", \"rtruediv\", \"mul\", \"rmul\", \"floordiv\", \"rfloordiv\"),\n ],\n)\ndef test_math_functions(other, axis, op):\n data = test_data[\"float_nan_data\"]\n if (op == \"floordiv\" or op == \"rfloordiv\") and axis == \"rows\":\n # lambda == \"series_or_list\"\n pytest.xfail(reason=\"different behavior\")\n\n if op == \"rmod\" and axis == \"rows\":\n # lambda == \"series_or_list\"\n pytest.xfail(reason=\"different behavior\")\n\n eval_general(\n *create_test_dfs(data), lambda df: getattr(df, op)(other(df, axis), axis=axis)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_fill_value_test_math_functions_fill_value.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_fill_value_test_math_functions_fill_value.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 116, "span_ids": ["test_math_functions_fill_value"], "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": "@pytest.mark.parametrize(\n \"other\",\n [lambda df: df[: -(2**4)], lambda df: df[df.columns[0]].reset_index(drop=True)],\n ids=[\"check_missing_value\", \"check_different_index\"],\n)\n@pytest.mark.parametrize(\"fill_value\", [None, 3.0])\n@pytest.mark.parametrize(\n \"op\",\n [\n *(\"add\", \"radd\", \"sub\", \"rsub\", \"mod\", \"rmod\", \"pow\", \"rpow\"),\n *(\"truediv\", \"rtruediv\", \"mul\", \"rmul\", \"floordiv\", \"rfloordiv\"),\n ],\n)\ndef test_math_functions_fill_value(other, fill_value, op):\n data = test_data[\"int_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: getattr(df, op)(other(df), axis=0, fill_value=fill_value),\n # This test causes an empty slice to be generated thus triggering:\n # https://github.com/modin-project/modin/issues/5974\n comparator_kwargs={\"check_dtypes\": get_current_execution() != \"BaseOnPython\"},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_level_test_math_functions_level.with_warns_that_defaultin.getattr_modin_df_op_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_functions_level_test_math_functions_level.with_warns_that_defaultin.getattr_modin_df_op_mod", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 135, "span_ids": ["test_math_functions_level"], "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": "@pytest.mark.parametrize(\n \"op\",\n [\n *(\"add\", \"radd\", \"sub\", \"rsub\", \"mod\", \"rmod\", \"pow\", \"rpow\"),\n *(\"truediv\", \"rtruediv\", \"mul\", \"rmul\", \"floordiv\", \"rfloordiv\"),\n ],\n)\ndef test_math_functions_level(op):\n modin_df = pd.DataFrame(test_data[\"int_data\"])\n modin_df.index = pandas.MultiIndex.from_tuples(\n [(i // 4, i // 2, i) for i in modin_df.index]\n )\n\n # Defaults to pandas\n with warns_that_defaulting_to_pandas():\n # Operation against self for sanity check\n getattr(modin_df, op)(modin_df, axis=0, level=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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_alias_test_math_alias.assert_getattr_pd_DataFra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_math_alias_test_math_alias.assert_getattr_pd_DataFra", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 163, "span_ids": ["test_math_alias"], "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": "@pytest.mark.parametrize(\n \"math_op, alias\",\n [\n (\"truediv\", \"divide\"),\n (\"truediv\", \"div\"),\n (\"rtruediv\", \"rdiv\"),\n (\"mul\", \"multiply\"),\n (\"sub\", \"subtract\"),\n (\"add\", \"__add__\"),\n (\"radd\", \"__radd__\"),\n (\"truediv\", \"__truediv__\"),\n (\"rtruediv\", \"__rtruediv__\"),\n (\"floordiv\", \"__floordiv__\"),\n (\"rfloordiv\", \"__rfloordiv__\"),\n (\"mod\", \"__mod__\"),\n (\"rmod\", \"__rmod__\"),\n (\"mul\", \"__mul__\"),\n (\"rmul\", \"__rmul__\"),\n (\"pow\", \"__pow__\"),\n (\"rpow\", \"__rpow__\"),\n (\"sub\", \"__sub__\"),\n (\"rsub\", \"__rsub__\"),\n ],\n)\ndef test_math_alias(math_op, alias):\n assert getattr(pd.DataFrame, math_op) == getattr(pd.DataFrame, alias)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_comparison_test_comparison.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_comparison_test_comparison.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 181, "span_ids": ["test_comparison"], "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": "@pytest.mark.parametrize(\"other\", [\"as_left\", 4, 4.0, \"a\"])\n@pytest.mark.parametrize(\"op\", [\"eq\", \"ge\", \"gt\", \"le\", \"lt\", \"ne\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_comparison(data, op, other):\n def operation(df):\n df = getattr(df, op)(df if other == \"as_left\" else other)\n if other == \"as_left\" and StorageFormat.get() == \"Hdk\":\n # In case of comparison with a DataFrame, HDK returns\n # a DataFrame with sorted columns.\n df = df.sort_index(axis=1)\n return df\n\n eval_general(\n *create_test_dfs(data),\n operation=operation,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_virtual_partitions_test_virtual_partitions.df_equals_modin_df_left_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_virtual_partitions_test_virtual_partitions.df_equals_modin_df_left_v", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 207, "span_ids": ["test_virtual_partitions"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n StorageFormat.get() != \"Pandas\",\n reason=\"Modin on this engine doesn't create virtual partitions.\",\n)\n@pytest.mark.parametrize(\n \"left_virtual,right_virtual\", [(True, False), (False, True), (True, True)]\n)\ndef test_virtual_partitions(left_virtual: bool, right_virtual: bool):\n # This test covers https://github.com/modin-project/modin/issues/4691\n n: int = 1000\n pd_df = pandas.DataFrame(list(range(n)))\n\n def modin_df(is_virtual):\n if not is_virtual:\n return pd.DataFrame(pd_df)\n result = pd.concat([pd.DataFrame([i]) for i in range(n)], ignore_index=True)\n # Modin should rebalance the partitions after the concat, producing virtual partitions.\n assert isinstance(\n result._query_compiler._modin_frame._partitions[0][0],\n PandasDataframeAxisPartition,\n )\n return result\n\n df_equals(modin_df(left_virtual) + modin_df(right_virtual), pd_df + pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_multi_level_comparison_test_multi_level_comparison.with_warns_that_defaultin.getattr_modin_df_multi_le": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_multi_level_comparison_test_multi_level_comparison.with_warns_that_defaultin.getattr_modin_df_multi_le", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 210, "end_line": 223, "span_ids": ["test_multi_level_comparison"], "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": "@pytest.mark.parametrize(\"op\", [\"eq\", \"ge\", \"gt\", \"le\", \"lt\", \"ne\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_multi_level_comparison(data, op):\n modin_df_multi_level = pd.DataFrame(data)\n\n new_idx = pandas.MultiIndex.from_tuples(\n [(i // 4, i // 2, i) for i in modin_df_multi_level.index]\n )\n modin_df_multi_level.index = new_idx\n\n # Defaults to pandas\n with warns_that_defaulting_to_pandas():\n # Operation against self for sanity check\n getattr(modin_df_multi_level, op)(modin_df_multi_level, axis=0, level=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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_equals_test_equals.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_equals_test_equals.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 247, "span_ids": ["test_equals"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_equals():\n frame_data = {\"col1\": [2.9, 3, 3, 3], \"col2\": [2, 3, 4, 1]}\n modin_df1 = pd.DataFrame(frame_data)\n modin_df2 = pd.DataFrame(frame_data)\n\n assert modin_df1.equals(modin_df2)\n\n df_equals(modin_df1, modin_df2)\n df_equals(modin_df1, pd.DataFrame(modin_df1))\n\n frame_data = {\"col1\": [2.9, 3, 3, 3], \"col2\": [2, 3, 5, 1]}\n modin_df3 = pd.DataFrame(frame_data, index=list(\"abcd\"))\n\n assert not modin_df1.equals(modin_df3)\n\n with pytest.raises(AssertionError):\n df_equals(modin_df3, modin_df1)\n\n with pytest.raises(AssertionError):\n df_equals(modin_df3, modin_df2)\n\n assert modin_df1.equals(modin_df2._query_compiler.to_pandas())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_mismatched_row_partitions_test_mismatched_row_partitions.df_equals_modin_res_pand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_mismatched_row_partitions_test_mismatched_row_partitions.df_equals_modin_res_pand", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 250, "end_line": 299, "span_ids": ["test_mismatched_row_partitions"], "tokens": 560}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"is_more_other_partitions\", [True, False])\n@pytest.mark.parametrize(\n \"op_type\", [\"df_ser\", \"df_df\", \"ser_ser_same_name\", \"ser_ser_different_name\"]\n)\n@pytest.mark.parametrize(\n \"is_idx_aligned\", [True, False], ids=[\"idx_aligned\", \"idx_not_aligned\"]\n)\ndef test_mismatched_row_partitions(is_idx_aligned, op_type, is_more_other_partitions):\n data = [0, 1, 2, 3, 4, 5]\n modin_df1, pandas_df1 = create_test_dfs({\"a\": data, \"b\": data})\n modin_df, pandas_df = modin_df1.loc[:2], pandas_df1.loc[:2]\n\n modin_df2 = pd.concat((modin_df, modin_df))\n pandas_df2 = pandas.concat((pandas_df, pandas_df))\n if is_more_other_partitions:\n modin_df2, modin_df1 = modin_df1, modin_df2\n pandas_df2, pandas_df1 = pandas_df1, pandas_df2\n\n if is_idx_aligned:\n if is_more_other_partitions:\n modin_df1.index = pandas_df1.index = pandas_df2.index\n else:\n modin_df2.index = pandas_df2.index = pandas_df1.index\n\n # Pandas don't support this case because result will contain duplicate values by col axis.\n if op_type == \"df_ser\" and not is_idx_aligned and is_more_other_partitions:\n eval_general(\n modin_df2,\n pandas_df2,\n lambda df: df / modin_df1.a\n if isinstance(df, pd.DataFrame)\n else df / pandas_df1.a,\n )\n return\n\n if op_type == \"df_ser\":\n modin_res = modin_df2 / modin_df1.a\n pandas_res = pandas_df2 / pandas_df1.a\n elif op_type == \"df_df\":\n modin_res = modin_df2 / modin_df1\n pandas_res = pandas_df2 / pandas_df1\n elif op_type == \"ser_ser_same_name\":\n modin_res = modin_df2.a / modin_df1.a\n pandas_res = pandas_df2.a / pandas_df1.a\n elif op_type == \"ser_ser_different_name\":\n modin_res = modin_df2.a / modin_df1.b\n pandas_res = pandas_df2.a / pandas_df1.b\n else:\n raise Exception(f\"op_type: {op_type} not supported in test\")\n df_equals(modin_res, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_duplicate_indexes_test_duplicate_indexes.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_duplicate_indexes_test_duplicate_indexes.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 309, "span_ids": ["test_duplicate_indexes"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_duplicate_indexes():\n data = [0, 1, 2, 3, 4, 5]\n modin_df1, pandas_df1 = create_test_dfs(\n {\"a\": data, \"b\": data}, index=[0, 1, 2, 0, 1, 2]\n )\n modin_df2, pandas_df2 = create_test_dfs({\"a\": data, \"b\": data})\n df_equals(modin_df1 / modin_df2, pandas_df1 / pandas_df2)\n df_equals(modin_df1 / modin_df1, pandas_df1 / pandas_df1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_mismatched_col_partitions_test_mismatched_col_partitions.df_equals_modin_res_pand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_mismatched_col_partitions_test_mismatched_col_partitions.df_equals_modin_res_pand", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 312, "end_line": 328, "span_ids": ["test_mismatched_col_partitions"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"subset_operand\", [\"left\", \"right\"])\ndef test_mismatched_col_partitions(subset_operand):\n data = [0, 1, 2, 3]\n modin_df1, pandas_df1 = create_test_dfs({\"a\": data, \"b\": data})\n modin_df_tmp, pandas_df_tmp = create_test_dfs({\"c\": data})\n\n modin_df2 = pd.concat([modin_df1, modin_df_tmp], axis=1)\n pandas_df2 = pandas.concat([pandas_df1, pandas_df_tmp], axis=1)\n\n if subset_operand == \"right\":\n modin_res = modin_df2 + modin_df1\n pandas_res = pandas_df2 + pandas_df1\n else:\n modin_res = modin_df1 + modin_df2\n pandas_res = pandas_df1 + pandas_df2\n\n df_equals(modin_res, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_empty_df_test_empty_df.df_equals_modin_res_pand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_empty_df_test_empty_df.df_equals_modin_res_pand", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 331, "end_line": 346, "span_ids": ["test_empty_df"], "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": "@pytest.mark.parametrize(\"empty_operand\", [\"right\", \"left\", \"both\"])\ndef test_empty_df(empty_operand):\n modin_df, pandas_df = create_test_dfs([0, 1, 2, 0, 1, 2])\n modin_df_empty, pandas_df_empty = create_test_dfs()\n\n if empty_operand == \"right\":\n modin_res = modin_df + modin_df_empty\n pandas_res = pandas_df + pandas_df_empty\n elif empty_operand == \"left\":\n modin_res = modin_df_empty + modin_df\n pandas_res = pandas_df_empty + pandas_df\n else:\n modin_res = modin_df_empty + modin_df_empty\n pandas_res = pandas_df_empty + pandas_df_empty\n\n df_equals(modin_res, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_add_string_to_df_test_non_commutative_multiply_pandas.assert_not_integer_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_add_string_to_df_test_non_commutative_multiply_pandas.assert_not_integer_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 349, "end_line": 371, "span_ids": ["test_add_custom_class", "test_non_commutative_multiply_pandas", "test_add_string_to_df"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add_string_to_df():\n modin_df, pandas_df = create_test_dfs([\"a\", \"b\"])\n eval_general(modin_df, pandas_df, lambda df: \"string\" + df)\n eval_general(modin_df, pandas_df, lambda df: df + \"string\")\n\n\ndef test_add_custom_class():\n # see https://github.com/modin-project/modin/issues/5236\n # Test that we can add any object that is addable to pandas object data\n # via \"+\".\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df + CustomIntegerForAddition(4),\n )\n\n\ndef test_non_commutative_multiply_pandas():\n # The non commutative integer class implementation is tricky. Check that\n # multiplying such an integer with a pandas dataframe is really not\n # commutative.\n pandas_df = pandas.DataFrame([[1]], dtype=int)\n integer = NonCommutativeMultiplyInteger(2)\n assert not (integer * pandas_df).equals(pandas_df * integer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_non_commutative_multiply_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_binary.py_test_non_commutative_multiply_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_binary.py", "file_name": "test_binary.py", "file_type": "text/x-python", "category": "test", "start_line": 374, "end_line": 382, "span_ids": ["test_non_commutative_multiply"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_non_commutative_multiply():\n # This test checks that mul and rmul do different things when\n # multiplication is not commutative, e.g. for adding a string to a string.\n # For context see https://github.com/modin-project/modin/issues/5238\n modin_df, pandas_df = create_test_dfs([1], dtype=int)\n integer = NonCommutativeMultiplyInteger(2)\n eval_general(modin_df, pandas_df, lambda s: integer * s)\n eval_general(modin_df, pandas_df, lambda s: s * integer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_sys_pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_sys_pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 60, "span_ids": ["docstring"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport pytest\nimport numpy as np\nimport pandas\nimport matplotlib\nfrom numpy.testing import assert_array_equal\nimport io\nimport warnings\n\nimport modin.pandas as pd\nfrom modin.utils import (\n to_pandas,\n get_current_execution,\n)\n\nfrom modin.pandas.test.utils import (\n df_equals,\n name_contains,\n test_data_values,\n test_data_keys,\n numeric_dfs,\n axis_keys,\n axis_values,\n bool_arg_keys,\n bool_arg_values,\n eval_general,\n create_test_dfs,\n generate_multiindex,\n test_data_resample,\n test_data,\n test_data_diff_dtype,\n modin_df_almost_equals_pandas,\n test_data_large_categorical_dataframe,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions, StorageFormat\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_ops_defaulting_to_pandas_test_ops_defaulting_to_pandas.with_warns_that_defaultin.if_make_args_is_not_None_.else_.try_.except_TypeError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_ops_defaulting_to_pandas_test_ops_defaulting_to_pandas.with_warns_that_defaultin.if_make_args_is_not_None_.else_.try_.except_TypeError_.pass", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 93, "span_ids": ["test_ops_defaulting_to_pandas"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"op, make_args\",\n [\n (\"align\", lambda df: {\"other\": df}),\n (\"corrwith\", lambda df: {\"other\": df}),\n (\"ewm\", lambda df: {\"com\": 0.5}),\n (\"from_dict\", lambda df: {\"data\": None}),\n (\"from_records\", lambda df: {\"data\": to_pandas(df)}),\n (\"hist\", lambda df: {\"column\": \"int_col\"}),\n (\"interpolate\", None),\n (\"mask\", lambda df: {\"cond\": df != 0}),\n (\"pct_change\", None),\n (\"to_xarray\", None),\n (\"flags\", None),\n (\"set_flags\", lambda df: {\"allows_duplicate_labels\": False}),\n ],\n)\ndef test_ops_defaulting_to_pandas(op, make_args):\n modin_df = pd.DataFrame(test_data_diff_dtype).drop([\"str_col\", \"bool_col\"], axis=1)\n if op == \"to_xarray\" and sys.version_info < (3, 9):\n pytest.skip(\"xarray doesn't support pandas>=2.0 for python 3.8\")\n with warns_that_defaulting_to_pandas():\n operation = getattr(modin_df, op)\n if make_args is not None:\n operation(**make_args(modin_df))\n else:\n try:\n operation()\n # `except` for non callable attributes\n except TypeError:\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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_style_test_asfreq.with_warns_that_defaultin.df_asfreq_freq_30S_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_style_test_asfreq.with_warns_that_defaultin.df_asfreq_freq_30S_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 134, "span_ids": ["test_asfreq", "test_partition_to_numpy", "test_to_numpy", "test_to_timestamp", "test_style"], "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": "def test_style():\n data = test_data_values[0]\n with warns_that_defaulting_to_pandas():\n pd.DataFrame(data).style\n\n\ndef test_to_timestamp():\n idx = pd.date_range(\"1/1/2012\", periods=5, freq=\"M\")\n df = pd.DataFrame(np.random.randint(0, 100, size=(len(idx), 4)), index=idx)\n\n with warns_that_defaulting_to_pandas():\n df.to_period().to_timestamp()\n\n\n@pytest.mark.parametrize(\n \"data\",\n test_data_values + [test_data_large_categorical_dataframe],\n ids=test_data_keys + [\"categorical_ints\"],\n)\ndef test_to_numpy(data):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n assert_array_equal(modin_df.values, pandas_df.values)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_partition_to_numpy(data):\n frame = pd.DataFrame(data)\n for partition in frame._query_compiler._modin_frame._partitions.flatten().tolist():\n assert_array_equal(partition.to_pandas().values, partition.to_numpy())\n\n\ndef test_asfreq():\n index = pd.date_range(\"1/1/2000\", periods=4, freq=\"T\")\n series = pd.Series([0.0, None, 2.0, 3.0], index=index)\n df = pd.DataFrame({\"s\": series})\n with warns_that_defaulting_to_pandas():\n # We are only testing that this defaults to pandas, so we will just check for\n # the warning\n df.asfreq(freq=\"30S\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_assign_test_assign.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_assign_test_assign.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 152, "span_ids": ["test_assign"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_assign():\n data = test_data_values[0]\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_result = modin_df.assign(new_column=pd.Series(modin_df.iloc[:, 0]))\n pandas_result = pandas_df.assign(new_column=pandas.Series(pandas_df.iloc[:, 0]))\n df_equals(modin_result, pandas_result)\n modin_result = modin_df.assign(\n new_column=pd.Series(modin_df.iloc[:, 0]),\n new_column2=pd.Series(modin_df.iloc[:, 1]),\n )\n pandas_result = pandas_df.assign(\n new_column=pandas.Series(pandas_df.iloc[:, 0]),\n new_column2=pandas.Series(pandas_df.iloc[:, 1]),\n )\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_at_time_test_at_time.df_equals_modin_df_T_at_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_at_time_test_at_time.df_equals_modin_df_T_at_t", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 155, "end_line": 163, "span_ids": ["test_at_time"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_at_time():\n i = pd.date_range(\"2008-01-01\", periods=1000, freq=\"12H\")\n modin_df = pd.DataFrame({\"A\": list(range(1000)), \"B\": list(range(1000))}, index=i)\n pandas_df = pandas.DataFrame(\n {\"A\": list(range(1000)), \"B\": list(range(1000))}, index=i\n )\n df_equals(modin_df.at_time(\"12:00\"), pandas_df.at_time(\"12:00\"))\n df_equals(modin_df.at_time(\"3:00\"), pandas_df.at_time(\"3:00\"))\n df_equals(modin_df.T.at_time(\"12:00\", axis=1), pandas_df.T.at_time(\"12:00\", axis=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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_between_time_test_between_time.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_between_time_test_between_time.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 183, "span_ids": ["test_between_time"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_between_time():\n i = pd.date_range(\"2008-01-01\", periods=1000, freq=\"12H\")\n modin_df = pd.DataFrame({\"A\": list(range(1000)), \"B\": list(range(1000))}, index=i)\n pandas_df = pandas.DataFrame(\n {\"A\": list(range(1000)), \"B\": list(range(1000))}, index=i\n )\n df_equals(\n modin_df.between_time(\"12:00\", \"17:00\"),\n pandas_df.between_time(\"12:00\", \"17:00\"),\n )\n df_equals(\n modin_df.between_time(\"3:00\", \"4:00\"),\n pandas_df.between_time(\"3:00\", \"4:00\"),\n )\n df_equals(\n modin_df.T.between_time(\"12:00\", \"17:00\", axis=1),\n pandas_df.T.between_time(\"12:00\", \"17:00\", axis=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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_bfill_test_bool.None_1.single_bool_modin_df___bo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_bfill_test_bool.None_1.single_bool_modin_df___bo", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 186, "end_line": 208, "span_ids": ["test_bfill", "test_bool"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_bfill(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n df_equals(modin_df.bfill(), pandas_df.bfill())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_bool(data):\n modin_df = pd.DataFrame(data)\n\n with pytest.raises(ValueError):\n modin_df.bool()\n modin_df.__bool__()\n\n single_bool_pandas_df = pandas.DataFrame([True])\n single_bool_modin_df = pd.DataFrame([True])\n\n assert single_bool_pandas_df.bool() == single_bool_modin_df.bool()\n\n with pytest.raises(ValueError):\n # __bool__ always raises this error for DataFrames\n single_bool_modin_df.__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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_boxplot_test_combine_first.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_boxplot_test_combine_first.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 230, "span_ids": ["test_boxplot", "test_combine_first"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_boxplot(data):\n modin_df = pd.DataFrame(data)\n\n assert modin_df.boxplot() == to_pandas(modin_df).boxplot()\n\n\ndef test_combine_first():\n data1 = {\"A\": [None, 0], \"B\": [None, 4]}\n modin_df1 = pd.DataFrame(data1)\n pandas_df1 = pandas.DataFrame(data1)\n data2 = {\"A\": [1, 1], \"B\": [3, 3]}\n modin_df2 = pd.DataFrame(data2)\n pandas_df2 = pandas.DataFrame(data2)\n df_equals(\n modin_df1.combine_first(modin_df2),\n pandas_df1.combine_first(pandas_df2),\n # https://github.com/modin-project/modin/issues/5959\n check_dtypes=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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr_TestCorr.test_corr.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr_TestCorr.test_corr.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 233, "end_line": 246, "span_ids": ["TestCorr", "TestCorr.test_corr"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCorr:\n @pytest.mark.parametrize(\"method\", [\"pearson\", \"kendall\", \"spearman\"])\n def test_corr(self, method):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.corr(method=method),\n )\n # Modin result may slightly differ from pandas result\n # due to floating pointing arithmetic.\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: df.corr(method=method),\n comparator=modin_df_almost_equals_pandas,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr.test_corr_min_periods_TestCorr.test_corr_non_numeric.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr.test_corr_min_periods_TestCorr.test_corr_non_numeric.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 248, "end_line": 289, "span_ids": ["TestCorr.test_corr_min_periods", "TestCorr.test_corr_non_numeric"], "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 TestCorr:\n\n @pytest.mark.parametrize(\"min_periods\", [1, 3, 5, 6])\n def test_corr_min_periods(self, min_periods):\n # only 3 valid values (a valid value is considered a row with no NaNs)\n eval_general(\n *create_test_dfs({\"a\": [1, 2, 3], \"b\": [3, 1, 5]}),\n lambda df: df.corr(min_periods=min_periods),\n )\n\n # only 5 valid values (a valid value is considered a row with no NaNs)\n eval_general(\n *create_test_dfs(\n {\"a\": [1, 2, 3, 4, 5, np.nan], \"b\": [1, 2, 1, 4, 5, np.nan]}\n ),\n lambda df: df.corr(min_periods=min_periods),\n )\n\n # only 4 valid values (a valid value is considered a row with no NaNs)\n eval_general(\n *create_test_dfs(\n {\"a\": [1, np.nan, 3, 4, 5, 6], \"b\": [1, 2, 1, 4, 5, np.nan]}\n ),\n lambda df: df.corr(min_periods=min_periods),\n )\n\n if StorageFormat.get() == \"Pandas\":\n # only 4 valid values located in different partitions (a valid value is considered a row with no NaNs)\n modin_df, pandas_df = create_test_dfs(\n {\"a\": [1, np.nan, 3, 4, 5, 6], \"b\": [1, 2, 1, 4, 5, np.nan]}\n )\n modin_df = pd.concat([modin_df.iloc[:3], modin_df.iloc[3:]])\n\n assert modin_df._query_compiler._modin_frame._partitions.shape == (2, 1)\n eval_general(\n modin_df, pandas_df, lambda df: df.corr(min_periods=min_periods)\n )\n\n @pytest.mark.parametrize(\"numeric_only\", [True, False, None])\n def test_corr_non_numeric(self, numeric_only):\n eval_general(\n *create_test_dfs({\"a\": [1, 2, 3], \"b\": [3, 2, 5], \"c\": [\"a\", \"b\", \"c\"]}),\n lambda df: df.corr(numeric_only=numeric_only),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr.test_corr_nans_in_different_partitions_TestCorr.test_corr_nans_in_different_partitions.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_TestCorr.test_corr_nans_in_different_partitions_TestCorr.test_corr_nans_in_different_partitions.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 291, "end_line": 330, "span_ids": ["TestCorr.test_corr_nans_in_different_partitions"], "tokens": 602}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCorr:\n\n @pytest.mark.skipif(\n StorageFormat.get() != \"Pandas\",\n reason=\"doesn't make sense for non-partitioned executions\",\n )\n def test_corr_nans_in_different_partitions(self):\n # NaN in the first partition\n modin_df, pandas_df = create_test_dfs(\n {\"a\": [np.nan, 2, 3, 4, 5, 6], \"b\": [3, 4, 2, 0, 7, 8]}\n )\n modin_df = pd.concat([modin_df.iloc[:2], modin_df.iloc[2:4], modin_df.iloc[4:]])\n\n assert modin_df._query_compiler._modin_frame._partitions.shape == (3, 1)\n eval_general(modin_df, pandas_df, lambda df: df.corr())\n\n # NaN in the last partition\n modin_df, pandas_df = create_test_dfs(\n {\"a\": [1, 2, 3, 4, 5, np.nan], \"b\": [3, 4, 2, 0, 7, 8]}\n )\n modin_df = pd.concat([modin_df.iloc[:2], modin_df.iloc[2:4], modin_df.iloc[4:]])\n\n assert modin_df._query_compiler._modin_frame._partitions.shape == (3, 1)\n eval_general(modin_df, pandas_df, lambda df: df.corr())\n\n # NaN in two partitions\n modin_df, pandas_df = create_test_dfs(\n {\"a\": [np.nan, 2, 3, 4, 5, 6], \"b\": [3, 4, 2, 0, 7, np.nan]}\n )\n modin_df = pd.concat([modin_df.iloc[:2], modin_df.iloc[2:4], modin_df.iloc[4:]])\n\n assert modin_df._query_compiler._modin_frame._partitions.shape == (3, 1)\n eval_general(modin_df, pandas_df, lambda df: df.corr())\n\n # NaN in all partitions\n modin_df, pandas_df = create_test_dfs(\n {\"a\": [np.nan, 2, 3, np.nan, 5, 6], \"b\": [3, 4, 2, 0, 7, np.nan]}\n )\n modin_df = pd.concat([modin_df.iloc[:2], modin_df.iloc[2:4], modin_df.iloc[4:]])\n\n assert modin_df._query_compiler._modin_frame._partitions.shape == (3, 1)\n eval_general(modin_df, pandas_df, lambda df: df.corr())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_cov_test_cov_numeric_only.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_cov_test_cov_numeric_only.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 366, "span_ids": ["test_cov_numeric_only", "test_cov"], "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": "@pytest.mark.parametrize(\"min_periods\", [1, 3, 5], ids=lambda x: f\"min_periods={x}\")\n@pytest.mark.parametrize(\"ddof\", [1, 2, 4], ids=lambda x: f\"ddof={x}\")\ndef test_cov(min_periods, ddof):\n # Modin result may slightly differ from pandas result\n # due to floating pointing arithmetic.\n if StorageFormat.get() == \"Hdk\":\n\n def comparator1(df1, df2):\n modin_df_almost_equals_pandas(df1, df2, max_diff=0.0002)\n\n comparator2 = comparator1\n else:\n comparator1 = df_equals\n comparator2 = modin_df_almost_equals_pandas\n\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.cov(min_periods=min_periods, ddof=ddof),\n comparator=comparator1,\n )\n\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: df.cov(min_periods=min_periods),\n comparator=comparator2,\n )\n\n\n@pytest.mark.parametrize(\"numeric_only\", [True, False, None])\ndef test_cov_numeric_only(numeric_only):\n eval_general(\n *create_test_dfs({\"a\": [1, 2, 3], \"b\": [3, 2, 5], \"c\": [\"a\", \"b\", \"c\"]}),\n lambda df: df.cov(numeric_only=numeric_only),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_dot_test_dot.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_dot_test_dot.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 369, "end_line": 413, "span_ids": ["test_dot"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dot(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n col_len = len(modin_df.columns)\n\n # Test list input\n arr = np.arange(col_len)\n modin_result = modin_df.dot(arr)\n pandas_result = pandas_df.dot(arr)\n df_equals(modin_result, pandas_result)\n\n # Test bad dimensions\n with pytest.raises(ValueError):\n modin_df.dot(np.arange(col_len + 10))\n\n # Test series input\n modin_series = pd.Series(np.arange(col_len), index=modin_df.columns)\n pandas_series = pandas.Series(np.arange(col_len), index=pandas_df.columns)\n modin_result = modin_df.dot(modin_series)\n pandas_result = pandas_df.dot(pandas_series)\n df_equals(modin_result, pandas_result)\n\n # Test dataframe input\n modin_result = modin_df.dot(modin_df.T)\n pandas_result = pandas_df.dot(pandas_df.T)\n df_equals(modin_result, pandas_result)\n\n # Test when input series index doesn't line up with columns\n with pytest.raises(ValueError):\n modin_df.dot(pd.Series(np.arange(col_len)))\n\n # Test case when left dataframe has size (n x 1)\n # and right dataframe has size (1 x n)\n modin_df = pd.DataFrame(modin_series)\n pandas_df = pandas.DataFrame(pandas_series)\n modin_result = modin_df.dot(modin_df.T)\n pandas_result = pandas_df.dot(pandas_df.T)\n df_equals(modin_result, pandas_result)\n\n # Test case when left dataframe has size (1 x 1)\n # and right dataframe has size (1 x n)\n modin_result = pd.DataFrame([1]).dot(modin_df.T)\n pandas_result = pandas.DataFrame([1]).dot(pandas_df.T)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_matmul_test_matmul.None_1.modin_df_pd_Series_np_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_matmul_test_matmul.None_1.modin_df_pd_Series_np_a", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 416, "end_line": 446, "span_ids": ["test_matmul"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_matmul(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n col_len = len(modin_df.columns)\n\n # Test list input\n arr = np.arange(col_len)\n modin_result = modin_df @ arr\n pandas_result = pandas_df @ arr\n df_equals(modin_result, pandas_result)\n\n # Test bad dimensions\n with pytest.raises(ValueError):\n modin_df @ np.arange(col_len + 10)\n\n # Test series input\n modin_series = pd.Series(np.arange(col_len), index=modin_df.columns)\n pandas_series = pandas.Series(np.arange(col_len), index=pandas_df.columns)\n modin_result = modin_df @ modin_series\n pandas_result = pandas_df @ pandas_series\n df_equals(modin_result, pandas_result)\n\n # Test dataframe input\n modin_result = modin_df @ modin_df.T\n pandas_result = pandas_df @ pandas_df.T\n df_equals(modin_result, pandas_result)\n\n # Test when input series index doesn't line up with columns\n with pytest.raises(ValueError):\n modin_df @ pd.Series(np.arange(col_len))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_first_test_first.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_first_test_first.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 449, "end_line": 456, "span_ids": ["test_first"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_first():\n i = pd.date_range(\"2010-04-09\", periods=400, freq=\"2D\")\n modin_df = pd.DataFrame({\"A\": list(range(400)), \"B\": list(range(400))}, index=i)\n pandas_df = pandas.DataFrame(\n {\"A\": list(range(400)), \"B\": list(range(400))}, index=i\n )\n df_equals(modin_df.first(\"3D\"), pandas_df.first(\"3D\"))\n df_equals(modin_df.first(\"20D\"), pandas_df.first(\"20D\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_info_default_param_test_info_default_param.with_io_StringIO_as_fir.assert_modin_info_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_info_default_param_test_info_default_param.with_io_StringIO_as_fir.assert_modin_info_1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 459, "end_line": 476, "span_ids": ["test_info_default_param"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_info_default_param(data):\n with io.StringIO() as first, io.StringIO() as second:\n eval_general(\n pd.DataFrame(data),\n pandas.DataFrame(data),\n verbose=None,\n max_cols=None,\n memory_usage=None,\n operation=lambda df, **kwargs: df.info(**kwargs),\n buf=lambda df: second if isinstance(df, pandas.DataFrame) else first,\n )\n modin_info = first.getvalue().splitlines()\n pandas_info = second.getvalue().splitlines()\n\n assert modin_info[0] == str(pd.DataFrame)\n assert pandas_info[0] == str(pandas.DataFrame)\n assert modin_info[1:] == pandas_info[1:]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py__randint_data_covers_htt_test_info.with_io_StringIO_as_fir.assert_modin_info_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py__randint_data_covers_htt_test_info.with_io_StringIO_as_fir.assert_modin_info_1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 479, "end_line": 504, "span_ids": ["test_info_default_param", "test_info"], "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": "# randint data covers https://github.com/modin-project/modin/issues/5137\n@pytest.mark.parametrize(\n \"data\", [test_data_values[0], np.random.randint(0, 100, (10, 10))]\n)\n@pytest.mark.parametrize(\"verbose\", [True, False])\n@pytest.mark.parametrize(\"max_cols\", [10, 99999999])\n@pytest.mark.parametrize(\"memory_usage\", [True, False, \"deep\"])\n@pytest.mark.parametrize(\"show_counts\", [True, False])\ndef test_info(data, verbose, max_cols, memory_usage, show_counts):\n with io.StringIO() as first, io.StringIO() as second:\n eval_general(\n pd.DataFrame(data),\n pandas.DataFrame(data),\n operation=lambda df, **kwargs: df.info(**kwargs),\n verbose=verbose,\n max_cols=max_cols,\n memory_usage=memory_usage,\n show_counts=show_counts,\n buf=lambda df: second if isinstance(df, pandas.DataFrame) else first,\n )\n modin_info = first.getvalue().splitlines()\n pandas_info = second.getvalue().splitlines()\n\n assert modin_info[0] == str(pd.DataFrame)\n assert pandas_info[0] == str(pandas.DataFrame)\n assert modin_info[1:] == pandas_info[1:]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_kurt_kurtosis_test_kurt_kurtosis.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_kurt_kurtosis_test_kurt_kurtosis.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 507, "end_line": 519, "span_ids": ["test_kurt_kurtosis"], "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": "@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"skipna\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"numeric_only\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"method\", [\"kurtosis\", \"kurt\"])\ndef test_kurt_kurtosis(axis, skipna, numeric_only, method):\n data = test_data[\"float_nan_data\"]\n\n eval_general(\n *create_test_dfs(data),\n lambda df: getattr(df, method)(\n axis=axis, skipna=skipna, numeric_only=numeric_only\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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_last_test_last.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_last_test_last.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 522, "end_line": 532, "span_ids": ["test_last"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_last():\n modin_index = pd.date_range(\"2010-04-09\", periods=400, freq=\"2D\")\n pandas_index = pandas.date_range(\"2010-04-09\", periods=400, freq=\"2D\")\n modin_df = pd.DataFrame(\n {\"A\": list(range(400)), \"B\": list(range(400))}, index=modin_index\n )\n pandas_df = pandas.DataFrame(\n {\"A\": list(range(400)), \"B\": list(range(400))}, index=pandas_index\n )\n df_equals(modin_df.last(\"3D\"), pandas_df.last(\"3D\"))\n df_equals(modin_df.last(\"20D\"), pandas_df.last(\"20D\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_melt_test_melt.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_melt_test_melt.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 535, "end_line": 560, "span_ids": ["test_melt"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"id_vars\", [lambda df: df.columns[0], lambda df: df.columns[:4], None]\n)\n@pytest.mark.parametrize(\n \"value_vars\", [lambda df: df.columns[-1], lambda df: df.columns[-4:], None]\n)\ndef test_melt(data, id_vars, value_vars):\n if StorageFormat.get() == \"Hdk\":\n # Drop NA and sort by all columns to make sure the order\n # is identical to Pandas.\n def melt(df, *args, **kwargs):\n df = df.melt(*args, **kwargs).dropna()\n return df.sort_values(df.columns.tolist())\n\n else:\n\n def melt(df, *args, **kwargs):\n return df.melt(*args, **kwargs).sort_values([\"variable\", \"value\"])\n\n eval_general(\n *create_test_dfs(data),\n lambda df, *args, **kwargs: melt(df, *args, **kwargs).reset_index(drop=True),\n id_vars=id_vars,\n value_vars=value_vars,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_test_pivot.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_test_pivot.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 563, "end_line": 579, "span_ids": ["test_pivot"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"index\", [lambda df: df.columns[0], lambda df: df[df.columns[0]].values, None]\n)\n@pytest.mark.parametrize(\"columns\", [lambda df: df.columns[len(df.columns) // 2]])\n@pytest.mark.parametrize(\n \"values\", [lambda df: df.columns[-1], lambda df: df.columns[-2:], None]\n)\ndef test_pivot(data, index, columns, values):\n eval_general(\n *create_test_dfs(data),\n lambda df, *args, **kwargs: df.pivot(*args, **kwargs),\n index=index,\n columns=columns,\n values=values,\n check_exception_type=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_data_test_pivot_table_data.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_data_test_pivot_table_data.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 582, "end_line": 641, "span_ids": ["test_pivot_table_data"], "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": "@pytest.mark.parametrize(\"data\", [test_data[\"int_data\"]], ids=[\"int_data\"])\n@pytest.mark.parametrize(\n \"index\",\n [\n pytest.param(lambda df: df.columns[0], id=\"single_index_col\"),\n pytest.param(\n lambda df: [*df.columns[0:2], *df.columns[-7:-4]], id=\"multiple_index_cols\"\n ),\n None,\n ],\n)\n@pytest.mark.parametrize(\n \"columns\",\n [\n pytest.param(lambda df: df.columns[len(df.columns) // 2], id=\"single_col\"),\n pytest.param(\n lambda df: [\n *df.columns[(len(df.columns) // 2) : (len(df.columns) // 2 + 4)],\n df.columns[-7],\n ],\n id=\"multiple_cols\",\n ),\n None,\n ],\n)\n@pytest.mark.parametrize(\n \"values\",\n [\n pytest.param(lambda df: df.columns[-1], id=\"single_value_col\"),\n pytest.param(lambda df: df.columns[-4:-1], id=\"multiple_value_cols\"),\n None,\n ],\n)\n@pytest.mark.parametrize(\n \"aggfunc\",\n [\n pytest.param(np.mean, id=\"callable_tree_reduce_func\"),\n pytest.param(\"mean\", id=\"tree_reduce_func\"),\n pytest.param(\"nunique\", id=\"full_axis_func\"),\n ],\n)\ndef test_pivot_table_data(data, index, columns, values, aggfunc):\n md_df, pd_df = create_test_dfs(data)\n\n # when values is None the output will be huge-dimensional,\n # so reducing dimension of testing data at that case\n if values is None:\n md_df, pd_df = md_df.iloc[:42, :42], pd_df.iloc[:42, :42]\n eval_general(\n md_df,\n pd_df,\n operation=lambda df, *args, **kwargs: df.pivot_table(\n *args, **kwargs\n ).sort_index(axis=int(index is not None)),\n index=index,\n columns=columns,\n values=values,\n aggfunc=aggfunc,\n check_exception_type=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_margins_test_pivot_table_margins.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_margins_test_pivot_table_margins.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 644, "end_line": 708, "span_ids": ["test_pivot_table_margins"], "tokens": 430}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", [test_data[\"int_data\"]], ids=[\"int_data\"])\n@pytest.mark.parametrize(\n \"index\",\n [\n pytest.param(lambda df: df.columns[0], id=\"single_index_column\"),\n pytest.param(\n lambda df: [df.columns[0], df.columns[len(df.columns) // 2 - 1]],\n id=\"multiple_index_cols\",\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"columns\",\n [\n pytest.param(lambda df: df.columns[len(df.columns) // 2], id=\"single_column\"),\n pytest.param(\n lambda df: [\n *df.columns[(len(df.columns) // 2) : (len(df.columns) // 2 + 4)],\n df.columns[-7],\n ],\n id=\"multiple_cols\",\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"values\",\n [\n pytest.param(lambda df: df.columns[-1], id=\"single_value\"),\n pytest.param(lambda df: df.columns[-4:-1], id=\"multiple_values\"),\n ],\n)\n@pytest.mark.parametrize(\n \"aggfunc\",\n [\n pytest.param([\"mean\", \"sum\"], id=\"list_func\"),\n pytest.param(\n lambda df: {df.columns[5]: \"mean\", df.columns[-5]: \"sum\"}, id=\"dict_func\"\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"margins_name\",\n [pytest.param(\"Custom name\", id=\"str_name\"), pytest.param(None, id=\"None_name\")],\n)\n@pytest.mark.parametrize(\"fill_value\", [None, 0])\ndef test_pivot_table_margins(\n data,\n index,\n columns,\n values,\n aggfunc,\n margins_name,\n fill_value,\n):\n eval_general(\n *create_test_dfs(data),\n operation=lambda df, *args, **kwargs: df.pivot_table(*args, **kwargs),\n index=index,\n columns=columns,\n values=values,\n aggfunc=aggfunc,\n margins=True,\n margins_name=margins_name,\n fill_value=fill_value,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_dropna_test_plot.if_name_contains_request_.for_left_right_in_zipped.if_isinstance_left_get_yd.else_.assert_np_array_equal_lef": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_pivot_table_dropna_test_plot.if_name_contains_request_.for_left_right_in_zipped.if_isinstance_left_get_yd.else_.assert_np_array_equal_lef", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 671, "end_line": 703, "span_ids": ["test_plot", "test_pivot_table_dropna"], "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": "@pytest.mark.parametrize(\"data\", [test_data[\"int_data\"]], ids=[\"int_data\"])\ndef test_pivot_table_dropna(data):\n eval_general(\n *create_test_dfs(data),\n operation=lambda df, *args, **kwargs: df.pivot_table(*args, **kwargs),\n index=lambda df: df.columns[0],\n columns=lambda df: df.columns[1],\n values=lambda df: df.columns[-1],\n dropna=False,\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_plot(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if name_contains(request.node.name, numeric_dfs):\n # We have to test this way because equality in plots means same object.\n zipped_plot_lines = zip(modin_df.plot().lines, pandas_df.plot().lines)\n for left, right in zipped_plot_lines:\n if isinstance(left.get_xdata(), np.ma.core.MaskedArray) and isinstance(\n right.get_xdata(), np.ma.core.MaskedArray\n ):\n assert all((left.get_xdata() == right.get_xdata()).data)\n else:\n assert np.array_equal(left.get_xdata(), right.get_xdata())\n if isinstance(left.get_ydata(), np.ma.core.MaskedArray) and isinstance(\n right.get_ydata(), np.ma.core.MaskedArray\n ):\n assert all((left.get_ydata() == right.get_ydata()).data)\n else:\n assert np.array_equal(left.get_xdata(), right.get_xdata())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_replace_test_replace.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_replace_test_replace.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 706, "end_line": 735, "span_ids": ["test_replace"], "tokens": 478}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_replace():\n modin_df = pd.DataFrame(\n {\"A\": [0, 1, 2, 3, 4], \"B\": [5, 6, 7, 8, 9], \"C\": [\"a\", \"b\", \"c\", \"d\", \"e\"]}\n )\n pandas_df = pandas.DataFrame(\n {\"A\": [0, 1, 2, 3, 4], \"B\": [5, 6, 7, 8, 9], \"C\": [\"a\", \"b\", \"c\", \"d\", \"e\"]}\n )\n modin_result = modin_df.replace({\"A\": 0, \"B\": 5}, 100)\n pandas_result = pandas_df.replace({\"A\": 0, \"B\": 5}, 100)\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.replace({\"A\": {0: 100, 4: 400}})\n pandas_result = pandas_df.replace({\"A\": {0: 100, 4: 400}})\n df_equals(modin_result, pandas_result)\n\n modin_df = pd.DataFrame({\"A\": [\"bat\", \"foo\", \"bait\"], \"B\": [\"abc\", \"bar\", \"xyz\"]})\n pandas_df = pandas.DataFrame(\n {\"A\": [\"bat\", \"foo\", \"bait\"], \"B\": [\"abc\", \"bar\", \"xyz\"]}\n )\n modin_result = modin_df.replace(regex={r\"^ba.$\": \"new\", \"foo\": \"xyz\"})\n pandas_result = pandas_df.replace(regex={r\"^ba.$\": \"new\", \"foo\": \"xyz\"})\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.replace(regex=[r\"^ba.$\", \"foo\"], value=\"new\")\n pandas_result = pandas_df.replace(regex=[r\"^ba.$\", \"foo\"], value=\"new\")\n df_equals(modin_result, pandas_result)\n\n modin_df.replace(regex=[r\"^ba.$\", \"foo\"], value=\"new\", inplace=True)\n pandas_df.replace(regex=[r\"^ba.$\", \"foo\"], value=\"new\", inplace=True)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_test_resampler.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_test_resampler.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 738, "end_line": 754, "span_ids": ["test_resampler"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"rule\", [\"5T\", pandas.offsets.Hour()])\n@pytest.mark.parametrize(\"axis\", [0])\ndef test_resampler(rule, axis):\n data, index = (\n test_data_resample[\"data\"],\n test_data_resample[\"index\"],\n )\n modin_resampler = pd.DataFrame(data, index=index).resample(rule, axis=axis)\n pandas_resampler = pandas.DataFrame(data, index=index).resample(rule, axis=axis)\n\n assert pandas_resampler.indices == modin_resampler.indices\n assert pandas_resampler.groups == modin_resampler.groups\n\n df_equals(\n modin_resampler.get_group(name=list(modin_resampler.groups)[0]),\n pandas_resampler.get_group(name=list(pandas_resampler.groups)[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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_functions_test_resampler_functions.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_functions_test_resampler_functions.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 757, "end_line": 779, "span_ids": ["test_resampler_functions"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"rule\", [\"5T\"])\n@pytest.mark.parametrize(\"axis\", [\"index\", \"columns\"])\n@pytest.mark.parametrize(\n \"method\",\n [\n *(\"count\", \"sum\", \"std\", \"sem\", \"size\", \"prod\", \"ohlc\", \"quantile\"),\n *(\"min\", \"median\", \"mean\", \"max\", \"last\", \"first\", \"nunique\", \"var\"),\n *(\"interpolate\", \"asfreq\", \"nearest\", \"bfill\", \"ffill\"),\n ],\n)\ndef test_resampler_functions(rule, axis, method):\n data, index = (\n test_data_resample[\"data\"],\n test_data_resample[\"index\"],\n )\n modin_df = pd.DataFrame(data, index=index)\n pandas_df = pandas.DataFrame(data, index=index)\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: getattr(df.resample(rule, axis=axis), method)(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_functions_with_arg_test_resampler_functions_with_arg.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resampler_functions_with_arg_test_resampler_functions_with_arg.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 782, "end_line": 807, "span_ids": ["test_resampler_functions_with_arg"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"rule\", [\"5T\"])\n@pytest.mark.parametrize(\"axis\", [\"index\", \"columns\"])\n@pytest.mark.parametrize(\n \"method_arg\",\n [\n (\"pipe\", lambda x: x.max() - x.min()),\n (\"transform\", lambda x: (x - x.mean()) / x.std()),\n (\"apply\", [\"sum\", \"mean\", \"max\"]),\n (\"aggregate\", [\"sum\", \"mean\", \"max\"]),\n ],\n)\ndef test_resampler_functions_with_arg(rule, axis, method_arg):\n data, index = (\n test_data_resample[\"data\"],\n test_data_resample[\"index\"],\n )\n modin_df = pd.DataFrame(data, index=index)\n pandas_df = pandas.DataFrame(data, index=index)\n\n method, arg = method_arg[0], method_arg[1]\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: getattr(df.resample(rule, axis=axis), method)(arg),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resample_specific_test_resample_specific.None_2.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resample_specific_test_resample_specific.None_2.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 810, "end_line": 855, "span_ids": ["test_resample_specific"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"rule\", [\"5T\"])\n@pytest.mark.parametrize(\"closed\", [\"left\", \"right\"])\n@pytest.mark.parametrize(\"label\", [\"right\", \"left\"])\n@pytest.mark.parametrize(\"on\", [None, \"DateColumn\"])\n@pytest.mark.parametrize(\"level\", [None, 1])\ndef test_resample_specific(rule, closed, label, on, level):\n data, index = (\n test_data_resample[\"data\"],\n test_data_resample[\"index\"],\n )\n modin_df = pd.DataFrame(data, index=index)\n pandas_df = pandas.DataFrame(data, index=index)\n\n if on is None and level is not None:\n index = pandas.MultiIndex.from_product(\n [[\"a\", \"b\", \"c\"], pandas.date_range(\"31/12/2000\", periods=4, freq=\"H\")]\n )\n pandas_df.index = index\n modin_df.index = index\n else:\n level = None\n\n if on is not None:\n pandas_df[on] = pandas.date_range(\"22/06/1941\", periods=12, freq=\"T\")\n modin_df[on] = pandas.date_range(\"22/06/1941\", periods=12, freq=\"T\")\n\n pandas_resampler = pandas_df.resample(\n rule,\n closed=closed,\n label=label,\n on=on,\n level=level,\n )\n modin_resampler = modin_df.resample(\n rule,\n closed=closed,\n label=label,\n on=on,\n level=level,\n )\n df_equals(modin_resampler.var(0), pandas_resampler.var(0))\n if on is None and level is None:\n df_equals(\n modin_resampler.fillna(method=\"nearest\"),\n pandas_resampler.fillna(method=\"nearest\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resample_getitem_test_resample_getitem.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_resample_getitem_test_resample_getitem.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 858, "end_line": 892, "span_ids": ["test_resample_getitem"], "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": "@pytest.mark.parametrize(\n \"columns\",\n [\n \"volume\",\n \"date\",\n [\"volume\"],\n [\"price\", \"date\"],\n (\"volume\",),\n pandas.Series([\"volume\"]),\n pandas.Index([\"volume\"]),\n [\"volume\", \"volume\", \"volume\"],\n [\"volume\", \"price\", \"date\"],\n ],\n ids=[\n \"column\",\n \"missed_column\",\n \"list\",\n \"missed_column\",\n \"tuple\",\n \"series\",\n \"index\",\n \"duplicate_column\",\n \"missed_columns\",\n ],\n)\ndef test_resample_getitem(columns):\n index = pandas.date_range(\"1/1/2013\", periods=9, freq=\"T\")\n data = {\n \"price\": range(9),\n \"volume\": range(10, 19),\n }\n eval_general(\n *create_test_dfs(data, index=index),\n lambda df: df.resample(\"3T\")[columns].mean(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_shift_test_shift.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_shift_test_shift.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 895, "end_line": 914, "span_ids": ["test_shift"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"index\", [\"default\", \"ndarray\", \"has_duplicates\"])\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"periods\", [0, 1, -1, 10, -10, 1000000000, -1000000000])\ndef test_shift(data, index, axis, periods):\n modin_df, pandas_df = create_test_dfs(data)\n if index == \"ndarray\":\n data_column_length = len(data[next(iter(data))])\n modin_df.index = pandas_df.index = np.arange(2, data_column_length + 2)\n elif index == \"has_duplicates\":\n modin_df.index = pandas_df.index = list(modin_df.index[:-3]) + [0, 1, 2]\n\n df_equals(\n modin_df.shift(periods=periods, axis=axis),\n pandas_df.shift(periods=periods, axis=axis),\n )\n df_equals(\n modin_df.shift(periods=periods, axis=axis, fill_value=777),\n pandas_df.shift(periods=periods, axis=axis, fill_value=777),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_stack_test_stack.None_2.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_stack_test_stack.None_2.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 917, "end_line": 980, "span_ids": ["test_stack"], "tokens": 600}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"is_multi_idx\", [True, False], ids=[\"idx_multi\", \"idx_index\"])\n@pytest.mark.parametrize(\"is_multi_col\", [True, False], ids=[\"col_multi\", \"col_index\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_stack(data, is_multi_idx, is_multi_col):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n if is_multi_idx:\n if len(pandas_df.index) == 256:\n index = pd.MultiIndex.from_product(\n [\n [\"a\", \"b\", \"c\", \"d\"],\n [\"x\", \"y\", \"z\", \"last\"],\n [\"i\", \"j\", \"k\", \"index\"],\n [1, 2, 3, 4],\n ]\n )\n elif len(pandas_df.index) == 100:\n index = pd.MultiIndex.from_product(\n [\n [\"x\", \"y\", \"z\", \"last\"],\n [\"a\", \"b\", \"c\", \"d\", \"f\"],\n [\"i\", \"j\", \"k\", \"l\", \"index\"],\n ]\n )\n else:\n index = pd.MultiIndex.from_tuples(\n [(i, i * 2, i * 3) for i in range(len(pandas_df.index))]\n )\n else:\n index = pandas_df.index\n\n if is_multi_col:\n if len(pandas_df.columns) == 64:\n columns = pd.MultiIndex.from_product(\n [[\"A\", \"B\", \"C\", \"D\"], [\"xx\", \"yy\", \"zz\", \"LAST\"], [10, 20, 30, 40]]\n )\n elif len(pandas_df.columns) == 100:\n columns = pd.MultiIndex.from_product(\n [\n [\"xx\", \"yy\", \"zz\", \"LAST\"],\n [\"A\", \"B\", \"C\", \"D\", \"F\"],\n [\"I\", \"J\", \"K\", \"L\", \"INDEX\"],\n ]\n )\n else:\n columns = pd.MultiIndex.from_tuples(\n [(i, i * 2, i * 3) for i in range(len(pandas_df.columns))]\n )\n else:\n columns = pandas_df.columns\n\n pandas_df.columns = columns\n pandas_df.index = index\n\n modin_df.columns = columns\n modin_df.index = index\n\n df_equals(modin_df.stack(), pandas_df.stack())\n\n if is_multi_col:\n df_equals(modin_df.stack(level=0), pandas_df.stack(level=0))\n df_equals(modin_df.stack(level=[0, 1]), pandas_df.stack(level=[0, 1]))\n df_equals(modin_df.stack(level=[0, 1, 2]), pandas_df.stack(level=[0, 1, 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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_swapaxes_test_swapaxes_axes_names.df_equals_modin_result1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_swapaxes_test_swapaxes_axes_names.df_equals_modin_result1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 983, "end_line": 999, "span_ids": ["test_swapaxes", "test_swapaxes_axes_names"], "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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis1\", [0, 1])\n@pytest.mark.parametrize(\"axis2\", [0, 1])\ndef test_swapaxes(data, axis1, axis2):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n pandas_result = pandas_df.swapaxes(axis1, axis2)\n modin_result = modin_df.swapaxes(axis1, axis2)\n df_equals(modin_result, pandas_result)\n\n\ndef test_swapaxes_axes_names():\n modin_df = pd.DataFrame(test_data_values[0])\n modin_result1 = modin_df.swapaxes(0, 1)\n modin_result2 = modin_df.swapaxes(\"columns\", \"index\")\n df_equals(modin_result1, modin_result2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_swaplevel_test_swaplevel.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_swaplevel_test_swaplevel.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1002, "end_line": 1033, "span_ids": ["test_swaplevel"], "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": "def test_swaplevel():\n data = np.random.randint(1, 100, 12)\n modin_df = pd.DataFrame(\n data,\n index=pd.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n pandas_df = pandas.DataFrame(\n data,\n index=pandas.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n df_equals(\n modin_df.swaplevel(\"Number\", \"Color\"),\n pandas_df.swaplevel(\"Number\", \"Color\"),\n )\n df_equals(modin_df.swaplevel(), pandas_df.swaplevel())\n df_equals(modin_df.swaplevel(0, 1), pandas_df.swaplevel(0, 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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_take_test_to_string.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_take_test_to_string.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1036, "end_line": 1074, "span_ids": ["test_to_string", "test_to_records", "test_take"], "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 test_take():\n modin_df = pd.DataFrame(\n [\n (\"falcon\", \"bird\", 389.0),\n (\"parrot\", \"bird\", 24.0),\n (\"lion\", \"mammal\", 80.5),\n (\"monkey\", \"mammal\", np.nan),\n ],\n columns=[\"name\", \"class\", \"max_speed\"],\n index=[0, 2, 3, 1],\n )\n pandas_df = pandas.DataFrame(\n [\n (\"falcon\", \"bird\", 389.0),\n (\"parrot\", \"bird\", 24.0),\n (\"lion\", \"mammal\", 80.5),\n (\"monkey\", \"mammal\", np.nan),\n ],\n columns=[\"name\", \"class\", \"max_speed\"],\n index=[0, 2, 3, 1],\n )\n df_equals(modin_df.take([0, 3]), pandas_df.take([0, 3]))\n df_equals(modin_df.take([2], axis=1), pandas_df.take([2], axis=1))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_to_records(request, data):\n eval_general(\n *create_test_dfs(data),\n lambda df: df.dropna().to_records(),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_to_string(data):\n eval_general(\n *create_test_dfs(data),\n lambda df: df.to_string(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_truncate_test_truncate.None_2.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_truncate_test_truncate.None_2.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1077, "end_line": 1122, "span_ids": ["test_truncate"], "tokens": 408}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_truncate(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n before = 1\n after = len(modin_df - 3)\n df_equals(modin_df.truncate(before, after), pandas_df.truncate(before, after))\n\n before = 1\n after = 3\n df_equals(modin_df.truncate(before, after), pandas_df.truncate(before, after))\n\n before = modin_df.columns[1]\n after = modin_df.columns[-3]\n try:\n pandas_result = pandas_df.truncate(before, after, axis=1)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.truncate(before, after, axis=1)\n else:\n modin_result = modin_df.truncate(before, after, axis=1)\n df_equals(modin_result, pandas_result)\n\n before = modin_df.columns[1]\n after = modin_df.columns[3]\n try:\n pandas_result = pandas_df.truncate(before, after, axis=1)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.truncate(before, after, axis=1)\n else:\n modin_result = modin_df.truncate(before, after, axis=1)\n df_equals(modin_result, pandas_result)\n\n before = None\n after = None\n df_equals(modin_df.truncate(before, after), pandas_df.truncate(before, after))\n try:\n pandas_result = pandas_df.truncate(before, after, axis=1)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.truncate(before, after, axis=1)\n else:\n modin_result = modin_df.truncate(before, after, axis=1)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_truncate_before_greater_than_after_test_tz_convert.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_truncate_before_greater_than_after_test_tz_convert.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1125, "end_line": 1152, "span_ids": ["test_tz_convert", "test_truncate_before_greater_than_after"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_truncate_before_greater_than_after():\n df = pd.DataFrame([[1, 2, 3]])\n with pytest.raises(ValueError, match=\"Truncate: 1 must be after 2\"):\n df.truncate(before=2, after=1)\n\n\ndef test_tz_convert():\n modin_idx = pd.date_range(\n \"1/1/2012\", periods=500, freq=\"2D\", tz=\"America/Los_Angeles\"\n )\n pandas_idx = pandas.date_range(\n \"1/1/2012\", periods=500, freq=\"2D\", tz=\"America/Los_Angeles\"\n )\n data = np.random.randint(0, 100, size=(len(modin_idx), 4))\n modin_df = pd.DataFrame(data, index=modin_idx)\n pandas_df = pandas.DataFrame(data, index=pandas_idx)\n modin_result = modin_df.tz_convert(\"UTC\", axis=0)\n pandas_result = pandas_df.tz_convert(\"UTC\", axis=0)\n df_equals(modin_result, pandas_result)\n\n modin_multi = pd.MultiIndex.from_arrays([modin_idx, range(len(modin_idx))])\n pandas_multi = pandas.MultiIndex.from_arrays([pandas_idx, range(len(modin_idx))])\n modin_series = pd.DataFrame(data, index=modin_multi)\n pandas_series = pandas.DataFrame(data, index=pandas_multi)\n df_equals(\n modin_series.tz_convert(\"UTC\", axis=0, level=0),\n pandas_series.tz_convert(\"UTC\", axis=0, level=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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_tz_localize_test_tz_localize.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_tz_localize_test_tz_localize.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1155, "end_line": 1164, "span_ids": ["test_tz_localize"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_tz_localize():\n idx = pd.date_range(\"1/1/2012\", periods=400, freq=\"2D\")\n data = np.random.randint(0, 100, size=(len(idx), 4))\n modin_df = pd.DataFrame(data, index=idx)\n pandas_df = pandas.DataFrame(data, index=idx)\n df_equals(modin_df.tz_localize(\"UTC\", axis=0), pandas_df.tz_localize(\"UTC\", axis=0))\n df_equals(\n modin_df.tz_localize(\"America/Los_Angeles\", axis=0),\n pandas_df.tz_localize(\"America/Los_Angeles\", axis=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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_unstack_test_unstack.None_2.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_unstack_test_unstack.None_2.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1167, "end_line": 1195, "span_ids": ["test_unstack"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"is_multi_idx\", [True, False], ids=[\"idx_multi\", \"idx_index\"])\n@pytest.mark.parametrize(\"is_multi_col\", [True, False], ids=[\"col_multi\", \"col_index\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_unstack(data, is_multi_idx, is_multi_col):\n modin_df, pandas_df = create_test_dfs(data)\n\n if is_multi_idx:\n index = generate_multiindex(len(pandas_df), nlevels=4, is_tree_like=True)\n else:\n index = pandas_df.index\n\n if is_multi_col:\n columns = generate_multiindex(\n len(pandas_df.columns), nlevels=3, is_tree_like=True\n )\n else:\n columns = pandas_df.columns\n\n pandas_df.columns = modin_df.columns = columns\n pandas_df.index = modin_df.index = index\n\n df_equals(modin_df.unstack(), pandas_df.unstack())\n df_equals(modin_df.unstack(level=1), pandas_df.unstack(level=1))\n if is_multi_idx:\n df_equals(modin_df.unstack(level=[0, 1]), pandas_df.unstack(level=[0, 1]))\n df_equals(modin_df.unstack(level=[0, 1, 2]), pandas_df.unstack(level=[0, 1, 2]))\n df_equals(\n modin_df.unstack(level=[0, 1, 2, 3]), pandas_df.unstack(level=[0, 1, 2, 3])\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_unstack_multiindex_types_test_unstack_multiindex_types.if_multi_idx_idx_inde.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_unstack_multiindex_types_test_unstack_multiindex_types.if_multi_idx_idx_inde.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1198, "end_line": 1225, "span_ids": ["test_unstack_multiindex_types"], "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": "@pytest.mark.parametrize(\n \"multi_col\", [\"col_multi_tree\", \"col_multi_not_tree\", \"col_index\"]\n)\n@pytest.mark.parametrize(\n \"multi_idx\", [\"idx_multi_tree\", \"idx_multi_not_tree\", \"idx_index\"]\n)\ndef test_unstack_multiindex_types(multi_col, multi_idx):\n MAX_NROWS = MAX_NCOLS = 36\n\n pandas_df = pandas.DataFrame(test_data[\"int_data\"]).iloc[:MAX_NROWS, :MAX_NCOLS]\n modin_df = pd.DataFrame(test_data[\"int_data\"]).iloc[:MAX_NROWS, :MAX_NCOLS]\n\n def get_new_index(index, cond):\n if cond == \"col_multi_tree\" or cond == \"idx_multi_tree\":\n return generate_multiindex(len(index), nlevels=3, is_tree_like=True)\n elif cond == \"col_multi_not_tree\" or cond == \"idx_multi_not_tree\":\n return generate_multiindex(len(index), nlevels=3)\n else:\n return index\n\n pandas_df.columns = modin_df.columns = get_new_index(pandas_df.columns, multi_col)\n pandas_df.index = modin_df.index = get_new_index(pandas_df.index, multi_idx)\n\n df_equals(modin_df.unstack(), pandas_df.unstack())\n df_equals(modin_df.unstack(level=1), pandas_df.unstack(level=1))\n if multi_idx != \"idx_index\":\n df_equals(modin_df.unstack(level=[0, 1]), pandas_df.unstack(level=[0, 1]))\n df_equals(modin_df.unstack(level=[0, 1, 2]), pandas_df.unstack(level=[0, 1, 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_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test___array___test_hasattr_sparse.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test___array___test_hasattr_sparse.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1228, "end_line": 1248, "span_ids": ["test___bool__", "test___array__", "test_hasattr_sparse"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___array__(data):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n assert_array_equal(modin_df.__array__(), pandas_df.__array__())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___bool__(data):\n eval_general(*create_test_dfs(data), lambda df: df.__bool__())\n\n\n@pytest.mark.parametrize(\n \"is_sparse_data\", [True, False], ids=[\"is_sparse\", \"is_not_sparse\"]\n)\ndef test_hasattr_sparse(is_sparse_data):\n modin_df, pandas_df = (\n create_test_dfs(pandas.arrays.SparseArray(test_data[\"float_nan_data\"].values()))\n if is_sparse_data\n else create_test_dfs(test_data[\"float_nan_data\"])\n )\n eval_general(modin_df, pandas_df, lambda df: hasattr(df, \"sparse\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_setattr_axes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_default.py_test_setattr_axes_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_default.py", "file_name": "test_default.py", "file_type": "text/x-python", "category": "test", "start_line": 1251, "end_line": 1272, "span_ids": ["test_attrs", "test_setattr_axes"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_setattr_axes():\n # Test that setting .index or .columns does not warn\n df = pd.DataFrame([[1, 2], [3, 4]])\n with warnings.catch_warnings():\n if get_current_execution() != \"BaseOnPython\":\n # In BaseOnPython, setting columns raises a warning because get_axis\n # defaults to pandas.\n warnings.simplefilter(\"error\")\n if StorageFormat.get() != \"Hdk\": # Not yet supported - #1766\n df.index = [\"foo\", \"bar\"]\n # Check that ensure_index was called\n pandas.testing.assert_index_equal(df.index, pandas.Index([\"foo\", \"bar\"]))\n\n df.columns = [9, 10]\n pandas.testing.assert_index_equal(df.columns, pandas.Index([9, 10]))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_attrs(data):\n modin_df, pandas_df = create_test_dfs(data)\n eval_general(modin_df, pandas_df, lambda df: df.attrs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_pytest_eval_loc.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_pytest_eval_loc.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 86, "span_ids": ["eval_loc", "eval_setitem", "docstring"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport numpy as np\nimport pandas\nfrom pandas.testing import assert_index_equal\nfrom pandas._testing import ensure_clean\nimport matplotlib\nimport modin.pandas as pd\nimport sys\n\nfrom modin.pandas.test.utils import (\n NROWS,\n RAND_LOW,\n RAND_HIGH,\n df_equals,\n arg_keys,\n name_contains,\n test_data,\n test_data_values,\n test_data_keys,\n axis_keys,\n axis_values,\n int_arg_keys,\n int_arg_values,\n create_test_dfs,\n eval_general,\n generate_multiindex,\n extra_test_parameters,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions, MinPartitionSize, StorageFormat\nfrom modin.utils import get_current_execution\nfrom modin.pandas.indexing import is_range_like\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\n\ndef eval_setitem(md_df, pd_df, value, col=None, loc=None):\n if loc is not None:\n col = pd_df.columns[loc]\n\n value_getter = value if callable(value) else (lambda *args, **kwargs: value)\n\n eval_general(\n md_df, pd_df, lambda df: df.__setitem__(col, value_getter(df)), __inplace__=True\n )\n\n\ndef eval_loc(md_df, pd_df, value, key):\n if isinstance(value, tuple):\n assert len(value) == 2\n # case when value for pandas different\n md_value, pd_value = value\n else:\n md_value, pd_value = value, value\n\n eval_general(\n md_df,\n pd_df,\n lambda df: df.loc.__setitem__(\n key, pd_value if isinstance(df, pandas.DataFrame) else md_value\n ),\n __inplace__=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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_with_nan_test_asof_with_nan.compare_asof_data_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_with_nan_test_asof_with_nan.compare_asof_data_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 110, "span_ids": ["test_asof_with_nan"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"dates\",\n [\n [\"2018-02-27 09:03:30\", \"2018-02-27 09:04:30\"],\n [\"2018-02-27 09:03:00\", \"2018-02-27 09:05:00\"],\n ],\n)\n@pytest.mark.parametrize(\"subset\", [\"a\", \"b\", [\"a\", \"b\"], None])\ndef test_asof_with_nan(dates, subset):\n data = {\"a\": [10, 20, 30, 40, 50], \"b\": [None, None, None, None, 500]}\n index = pd.DatetimeIndex(\n [\n \"2018-02-27 09:01:00\",\n \"2018-02-27 09:02:00\",\n \"2018-02-27 09:03:00\",\n \"2018-02-27 09:04:00\",\n \"2018-02-27 09:05:00\",\n ]\n )\n modin_where = pd.DatetimeIndex(dates)\n pandas_where = pandas.DatetimeIndex(dates)\n compare_asof(data, index, modin_where, pandas_where, subset)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_without_nan_test_asof_without_nan.compare_asof_data_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_without_nan_test_asof_without_nan.compare_asof_data_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 134, "span_ids": ["test_asof_without_nan"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"dates\",\n [\n [\"2018-02-27 09:03:30\", \"2018-02-27 09:04:30\"],\n [\"2018-02-27 09:03:00\", \"2018-02-27 09:05:00\"],\n ],\n)\n@pytest.mark.parametrize(\"subset\", [\"a\", \"b\", [\"a\", \"b\"], None])\ndef test_asof_without_nan(dates, subset):\n data = {\"a\": [10, 20, 30, 40, 50], \"b\": [70, 600, 30, -200, 500]}\n index = pd.DatetimeIndex(\n [\n \"2018-02-27 09:01:00\",\n \"2018-02-27 09:02:00\",\n \"2018-02-27 09:03:00\",\n \"2018-02-27 09:04:00\",\n \"2018-02-27 09:05:00\",\n ]\n )\n modin_where = pd.DatetimeIndex(dates)\n pandas_where = pandas.DatetimeIndex(dates)\n compare_asof(data, index, modin_where, pandas_where, subset)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_large_test_asof_large.compare_asof_data_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_asof_large_test_asof_large.compare_asof_data_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 147, "span_ids": ["test_asof_large"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"lookup\",\n [[60, 70, 90], [60.5, 70.5, 100]],\n)\n@pytest.mark.parametrize(\"subset\", [\"col2\", \"col1\", [\"col1\", \"col2\"], None])\ndef test_asof_large(lookup, subset):\n data = test_data[\"float_nan_data\"]\n index = list(range(NROWS))\n modin_where = pd.Index(lookup)\n pandas_where = pandas.Index(lookup)\n compare_asof(data, index, modin_where, pandas_where, subset)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_compare_asof_compare_asof.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_compare_asof_compare_asof.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 150, "end_line": 170, "span_ids": ["compare_asof"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compare_asof(\n data, index, modin_where: pd.Index, pandas_where: pandas.Index, subset\n):\n modin_df = pd.DataFrame(data, index=index)\n pandas_df = pandas.DataFrame(data, index=index)\n df_equals(\n modin_df.asof(modin_where, subset=subset),\n pandas_df.asof(pandas_where, subset=subset),\n )\n df_equals(\n modin_df.asof(modin_where.values, subset=subset),\n pandas_df.asof(pandas_where.values, subset=subset),\n )\n df_equals(\n modin_df.asof(list(modin_where.values), subset=subset),\n pandas_df.asof(list(pandas_where.values), subset=subset),\n )\n df_equals(\n modin_df.asof(modin_where.values[0], subset=subset),\n pandas_df.asof(pandas_where.values[0], subset=subset),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_first_valid_index_test_iat.with_pytest_raises_NotImp.modin_df_iat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_first_valid_index_test_iat.with_pytest_raises_NotImp.modin_df_iat_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 202, "span_ids": ["test_first_valid_index", "test_head", "test_iat"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_first_valid_index(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n assert modin_df.first_valid_index() == (pandas_df.first_valid_index())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=arg_keys(\"n\", int_arg_keys))\ndef test_head(data, n):\n # Test normal dataframe head\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n df_equals(modin_df.head(n), pandas_df.head(n))\n df_equals(modin_df.head(len(modin_df) + 1), pandas_df.head(len(pandas_df) + 1))\n\n # Test head when we call it from a QueryCompilerView\n modin_result = modin_df.loc[:, [\"col1\", \"col3\", \"col3\"]].head(n)\n pandas_result = pandas_df.loc[:, [\"col1\", \"col3\", \"col3\"]].head(n)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.skip(reason=\"Defaulting to Pandas\")\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_iat(data):\n modin_df = pd.DataFrame(data)\n\n with pytest.raises(NotImplementedError):\n modin_df.iat()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_test_iloc.if_not_name_contains_requ.else_.with_pytest_raises_IndexE.modin_df_iloc_0_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_test_iloc.if_not_name_contains_requ.else_.with_pytest_raises_IndexE.modin_df_iloc_0_1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 205, "end_line": 259, "span_ids": ["test_iloc"], "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": "@pytest.mark.gpu\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_iloc(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if not name_contains(request.node.name, [\"empty_data\"]):\n # Scalar\n np.testing.assert_equal(modin_df.iloc[0, 1], pandas_df.iloc[0, 1])\n\n # Series\n df_equals(modin_df.iloc[0], pandas_df.iloc[0])\n df_equals(modin_df.iloc[1:, 0], pandas_df.iloc[1:, 0])\n df_equals(modin_df.iloc[1:2, 0], pandas_df.iloc[1:2, 0])\n\n # DataFrame\n df_equals(modin_df.iloc[[1, 2]], pandas_df.iloc[[1, 2]])\n # See issue #80\n # df_equals(modin_df.iloc[[1, 2], [1, 0]], pandas_df.iloc[[1, 2], [1, 0]])\n df_equals(modin_df.iloc[1:2, 0:2], pandas_df.iloc[1:2, 0:2])\n\n # Issue #43\n modin_df.iloc[0:3, :]\n\n # Write Item\n modin_df.iloc[[1, 2]] = 42\n pandas_df.iloc[[1, 2]] = 42\n df_equals(modin_df, pandas_df)\n\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_df.iloc[0] = modin_df.iloc[1]\n pandas_df.iloc[0] = pandas_df.iloc[1]\n df_equals(modin_df, pandas_df)\n\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_df.iloc[:, 0] = modin_df.iloc[:, 1]\n pandas_df.iloc[:, 0] = pandas_df.iloc[:, 1]\n df_equals(modin_df, pandas_df)\n\n # From issue #1775\n df_equals(\n modin_df.iloc[lambda df: df.index.get_indexer_for(df.index[:5])],\n pandas_df.iloc[lambda df: df.index.get_indexer_for(df.index[:5])],\n )\n\n # Read values, selecting rows with callable and a column with a scalar.\n df_equals(\n pandas_df.iloc[lambda df: df.index.get_indexer_for(df.index[:5]), 0],\n modin_df.iloc[lambda df: df.index.get_indexer_for(df.index[:5]), 0],\n )\n else:\n with pytest.raises(IndexError):\n modin_df.iloc[0, 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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_test_index.df_equals_modin_df_cp_ind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_test_index.df_equals_modin_df_cp_ind", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 274, "span_ids": ["test_index"], "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": "@pytest.mark.gpu\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_index(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.index, pandas_df.index)\n modin_df_cp = modin_df.copy()\n pandas_df_cp = pandas_df.copy()\n\n modin_df_cp.index = [str(i) for i in modin_df_cp.index]\n pandas_df_cp.index = [str(i) for i in pandas_df_cp.index]\n df_equals(modin_df_cp.index, pandas_df_cp.index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_indexing_duplicate_axis_test_indexing_duplicate_axis.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_indexing_duplicate_axis_test_indexing_duplicate_axis.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 277, "end_line": 292, "span_ids": ["test_indexing_duplicate_axis"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.gpu\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_indexing_duplicate_axis(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_df.index = pandas_df.index = [i // 3 for i in range(len(modin_df))]\n assert any(modin_df.index.duplicated())\n assert any(pandas_df.index.duplicated())\n\n df_equals(modin_df.iloc[0], pandas_df.iloc[0])\n df_equals(modin_df.loc[0], pandas_df.loc[0])\n df_equals(modin_df.iloc[0, 0:4], pandas_df.iloc[0, 0:4])\n df_equals(\n modin_df.loc[0, modin_df.columns[0:4]],\n pandas_df.loc[0, pandas_df.columns[0:4]],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_set_index_test_set_index.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_set_index_test_set_index.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 295, "end_line": 331, "span_ids": ["test_set_index"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"key_func\",\n [\n # test for the case from https://github.com/modin-project/modin/issues/4308\n \"non_existing_column\",\n lambda df: df.columns[0],\n lambda df: df.index,\n lambda df: [df.index, df.columns[0]],\n lambda df: pandas.Series(list(range(len(df.index))))\n if isinstance(df, pandas.DataFrame)\n else pd.Series(list(range(len(df)))),\n ],\n ids=[\n \"non_existing_column\",\n \"first_column_name\",\n \"original_index\",\n \"list_of_index_and_first_column_name\",\n \"series_of_integers\",\n ],\n)\n@pytest.mark.parametrize(\n \"drop_kwargs\",\n [{\"drop\": True}, {\"drop\": False}, {}],\n ids=[\"drop_True\", \"drop_False\", \"no_drop_param\"],\n)\ndef test_set_index(data, key_func, drop_kwargs, request):\n if (\n \"list_of_index_and_first_column_name\" in request.node.name\n and \"drop_False\" in request.node.name\n ):\n pytest.xfail(\n reason=\"KeyError: https://github.com/modin-project/modin/issues/5636\"\n )\n eval_general(\n *create_test_dfs(data), lambda df: df.set_index(key_func(df), **drop_kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_set_index_with_multiindex_test_keys.df_equals_modin_df_keys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_set_index_with_multiindex_test_keys.df_equals_modin_df_keys_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 334, "end_line": 348, "span_ids": ["test_keys", "test_set_index_with_multiindex"], "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": "@pytest.mark.parametrize(\"index\", [\"a\", [\"a\", (\"b\", \"\")]])\ndef test_set_index_with_multiindex(index):\n # see #5186 for details\n kwargs = {\"columns\": [[\"a\", \"b\", \"c\", \"d\"], [\"\", \"\", \"x\", \"y\"]]}\n modin_df, pandas_df = create_test_dfs(np.random.rand(2, 4), **kwargs)\n eval_general(modin_df, pandas_df, lambda df: df.set_index(index))\n\n\n@pytest.mark.gpu\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_keys(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.keys(), pandas_df.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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_test_loc.modin_df_copy3.modin_df_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_test_loc.modin_df_copy3.modin_df_copy_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 351, "end_line": 422, "span_ids": ["test_loc"], "tokens": 796}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\ndef test_loc(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n key1 = modin_df.columns[0]\n key2 = modin_df.columns[1]\n # Scalar\n df_equals(modin_df.loc[0, key1], pandas_df.loc[0, key1])\n\n # Series\n df_equals(modin_df.loc[0], pandas_df.loc[0])\n df_equals(modin_df.loc[1:, key1], pandas_df.loc[1:, key1])\n df_equals(modin_df.loc[1:2, key1], pandas_df.loc[1:2, key1])\n df_equals(modin_df.loc[:, key1], pandas_df.loc[:, key1])\n\n # DataFrame\n df_equals(modin_df.loc[[1, 2]], pandas_df.loc[[1, 2]])\n\n indices = [i % 3 == 0 for i in range(len(modin_df.index))]\n columns = [i % 5 == 0 for i in range(len(modin_df.columns))]\n\n # Key is a list of booleans\n modin_result = modin_df.loc[indices, columns]\n pandas_result = pandas_df.loc[indices, columns]\n df_equals(modin_result, pandas_result)\n\n # Key is a Modin or pandas series of booleans\n df_equals(\n modin_df.loc[pd.Series(indices), pd.Series(columns, index=modin_df.columns)],\n pandas_df.loc[\n pandas.Series(indices), pandas.Series(columns, index=modin_df.columns)\n ],\n )\n\n modin_result = modin_df.loc[:, columns]\n pandas_result = pandas_df.loc[:, columns]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[indices]\n pandas_result = pandas_df.loc[indices]\n df_equals(modin_result, pandas_result)\n\n # See issue #80\n # df_equals(modin_df.loc[[1, 2], ['col1']], pandas_df.loc[[1, 2], ['col1']])\n df_equals(modin_df.loc[1:2, key1:key2], pandas_df.loc[1:2, key1:key2])\n\n # From issue #421\n df_equals(modin_df.loc[:, [key2, key1]], pandas_df.loc[:, [key2, key1]])\n df_equals(modin_df.loc[[2, 1], :], pandas_df.loc[[2, 1], :])\n\n # From issue #1023\n key1 = modin_df.columns[0]\n key2 = modin_df.columns[-2]\n df_equals(modin_df.loc[:, key1:key2], pandas_df.loc[:, key1:key2])\n\n # Write Item\n modin_df_copy = modin_df.copy()\n pandas_df_copy = pandas_df.copy()\n modin_df_copy.loc[[1, 2]] = 42\n pandas_df_copy.loc[[1, 2]] = 42\n df_equals(modin_df_copy, pandas_df_copy)\n\n # Write an item, selecting rows with a callable.\n modin_df_copy2 = modin_df.copy()\n pandas_df_copy2 = pandas_df.copy()\n modin_df_copy2.loc[lambda df: df[key1].isin(list(range(1000)))] = 42\n pandas_df_copy2.loc[lambda df: df[key1].isin(list(range(1000)))] = 42\n df_equals(modin_df_copy2, pandas_df_copy2)\n\n # Write an item, selecting rows with a callable and a column with a scalar.\n modin_df_copy3 = modin_df.copy()\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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc.pandas_df_copy3_test_loc.with_pytest_raises_KeyErr.modin_df_loc_NO_EXIST_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc.pandas_df_copy3_test_loc.with_pytest_raises_KeyErr.modin_df_loc_NO_EXIST_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 423, "end_line": 445, "span_ids": ["test_loc"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_loc(data):\n # ... other code\n pandas_df_copy3 = pandas_df.copy()\n modin_df_copy3.loc[lambda df: df[key1].isin(list(range(1000))), key1] = 42\n pandas_df_copy3.loc[lambda df: df[key1].isin(list(range(1000))), key1] = 42\n df_equals(modin_df_copy3, pandas_df_copy3)\n\n # Disabled for `BaseOnPython` because of the issue with `getitem_array`:\n # https://github.com/modin-project/modin/issues/3701\n if get_current_execution() != \"BaseOnPython\":\n # From issue #1775\n df_equals(\n modin_df.loc[lambda df: df.iloc[:, 0].isin(list(range(1000)))],\n pandas_df.loc[lambda df: df.iloc[:, 0].isin(list(range(1000)))],\n )\n\n # Read values, selecting rows with a callable and a column with a scalar.\n df_equals(\n pandas_df.loc[lambda df: df[key1].isin(list(range(1000))), key1],\n modin_df.loc[lambda df: df[key1].isin(list(range(1000))), key1],\n )\n\n # From issue #1374\n with pytest.raises(KeyError):\n modin_df.loc[\"NO_EXIST\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_4456_test_loc_4456.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_4456_test_loc_4456.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 448, "end_line": 514, "span_ids": ["test_loc_4456"], "tokens": 613}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"key_getter, value_getter\",\n [\n pytest.param(\n lambda df, axis: (\n (slice(None), df.axes[axis][:2])\n if axis\n else (df.axes[axis][:2], slice(None))\n ),\n lambda df, axis: df.iloc[:, :1] if axis else df.iloc[:1, :],\n id=\"len(key)_>_len(value)\",\n ),\n pytest.param(\n lambda df, axis: (\n (slice(None), df.axes[axis][:2])\n if axis\n else (df.axes[axis][:2], slice(None))\n ),\n lambda df, axis: df.iloc[:, :3] if axis else df.iloc[:3, :],\n id=\"len(key)_<_len(value)\",\n ),\n pytest.param(\n lambda df, axis: (\n (slice(None), df.axes[axis][:2])\n if axis\n else (df.axes[axis][:2], slice(None))\n ),\n lambda df, axis: df.iloc[:, :2] if axis else df.iloc[:2, :],\n id=\"len(key)_==_len(value)\",\n ),\n ],\n)\n@pytest.mark.parametrize(\"key_axis\", [0, 1])\n@pytest.mark.parametrize(\"reverse_value_index\", [True, False])\n@pytest.mark.parametrize(\"reverse_value_columns\", [True, False])\ndef test_loc_4456(\n key_getter, value_getter, key_axis, reverse_value_index, reverse_value_columns\n):\n data = test_data[\"float_nan_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n key = key_getter(pandas_df, key_axis)\n\n # `df.loc` doesn't work right for range-like indexers. Converting them to a list.\n # https://github.com/modin-project/modin/issues/4497\n if is_range_like(key[0]):\n key = (list(key[0]), key[1])\n if is_range_like(key[1]):\n key = (key[0], list(key[1]))\n\n value = pandas.DataFrame(\n np.random.randint(0, 100, size=pandas_df.shape),\n index=pandas_df.index,\n columns=pandas_df.columns,\n )\n pdf_value = value_getter(value, key_axis)\n mdf_value = value_getter(pd.DataFrame(value), key_axis)\n\n if reverse_value_index:\n pdf_value = pdf_value.reindex(index=pdf_value.index[::-1])\n mdf_value = mdf_value.reindex(index=mdf_value.index[::-1])\n if reverse_value_columns:\n pdf_value = pdf_value.reindex(columns=pdf_value.columns[::-1])\n mdf_value = mdf_value.reindex(columns=mdf_value.columns[::-1])\n\n eval_loc(modin_df, pandas_df, pdf_value, key)\n eval_loc(modin_df, pandas_df, (mdf_value, pdf_value), 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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_5829_test_loc_5829.eval_loc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_5829_test_loc_5829.eval_loc_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 517, "end_line": 526, "span_ids": ["test_loc_5829"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_5829():\n data = {\"a\": [1, 2, 3, 4, 5], \"b\": [11, 12, 13, 14, 15]}\n modin_df = pd.DataFrame(data, dtype=object)\n pandas_df = pandas.DataFrame(data, dtype=object)\n eval_loc(\n modin_df,\n pandas_df,\n value=np.array([[24, 34, 44], [25, 35, 45]]),\n key=([3, 4], [\"c\", \"d\", \"e\"]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py__This_tests_the_bug_from_test_loc_setting_single_categorical_column.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py__This_tests_the_bug_from_test_loc_setting_single_categorical_column.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 529, "end_line": 535, "span_ids": ["test_loc_setting_single_categorical_column", "test_loc_5829"], "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": "# This tests the bug from https://github.com/modin-project/modin/issues/3736\ndef test_loc_setting_single_categorical_column():\n modin_df = pd.DataFrame({\"status\": [\"a\", \"b\", \"c\"]}, dtype=\"category\")\n pandas_df = pandas.DataFrame({\"status\": [\"a\", \"b\", \"c\"]}, dtype=\"category\")\n modin_df.loc[1:3, \"status\"] = \"a\"\n pandas_df.loc[1:3, \"status\"] = \"a\"\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_test_loc_multi_index.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_test_loc_multi_index.None_8", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 538, "end_line": 607, "span_ids": ["test_loc_multi_index"], "tokens": 714}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_multi_index():\n modin_df = pd.read_csv(\n \"modin/pandas/test/data/blah.csv\", header=[0, 1, 2, 3], index_col=0\n )\n pandas_df = pandas.read_csv(\n \"modin/pandas/test/data/blah.csv\", header=[0, 1, 2, 3], index_col=0\n )\n\n df_equals(modin_df.loc[1], pandas_df.loc[1])\n df_equals(modin_df.loc[1, \"Presidents\"], pandas_df.loc[1, \"Presidents\"])\n df_equals(\n modin_df.loc[1, (\"Presidents\", \"Pure mentions\")],\n pandas_df.loc[1, (\"Presidents\", \"Pure mentions\")],\n )\n assert (\n modin_df.loc[1, (\"Presidents\", \"Pure mentions\", \"IND\", \"all\")]\n == pandas_df.loc[1, (\"Presidents\", \"Pure mentions\", \"IND\", \"all\")]\n )\n df_equals(modin_df.loc[(1, 2), \"Presidents\"], pandas_df.loc[(1, 2), \"Presidents\"])\n\n tuples = [\n (\"bar\", \"one\"),\n (\"bar\", \"two\"),\n (\"bar\", \"three\"),\n (\"bar\", \"four\"),\n (\"baz\", \"one\"),\n (\"baz\", \"two\"),\n (\"baz\", \"three\"),\n (\"baz\", \"four\"),\n (\"foo\", \"one\"),\n (\"foo\", \"two\"),\n (\"foo\", \"three\"),\n (\"foo\", \"four\"),\n (\"qux\", \"one\"),\n (\"qux\", \"two\"),\n (\"qux\", \"three\"),\n (\"qux\", \"four\"),\n ]\n\n modin_index = pd.MultiIndex.from_tuples(tuples, names=[\"first\", \"second\"])\n pandas_index = pandas.MultiIndex.from_tuples(tuples, names=[\"first\", \"second\"])\n frame_data = np.random.randint(0, 100, size=(16, 100))\n modin_df = pd.DataFrame(\n frame_data,\n index=modin_index,\n columns=[\"col{}\".format(i) for i in range(100)],\n )\n pandas_df = pandas.DataFrame(\n frame_data,\n index=pandas_index,\n columns=[\"col{}\".format(i) for i in range(100)],\n )\n df_equals(modin_df.loc[\"bar\", \"col1\"], pandas_df.loc[\"bar\", \"col1\"])\n assert modin_df.loc[(\"bar\", \"one\"), \"col1\"] == pandas_df.loc[(\"bar\", \"one\"), \"col1\"]\n df_equals(\n modin_df.loc[\"bar\", (\"col1\", \"col2\")],\n pandas_df.loc[\"bar\", (\"col1\", \"col2\")],\n )\n\n # From issue #1456\n transposed_modin = modin_df.T\n transposed_pandas = pandas_df.T\n df_equals(\n transposed_modin.loc[transposed_modin.index[:-2], :],\n transposed_pandas.loc[transposed_pandas.index[:-2], :],\n )\n\n # From issue #1610\n df_equals(modin_df.loc[modin_df.index], pandas_df.loc[pandas_df.index])\n df_equals(modin_df.loc[modin_df.index[:7]], pandas_df.loc[pandas_df.index[:7]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_with_tuples_test_loc_multi_index_with_tuples.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_with_tuples_test_loc_multi_index_with_tuples.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 610, "end_line": 619, "span_ids": ["test_loc_multi_index_with_tuples"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_multi_index_with_tuples():\n arrays = [\n [\"bar\", \"bar\", \"baz\", \"baz\"],\n [\"one\", \"two\", \"one\", \"two\"],\n ]\n nrows = 5\n columns = pd.MultiIndex.from_tuples(zip(*arrays), names=[\"a\", \"b\"])\n data = np.arange(0, nrows * len(columns)).reshape(nrows, len(columns))\n modin_df, pandas_df = create_test_dfs(data, columns=columns)\n eval_general(modin_df, pandas_df, lambda df: df.loc[:, (\"bar\", \"two\")])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_rows_with_tuples_5721_test_loc_multi_index_rows_with_tuples_5721.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_rows_with_tuples_5721_test_loc_multi_index_rows_with_tuples_5721.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 622, "end_line": 632, "span_ids": ["test_loc_multi_index_rows_with_tuples_5721"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_multi_index_rows_with_tuples_5721():\n arrays = [\n [\"bar\", \"bar\", \"baz\", \"baz\"],\n [\"one\", \"two\", \"one\", \"two\"],\n ]\n ncols = 5\n index = pd.MultiIndex.from_tuples(zip(*arrays), names=[\"a\", \"b\"])\n data = np.arange(0, ncols * len(index)).reshape(len(index), ncols)\n modin_df, pandas_df = create_test_dfs(data, index=index)\n eval_general(modin_df, pandas_df, lambda df: df.loc[(\"bar\",)])\n eval_general(modin_df, pandas_df, lambda df: df.loc[(\"bar\", \"two\")])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_level_two_has_same_name_as_column_test_loc_multi_index_duplicate_keys.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_level_two_has_same_name_as_column_test_loc_multi_index_duplicate_keys.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 635, "end_line": 649, "span_ids": ["test_loc_multi_index_duplicate_keys", "test_loc_multi_index_level_two_has_same_name_as_column"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_multi_index_level_two_has_same_name_as_column():\n eval_general(\n *create_test_dfs(\n pandas.DataFrame(\n [[0]], index=[pd.Index([\"foo\"]), pd.Index([\"bar\"])], columns=[\"bar\"]\n )\n ),\n lambda df: df.loc[(\"foo\", \"bar\")],\n )\n\n\ndef test_loc_multi_index_duplicate_keys():\n modin_df, pandas_df = create_test_dfs([1, 2], index=[[\"a\", \"a\"], [\"b\", \"b\"]])\n eval_general(modin_df, pandas_df, lambda df: df.loc[(\"a\", \"b\"), 0])\n eval_general(modin_df, pandas_df, lambda df: df.loc[(\"a\", \"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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_both_axes_test_loc_multi_index_both_axes.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_multi_index_both_axes_test_loc_multi_index_both_axes.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 652, "end_line": 667, "span_ids": ["test_loc_multi_index_both_axes"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_multi_index_both_axes():\n multi_index = pd.MultiIndex.from_tuples(\n [(\"r0\", \"rA\"), (\"r1\", \"rB\")], names=[\"Courses\", \"Fee\"]\n )\n cols = pd.MultiIndex.from_tuples(\n [\n (\"Gasoline\", \"Toyota\"),\n (\"Gasoline\", \"Ford\"),\n (\"Electric\", \"Tesla\"),\n (\"Electric\", \"Nio\"),\n ]\n )\n data = [[100, 300, 900, 400], [200, 500, 300, 600]]\n modin_df, pandas_df = create_test_dfs(data, columns=cols, index=multi_index)\n eval_general(modin_df, pandas_df, lambda df: df.loc[(\"r0\", \"rA\"), :])\n eval_general(modin_df, pandas_df, lambda df: df.loc[:, (\"Gasoline\", \"Toyota\")])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_empty_test_loc_iloc_2064.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_empty_test_loc_iloc_2064.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 670, "end_line": 689, "span_ids": ["test_loc_iloc_2064", "test_loc_empty"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loc_empty():\n pandas_df = pandas.DataFrame(index=range(5))\n modin_df = pd.DataFrame(index=range(5))\n\n df_equals(pandas_df.loc[1], modin_df.loc[1])\n pandas_df.loc[1] = 3\n modin_df.loc[1] = 3\n df_equals(pandas_df, modin_df)\n\n\n@pytest.mark.parametrize(\"locator_name\", [\"iloc\", \"loc\"])\ndef test_loc_iloc_2064(locator_name):\n modin_df, pandas_df = create_test_dfs(columns=[\"col1\", \"col2\"])\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: getattr(df, locator_name).__setitem__([1], [11, 22]),\n __inplace__=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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_assignment_test_loc_assignment.df_equals_md_df_pd_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_assignment_test_loc_assignment.df_equals_md_df_pd_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 692, "end_line": 701, "span_ids": ["test_loc_assignment"], "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": "@pytest.mark.parametrize(\"index\", [[\"row1\", \"row2\", \"row3\"]])\n@pytest.mark.parametrize(\"columns\", [[\"col1\", \"col2\"]])\ndef test_loc_assignment(index, columns):\n md_df, pd_df = create_test_dfs(index=index, columns=columns)\n for i, ind in enumerate(index):\n for j, col in enumerate(columns):\n value_to_assign = int(str(i) + str(j))\n md_df.loc[ind][col] = value_to_assign\n pd_df.loc[ind][col] = value_to_assign\n df_equals(md_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_insert_row_test_loc_insert_row.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_insert_row_test_loc_insert_row.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 704, "end_line": 715, "span_ids": ["test_loc_insert_row"], "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": "@pytest.mark.parametrize(\"left, right\", [(2, 1), (6, 1), (lambda df: 70, 1), (90, 70)])\ndef test_loc_insert_row(left, right):\n # This test case comes from\n # https://github.com/modin-project/modin/issues/3764\n pandas_df = pandas.DataFrame([[1, 2, 3], [4, 5, 6]])\n modin_df = pd.DataFrame([[1, 2, 3], [4, 5, 6]])\n\n def _test_loc_rows(df):\n df.loc[left] = df.loc[right]\n return df\n\n eval_general(modin_df, pandas_df, _test_loc_rows)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_insert_col_test_loc_insert_col.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_insert_col_test_loc_insert_col.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 718, "end_line": 737, "span_ids": ["test_loc_insert_col"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"columns\", [10, (100, 102), (2, 6), [10, 11, 12], \"a\", [\"b\", \"c\", \"d\"]]\n)\ndef test_loc_insert_col(columns):\n # This test case comes from\n # https://github.com/modin-project/modin/issues/3764\n pandas_df = pandas.DataFrame([[1, 2, 3], [4, 5, 6]])\n modin_df = pd.DataFrame([[1, 2, 3], [4, 5, 6]])\n\n if isinstance(columns, tuple) and len(columns) == 2:\n\n def _test_loc_cols(df):\n df.loc[:, columns[0] : columns[1]] = 1\n\n else:\n\n def _test_loc_cols(df):\n df.loc[:, columns] = 1\n\n eval_general(modin_df, pandas_df, _test_loc_cols)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_loc_iter_dfs_test_loc_iter_assignment.df_equals_md_df_pd_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_loc_iter_dfs_test_loc_iter_assignment.df_equals_md_df_pd_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 740, "end_line": 767, "span_ids": ["loc_iter_dfs", "test_loc_iter_assignment"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef loc_iter_dfs():\n columns = [\"col1\", \"col2\", \"col3\"]\n index = [\"row1\", \"row2\", \"row3\"]\n return create_test_dfs(\n {col: ([idx] * len(index)) for idx, col in enumerate(columns)},\n columns=columns,\n index=index,\n )\n\n\n@pytest.mark.parametrize(\"reverse_order\", [False, True])\n@pytest.mark.parametrize(\"axis\", [0, 1])\ndef test_loc_iter_assignment(loc_iter_dfs, reverse_order, axis):\n if reverse_order and axis:\n pytest.xfail(\n \"Due to internal sorting of lookup values assignment order is lost, see GH-#2552\"\n )\n\n md_df, pd_df = loc_iter_dfs\n\n select = [slice(None), slice(None)]\n select[axis] = sorted(pd_df.axes[axis][:-1], reverse=reverse_order)\n select = tuple(select)\n\n pd_df.loc[select] = pd_df.loc[select] + pd_df.loc[select]\n md_df.loc[select] = md_df.loc[select] + md_df.loc[select]\n df_equals(md_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_order_test_loc_nested_assignment.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_order_test_loc_nested_assignment.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 770, "end_line": 796, "span_ids": ["test_loc_nested_assignment", "test_loc_order"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"reverse_order\", [False, True])\n@pytest.mark.parametrize(\"axis\", [0, 1])\ndef test_loc_order(loc_iter_dfs, reverse_order, axis):\n md_df, pd_df = loc_iter_dfs\n\n select = [slice(None), slice(None)]\n select[axis] = sorted(pd_df.axes[axis][:-1], reverse=reverse_order)\n select = tuple(select)\n\n df_equals(pd_df.loc[select], md_df.loc[select])\n\n\n@pytest.mark.gpu\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_loc_nested_assignment(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n key1 = modin_df.columns[0]\n key2 = modin_df.columns[1]\n\n modin_df[key1].loc[0] = 500\n pandas_df[key1].loc[0] = 500\n df_equals(modin_df, pandas_df)\n\n modin_df[key2].loc[0] = None\n pandas_df[key2].loc[0] = None\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_assignment_test_iloc_assignment.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_assignment_test_iloc_assignment.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 799, "end_line": 817, "span_ids": ["test_iloc_assignment"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_iloc_assignment():\n modin_df = pd.DataFrame(index=[\"row1\", \"row2\", \"row3\"], columns=[\"col1\", \"col2\"])\n pandas_df = pandas.DataFrame(\n index=[\"row1\", \"row2\", \"row3\"], columns=[\"col1\", \"col2\"]\n )\n modin_df.iloc[0][\"col1\"] = 11\n modin_df.iloc[1][\"col1\"] = 21\n modin_df.iloc[2][\"col1\"] = 31\n modin_df.iloc[lambda df: 0][\"col2\"] = 12\n modin_df.iloc[1][lambda df: [\"col2\"]] = 22\n modin_df.iloc[lambda df: 2][lambda df: [\"col2\"]] = 32\n pandas_df.iloc[0][\"col1\"] = 11\n pandas_df.iloc[1][\"col1\"] = 21\n pandas_df.iloc[2][\"col1\"] = 31\n pandas_df.iloc[lambda df: 0][\"col2\"] = 12\n pandas_df.iloc[1][lambda df: [\"col2\"]] = 22\n pandas_df.iloc[lambda df: 2][lambda df: [\"col2\"]] = 32\n\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_nested_assignment_test_iloc_nested_assignment.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_nested_assignment_test_iloc_nested_assignment.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 820, "end_line": 833, "span_ids": ["test_iloc_nested_assignment"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_iloc_nested_assignment(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n key1 = modin_df.columns[0]\n key2 = modin_df.columns[1]\n\n modin_df[key1].iloc[0] = 500\n pandas_df[key1].iloc[0] = 500\n df_equals(modin_df, pandas_df)\n\n modin_df[key2].iloc[0] = None\n pandas_df[key2].iloc[0] = None\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_empty_test_loc_series.df_equals_pd_df_md_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_iloc_empty_test_loc_series.df_equals_pd_df_md_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 836, "end_line": 858, "span_ids": ["test_iloc_empty", "test_iloc_loc_key_length", "test_loc_series"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_iloc_empty():\n pandas_df = pandas.DataFrame(index=range(5))\n modin_df = pd.DataFrame(index=range(5))\n\n df_equals(pandas_df.iloc[1], modin_df.iloc[1])\n pandas_df.iloc[1] = 3\n modin_df.iloc[1] = 3\n df_equals(pandas_df, modin_df)\n\n\ndef test_iloc_loc_key_length():\n modin_ser, pandas_ser = pd.Series(0), pandas.Series(0)\n eval_general(modin_ser, pandas_ser, lambda ser: ser.iloc[0, 0])\n eval_general(modin_ser, pandas_ser, lambda ser: ser.loc[0, 0])\n\n\ndef test_loc_series():\n md_df, pd_df = create_test_dfs({\"a\": [1, 2], \"b\": [3, 4]})\n\n pd_df.loc[pd_df[\"a\"] > 1, \"b\"] = np.log(pd_df[\"b\"])\n md_df.loc[md_df[\"a\"] > 1, \"b\"] = np.log(md_df[\"b\"])\n\n df_equals(pd_df, md_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_iloc_slice_indexer_test_loc_iloc_slice_indexer.eval_general_md_df_pd_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_iloc_slice_indexer_test_loc_iloc_slice_indexer.eval_general_md_df_pd_df", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 861, "end_line": 881, "span_ids": ["test_loc_iloc_slice_indexer"], "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": "@pytest.mark.parametrize(\"locator_name\", [\"loc\", \"iloc\"])\n@pytest.mark.parametrize(\n \"slice_indexer\",\n [\n slice(None, None, -2),\n slice(1, 10, None),\n slice(None, 10, None),\n slice(10, None, None),\n slice(10, None, -2),\n slice(-10, None, -2),\n slice(None, 1_000_000_000, None),\n ],\n)\ndef test_loc_iloc_slice_indexer(locator_name, slice_indexer):\n md_df, pd_df = create_test_dfs(test_data_values[0])\n # Shifting the index, so labels won't match its position\n shifted_index = pandas.RangeIndex(1, len(md_df) + 1)\n md_df.index = shifted_index\n pd_df.index = shifted_index\n\n eval_general(md_df, pd_df, lambda df: getattr(df, locator_name)[slice_indexer])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_TestLocRangeLikeIndexer_TestLocRangeLikeIndexer.test_range_getitem_two_values_5702.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_TestLocRangeLikeIndexer_TestLocRangeLikeIndexer.test_range_getitem_two_values_5702.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 884, "end_line": 923, "span_ids": ["TestLocRangeLikeIndexer", "TestLocRangeLikeIndexer.test_range_getitem_single_value", "TestLocRangeLikeIndexer.test_range_index_getitem_single_value", "TestLocRangeLikeIndexer.test_range_getitem_two_values_5702", "TestLocRangeLikeIndexer.test_range_index_getitem_two_values"], "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": "@pytest.mark.parametrize(\n \"indexer_size\",\n [\n 1,\n 2,\n NROWS,\n pytest.param(\n NROWS + 1,\n marks=pytest.mark.xfail(\n reason=\"https://github.com/modin-project/modin/issues/5739\", strict=True\n ),\n ),\n ],\n)\nclass TestLocRangeLikeIndexer:\n \"\"\"Test cases related to https://github.com/modin-project/modin/issues/5702\"\"\"\n\n def test_range_index_getitem_single_value(self, indexer_size):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.loc[pd.RangeIndex(indexer_size)],\n )\n\n def test_range_index_getitem_two_values(self, indexer_size):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.loc[pd.RangeIndex(indexer_size), :],\n )\n\n def test_range_getitem_single_value(self, indexer_size):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.loc[range(indexer_size)],\n )\n\n def test_range_getitem_two_values_5702(self, indexer_size):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.loc[range(indexer_size), :],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_pop_test_pop.if_empty_data_not_in_re.df_equals_temp_modin_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_pop_test_pop.if_empty_data_not_in_re.df_equals_temp_modin_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 926, "end_line": 938, "span_ids": ["test_pop"], "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.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_pop(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if \"empty_data\" not in request.node.name:\n key = modin_df.columns[0]\n temp_modin_df = modin_df.copy()\n temp_pandas_df = pandas_df.copy()\n modin_popped = temp_modin_df.pop(key)\n pandas_popped = temp_pandas_df.pop(key)\n df_equals(modin_popped, pandas_popped)\n df_equals(temp_modin_df, temp_pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_test_reindex.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_test_reindex.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 941, "end_line": 969, "span_ids": ["test_reindex"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reindex():\n frame_data = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col4\": [12, 13, 14, 15],\n \"col5\": [0, 0, 0, 0],\n }\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n df_equals(modin_df.reindex([0, 3, 2, 1]), pandas_df.reindex([0, 3, 2, 1]))\n df_equals(modin_df.reindex([0, 6, 2]), pandas_df.reindex([0, 6, 2]))\n df_equals(\n modin_df.reindex([\"col1\", \"col3\", \"col4\", \"col2\"], axis=1),\n pandas_df.reindex([\"col1\", \"col3\", \"col4\", \"col2\"], axis=1),\n )\n df_equals(\n modin_df.reindex([\"col1\", \"col7\", \"col4\", \"col8\"], axis=1),\n pandas_df.reindex([\"col1\", \"col7\", \"col4\", \"col8\"], axis=1),\n )\n df_equals(\n modin_df.reindex(index=[0, 1, 5], columns=[\"col1\", \"col7\", \"col4\", \"col8\"]),\n pandas_df.reindex(index=[0, 1, 5], columns=[\"col1\", \"col7\", \"col4\", \"col8\"]),\n )\n df_equals(\n modin_df.T.reindex([\"col1\", \"col7\", \"col4\", \"col8\"], axis=0),\n pandas_df.T.reindex([\"col1\", \"col7\", \"col4\", \"col8\"], axis=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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_4438_test_reindex_4438.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_4438_test_reindex_4438.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 972, "end_line": 1014, "span_ids": ["test_reindex_4438"], "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": "def test_reindex_4438():\n index = pd.date_range(end=\"1/1/2018\", periods=3, freq=\"h\", name=\"some meta\")\n new_index = list(reversed(index))\n\n # index case\n modin_df = pd.DataFrame([1, 2, 3], index=index)\n pandas_df = pandas.DataFrame([1, 2, 3], index=index)\n new_modin_df = modin_df.reindex(new_index)\n new_pandas_df = pandas_df.reindex(new_index)\n df_equals(new_modin_df, new_pandas_df)\n\n # column case\n modin_df = pd.DataFrame(np.array([[1], [2], [3]]).T, columns=index)\n pandas_df = pandas.DataFrame(np.array([[1], [2], [3]]).T, columns=index)\n new_modin_df = modin_df.reindex(columns=new_index)\n new_pandas_df = pandas_df.reindex(columns=new_index)\n df_equals(new_modin_df, new_pandas_df)\n\n # multiindex case\n multi_index = pandas.MultiIndex.from_arrays(\n [(\"a\", \"b\", \"c\"), (\"a\", \"b\", \"c\")], names=[\"first\", \"second\"]\n )\n new_multi_index = list(reversed(multi_index))\n\n modin_df = pd.DataFrame([1, 2, 3], index=multi_index)\n pandas_df = pandas.DataFrame([1, 2, 3], index=multi_index)\n new_modin_df = modin_df.reindex(new_multi_index)\n new_pandas_df = pandas_df.reindex(new_multi_index)\n df_equals(new_modin_df, new_pandas_df)\n\n # multicolumn case\n modin_df = pd.DataFrame(np.array([[1], [2], [3]]).T, columns=multi_index)\n pandas_df = pandas.DataFrame(np.array([[1], [2], [3]]).T, columns=multi_index)\n new_modin_df = modin_df.reindex(columns=new_multi_index)\n new_pandas_df = pandas_df.reindex(columns=new_multi_index)\n df_equals(new_modin_df, new_pandas_df)\n\n # index + multiindex case\n modin_df = pd.DataFrame([1, 2, 3], index=index)\n pandas_df = pandas.DataFrame([1, 2, 3], index=index)\n new_modin_df = modin_df.reindex(new_multi_index)\n new_pandas_df = pandas_df.reindex(new_multi_index)\n df_equals(new_modin_df, new_pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_like_test_reindex_like.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_like_test_reindex_like.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1017, "end_line": 1036, "span_ids": ["test_reindex_like"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reindex_like():\n o_data = [\n [24.3, 75.7, \"high\"],\n [31, 87.8, \"high\"],\n [22, 71.6, \"medium\"],\n [35, 95, \"medium\"],\n ]\n o_columns = [\"temp_celsius\", \"temp_fahrenheit\", \"windspeed\"]\n o_index = pd.date_range(start=\"2014-02-12\", end=\"2014-02-15\", freq=\"D\")\n new_data = [[28, \"low\"], [30, \"low\"], [35.1, \"medium\"]]\n new_columns = [\"temp_celsius\", \"windspeed\"]\n new_index = pd.DatetimeIndex([\"2014-02-12\", \"2014-02-13\", \"2014-02-15\"])\n modin_df1 = pd.DataFrame(o_data, columns=o_columns, index=o_index)\n modin_df2 = pd.DataFrame(new_data, columns=new_columns, index=new_index)\n modin_result = modin_df2.reindex_like(modin_df1)\n\n pandas_df1 = pandas.DataFrame(o_data, columns=o_columns, index=o_index)\n pandas_df2 = pandas.DataFrame(new_data, columns=new_columns, index=new_index)\n pandas_result = pandas_df2.reindex_like(pandas_df1)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_sanity_test_rename_sanity.assert_renamed_index_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_sanity_test_rename_sanity.assert_renamed_index_name", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1039, "end_line": 1106, "span_ids": ["test_rename_sanity"], "tokens": 642}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_sanity():\n source_df = pandas.DataFrame(test_data[\"int_data\"])[\n [\"col1\", \"index\", \"col3\", \"col4\"]\n ]\n mapping = {\"col1\": \"a\", \"index\": \"b\", \"col3\": \"c\", \"col4\": \"d\"}\n\n modin_df = pd.DataFrame(source_df)\n df_equals(modin_df.rename(columns=mapping), source_df.rename(columns=mapping))\n\n renamed2 = source_df.rename(columns=str.lower)\n df_equals(modin_df.rename(columns=str.lower), renamed2)\n\n modin_df = pd.DataFrame(renamed2)\n df_equals(modin_df.rename(columns=str.upper), renamed2.rename(columns=str.upper))\n\n # index\n data = {\"A\": {\"foo\": 0, \"bar\": 1}}\n\n # gets sorted alphabetical\n df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n assert_index_equal(\n modin_df.rename(index={\"foo\": \"bar\", \"bar\": \"foo\"}).index,\n df.rename(index={\"foo\": \"bar\", \"bar\": \"foo\"}).index,\n )\n\n assert_index_equal(\n modin_df.rename(index=str.upper).index, df.rename(index=str.upper).index\n )\n\n # Using the `mapper` functionality with `axis`\n assert_index_equal(\n modin_df.rename(str.upper, axis=0).index, df.rename(str.upper, axis=0).index\n )\n assert_index_equal(\n modin_df.rename(str.upper, axis=1).columns,\n df.rename(str.upper, axis=1).columns,\n )\n\n # have to pass something\n with pytest.raises(TypeError):\n modin_df.rename()\n\n # partial columns\n source_df.rename(columns={\"col3\": \"foo\", \"col4\": \"bar\"})\n modin_df = pd.DataFrame(source_df)\n assert_index_equal(\n modin_df.rename(columns={\"col3\": \"foo\", \"col4\": \"bar\"}).index,\n source_df.rename(columns={\"col3\": \"foo\", \"col4\": \"bar\"}).index,\n )\n\n # other axis\n source_df.T.rename(index={\"col3\": \"foo\", \"col4\": \"bar\"})\n assert_index_equal(\n source_df.T.rename(index={\"col3\": \"foo\", \"col4\": \"bar\"}).index,\n modin_df.T.rename(index={\"col3\": \"foo\", \"col4\": \"bar\"}).index,\n )\n\n # index with name\n index = pandas.Index([\"foo\", \"bar\"], name=\"name\")\n renamer = pandas.DataFrame(data, index=index)\n modin_df = pd.DataFrame(data, index=index)\n\n renamed = renamer.rename(index={\"foo\": \"bar\", \"bar\": \"foo\"})\n modin_renamed = modin_df.rename(index={\"foo\": \"bar\", \"bar\": \"foo\"})\n assert_index_equal(renamed.index, modin_renamed.index)\n\n assert renamed.index.name == modin_renamed.index.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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_multiindex_test_rename_multiindex.modin_renamed_22.modin_df_rename_columns_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_multiindex_test_rename_multiindex.modin_renamed_22.modin_df_rename_columns_f", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1109, "end_line": 1171, "span_ids": ["test_rename_multiindex"], "tokens": 776}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_multiindex():\n tuples_index = [(\"foo1\", \"bar1\"), (\"foo2\", \"bar2\")]\n tuples_columns = [(\"fizz1\", \"buzz1\"), (\"fizz2\", \"buzz2\")]\n index = pandas.MultiIndex.from_tuples(tuples_index, names=[\"foo\", \"bar\"])\n columns = pandas.MultiIndex.from_tuples(tuples_columns, names=[\"fizz\", \"buzz\"])\n\n frame_data = [(0, 0), (1, 1)]\n df = pandas.DataFrame(frame_data, index=index, columns=columns)\n modin_df = pd.DataFrame(frame_data, index=index, columns=columns)\n\n #\n # without specifying level -> accross all levels\n renamed = df.rename(\n index={\"foo1\": \"foo3\", \"bar2\": \"bar3\"},\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"},\n )\n modin_renamed = modin_df.rename(\n index={\"foo1\": \"foo3\", \"bar2\": \"bar3\"},\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"},\n )\n assert_index_equal(renamed.index, modin_renamed.index)\n\n renamed = df.rename(\n index={\"foo1\": \"foo3\", \"bar2\": \"bar3\"},\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"},\n )\n assert_index_equal(renamed.columns, modin_renamed.columns)\n assert renamed.index.names == modin_renamed.index.names\n assert renamed.columns.names == modin_renamed.columns.names\n\n #\n # with specifying a level\n\n # dict\n renamed = df.rename(columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=0)\n modin_renamed = modin_df.rename(\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=0\n )\n assert_index_equal(renamed.columns, modin_renamed.columns)\n renamed = df.rename(columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=\"fizz\")\n modin_renamed = modin_df.rename(\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=\"fizz\"\n )\n assert_index_equal(renamed.columns, modin_renamed.columns)\n\n renamed = df.rename(columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=1)\n modin_renamed = modin_df.rename(\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=1\n )\n assert_index_equal(renamed.columns, modin_renamed.columns)\n renamed = df.rename(columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=\"buzz\")\n modin_renamed = modin_df.rename(\n columns={\"fizz1\": \"fizz3\", \"buzz2\": \"buzz3\"}, level=\"buzz\"\n )\n assert_index_equal(renamed.columns, modin_renamed.columns)\n\n # function\n func = str.upper\n renamed = df.rename(columns=func, level=0)\n modin_renamed = modin_df.rename(columns=func, level=0)\n assert_index_equal(renamed.columns, modin_renamed.columns)\n renamed = df.rename(columns=func, level=\"fizz\")\n modin_renamed = modin_df.rename(columns=func, level=\"fizz\")\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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_multiindex.None_7_test_rename_multiindex.assert_index_equal_modin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_multiindex.None_7_test_rename_multiindex.assert_index_equal_modin_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1172, "end_line": 1184, "span_ids": ["test_rename_multiindex"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_multiindex():\n # ... other code\n assert_index_equal(renamed.columns, modin_renamed.columns)\n\n renamed = df.rename(columns=func, level=1)\n modin_renamed = modin_df.rename(columns=func, level=1)\n assert_index_equal(renamed.columns, modin_renamed.columns)\n renamed = df.rename(columns=func, level=\"buzz\")\n modin_renamed = modin_df.rename(columns=func, level=\"buzz\")\n assert_index_equal(renamed.columns, modin_renamed.columns)\n\n # index\n renamed = df.rename(index={\"foo1\": \"foo3\", \"bar2\": \"bar3\"}, level=0)\n modin_renamed = modin_df.rename(index={\"foo1\": \"foo3\", \"bar2\": \"bar3\"}, level=0)\n assert_index_equal(modin_renamed.index, renamed.index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_nocopy_test_rename_nocopy.assert_modin_df_col3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_nocopy_test_rename_nocopy.assert_modin_df_col3_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1187, "end_line": 1195, "span_ids": ["test_rename_nocopy"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(reason=\"Pandas does not pass this test\")\ndef test_rename_nocopy():\n source_df = pandas.DataFrame(test_data[\"int_data\"])[\n [\"col1\", \"index\", \"col3\", \"col4\"]\n ]\n modin_df = pd.DataFrame(source_df)\n modin_renamed = modin_df.rename(columns={\"col3\": \"foo\"}, copy=False)\n modin_renamed[\"foo\"] = 1\n assert (modin_df[\"col3\"] == 1).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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_inplace_test_rename_inplace.df_equals_modin_frame_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_inplace_test_rename_inplace.df_equals_modin_frame_fr", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1198, "end_line": 1214, "span_ids": ["test_rename_inplace"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_inplace():\n source_df = pandas.DataFrame(test_data[\"int_data\"])[\n [\"col1\", \"index\", \"col3\", \"col4\"]\n ]\n modin_df = pd.DataFrame(source_df)\n\n df_equals(\n modin_df.rename(columns={\"col3\": \"foo\"}),\n source_df.rename(columns={\"col3\": \"foo\"}),\n )\n\n frame = source_df.copy()\n modin_frame = modin_df.copy()\n frame.rename(columns={\"col3\": \"foo\"}, inplace=True)\n modin_frame.rename(columns={\"col3\": \"foo\"}, inplace=True)\n\n df_equals(modin_frame, frame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_bug_test_rename_bug.df_equals_modin_df_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_bug_test_rename_bug.df_equals_modin_df_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1217, "end_line": 1232, "span_ids": ["test_rename_bug"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_bug():\n # rename set ref_locs, and set_index was not resetting\n frame_data = {0: [\"foo\", \"bar\"], 1: [\"bah\", \"bas\"], 2: [1, 2]}\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n df = df.rename(columns={0: \"a\"})\n df = df.rename(columns={1: \"b\"})\n df = df.set_index([\"a\", \"b\"])\n df.columns = [\"2001-01-01\"]\n\n modin_df = modin_df.rename(columns={0: \"a\"})\n modin_df = modin_df.rename(columns={1: \"b\"})\n modin_df = modin_df.set_index([\"a\", \"b\"])\n modin_df.columns = [\"2001-01-01\"]\n\n df_equals(modin_df, df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_to_datetime_using_set_index_test_index_to_datetime_using_set_index.df_equals_modin_df_years_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_to_datetime_using_set_index_test_index_to_datetime_using_set_index.df_equals_modin_df_years_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1235, "end_line": 1249, "span_ids": ["test_index_to_datetime_using_set_index"], "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_index_to_datetime_using_set_index():\n data = {\"YEAR\": [\"1992\", \"1993\", \"1994\"], \"ALIENS\": [1, 99, 1]}\n modin_df_years = pd.DataFrame(data=data)\n df_years = pandas.DataFrame(data=data)\n modin_df_years = modin_df_years.set_index(\"YEAR\")\n df_years = df_years.set_index(\"YEAR\")\n modin_datetime_index = pd.to_datetime(modin_df_years.index, format=\"%Y\")\n pandas_datetime_index = pandas.to_datetime(df_years.index, format=\"%Y\")\n\n modin_df_years.index = modin_datetime_index\n df_years.index = pandas_datetime_index\n\n modin_df_years.set_index(modin_datetime_index)\n df_years.set_index(pandas_datetime_index)\n df_equals(modin_df_years, df_years)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_axis_test_rename_axis.with_pytest_raises_ValueE.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_axis_test_rename_axis.with_pytest_raises_ValueE.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1252, "end_line": 1290, "span_ids": ["test_rename_axis"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_axis():\n data = {\"num_legs\": [4, 4, 2], \"num_arms\": [0, 0, 2]}\n index = [\"dog\", \"cat\", \"monkey\"]\n modin_df = pd.DataFrame(data, index)\n pandas_df = pandas.DataFrame(data, index)\n df_equals(modin_df.rename_axis(\"animal\"), pandas_df.rename_axis(\"animal\"))\n df_equals(\n modin_df.rename_axis(\"limbs\", axis=\"columns\"),\n pandas_df.rename_axis(\"limbs\", axis=\"columns\"),\n )\n\n modin_df.rename_axis(\"limbs\", axis=\"columns\", inplace=True)\n pandas_df.rename_axis(\"limbs\", axis=\"columns\", inplace=True)\n df_equals(modin_df, pandas_df)\n\n new_index = pd.MultiIndex.from_product(\n [[\"mammal\"], [\"dog\", \"cat\", \"monkey\"]], names=[\"type\", \"name\"]\n )\n modin_df.index = new_index\n pandas_df.index = new_index\n\n df_equals(\n modin_df.rename_axis(index={\"type\": \"class\"}),\n pandas_df.rename_axis(index={\"type\": \"class\"}),\n )\n df_equals(\n modin_df.rename_axis(columns=str.upper),\n pandas_df.rename_axis(columns=str.upper),\n )\n df_equals(\n modin_df.rename_axis(columns=[str.upper(o) for o in modin_df.columns.names]),\n pandas_df.rename_axis(columns=[str.upper(o) for o in pandas_df.columns.names]),\n )\n\n with pytest.raises(ValueError):\n df_equals(\n modin_df.rename_axis(str.upper, axis=1),\n pandas_df.rename_axis(str.upper, axis=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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_axis_inplace_test_rename_axis_inplace.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_axis_inplace_test_rename_axis_inplace.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1293, "end_line": 1311, "span_ids": ["test_rename_axis_inplace"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_axis_inplace():\n test_frame = pandas.DataFrame(test_data[\"int_data\"])\n modin_df = pd.DataFrame(test_frame)\n\n result = test_frame.copy()\n modin_result = modin_df.copy()\n no_return = result.rename_axis(\"foo\", inplace=True)\n modin_no_return = modin_result.rename_axis(\"foo\", inplace=True)\n\n assert no_return is modin_no_return\n df_equals(modin_result, result)\n\n result = test_frame.copy()\n modin_result = modin_df.copy()\n no_return = result.rename_axis(\"bar\", axis=1, inplace=True)\n modin_no_return = modin_result.rename_axis(\"bar\", axis=1, inplace=True)\n\n assert no_return is modin_no_return\n df_equals(modin_result, 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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_issue5600_test_rename_issue5600.assert_df_renamed_columns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_rename_issue5600_test_rename_issue5600.assert_df_renamed_columns", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1314, "end_line": 1325, "span_ids": ["test_rename_issue5600"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_issue5600():\n # Check the issue for more details\n # https://github.com/modin-project/modin/issues/5600\n df = pd.DataFrame({\"a\": [1, 2]})\n df_renamed = df.rename(columns={\"a\": \"new_a\"}, copy=True, inplace=False)\n\n # Check that the source frame was untouched\n assert df.dtypes.keys().tolist() == [\"a\"]\n assert df.columns.tolist() == [\"a\"]\n\n assert df_renamed.dtypes.keys().tolist() == [\"new_a\"]\n assert df_renamed.columns.tolist() == [\"new_a\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reorder_levels_test_reorder_levels.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reorder_levels_test_reorder_levels.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1328, "end_line": 1357, "span_ids": ["test_reorder_levels"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reorder_levels():\n data = np.random.randint(1, 100, 12)\n modin_df = pd.DataFrame(\n data,\n index=pd.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n pandas_df = pandas.DataFrame(\n data,\n index=pandas.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n df_equals(\n modin_df.reorder_levels([\"Letter\", \"Color\", \"Number\"]),\n pandas_df.reorder_levels([\"Letter\", \"Color\", \"Number\"]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_multiindex_test_reindex_multiindex.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reindex_multiindex_test_reindex_multiindex.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1360, "end_line": 1393, "span_ids": ["test_reindex_multiindex"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reindex_multiindex():\n data1, data2 = np.random.randint(1, 20, (5, 5)), np.random.randint(10, 25, 6)\n index = np.array([\"AUD\", \"BRL\", \"CAD\", \"EUR\", \"INR\"])\n modin_midx = pd.MultiIndex.from_product(\n [[\"Bank_1\", \"Bank_2\"], [\"AUD\", \"CAD\", \"EUR\"]], names=[\"Bank\", \"Curency\"]\n )\n pandas_midx = pandas.MultiIndex.from_product(\n [[\"Bank_1\", \"Bank_2\"], [\"AUD\", \"CAD\", \"EUR\"]], names=[\"Bank\", \"Curency\"]\n )\n modin_df1, modin_df2 = (\n pd.DataFrame(data=data1, index=index, columns=index),\n pd.DataFrame(data2, modin_midx),\n )\n pandas_df1, pandas_df2 = (\n pandas.DataFrame(data=data1, index=index, columns=index),\n pandas.DataFrame(data2, pandas_midx),\n )\n modin_df2.columns, pandas_df2.columns = [\"Notional\"], [\"Notional\"]\n md_midx = pd.MultiIndex.from_product([modin_df2.index.levels[0], modin_df1.index])\n pd_midx = pandas.MultiIndex.from_product(\n [pandas_df2.index.levels[0], pandas_df1.index]\n )\n # reindex without axis, index, or columns\n modin_result = modin_df1.reindex(md_midx, fill_value=0)\n pandas_result = pandas_df1.reindex(pd_midx, fill_value=0)\n df_equals(modin_result, pandas_result)\n # reindex with only axis\n modin_result = modin_df1.reindex(md_midx, fill_value=0, axis=0)\n pandas_result = pandas_df1.reindex(pd_midx, fill_value=0, axis=0)\n df_equals(modin_result, pandas_result)\n # reindex with axis and level\n modin_result = modin_df1.reindex(md_midx, fill_value=0, axis=0, level=0)\n pandas_result = pandas_df1.reindex(pd_midx, fill_value=0, axis=0, level=0)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_test_reset_index.df_equals_modin_df_cp_pd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_test_reset_index.df_equals_modin_df_cp_pd", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1396, "end_line": 1412, "span_ids": ["test_reset_index"], "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": "@pytest.mark.parametrize(\"test_async_reset_index\", [False, True])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_reset_index(data, test_async_reset_index):\n modin_df, pandas_df = create_test_dfs(data)\n if test_async_reset_index:\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n modin_result = modin_df.reset_index(inplace=False)\n pandas_result = pandas_df.reset_index(inplace=False)\n df_equals(modin_result, pandas_result)\n\n modin_df_cp = modin_df.copy()\n pd_df_cp = pandas_df.copy()\n if test_async_reset_index:\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n modin_df_cp.reset_index(inplace=True)\n pd_df_cp.reset_index(inplace=True)\n df_equals(modin_df_cp, pd_df_cp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_multiindex_groupby_test_reset_index_multiindex_groupby.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_multiindex_groupby_test_reset_index_multiindex_groupby.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1415, "end_line": 1441, "span_ids": ["test_reset_index_multiindex_groupby"], "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": "@pytest.mark.parametrize(\n \"data\",\n [\n test_data[\"int_data\"],\n pytest.param(\n test_data[\"float_nan_data\"],\n marks=pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/modin-project/modin/issues/2896\",\n ),\n ),\n ],\n)\ndef test_reset_index_multiindex_groupby(data):\n # GH#4394\n modin_df, pandas_df = create_test_dfs(data)\n modin_df.index = pd.MultiIndex.from_tuples(\n [(i // 10, i // 5, i) for i in range(len(modin_df))]\n )\n pandas_df.index = pandas.MultiIndex.from_tuples(\n [(i // 10, i // 5, i) for i in range(len(pandas_df))]\n )\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.reset_index().groupby(list(df.columns[:2])).count(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop_test_reset_index_with_multi_index_no_drop.index.names._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop_test_reset_index_with_multi_index_no_drop.index.names._", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1444, "end_line": 1563, "span_ids": ["test_reset_index_with_multi_index_no_drop"], "tokens": 825}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"test_async_reset_index\", [False, True])\n@pytest.mark.parametrize(\n \"data\",\n [\n pytest.param(\n test_data[\"int_data\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n test_data[\"float_nan_data\"],\n ],\n ids=[\"int_data\", \"float_nan_data\"],\n)\n@pytest.mark.parametrize(\"nlevels\", [3])\n@pytest.mark.parametrize(\"columns_multiindex\", [True, False])\n@pytest.mark.parametrize(\n \"level\",\n [\n \"no_level\",\n None,\n 0,\n 1,\n 2,\n [2, 0],\n [2, 1],\n [1, 0],\n pytest.param(\n [2, 1, 2],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [0, 0, 0, 0],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_2\", \"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [2, \"level_name_0\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\"col_level\", [\"no_col_level\", 0, 1, 2])\n@pytest.mark.parametrize(\"col_fill\", [\"no_col_fill\", None, 0, \"new\"])\n@pytest.mark.parametrize(\"drop\", [False])\n@pytest.mark.parametrize(\n \"multiindex_levels_names_max_levels\",\n [\n 0,\n 1,\n 2,\n pytest.param(\n 3, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n pytest.param(\n 4, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"none_in_index_names\",\n [\n pytest.param(\n False,\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n True,\n \"mixed_1st_None\",\n pytest.param(\n \"mixed_2nd_None\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\ndef test_reset_index_with_multi_index_no_drop(\n data,\n nlevels,\n columns_multiindex,\n level,\n col_level,\n col_fill,\n drop,\n multiindex_levels_names_max_levels,\n none_in_index_names,\n test_async_reset_index,\n):\n data_rows = len(data[list(data.keys())[0]])\n index = generate_multiindex(data_rows, nlevels=nlevels)\n data_columns = len(data.keys())\n columns = (\n generate_multiindex(data_columns, nlevels=nlevels)\n if columns_multiindex\n else pandas.RangeIndex(0, data_columns)\n )\n # Replace original data columns with generated\n data = {columns[ind]: data[key] for ind, key in enumerate(data)}\n index.names = (\n [f\"level_{i}\" for i in range(index.nlevels)]\n if multiindex_levels_names_max_levels == 0\n else [\n tuple(\n [\n f\"level_{i}_name_{j}\"\n for j in range(\n 0,\n max(multiindex_levels_names_max_levels + 1 - index.nlevels, 0)\n + i,\n )\n ]\n )\n if max(multiindex_levels_names_max_levels + 1 - index.nlevels, 0) + i > 0\n else f\"level_{i}\"\n for i in range(index.nlevels)\n ]\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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop.if_none_in_index_names_is_test_reset_index_with_multi_index_no_drop.kwargs._drop_drop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop.if_none_in_index_names_is_test_reset_index_with_multi_index_no_drop.kwargs._drop_drop_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1565, "end_line": 1584, "span_ids": ["test_reset_index_with_multi_index_no_drop"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"test_async_reset_index\", [False, True])\n@pytest.mark.parametrize(\n \"data\",\n [\n pytest.param(\n test_data[\"int_data\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n test_data[\"float_nan_data\"],\n ],\n ids=[\"int_data\", \"float_nan_data\"],\n)\n@pytest.mark.parametrize(\"nlevels\", [3])\n@pytest.mark.parametrize(\"columns_multiindex\", [True, False])\n@pytest.mark.parametrize(\n \"level\",\n [\n \"no_level\",\n None,\n 0,\n 1,\n 2,\n [2, 0],\n [2, 1],\n [1, 0],\n pytest.param(\n [2, 1, 2],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [0, 0, 0, 0],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_2\", \"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [2, \"level_name_0\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\"col_level\", [\"no_col_level\", 0, 1, 2])\n@pytest.mark.parametrize(\"col_fill\", [\"no_col_fill\", None, 0, \"new\"])\n@pytest.mark.parametrize(\"drop\", [False])\n@pytest.mark.parametrize(\n \"multiindex_levels_names_max_levels\",\n [\n 0,\n 1,\n 2,\n pytest.param(\n 3, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n pytest.param(\n 4, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"none_in_index_names\",\n [\n pytest.param(\n False,\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n True,\n \"mixed_1st_None\",\n pytest.param(\n \"mixed_2nd_None\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\ndef test_reset_index_with_multi_index_no_drop(\n data,\n nlevels,\n columns_multiindex,\n level,\n col_level,\n col_fill,\n drop,\n multiindex_levels_names_max_levels,\n none_in_index_names,\n test_async_reset_index,\n):\n # ... other code\n\n if none_in_index_names is True:\n index.names = [None] * len(index.names)\n elif none_in_index_names:\n names_list = list(index.names)\n start_index = 0 if none_in_index_names == \"mixed_1st_None\" else 1\n names_list[start_index::2] = [None] * len(names_list[start_index::2])\n index.names = names_list\n\n modin_df = pd.DataFrame(data, index=index, columns=columns)\n pandas_df = pandas.DataFrame(data, index=index, columns=columns)\n\n if isinstance(level, list):\n level = [\n index.names[int(x[len(\"level_name_\") :])]\n if isinstance(x, str) and x.startswith(\"level_name_\")\n else x\n for x in level\n ]\n\n kwargs = {\"drop\": drop}\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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop.if_level_no_level__test_reset_index_with_multi_index_no_drop.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_no_drop.if_level_no_level__test_reset_index_with_multi_index_no_drop.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1585, "end_line": 1599, "span_ids": ["test_reset_index_with_multi_index_no_drop"], "tokens": 720}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"test_async_reset_index\", [False, True])\n@pytest.mark.parametrize(\n \"data\",\n [\n pytest.param(\n test_data[\"int_data\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n test_data[\"float_nan_data\"],\n ],\n ids=[\"int_data\", \"float_nan_data\"],\n)\n@pytest.mark.parametrize(\"nlevels\", [3])\n@pytest.mark.parametrize(\"columns_multiindex\", [True, False])\n@pytest.mark.parametrize(\n \"level\",\n [\n \"no_level\",\n None,\n 0,\n 1,\n 2,\n [2, 0],\n [2, 1],\n [1, 0],\n pytest.param(\n [2, 1, 2],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [0, 0, 0, 0],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_2\", \"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [2, \"level_name_0\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\"col_level\", [\"no_col_level\", 0, 1, 2])\n@pytest.mark.parametrize(\"col_fill\", [\"no_col_fill\", None, 0, \"new\"])\n@pytest.mark.parametrize(\"drop\", [False])\n@pytest.mark.parametrize(\n \"multiindex_levels_names_max_levels\",\n [\n 0,\n 1,\n 2,\n pytest.param(\n 3, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n pytest.param(\n 4, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"none_in_index_names\",\n [\n pytest.param(\n False,\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n True,\n \"mixed_1st_None\",\n pytest.param(\n \"mixed_2nd_None\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\ndef test_reset_index_with_multi_index_no_drop(\n data,\n nlevels,\n columns_multiindex,\n level,\n col_level,\n col_fill,\n drop,\n multiindex_levels_names_max_levels,\n none_in_index_names,\n test_async_reset_index,\n):\n # ... other code\n if level != \"no_level\":\n kwargs[\"level\"] = level\n if col_level != \"no_col_level\":\n kwargs[\"col_level\"] = col_level\n if col_fill != \"no_col_fill\":\n kwargs[\"col_fill\"] = col_fill\n if test_async_reset_index:\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.reset_index(**kwargs),\n # https://github.com/modin-project/modin/issues/5960\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_drop_test_reset_index_with_multi_index_drop.test_reset_index_with_mul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_multi_index_drop_test_reset_index_with_multi_index_drop.test_reset_index_with_mul", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1602, "end_line": 1696, "span_ids": ["test_reset_index_with_multi_index_drop"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"test_async_reset_index\", [False, True])\n@pytest.mark.parametrize(\n \"data\",\n [\n pytest.param(\n test_data[\"int_data\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n test_data[\"float_nan_data\"],\n ],\n ids=[\"int_data\", \"float_nan_data\"],\n)\n@pytest.mark.parametrize(\"nlevels\", [3])\n@pytest.mark.parametrize(\n \"level\",\n [\n \"no_level\",\n None,\n 0,\n 1,\n 2,\n [2, 0],\n [2, 1],\n [1, 0],\n pytest.param(\n [2, 1, 2],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [0, 0, 0, 0],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [\"level_name_2\", \"level_name_1\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n [2, \"level_name_0\"],\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"multiindex_levels_names_max_levels\",\n [\n 0,\n 1,\n 2,\n pytest.param(\n 3, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n pytest.param(\n 4, marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\")\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"none_in_index_names\",\n [\n pytest.param(\n False,\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n True,\n \"mixed_1st_None\",\n pytest.param(\n \"mixed_2nd_None\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\ndef test_reset_index_with_multi_index_drop(\n data,\n nlevels,\n level,\n multiindex_levels_names_max_levels,\n none_in_index_names,\n test_async_reset_index,\n):\n test_reset_index_with_multi_index_no_drop(\n data,\n nlevels,\n True,\n level,\n \"no_col_level\",\n \"no_col_fill\",\n True,\n multiindex_levels_names_max_levels,\n none_in_index_names,\n test_async_reset_index,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_named_index_test_reset_index_with_named_index.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_with_named_index_test_reset_index_with_named_index.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1699, "end_line": 1753, "span_ids": ["test_reset_index_with_named_index"], "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": "@pytest.mark.parametrize(\n \"test_async_reset_index\",\n [\n False,\n pytest.param(\n True,\n marks=pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK does not store trivial indexes.\",\n ),\n ),\n ],\n)\n@pytest.mark.parametrize(\"index_levels_names_max_levels\", [0, 1, 2])\ndef test_reset_index_with_named_index(\n index_levels_names_max_levels, test_async_reset_index\n):\n modin_df = pd.DataFrame(test_data_values[0])\n pandas_df = pandas.DataFrame(test_data_values[0])\n\n index_name = (\n tuple([f\"name_{j}\" for j in range(0, index_levels_names_max_levels)])\n if index_levels_names_max_levels > 0\n else \"NAME_OF_INDEX\"\n )\n modin_df.index.name = pandas_df.index.name = index_name\n df_equals(modin_df, pandas_df)\n if test_async_reset_index:\n # The change in index is not automatically handled by Modin. See #3941.\n modin_df.index = modin_df.index\n modin_df._to_pandas()\n\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n df_equals(modin_df.reset_index(drop=False), pandas_df.reset_index(drop=False))\n\n if test_async_reset_index:\n # The change in index is not automatically handled by Modin. See #3941.\n modin_df.index = modin_df.index\n modin_df._to_pandas()\n\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n modin_df.reset_index(drop=True, inplace=True)\n pandas_df.reset_index(drop=True, inplace=True)\n df_equals(modin_df, pandas_df)\n\n modin_df = pd.DataFrame(test_data_values[0])\n pandas_df = pandas.DataFrame(test_data_values[0])\n modin_df.index.name = pandas_df.index.name = index_name\n if test_async_reset_index:\n # The change in index is not automatically handled by Modin. See #3941.\n modin_df.index = modin_df.index\n modin_df._to_pandas()\n\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n df_equals(modin_df.reset_index(drop=False), pandas_df.reset_index(drop=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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_metadata_update_test_reset_index_metadata_update.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_reset_index_metadata_update_test_reset_index_metadata_update.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1756, "end_line": 1776, "span_ids": ["test_reset_index_metadata_update"], "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": "@pytest.mark.parametrize(\"test_async_reset_index\", [False, True])\n@pytest.mark.parametrize(\n \"index\",\n [\n pandas.Index([11, 22, 33, 44], name=\"col0\"),\n pandas.MultiIndex.from_product(\n [[100, 200], [300, 400]], names=[\"level1\", \"col0\"]\n ),\n ],\n ids=[\"index\", \"multiindex\"],\n)\ndef test_reset_index_metadata_update(index, test_async_reset_index):\n modin_df, pandas_df = create_test_dfs({\"col0\": [0, 1, 2, 3]}, index=index)\n modin_df.columns = pandas_df.columns = [\"col1\"]\n if test_async_reset_index:\n # The change in index is not automatically handled by Modin. See #3941.\n modin_df.index = modin_df.index\n modin_df._to_pandas()\n\n modin_df._query_compiler._modin_frame.set_index_cache(None)\n eval_general(modin_df, pandas_df, lambda df: df.reset_index())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_sample_test_sample.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_sample_test_sample.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1779, "end_line": 1859, "span_ids": ["test_sample"], "tokens": 809}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\ndef test_sample(data, axis):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n with pytest.raises(ValueError):\n modin_df.sample(n=3, frac=0.4, axis=axis)\n\n with pytest.raises(KeyError):\n modin_df.sample(frac=0.5, weights=\"CoLuMn_No_ExIsT\", axis=0)\n\n with pytest.raises(ValueError):\n modin_df.sample(frac=0.5, weights=modin_df.columns[0], axis=1)\n\n with pytest.raises(ValueError):\n modin_df.sample(\n frac=0.5, weights=[0.5 for _ in range(len(modin_df.index[:-1]))], axis=0\n )\n\n with pytest.raises(ValueError):\n modin_df.sample(\n frac=0.5,\n weights=[0.5 for _ in range(len(modin_df.columns[:-1]))],\n axis=1,\n )\n\n with pytest.raises(ValueError):\n modin_df.sample(n=-3, axis=axis)\n\n with pytest.raises(ValueError):\n modin_df.sample(frac=0.2, weights=pandas.Series(), axis=axis)\n\n if isinstance(axis, str):\n num_axis = pandas.DataFrame()._get_axis_number(axis)\n else:\n num_axis = axis\n\n # weights that sum to 1\n sums = sum(i % 2 for i in range(len(modin_df.axes[num_axis])))\n weights = [i % 2 / sums for i in range(len(modin_df.axes[num_axis]))]\n\n modin_result = modin_df.sample(\n frac=0.5, random_state=42, weights=weights, axis=axis\n )\n pandas_result = pandas_df.sample(\n frac=0.5, random_state=42, weights=weights, axis=axis\n )\n df_equals(modin_result, pandas_result)\n\n # weights that don't sum to 1\n weights = [i % 2 for i in range(len(modin_df.axes[num_axis]))]\n modin_result = modin_df.sample(\n frac=0.5, random_state=42, weights=weights, axis=axis\n )\n pandas_result = pandas_df.sample(\n frac=0.5, random_state=42, weights=weights, axis=axis\n )\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.sample(n=0, axis=axis)\n pandas_result = pandas_df.sample(n=0, axis=axis)\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.sample(frac=0.5, random_state=42, axis=axis)\n pandas_result = pandas_df.sample(frac=0.5, random_state=42, axis=axis)\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.sample(n=2, random_state=42, axis=axis)\n pandas_result = pandas_df.sample(n=2, random_state=42, axis=axis)\n df_equals(modin_result, pandas_result)\n\n # issue #1692, numpy RandomState object\n # We must create a new random state for each iteration because the values that\n # are selected will be impacted if the object has already been used.\n random_state = np.random.RandomState(42)\n modin_result = modin_df.sample(frac=0.5, random_state=random_state, axis=axis)\n\n random_state = np.random.RandomState(42)\n pandas_result = pandas_df.sample(frac=0.5, random_state=random_state, axis=axis)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_empty_sample_test_tail.df_equals_modin_df_tail_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_empty_sample_test_tail.df_equals_modin_df_tail_l", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1862, "end_line": 1911, "span_ids": ["test_tail", "test_empty_sample", "test_select_dtypes"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_empty_sample():\n modin_df, pandas_df = create_test_dfs([1])\n # issue #4983\n # If we have a fraction of the dataset that results in n=0, we should\n # make sure that we don't pass in both n and frac to sample internally.\n eval_general(modin_df, pandas_df, lambda df: df.sample(frac=0.12))\n\n\ndef test_select_dtypes():\n frame_data = {\n \"test1\": list(\"abc\"),\n \"test2\": np.arange(3, 6).astype(\"u1\"),\n \"test3\": np.arange(8.0, 11.0, dtype=\"float64\"),\n \"test4\": [True, False, True],\n \"test5\": pandas.date_range(\"now\", periods=3).values,\n \"test6\": list(range(5, 8)),\n }\n df = pandas.DataFrame(frame_data)\n rd = pd.DataFrame(frame_data)\n\n include = np.float64, \"integer\"\n exclude = (np.bool_,)\n r = rd.select_dtypes(include=include, exclude=exclude)\n\n e = df[[\"test2\", \"test3\", \"test6\"]]\n df_equals(r, e)\n\n r = rd.select_dtypes(include=np.bool_)\n e = df[[\"test4\"]]\n df_equals(r, e)\n\n r = rd.select_dtypes(exclude=np.bool_)\n e = df[[\"test1\", \"test2\", \"test3\", \"test5\", \"test6\"]]\n df_equals(r, e)\n\n try:\n pd.DataFrame().select_dtypes()\n assert False\n except ValueError:\n assert True\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=arg_keys(\"n\", int_arg_keys))\ndef test_tail(data, n):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.tail(n), pandas_df.tail(n))\n df_equals(modin_df.tail(len(modin_df)), pandas_df.tail(len(pandas_df)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_xs_test_xs.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_xs_test_xs.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1914, "end_line": 1944, "span_ids": ["test_xs"], "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": "def test_xs():\n # example is based on the doctest in the upstream pandas docstring\n data = {\n \"num_legs\": [4, 4, 2, 2],\n \"num_wings\": [0, 0, 2, 2],\n \"class\": [\"mammal\", \"mammal\", \"mammal\", \"bird\"],\n \"animal\": [\"cat\", \"dog\", \"bat\", \"penguin\"],\n \"locomotion\": [\"walks\", \"walks\", \"flies\", \"walks\"],\n }\n modin_df, pandas_df = create_test_dfs(data)\n\n def prepare_dataframes(df):\n # to make several partitions (only for Modin dataframe)\n df = (pd if isinstance(df, pd.DataFrame) else pandas).concat([df, df], axis=0)\n # looks like pandas is sorting the index whereas modin is not, performing a join operation.\n df = df.reset_index(drop=True)\n df = df.join(df, rsuffix=\"_y\")\n return df.set_index([\"class\", \"animal\", \"locomotion\"])\n\n modin_df = prepare_dataframes(modin_df)\n pandas_df = prepare_dataframes(pandas_df)\n eval_general(modin_df, pandas_df, lambda df: df.xs(\"mammal\"))\n eval_general(modin_df, pandas_df, lambda df: df.xs(\"cat\", level=1))\n eval_general(modin_df, pandas_df, lambda df: df.xs(\"num_legs\", axis=1))\n eval_general(\n modin_df, pandas_df, lambda df: df.xs(\"cat\", level=1, drop_level=False)\n )\n eval_general(modin_df, pandas_df, lambda df: df.xs((\"mammal\", \"cat\")))\n eval_general(\n modin_df, pandas_df, lambda df: df.xs((\"mammal\", \"cat\"), drop_level=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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getitem___test___getitem__.df_equals_pd_DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getitem___test___getitem__.df_equals_pd_DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1947, "end_line": 1978, "span_ids": ["test___getitem__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___getitem__(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n key = modin_df.columns[0]\n modin_col = modin_df.__getitem__(key)\n assert isinstance(modin_col, pd.Series)\n\n pd_col = pandas_df[key]\n df_equals(pd_col, modin_col)\n\n slices = [\n (None, -1),\n (-1, None),\n (1, 2),\n (1, None),\n (None, 1),\n (1, -1),\n (-3, -1),\n (1, -1, 2),\n (-1, 1, -1),\n (None, None, 2),\n ]\n\n # slice test\n for slice_param in slices:\n s = slice(*slice_param)\n df_equals(modin_df[s], pandas_df[s])\n\n # Test empty\n df_equals(pd.DataFrame([])[:10], pandas.DataFrame([])[:10])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getitem_bool_indexers_test___getitem_bool_indexers.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getitem_bool_indexers_test___getitem_bool_indexers.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 1981, "end_line": 2000, "span_ids": ["test___getitem_bool_indexers"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___getitem_bool_indexers(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n indices = [i % 3 == 0 for i in range(len(modin_df.index))]\n columns = [i % 5 == 0 for i in range(len(modin_df.columns))]\n\n # Key is a list of booleans\n modin_result = modin_df.loc[indices, columns]\n pandas_result = pandas_df.loc[indices, columns]\n df_equals(modin_result, pandas_result)\n\n # Key is a Modin or pandas series of booleans\n df_equals(\n modin_df.loc[pd.Series(indices), pd.Series(columns, index=modin_df.columns)],\n pandas_df.loc[\n pandas.Series(indices), pandas.Series(columns, index=modin_df.columns)\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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_getitem_empty_mask_test_getitem_empty_mask.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_getitem_empty_mask_test_getitem_empty_mask.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2003, "end_line": 2030, "span_ids": ["test_getitem_empty_mask"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_getitem_empty_mask():\n # modin-project/modin#517\n modin_frames = []\n pandas_frames = []\n data1 = np.random.randint(0, 100, size=(100, 4))\n mdf1 = pd.DataFrame(data1, columns=list(\"ABCD\"))\n pdf1 = pandas.DataFrame(data1, columns=list(\"ABCD\"))\n modin_frames.append(mdf1)\n pandas_frames.append(pdf1)\n\n data2 = np.random.randint(0, 100, size=(100, 4))\n mdf2 = pd.DataFrame(data2, columns=list(\"ABCD\"))\n pdf2 = pandas.DataFrame(data2, columns=list(\"ABCD\"))\n modin_frames.append(mdf2)\n pandas_frames.append(pdf2)\n\n data3 = np.random.randint(0, 100, size=(100, 4))\n mdf3 = pd.DataFrame(data3, columns=list(\"ABCD\"))\n pdf3 = pandas.DataFrame(data3, columns=list(\"ABCD\"))\n modin_frames.append(mdf3)\n pandas_frames.append(pdf3)\n\n modin_data = pd.concat(modin_frames)\n pandas_data = pandas.concat(pandas_frames)\n df_equals(\n modin_data[[False for _ in modin_data.index]],\n pandas_data[[False for _ in modin_data.index]],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_getitem_datetime_slice_test_getitem_same_name.df_equals_modin_df_c3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_getitem_datetime_slice_test_getitem_same_name.df_equals_modin_df_c3_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2033, "end_line": 2057, "span_ids": ["test_getitem_same_name", "test_getitem_datetime_slice"], "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": "def test_getitem_datetime_slice():\n data = {\"data\": range(1000)}\n index = pd.date_range(\"2017/1/4\", periods=1000)\n modin_df = pd.DataFrame(data=data, index=index)\n pandas_df = pandas.DataFrame(data=data, index=index)\n\n s = slice(\"2017-01-06\", \"2017-01-09\")\n df_equals(modin_df[s], pandas_df[s])\n\n\ndef test_getitem_same_name():\n data = [\n [1, 2, 3, 4],\n [5, 6, 7, 8],\n [9, 10, 11, 12],\n [13, 14, 15, 16],\n [17, 18, 19, 20],\n ]\n columns = [\"c1\", \"c2\", \"c1\", \"c3\"]\n modin_df = pd.DataFrame(data, columns=columns)\n pandas_df = pandas.DataFrame(data, columns=columns)\n df_equals(modin_df[\"c1\"], pandas_df[\"c1\"])\n df_equals(modin_df[\"c2\"], pandas_df[\"c2\"])\n df_equals(modin_df[[\"c1\", \"c2\"]], pandas_df[[\"c1\", \"c2\"]])\n df_equals(modin_df[\"c3\"], pandas_df[\"c3\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getattr___test___getattr__.if_empty_data_not_in_re.assert_isinstance_df2_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___getattr___test___getattr__.if_empty_data_not_in_re.assert_isinstance_df2_col", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2060, "end_line": 2076, "span_ids": ["test___getattr__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___getattr__(request, data):\n modin_df = pd.DataFrame(data)\n\n if \"empty_data\" not in request.node.name:\n key = modin_df.columns[0]\n modin_df.__getattr__(key)\n\n col = modin_df.__getattr__(\"col1\")\n assert isinstance(col, pd.Series)\n\n col = getattr(modin_df, \"col1\")\n assert isinstance(col, pd.Series)\n\n # Check that lookup in column doesn't override other attributes\n df2 = modin_df.rename(index=str, columns={key: \"columns\"})\n assert isinstance(df2.columns, pandas.Index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem___test___setitem__.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem___test___setitem__.None_11", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2079, "end_line": 2147, "span_ids": ["test___setitem__"], "tokens": 734}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\ndef test___setitem__(data):\n eval_setitem(*create_test_dfs(data), loc=-1, value=1)\n eval_setitem(\n *create_test_dfs(data), loc=-1, value=lambda df: type(df)(df[df.columns[0]])\n )\n\n nrows = len(data[list(data.keys())[0]])\n arr = np.arange(nrows * 2).reshape(-1, 2)\n\n eval_setitem(*create_test_dfs(data), loc=-1, value=arr)\n eval_setitem(*create_test_dfs(data), col=\"___NON EXISTENT COLUMN\", value=arr)\n eval_setitem(*create_test_dfs(data), loc=0, value=np.arange(nrows))\n\n modin_df = pd.DataFrame(columns=data.keys())\n pandas_df = pandas.DataFrame(columns=data.keys())\n\n for col in modin_df.columns:\n modin_df[col] = np.arange(1000)\n\n for col in pandas_df.columns:\n pandas_df[col] = np.arange(1000)\n\n df_equals(modin_df, pandas_df)\n\n # Test series assignment to column\n modin_df = pd.DataFrame(columns=modin_df.columns)\n pandas_df = pandas.DataFrame(columns=pandas_df.columns)\n modin_df[modin_df.columns[-1]] = modin_df[modin_df.columns[0]]\n pandas_df[pandas_df.columns[-1]] = pandas_df[pandas_df.columns[0]]\n df_equals(modin_df, pandas_df)\n\n if not sys.version_info.major == 3 and sys.version_info.minor > 6:\n # This test doesn't work correctly on Python 3.6\n # Test 2d ndarray assignment to column\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_df[\"new_col\"] = modin_df[[modin_df.columns[0]]].values\n pandas_df[\"new_col\"] = pandas_df[[pandas_df.columns[0]]].values\n df_equals(modin_df, pandas_df)\n assert isinstance(modin_df[\"new_col\"][0], type(pandas_df[\"new_col\"][0]))\n\n modin_df[1:5] = 10\n pandas_df[1:5] = 10\n df_equals(modin_df, pandas_df)\n\n # Transpose test\n modin_df = pd.DataFrame(data).T\n pandas_df = pandas.DataFrame(data).T\n\n modin_df[modin_df.columns[0]] = 0\n pandas_df[pandas_df.columns[0]] = 0\n df_equals(modin_df, pandas_df)\n\n modin_df.columns = [str(i) for i in modin_df.columns]\n pandas_df.columns = [str(i) for i in pandas_df.columns]\n\n modin_df[modin_df.columns[0]] = 0\n pandas_df[pandas_df.columns[0]] = 0\n\n df_equals(modin_df, pandas_df)\n\n modin_df[modin_df.columns[0]][modin_df.index[0]] = 12345\n pandas_df[pandas_df.columns[0]][pandas_df.index[0]] = 12345\n df_equals(modin_df, pandas_df)\n\n modin_df[1:5] = 10\n pandas_df[1:5] = 10\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__partitions_aligning_test___setitem__partitions_aligning.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__partitions_aligning_test___setitem__partitions_aligning.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2150, "end_line": 2180, "span_ids": ["test___setitem__partitions_aligning"], "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": "@pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/165\",\n)\ndef test___setitem__partitions_aligning():\n # from issue #2390\n modin_df = pd.DataFrame({\"a\": [1, 2, 3]})\n pandas_df = pandas.DataFrame({\"a\": [1, 2, 3]})\n modin_df[\"b\"] = pd.Series([4, 5, 6, 7, 8])\n pandas_df[\"b\"] = pandas.Series([4, 5, 6, 7, 8])\n df_equals(modin_df, pandas_df)\n\n # from issue #2442\n data = {\"a\": [1, 2, 3, 4]}\n # Index with duplicated timestamp\n index = pandas.to_datetime([\"2020-02-06\", \"2020-02-06\", \"2020-02-22\", \"2020-03-26\"])\n\n md_df, pd_df = create_test_dfs(data, index=index)\n # Setting new column\n pd_df[\"b\"] = pandas.Series(np.arange(4))\n md_df[\"b\"] = pd.Series(np.arange(4))\n df_equals(md_df, pd_df)\n\n # Setting existing column\n pd_df[\"b\"] = pandas.Series(np.arange(4))\n md_df[\"b\"] = pd.Series(np.arange(4))\n df_equals(md_df, pd_df)\n\n pd_df[\"a\"] = pandas.Series(np.arange(4))\n md_df[\"a\"] = pd.Series(np.arange(4))\n df_equals(md_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__with_mismatched_partitions_test___setitem__with_mismatched_partitions.with_ensure_clean_csv_.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__with_mismatched_partitions_test___setitem__with_mismatched_partitions.with_ensure_clean_csv_.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2183, "end_line": 2190, "span_ids": ["test___setitem__with_mismatched_partitions"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___setitem__with_mismatched_partitions():\n with ensure_clean(\".csv\") as fname:\n np.savetxt(fname, np.random.randint(0, 100, size=(200_000, 99)), delimiter=\",\")\n modin_df = pd.read_csv(fname)\n pandas_df = pandas.read_csv(fname)\n modin_df[\"new\"] = pd.Series(list(range(len(modin_df))))\n pandas_df[\"new\"] = pandas.Series(list(range(len(pandas_df))))\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__mask_test___setitem__mask.with_pytest_raises_ValueE.modin_df_array_20": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__mask_test___setitem__mask.with_pytest_raises_ValueE.modin_df_array_20", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2193, "end_line": 2218, "span_ids": ["test___setitem__mask"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___setitem__mask():\n # DataFrame mask:\n data = test_data[\"int_data\"]\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n mean = int((RAND_HIGH + RAND_LOW) / 2)\n pandas_df[pandas_df > mean] = -50\n modin_df[modin_df > mean] = -50\n\n df_equals(modin_df, pandas_df)\n\n # Array mask:\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n array = (pandas_df > mean).to_numpy()\n\n modin_df[array] = -50\n pandas_df[array] = -50\n\n df_equals(modin_df, pandas_df)\n\n # Array mask of wrong size:\n with pytest.raises(ValueError):\n array = np.array([[1, 2], [3, 4]])\n modin_df[array] = 20", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_on_empty_df_test_setitem_on_empty_df.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_on_empty_df_test_setitem_on_empty_df.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2221, "end_line": 2265, "span_ids": ["test_setitem_on_empty_df"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\", reason=\"https://github.com/intel-ai/hdk/issues/165\"\n)\n@pytest.mark.parametrize(\n \"data\",\n [\n {},\n {\"id\": [], \"max_speed\": [], \"health\": []},\n {\"id\": [1], \"max_speed\": [2], \"health\": [3]},\n {\"id\": [4, 40, 400], \"max_speed\": [111, 222, 333], \"health\": [33, 22, 11]},\n ],\n ids=[\"empty_frame\", \"empty_cols\", \"1_length_cols\", \"2_length_cols\"],\n)\n@pytest.mark.parametrize(\n \"value\",\n [[11, 22], [11, 22, 33]],\n ids=[\"2_length_val\", \"3_length_val\"],\n)\n@pytest.mark.parametrize(\"convert_to_series\", [False, True])\n@pytest.mark.parametrize(\"new_col_id\", [123, \"new_col\"], ids=[\"integer\", \"string\"])\ndef test_setitem_on_empty_df(data, value, convert_to_series, new_col_id):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n def applyier(df):\n if convert_to_series:\n converted_value = (\n pandas.Series(value)\n if isinstance(df, pandas.DataFrame)\n else pd.Series(value)\n )\n else:\n converted_value = value\n df[new_col_id] = converted_value\n return df\n\n eval_general(\n modin_df,\n pandas_df,\n applyier,\n # https://github.com/modin-project/modin/issues/5961\n comparator_kwargs={\n \"check_dtypes\": not (len(pandas_df) == 0 and len(pandas_df.columns) != 0)\n },\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_on_empty_df_4407_test___setitem__unhashable_list.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_on_empty_df_4407_test___setitem__unhashable_list.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2268, "end_line": 2289, "span_ids": ["test_setitem_on_empty_df_4407", "test___setitem__unhashable_list"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_setitem_on_empty_df_4407():\n data = {}\n index = pd.date_range(end=\"1/1/2018\", periods=0, freq=\"D\")\n column = pd.date_range(end=\"1/1/2018\", periods=1, freq=\"h\")[0]\n modin_df = pd.DataFrame(data, columns=index)\n pandas_df = pandas.DataFrame(data, columns=index)\n\n modin_df[column] = pd.Series([1])\n pandas_df[column] = pandas.Series([1])\n\n df_equals(modin_df, pandas_df)\n assert modin_df.columns.freq == pandas_df.columns.freq\n\n\ndef test___setitem__unhashable_list():\n # from #3258 and #3291\n cols = [\"a\", \"b\"]\n modin_df = pd.DataFrame([[0, 0]], columns=cols)\n modin_df[cols] = modin_df[cols]\n pandas_df = pandas.DataFrame([[0, 0]], columns=cols)\n pandas_df[cols] = pandas_df[cols]\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_unhashable_key_test_setitem_unhashable_key.for_key_in_col1_col.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_unhashable_key_test_setitem_unhashable_key.for_key_in_col1_col.None_7", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2292, "end_line": 2336, "span_ids": ["test_setitem_unhashable_key"], "tokens": 506}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_setitem_unhashable_key():\n source_modin_df, source_pandas_df = create_test_dfs(test_data[\"float_nan_data\"])\n row_count = source_modin_df.shape[0]\n\n def _make_copy(df1, df2):\n return df1.copy(deep=True), df2.copy(deep=True)\n\n for key in ([\"col1\", \"col2\"], [\"new_col1\", \"new_col2\"]):\n # 1d list case\n value = [1, 2]\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, value, key)\n\n # 2d list case\n value = [[1, 2]] * row_count\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, value, key)\n\n # pandas DataFrame case\n df_value = pandas.DataFrame(value, columns=[\"value_col1\", \"value_col2\"])\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, df_value, key)\n\n # numpy array case\n value = df_value.to_numpy()\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, value, key)\n\n # pandas Series case\n value = df_value[\"value_col1\"]\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, value, key[:1])\n\n # pandas Index case\n value = df_value.index\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, value, key[:1])\n\n # scalar case\n value = 3\n modin_df, pandas_df = _make_copy(source_modin_df, source_pandas_df)\n eval_setitem(modin_df, pandas_df, value, key)\n\n # test failed case: ValueError('Columns must be same length as key')\n eval_setitem(modin_df, pandas_df, df_value[[\"value_col1\"]], 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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_2d_insertion_test_setitem_2d_insertion.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_setitem_2d_insertion_test_setitem_2d_insertion.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2339, "end_line": 2387, "span_ids": ["test_setitem_2d_insertion"], "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": "def test_setitem_2d_insertion():\n def build_value_picker(modin_value, pandas_value):\n \"\"\"Build a function that returns either Modin or pandas DataFrame depending on the passed frame.\"\"\"\n return (\n lambda source_df, *args, **kwargs: modin_value\n if isinstance(source_df, (pd.DataFrame, pd.Series))\n else pandas_value\n )\n\n modin_df, pandas_df = create_test_dfs(test_data[\"int_data\"])\n\n # Easy case - key and value.columns are equal\n modin_value, pandas_value = create_test_dfs(\n {\"new_value1\": np.arange(len(modin_df)), \"new_value2\": np.arange(len(modin_df))}\n )\n eval_setitem(\n modin_df,\n pandas_df,\n build_value_picker(modin_value, pandas_value),\n col=[\"new_value1\", \"new_value2\"],\n )\n\n # Key and value.columns have equal values but in different order\n new_columns = [\"new_value3\", \"new_value4\"]\n modin_value.columns, pandas_value.columns = new_columns, new_columns\n eval_setitem(\n modin_df,\n pandas_df,\n build_value_picker(modin_value, pandas_value),\n col=[\"new_value4\", \"new_value3\"],\n )\n\n # Key and value.columns have different values\n new_columns = [\"new_value5\", \"new_value6\"]\n modin_value.columns, pandas_value.columns = new_columns, new_columns\n eval_setitem(\n modin_df,\n pandas_df,\n build_value_picker(modin_value, pandas_value),\n col=[\"__new_value5\", \"__new_value6\"],\n )\n\n # Key and value.columns have different lengths, testing that both raise the same exception\n eval_setitem(\n modin_df,\n pandas_df,\n build_value_picker(modin_value.iloc[:, [0]], pandas_value.iloc[:, [0]]),\n col=[\"new_value7\", \"new_value8\"],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__single_item_in_series_test_iloc_assigning_scalar_none_to_string_frame.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___setitem__single_item_in_series_test_iloc_assigning_scalar_none_to_string_frame.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2390, "end_line": 2418, "span_ids": ["test___setitem__assigning_single_categorical_sets_correct_dtypes", "test_iloc_assigning_scalar_none_to_string_frame", "test___setitem__single_item_in_series"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___setitem__single_item_in_series():\n # Test assigning a single item in a Series for issue\n # https://github.com/modin-project/modin/issues/3860\n modin_series = pd.Series(99)\n pandas_series = pandas.Series(99)\n modin_series[:1] = pd.Series(100)\n pandas_series[:1] = pandas.Series(100)\n df_equals(modin_series, pandas_series)\n\n\ndef test___setitem__assigning_single_categorical_sets_correct_dtypes():\n # This test case comes from\n # https://github.com/modin-project/modin/issues/3895\n modin_df = pd.DataFrame({\"categories\": [\"A\"]})\n modin_df[\"categories\"] = pd.Categorical([\"A\"])\n pandas_df = pandas.DataFrame({\"categories\": [\"A\"]})\n pandas_df[\"categories\"] = pandas.Categorical([\"A\"])\n df_equals(modin_df, pandas_df)\n\n\ndef test_iloc_assigning_scalar_none_to_string_frame():\n # This test case comes from\n # https://github.com/modin-project/modin/issues/3981\n data = [[\"A\"]]\n modin_df = pd.DataFrame(data, dtype=\"string\")\n modin_df.iloc[0, 0] = None\n pandas_df = pandas.DataFrame(data, dtype=\"string\")\n pandas_df.iloc[0, 0] = None\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_boolean_assignment_scalar_dtypes_test_loc_boolean_assignment_scalar_dtypes.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_loc_boolean_assignment_scalar_dtypes_test_loc_boolean_assignment_scalar_dtypes.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2421, "end_line": 2450, "span_ids": ["test_loc_boolean_assignment_scalar_dtypes"], "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": "@pytest.mark.parametrize(\n \"value\",\n [\n 1,\n np.int32(1),\n 1.0,\n \"str val\",\n pandas.Timestamp(\"1/4/2018\"),\n np.datetime64(0, \"ms\"),\n True,\n ],\n)\ndef test_loc_boolean_assignment_scalar_dtypes(value):\n modin_df, pandas_df = create_test_dfs(\n {\n \"a\": [1, 2, 3],\n \"b\": [3.0, 5.0, 6.0],\n \"c\": [\"a\", \"b\", \"c\"],\n \"d\": [1.0, \"c\", 2.0],\n \"e\": pandas.to_datetime([\"1/1/2018\", \"1/2/2018\", \"1/3/2018\"]),\n \"f\": [True, False, True],\n }\n )\n modin_idx, pandas_idx = pd.Series([False, True, True]), pandas.Series(\n [False, True, True]\n )\n\n modin_df.loc[modin_idx] = value\n pandas_df.loc[pandas_idx] = value\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___len___test_index_order.for_func_in_all_any_.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test___len___test_index_order.for_func_in_all_any_.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2453, "end_line": 2479, "span_ids": ["test_index_order", "test___len__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___len__(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n assert len(modin_df) == len(pandas_df)\n\n\ndef test_index_order():\n # see #1708 and #1869 for details\n df_modin, df_pandas = (\n pd.DataFrame(test_data[\"float_nan_data\"]),\n pandas.DataFrame(test_data[\"float_nan_data\"]),\n )\n rows_number = len(df_modin.index)\n level_0 = np.random.choice([x for x in range(10)], rows_number)\n level_1 = np.random.choice([x for x in range(10)], rows_number)\n index = pandas.MultiIndex.from_arrays([level_0, level_1])\n\n df_modin.index = index\n df_pandas.index = index\n\n for func in [\"all\", \"any\", \"count\"]:\n df_equals(\n getattr(df_modin, func)().index,\n getattr(df_pandas, func)().index,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_multiindex_from_frame_test__getitem_bool_single_row_dataframe.eval_general_pd_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_multiindex_from_frame_test__getitem_bool_single_row_dataframe.eval_general_pd_pandas_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2482, "end_line": 2499, "span_ids": ["test__getitem_bool_single_row_dataframe", "test_multiindex_from_frame"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"sortorder\", [0, 3, 5])\ndef test_multiindex_from_frame(data, sortorder):\n modin_df, pandas_df = create_test_dfs(data)\n\n def call_from_frame(df):\n if type(df).__module__.startswith(\"pandas\"):\n return pandas.MultiIndex.from_frame(df, sortorder)\n else:\n return pd.MultiIndex.from_frame(df, sortorder)\n\n eval_general(modin_df, pandas_df, call_from_frame, comparator=assert_index_equal)\n\n\ndef test__getitem_bool_single_row_dataframe():\n # This test case comes from\n # https://github.com/modin-project/modin/issues/4845\n eval_general(pd, pandas, lambda lib: lib.DataFrame([1])[lib.Series([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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test__getitem_bool_with_empty_partition_test__getitem_bool_with_empty_partition.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test__getitem_bool_with_empty_partition_test__getitem_bool_with_empty_partition.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2502, "end_line": 2524, "span_ids": ["test__getitem_bool_with_empty_partition"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test__getitem_bool_with_empty_partition():\n # This test case comes from\n # https://github.com/modin-project/modin/issues/5188\n\n size = MinPartitionSize.get()\n\n pandas_series = pandas.Series([True if i % 2 else False for i in range(size)])\n modin_series = pd.Series(pandas_series)\n\n pandas_df = pandas.DataFrame([i for i in range(size + 1)])\n pandas_df.iloc[size] = np.nan\n modin_df = pd.DataFrame(pandas_df)\n\n pandas_tmp_result = pandas_df.dropna()\n modin_tmp_result = modin_df.dropna()\n\n eval_general(\n modin_tmp_result,\n pandas_tmp_result,\n lambda df: df[modin_series]\n if isinstance(df, pd.DataFrame)\n else df[pandas_series],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py__This_is_a_very_subtle_b_test_lazy_eval_index.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py__This_is_a_very_subtle_b_test_lazy_eval_index.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2527, "end_line": 2543, "span_ids": ["test_lazy_eval_index", "test__getitem_bool_with_empty_partition"], "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": "# This is a very subtle bug that comes from:\n# https://github.com/modin-project/modin/issues/4945\ndef test_lazy_eval_index():\n modin_df, pandas_df = create_test_dfs({\"col0\": [0, 1]})\n\n def func(df):\n df_copy = df[df[\"col0\"] < 6].copy()\n # The problem here is that the index is not copied over so it needs\n # to get recomputed at some point. Our implementation of __setitem__\n # requires us to build a mask and insert the value from the right\n # handside into the new DataFrame. However, it's possible that we\n # won't have any new partitions, so we will end up computing an empty\n # index.\n df_copy[\"col0\"] = df_copy[\"col0\"].apply(lambda x: x + 1)\n return df_copy\n\n eval_general(modin_df, pandas_df, 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_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_of_empty_frame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_indexing.py_test_index_of_empty_frame_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_indexing.py", "file_name": "test_indexing.py", "file_type": "text/x-python", "category": "test", "start_line": 2546, "end_line": 2565, "span_ids": ["test_index_of_empty_frame"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_index_of_empty_frame():\n # Test on an empty frame created by user\n md_df, pd_df = create_test_dfs(\n {}, index=pandas.Index([], name=\"index name\"), columns=[\"a\", \"b\"]\n )\n assert md_df.empty and pd_df.empty\n df_equals(md_df.index, pd_df.index)\n\n # Test on an empty frame produced by Modin's logic\n data = test_data_values[0]\n md_df, pd_df = create_test_dfs(\n data, index=pandas.RangeIndex(len(next(iter(data.values()))), name=\"index name\")\n )\n\n md_res = md_df.query(f\"{md_df.columns[0]} > {RAND_HIGH}\")\n pd_res = pd_df.query(f\"{pd_df.columns[0]} > {RAND_HIGH}\")\n\n assert md_res.empty and pd_res.empty\n df_equals(md_res.index, pd_res.index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_pytest_matplotlib_use_Agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_pytest_matplotlib_use_Agg_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 41, "span_ids": ["docstring"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nimport numpy as np\nimport pandas\nimport matplotlib\nimport modin.pandas as pd\nimport io\nimport warnings\n\nfrom modin.pandas.test.utils import (\n random_state,\n RAND_LOW,\n RAND_HIGH,\n df_equals,\n test_data_values,\n test_data_keys,\n test_data,\n create_test_dfs,\n eval_general,\n)\nfrom modin.pandas.utils import SET_DATAFRAME_ATTRIBUTE_WARNING\nfrom modin.config import NPartitions\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_items_iterrows_test_items_iterrows.for_modin_item_pandas_it.assert_pandas_index_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_items_iterrows_test_items_iterrows.for_modin_item_pandas_it.assert_pandas_index_mo", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 44, "end_line": 55, "span_ids": ["test_items_iterrows"], "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": "@pytest.mark.parametrize(\"method\", [\"items\", \"iterrows\"])\ndef test_items_iterrows(method):\n data = test_data[\"float_nan_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n for modin_item, pandas_item in zip(\n getattr(modin_df, method)(), getattr(pandas_df, method)()\n ):\n modin_index, modin_series = modin_item\n pandas_index, pandas_series = pandas_item\n df_equals(pandas_series, modin_series)\n assert pandas_index == modin_index", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_itertuples_name_test_itertuples_name.for_modin_row_pandas_row.np_testing_assert_equal_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_itertuples_name_test_itertuples_name.for_modin_row_pandas_row.np_testing_assert_equal_m", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 58, "end_line": 66, "span_ids": ["test_itertuples_name"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"name\", [None, \"NotPandas\"])\ndef test_itertuples_name(name):\n data = test_data[\"float_nan_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n modin_it_custom = modin_df.itertuples(name=name)\n pandas_it_custom = pandas_df.itertuples(name=name)\n for modin_row, pandas_row in zip(modin_it_custom, pandas_it_custom):\n np.testing.assert_equal(modin_row, pandas_row)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_itertuples_multiindex_test_itertuples_multiindex.for_modin_row_pandas_row.np_testing_assert_equal_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_itertuples_multiindex_test_itertuples_multiindex.for_modin_row_pandas_row.np_testing_assert_equal_m", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 81, "span_ids": ["test_itertuples_multiindex"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_itertuples_multiindex():\n data = test_data[\"int_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n new_idx = pd.MultiIndex.from_tuples(\n [(i // 4, i // 2, i) for i in range(len(modin_df.columns))]\n )\n modin_df.columns = new_idx\n pandas_df.columns = new_idx\n modin_it_custom = modin_df.itertuples()\n pandas_it_custom = pandas_df.itertuples()\n for modin_row, pandas_row in zip(modin_it_custom, pandas_it_custom):\n np.testing.assert_equal(modin_row, pandas_row)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___iter___test___iter__.assert_list_modin_iterato": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___iter___test___iter__.assert_list_modin_iterato", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 84, "end_line": 95, "span_ids": ["test___iter__"], "tokens": 106}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___iter__():\n modin_df = pd.DataFrame(test_data_values[0])\n pandas_df = pandas.DataFrame(test_data_values[0])\n\n modin_iterator = modin_df.__iter__()\n\n # Check that modin_iterator implements the iterator interface\n assert hasattr(modin_iterator, \"__iter__\")\n assert hasattr(modin_iterator, \"next\") or hasattr(modin_iterator, \"__next__\")\n\n pd_iterator = pandas_df.__iter__()\n assert list(modin_iterator) == list(pd_iterator)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___contains___test___contains__.if_empty_data_not_in_re.assert_result_key_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___contains___test___contains__.if_empty_data_not_in_re.assert_result_key_in_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 112, "span_ids": ["test___contains__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___contains__(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n result = False\n key = \"Not Exist\"\n assert result == modin_df.__contains__(key)\n assert result == (key in modin_df)\n\n if \"empty_data\" not in request.node.name:\n result = True\n key = pandas_df.columns[0]\n assert result == modin_df.__contains__(key)\n assert result == (key in modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_display_options_for___repr___test_display_options_for___repr__.assert_modin_df_repr_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_display_options_for___repr___test_display_options_for___repr__.assert_modin_df_repr_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 115, "end_line": 140, "span_ids": ["test_display_options_for___repr__"], "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": "@pytest.mark.parametrize(\"expand_frame_repr\", [False, True])\n@pytest.mark.parametrize(\n \"max_rows_columns\",\n [(5, 5), (10, 10), (50, 50), (51, 51), (52, 52), (75, 75), (None, None)],\n)\n@pytest.mark.parametrize(\"frame_size\", [101, 102])\ndef test_display_options_for___repr__(max_rows_columns, expand_frame_repr, frame_size):\n frame_data = random_state.randint(\n RAND_LOW, RAND_HIGH, size=(frame_size, frame_size)\n )\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n context_arg = [\n \"display.max_rows\",\n max_rows_columns[0],\n \"display.max_columns\",\n max_rows_columns[1],\n \"display.expand_frame_repr\",\n expand_frame_repr,\n ]\n with pd.option_context(*context_arg):\n modin_df_repr = repr(modin_df)\n with pandas.option_context(*context_arg):\n pandas_df_repr = repr(pandas_df)\n assert modin_df_repr == pandas_df_repr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___finalize___test___deepcopy__.df_equals_modin_df_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___finalize___test___deepcopy__.df_equals_modin_df_copy_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 167, "span_ids": ["test___copy__", "test___deepcopy__", "test___finalize__"], "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___finalize__():\n data = test_data_values[0]\n with warns_that_defaulting_to_pandas():\n pd.DataFrame(data).__finalize__(None)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___copy__(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_df_copy, pandas_df_copy = modin_df.__copy__(), pandas_df.__copy__()\n df_equals(modin_df_copy, pandas_df_copy)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___deepcopy__(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_df_copy, pandas_df_copy = (\n modin_df.__deepcopy__(),\n pandas_df.__deepcopy__(),\n )\n df_equals(modin_df_copy, pandas_df_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_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr___test___repr__._From_Issue_1705": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr___test___repr__._From_Issue_1705", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 224, "span_ids": ["test___repr__"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___repr__():\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(1000, 100))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n assert repr(pandas_df) == repr(modin_df)\n\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(1000, 99))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n assert repr(pandas_df) == repr(modin_df)\n\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(1000, 101))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n assert repr(pandas_df) == repr(modin_df)\n\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(1000, 102))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n assert repr(pandas_df) == repr(modin_df)\n\n # ___repr___ method has a different code path depending on\n # whether the number of rows is >60; and a different code path\n # depending on the number of columns is >20.\n # Previous test cases already check the case when cols>20\n # and rows>60. The cases that follow exercise the other three\n # combinations.\n # rows <= 60, cols > 20\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(10, 100))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n assert repr(pandas_df) == repr(modin_df)\n\n # rows <= 60, cols <= 20\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(10, 10))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n assert repr(pandas_df) == repr(modin_df)\n\n # rows > 60, cols <= 20\n frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(100, 10))\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n assert repr(pandas_df) == repr(modin_df)\n\n # Empty\n pandas_df = pandas.DataFrame(columns=[\"col{}\".format(i) for i in range(100)])\n modin_df = pd.DataFrame(columns=[\"col{}\".format(i) for i in range(100)])\n\n assert repr(pandas_df) == repr(modin_df)\n\n # From Issue #1705\n # ... other code\n assert repr(pandas_df) == repr(modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr__.string_data_test___repr__.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr__.string_data_test___repr__.None_8", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 225, "end_line": 235, "span_ids": ["test___repr__"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___repr__():\n\n # rows > 60, cols <= 20\n # ... other code\n string_data = \"\"\"\"time\",\"device_id\",\"lat\",\"lng\",\"accuracy\",\"activity_1\",\"activity_1_conf\",\"activity_2\",\"activity_2_conf\",\"activity_3\",\"activity_3_conf\"\n\"2016-08-26 09:00:00.206\",2,60.186805,24.821049,33.6080017089844,\"STILL\",75,\"IN_VEHICLE\",5,\"ON_BICYCLE\",5\n\"2016-08-26 09:00:05.428\",5,60.192928,24.767222,5,\"WALKING\",62,\"ON_BICYCLE\",29,\"RUNNING\",6\n\"2016-08-26 09:00:05.818\",1,60.166382,24.700443,3,\"WALKING\",75,\"IN_VEHICLE\",5,\"ON_BICYCLE\",5\n\"2016-08-26 09:00:15.816\",1,60.166254,24.700671,3,\"WALKING\",75,\"IN_VEHICLE\",5,\"ON_BICYCLE\",5\n\"2016-08-26 09:00:16.413\",5,60.193055,24.767427,5,\"WALKING\",85,\"ON_BICYCLE\",15,\"UNKNOWN\",0\n\"2016-08-26 09:00:20.578\",3,60.152996,24.745216,3.90000009536743,\"STILL\",69,\"IN_VEHICLE\",31,\"UNKNOWN\",0\"\"\"\n pandas_df = pandas.read_csv(io.StringIO(string_data))\n with warns_that_defaulting_to_pandas():\n modin_df = pd.read_csv(io.StringIO(string_data))\n assert repr(pandas_df) == repr(modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr__does_not_raise_attribute_column_warning_test_inplace_series_ops.if_len_modin_df_columns_.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___repr__does_not_raise_attribute_column_warning_test_inplace_series_ops.if_len_modin_df_columns_.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 238, "end_line": 260, "span_ids": ["test_inplace_series_ops", "test___repr__does_not_raise_attribute_column_warning"], "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 test___repr__does_not_raise_attribute_column_warning():\n # See https://github.com/modin-project/modin/issues/5380\n df = pd.DataFrame([1])\n with warnings.catch_warnings():\n warnings.filterwarnings(action=\"error\", message=SET_DATAFRAME_ATTRIBUTE_WARNING)\n repr(df)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_inplace_series_ops(data):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n if len(modin_df.columns) > len(pandas_df.columns):\n col0 = modin_df.columns[0]\n col1 = modin_df.columns[1]\n pandas_df[col1].dropna(inplace=True)\n modin_df[col1].dropna(inplace=True)\n df_equals(modin_df, pandas_df)\n\n pandas_df[col0].fillna(0, inplace=True)\n modin_df[col0].fillna(0, inplace=True)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py__Note_Tests_setting_an__test___setattr__not_column.assert_modin_df_new_col_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py__Note_Tests_setting_an__test___setattr__not_column.assert_modin_df_new_col_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 263, "end_line": 275, "span_ids": ["test___setattr__not_column", "test_inplace_series_ops"], "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": "# Note: Tests setting an attribute that is not an existing column label\ndef test___setattr__not_column():\n pandas_df = pandas.DataFrame([1, 2, 3])\n modin_df = pd.DataFrame([1, 2, 3])\n\n pandas_df.new_col = [4, 5, 6]\n modin_df.new_col = [4, 5, 6]\n\n df_equals(modin_df, pandas_df)\n\n # While `new_col` is not a column of the dataframe,\n # it should be accessible with __getattr__.\n assert modin_df.new_col == pandas_df.new_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_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___setattr__mutating_column_test___setattr__mutating_column.assert_isinstance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test___setattr__mutating_column_test___setattr__mutating_column.assert_isinstance_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 278, "end_line": 330, "span_ids": ["test___setattr__mutating_column"], "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": "def test___setattr__mutating_column():\n # Use case from issue #4577\n pandas_df = pandas.DataFrame([[1]], columns=[\"col0\"])\n modin_df = pd.DataFrame([[1]], columns=[\"col0\"])\n\n # Replacing a column with a list should mutate the column in place.\n pandas_df.col0 = [3]\n modin_df.col0 = [3]\n\n df_equals(modin_df, pandas_df)\n # Check that the col0 attribute reflects the value update.\n df_equals(modin_df.col0, pandas_df.col0)\n\n pandas_df.col0 = pandas.Series([5])\n modin_df.col0 = pd.Series([5])\n\n # Check that the col0 attribute reflects this update\n df_equals(modin_df, pandas_df)\n\n pandas_df.loc[0, \"col0\"] = 4\n modin_df.loc[0, \"col0\"] = 4\n\n # Check that the col0 attribute reflects update via loc\n df_equals(modin_df, pandas_df)\n assert modin_df.col0.equals(modin_df[\"col0\"])\n\n # Check that attempting to add a new col via attributes raises warning\n # and adds the provided list as a new attribute and not a column.\n with pytest.warns(\n UserWarning,\n match=SET_DATAFRAME_ATTRIBUTE_WARNING,\n ):\n modin_df.col1 = [4]\n\n with warnings.catch_warnings():\n warnings.filterwarnings(\n action=\"error\",\n message=SET_DATAFRAME_ATTRIBUTE_WARNING,\n )\n modin_df.col1 = [5]\n modin_df.new_attr = 6\n modin_df.col0 = 7\n\n assert \"new_attr\" in dir(\n modin_df\n ), \"Modin attribute was not correctly added to the df.\"\n assert (\n \"new_attr\" not in modin_df\n ), \"New attribute was not correctly added to columns.\"\n assert modin_df.new_attr == 6, \"Modin attribute value was set incorrectly.\"\n assert isinstance(\n modin_df.col0, pd.Series\n ), \"Scalar was not broadcasted properly to an existing column.\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_isin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_iter.py_test_isin_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_iter.py", "file_name": "test_iter.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 377, "span_ids": ["test_isin_with_modin_objects", "test_isin"], "tokens": 413}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\ndef test_isin(data):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n val = [1, 2, 3, 4]\n pandas_result = pandas_df.isin(val)\n modin_result = modin_df.isin(val)\n\n df_equals(modin_result, pandas_result)\n\n\ndef test_isin_with_modin_objects():\n modin_df1, pandas_df1 = create_test_dfs({\"a\": [1, 2], \"b\": [3, 4]})\n modin_series, pandas_series = pd.Series([1, 4, 5, 6]), pandas.Series([1, 4, 5, 6])\n\n eval_general(\n (modin_df1, modin_series),\n (pandas_df1, pandas_series),\n lambda srs: srs[0].isin(srs[1]),\n )\n\n modin_df2 = modin_series.to_frame(\"a\")\n pandas_df2 = pandas_series.to_frame(\"a\")\n\n eval_general(\n (modin_df1, modin_df2),\n (pandas_df1, pandas_df2),\n lambda srs: srs[0].isin(srs[1]),\n )\n\n # Check case when indices are not matching\n modin_df1, pandas_df1 = create_test_dfs({\"a\": [1, 2], \"b\": [3, 4]}, index=[10, 11])\n\n eval_general(\n (modin_df1, modin_series),\n (pandas_df1, pandas_series),\n lambda srs: srs[0].isin(srs[1]),\n )\n eval_general(\n (modin_df1, modin_df2),\n (pandas_df1, pandas_df2),\n lambda srs: srs[0].isin(srs[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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_pytest_pd_DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_pytest_pd_DataFrame_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 54, "span_ids": ["docstring"], "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 pytest\nimport numpy as np\nimport pandas\nimport matplotlib\n\nimport modin.pandas as pd\nfrom modin.utils import to_pandas\n\nfrom modin.pandas.test.utils import (\n create_test_dfs,\n random_state,\n df_equals,\n arg_keys,\n test_data_values,\n test_data_keys,\n axis_keys,\n axis_values,\n bool_arg_keys,\n bool_arg_values,\n test_data,\n generate_multiindex,\n eval_general,\n rotate_decimal_digits_or_symbols,\n extra_test_parameters,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions, Engine, StorageFormat\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\n# Initialize env for storage format detection in @pytest.mark.*\npd.DataFrame()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_combine_test_combine.pandas_df_combine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_combine_test_combine.pandas_df_combine_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 65, "span_ids": ["test_combine"], "tokens": 109}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_combine(data):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n modin_df.combine(modin_df + 1, lambda s1, s2: s1 if s1.count() < s2.count() else s2)\n pandas_df.combine(\n pandas_df + 1, lambda s1, s2: s1 if s1.count() < s2.count() else s2\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join_test_join.pandas_df_9.pandas_DataFrame_frame_da": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join_test_join.pandas_df_9.pandas_DataFrame_frame_da", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 145, "span_ids": ["test_join"], "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": "@pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\", reason=\"https://github.com/intel-ai/hdk/issues/264\"\n)\n@pytest.mark.parametrize(\n \"test_data, test_data2\",\n [\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n ],\n)\ndef test_join(test_data, test_data2):\n modin_df = pd.DataFrame(\n test_data,\n columns=[\"col{}\".format(i) for i in range(test_data.shape[1])],\n index=pd.Index([i for i in range(1, test_data.shape[0] + 1)], name=\"key\"),\n )\n pandas_df = pandas.DataFrame(\n test_data,\n columns=[\"col{}\".format(i) for i in range(test_data.shape[1])],\n index=pandas.Index([i for i in range(1, test_data.shape[0] + 1)], name=\"key\"),\n )\n modin_df2 = pd.DataFrame(\n test_data2,\n columns=[\"col{}\".format(i) for i in range(test_data2.shape[1])],\n index=pd.Index([i for i in range(1, test_data2.shape[0] + 1)], name=\"key\"),\n )\n pandas_df2 = pandas.DataFrame(\n test_data2,\n columns=[\"col{}\".format(i) for i in range(test_data2.shape[1])],\n index=pandas.Index([i for i in range(1, test_data2.shape[0] + 1)], name=\"key\"),\n )\n\n hows = [\"inner\", \"left\", \"right\", \"outer\"]\n ons = [\"col33\", \"col34\"]\n sorts = [False, True]\n for i in range(4):\n for j in range(2):\n modin_result = modin_df.join(\n modin_df2,\n how=hows[i],\n on=ons[j],\n sort=sorts[j],\n lsuffix=\"_caller\",\n rsuffix=\"_other\",\n )\n pandas_result = pandas_df.join(\n pandas_df2,\n how=hows[i],\n on=ons[j],\n sort=sorts[j],\n lsuffix=\"_caller\",\n rsuffix=\"_other\",\n )\n df_equals(modin_result, pandas_result)\n\n frame_data = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 0, 1],\n \"col4\": [2, 4, 5, 6],\n }\n\n modin_df = pd.DataFrame(frame_data)\n pandas_df = pandas.DataFrame(frame_data)\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join.frame_data2_test_join.None_2.df_equals_modin_join_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join.frame_data2_test_join.None_2.df_equals_modin_join_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 147, "end_line": 166, "span_ids": ["test_join"], "tokens": 488}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\", reason=\"https://github.com/intel-ai/hdk/issues/264\"\n)\n@pytest.mark.parametrize(\n \"test_data, test_data2\",\n [\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n ],\n)\ndef test_join(test_data, test_data2):\n # ... other code\n\n frame_data2 = {\"col5\": [0], \"col6\": [1]}\n modin_df2 = pd.DataFrame(frame_data2)\n pandas_df2 = pandas.DataFrame(frame_data2)\n\n join_types = [\"left\", \"right\", \"outer\", \"inner\"]\n for how in join_types:\n modin_join = modin_df.join(modin_df2, how=how)\n pandas_join = pandas_df.join(pandas_df2, how=how)\n df_equals(modin_join, pandas_join)\n\n frame_data3 = {\"col7\": [1, 2, 3, 5, 6, 7, 8]}\n\n modin_df3 = pd.DataFrame(frame_data3)\n pandas_df3 = pandas.DataFrame(frame_data3)\n\n join_types = [\"left\", \"outer\", \"inner\"]\n for how in join_types:\n modin_join = modin_df.join([modin_df2, modin_df3], how=how)\n pandas_join = pandas_df.join([pandas_df2, pandas_df3], how=how)\n df_equals(modin_join, pandas_join)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join_5203_test_join_5203.for_dfs_in_modin_dfs_pa.with_pytest_raises_.dfs_0_join_dfs_1_dfs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_join_5203_test_join_5203.for_dfs_in_modin_dfs_pa.with_pytest_raises_.dfs_0_join_dfs_1_dfs_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 169, "end_line": 181, "span_ids": ["test_join_5203"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_join_5203():\n data = np.ones([2, 4])\n kwargs = {\"columns\": [\"a\", \"b\", \"c\", \"d\"]}\n modin_dfs, pandas_dfs = [None] * 3, [None] * 3\n for idx in range(len(modin_dfs)):\n modin_dfs[idx], pandas_dfs[idx] = create_test_dfs(data, **kwargs)\n\n for dfs in (modin_dfs, pandas_dfs):\n with pytest.raises(\n ValueError,\n match=\"Joining multiple DataFrames only supported for joining on index\",\n ):\n dfs[0].join([dfs[1], dfs[2]], how=\"inner\", on=\"a\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_test_merge.pandas_df2_10.pandas_DataFrame_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_test_merge.pandas_df2_10.pandas_DataFrame_name_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 260, "span_ids": ["test_merge"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"test_data, test_data2\",\n [\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n ],\n)\ndef test_merge(test_data, test_data2):\n modin_df = pd.DataFrame(\n test_data,\n columns=[\"col{}\".format(i) for i in range(test_data.shape[1])],\n index=pd.Index([i for i in range(1, test_data.shape[0] + 1)], name=\"key\"),\n )\n pandas_df = pandas.DataFrame(\n test_data,\n columns=[\"col{}\".format(i) for i in range(test_data.shape[1])],\n index=pandas.Index([i for i in range(1, test_data.shape[0] + 1)], name=\"key\"),\n )\n modin_df2 = pd.DataFrame(\n test_data2,\n columns=[\"col{}\".format(i) for i in range(test_data2.shape[1])],\n index=pd.Index([i for i in range(1, test_data2.shape[0] + 1)], name=\"key\"),\n )\n pandas_df2 = pandas.DataFrame(\n test_data2,\n columns=[\"col{}\".format(i) for i in range(test_data2.shape[1])],\n index=pandas.Index([i for i in range(1, test_data2.shape[0] + 1)], name=\"key\"),\n )\n\n hows = [\"left\", \"inner\"]\n ons = [\"col33\", [\"col33\", \"col34\"]]\n sorts = [False, True]\n for i in range(2):\n for j in range(2):\n modin_result = modin_df.merge(\n modin_df2, how=hows[i], on=ons[j], sort=sorts[j]\n )\n pandas_result = pandas_df.merge(\n pandas_df2, how=hows[i], on=ons[j], sort=sorts[j]\n )\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.merge(\n modin_df2,\n how=hows[i],\n left_on=\"key\",\n right_on=\"key\",\n sort=sorts[j],\n )\n pandas_result = pandas_df.merge(\n pandas_df2,\n how=hows[i],\n left_on=\"key\",\n right_on=\"key\",\n sort=sorts[j],\n )\n df_equals(modin_result, pandas_result)\n\n # Test for issue #1771\n modin_df = pd.DataFrame({\"name\": np.arange(40)})\n modin_df2 = pd.DataFrame({\"name\": [39], \"position\": [0]})\n pandas_df = pandas.DataFrame({\"name\": np.arange(40)})\n pandas_df2 = pandas.DataFrame({\"name\": [39], \"position\": [0]})\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge.modin_result_test_merge.join_types._outer_inner_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge.modin_result_test_merge.join_types._outer_inner_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 261, "end_line": 279, "span_ids": ["test_merge"], "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": "@pytest.mark.parametrize(\n \"test_data, test_data2\",\n [\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n ],\n)\ndef test_merge(test_data, test_data2):\n # ... other code\n modin_result = modin_df.merge(modin_df2, on=\"name\", how=\"inner\")\n pandas_result = pandas_df.merge(pandas_df2, on=\"name\", how=\"inner\")\n df_equals(modin_result, pandas_result)\n\n frame_data = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 0, 1],\n \"col4\": [2, 4, 5, 6],\n }\n\n modin_df = pd.DataFrame(frame_data)\n pandas_df = pandas.DataFrame(frame_data)\n\n frame_data2 = {\"col1\": [0, 1, 2], \"col2\": [1, 5, 6]}\n modin_df2 = pd.DataFrame(frame_data2)\n pandas_df2 = pandas.DataFrame(frame_data2)\n\n join_types = [\"outer\", \"inner\"]\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge.for_how_in_join_types__test_merge.with_pytest_raises_TypeEr.modin_df_merge_Non_valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge.for_how_in_join_types__test_merge.with_pytest_raises_TypeEr.modin_df_merge_Non_valid", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 280, "end_line": 350, "span_ids": ["test_merge"], "tokens": 837}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"test_data, test_data2\",\n [\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**7, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n ),\n (\n np.random.uniform(0, 100, size=(2**6, 2**7)),\n np.random.uniform(0, 100, size=(2**6, 2**6)),\n ),\n ],\n)\ndef test_merge(test_data, test_data2):\n # ... other code\n for how in join_types:\n # Defaults\n modin_result = modin_df.merge(modin_df2, how=how)\n pandas_result = pandas_df.merge(pandas_df2, how=how)\n df_equals(modin_result, pandas_result)\n\n # left_on and right_index\n modin_result = modin_df.merge(\n modin_df2, how=how, left_on=\"col1\", right_index=True\n )\n pandas_result = pandas_df.merge(\n pandas_df2, how=how, left_on=\"col1\", right_index=True\n )\n df_equals(modin_result, pandas_result)\n\n # left_index and right_on\n modin_result = modin_df.merge(\n modin_df2, how=how, left_index=True, right_on=\"col1\"\n )\n pandas_result = pandas_df.merge(\n pandas_df2, how=how, left_index=True, right_on=\"col1\"\n )\n df_equals(modin_result, pandas_result)\n\n # left_on and right_on col1\n modin_result = modin_df.merge(\n modin_df2, how=how, left_on=\"col1\", right_on=\"col1\"\n )\n pandas_result = pandas_df.merge(\n pandas_df2, how=how, left_on=\"col1\", right_on=\"col1\"\n )\n df_equals(modin_result, pandas_result)\n\n # left_on and right_on col2\n modin_result = modin_df.merge(\n modin_df2, how=how, left_on=\"col2\", right_on=\"col2\"\n )\n pandas_result = pandas_df.merge(\n pandas_df2, how=how, left_on=\"col2\", right_on=\"col2\"\n )\n df_equals(modin_result, pandas_result)\n\n # left_index and right_index\n modin_result = modin_df.merge(\n modin_df2, how=how, left_index=True, right_index=True\n )\n pandas_result = pandas_df.merge(\n pandas_df2, how=how, left_index=True, right_index=True\n )\n df_equals(modin_result, pandas_result)\n\n # Cannot merge a Series without a name\n ps = pandas.Series(frame_data2.get(\"col1\"))\n ms = pd.Series(frame_data2.get(\"col1\"))\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.merge(ms if isinstance(df, pd.DataFrame) else ps),\n )\n\n # merge a Series with a name\n ps = pandas.Series(frame_data2.get(\"col1\"), name=\"col1\")\n ms = pd.Series(frame_data2.get(\"col1\"), name=\"col1\")\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.merge(ms if isinstance(df, pd.DataFrame) else ps),\n )\n\n with pytest.raises(TypeError):\n modin_df.merge(\"Non-valid 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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_with_mi_columns_test_merge_with_mi_columns.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_with_mi_columns_test_merge_with_mi_columns.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 353, "end_line": 374, "span_ids": ["test_merge_with_mi_columns"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge_with_mi_columns():\n modin_df1, pandas_df1 = create_test_dfs(\n {\n (\"col0\", \"a\"): [1, 2, 3, 4],\n (\"col0\", \"b\"): [2, 3, 4, 5],\n (\"col1\", \"a\"): [3, 4, 5, 6],\n }\n )\n\n modin_df2, pandas_df2 = create_test_dfs(\n {\n (\"col0\", \"a\"): [1, 2, 3, 4],\n (\"col0\", \"c\"): [2, 3, 4, 5],\n (\"col1\", \"a\"): [3, 4, 5, 6],\n }\n )\n\n eval_general(\n (modin_df1, modin_df2),\n (pandas_df1, pandas_df2),\n lambda dfs: dfs[0].merge(dfs[1], on=[(\"col0\", \"a\")]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index_test_merge_on_index.pandas_df2.pandas_df2_set_index_id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index_test_merge_on_index.pandas_df2.pandas_df2_set_index_id", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 377, "end_line": 405, "span_ids": ["test_merge_on_index"], "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": "@pytest.mark.parametrize(\"has_index_cache\", [True, False])\ndef test_merge_on_index(has_index_cache):\n modin_df1, pandas_df1 = create_test_dfs(\n {\n \"idx_key1\": [1, 2, 3, 4],\n \"idx_key2\": [2, 3, 4, 5],\n \"idx_key3\": [3, 4, 5, 6],\n \"data_col1\": [10, 2, 3, 4],\n \"col_key1\": [3, 4, 5, 6],\n \"col_key2\": [3, 4, 5, 6],\n }\n )\n\n modin_df1 = modin_df1.set_index([\"idx_key1\", \"idx_key2\"])\n pandas_df1 = pandas_df1.set_index([\"idx_key1\", \"idx_key2\"])\n\n modin_df2, pandas_df2 = create_test_dfs(\n {\n \"idx_key1\": [4, 3, 2, 1],\n \"idx_key2\": [5, 4, 3, 2],\n \"idx_key3\": [6, 5, 4, 3],\n \"data_col2\": [10, 2, 3, 4],\n \"col_key1\": [6, 5, 4, 3],\n \"col_key2\": [6, 5, 4, 3],\n }\n )\n\n modin_df2 = modin_df2.set_index([\"idx_key2\", \"idx_key3\"])\n pandas_df2 = pandas_df2.set_index([\"idx_key2\", \"idx_key3\"])\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index.setup_cache_test_merge_on_index.setup_cache.if_has_index_cache_.else_.modin_df2__query_compiler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index.setup_cache_test_merge_on_index.setup_cache.if_has_index_cache_.else_.modin_df2__query_compiler", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 407, "end_line": 421, "span_ids": ["test_merge_on_index"], "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": "@pytest.mark.parametrize(\"has_index_cache\", [True, False])\ndef test_merge_on_index(has_index_cache):\n # ... other code\n\n def setup_cache():\n if has_index_cache:\n modin_df1.index # triggering index materialization\n modin_df2.index\n assert modin_df1._query_compiler._modin_frame.has_index_cache\n assert modin_df2._query_compiler._modin_frame.has_index_cache\n else:\n # Propagate deferred indices to partitions\n # The change in index is not automatically handled by Modin. See #3941.\n modin_df1.index = modin_df1.index\n modin_df1._to_pandas()\n modin_df1._query_compiler._modin_frame.set_index_cache(None)\n modin_df2.index = modin_df2.index\n modin_df2._to_pandas()\n modin_df2._query_compiler._modin_frame.set_index_cache(None)\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index.for_on_in__test_merge_on_index.for_left_on_right_on_in_.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_merge_on_index.for_on_in__test_merge_on_index.for_left_on_right_on_in_.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 423, "end_line": 450, "span_ids": ["test_merge_on_index"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"has_index_cache\", [True, False])\ndef test_merge_on_index(has_index_cache):\n # ... other code\n\n for on in (\n [\"col_key1\", \"idx_key1\"],\n [\"col_key1\", \"idx_key2\"],\n [\"col_key1\", \"idx_key3\"],\n [\"idx_key1\"],\n [\"idx_key2\"],\n [\"idx_key3\"],\n ):\n setup_cache()\n eval_general(\n (modin_df1, modin_df2),\n (pandas_df1, pandas_df2),\n lambda dfs: dfs[0].merge(dfs[1], on=on),\n )\n\n for left_on, right_on in (\n ([\"idx_key1\"], [\"col_key1\"]),\n ([\"col_key1\"], [\"idx_key3\"]),\n ([\"idx_key1\"], [\"idx_key3\"]),\n ([\"idx_key2\"], [\"idx_key2\"]),\n ([\"col_key1\", \"idx_key2\"], [\"col_key2\", \"idx_key2\"]),\n ):\n setup_cache()\n eval_general(\n (modin_df1, modin_df2),\n (pandas_df1, pandas_df2),\n lambda dfs: dfs[0].merge(dfs[1], left_on=left_on, right_on=right_on),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_index_test_sort_index.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_index_test_sort_index.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 453, "end_line": 485, "span_ids": ["test_sort_index"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"ascending\", bool_arg_values, ids=arg_keys(\"ascending\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"na_position\", [\"first\", \"last\"], ids=[\"first\", \"last\"])\ndef test_sort_index(axis, ascending, na_position):\n data = test_data[\"float_nan_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n # Change index value so sorting will actually make a difference\n if axis == 0:\n length = len(modin_df.index)\n for df in [modin_df, pandas_df]:\n df.index = [(i - length / 2) % length for i in range(length)]\n\n dfs = [modin_df, pandas_df]\n # Add NaNs to sorted index\n for idx in range(len(dfs)):\n sort_index = dfs[idx].axes[axis]\n dfs[idx] = dfs[idx].set_axis(\n [np.nan if i % 2 == 0 else sort_index[i] for i in range(len(sort_index))],\n axis=axis,\n copy=False,\n )\n modin_df, pandas_df = dfs\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.sort_index(\n axis=axis, ascending=ascending, na_position=na_position\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_index_inplace_test_sort_multiindex.for_kwargs_in_level_.with_warns_that_defaultin.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_index_inplace_test_sort_multiindex.for_kwargs_in_level_.with_warns_that_defaultin.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 488, "end_line": 515, "span_ids": ["test_sort_multiindex", "test_sort_index_inplace"], "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": "@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\ndef test_sort_index_inplace(axis):\n data = test_data[\"int_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n for df in [modin_df, pandas_df]:\n df.sort_index(axis=axis, inplace=True)\n df_equals(modin_df, pandas_df)\n\n\n@pytest.mark.parametrize(\n \"sort_remaining\", bool_arg_values, ids=arg_keys(\"sort_remaining\", bool_arg_keys)\n)\ndef test_sort_multiindex(sort_remaining):\n data = test_data[\"int_data\"]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n for index in [\"index\", \"columns\"]:\n new_index = generate_multiindex(len(getattr(modin_df, index)))\n for df in [modin_df, pandas_df]:\n setattr(df, index, new_index)\n\n for kwargs in [{\"level\": 0}, {\"axis\": 0}, {\"axis\": 1}]:\n with warns_that_defaulting_to_pandas():\n df_equals(\n modin_df.sort_index(sort_remaining=sort_remaining, **kwargs),\n pandas_df.sort_index(sort_remaining=sort_remaining, **kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_test_sort_values.by_list._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_test_sort_values.by_list._", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 518, "end_line": 607, "span_ids": ["test_sort_values"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"by\",\n [\n pytest.param(\n \"first\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n \"first,last\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n \"first,last,middle\",\n ],\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\n \"ascending\",\n bool_arg_values + [\"list_first_True\", \"list_first_False\"],\n ids=arg_keys(\"ascending\", bool_arg_keys + [\"list_first_True\", \"list_first_False\"]),\n)\n@pytest.mark.parametrize(\n \"inplace\", bool_arg_values, ids=arg_keys(\"inplace\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"kind\",\n [\n pytest.param(\n \"mergesort\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n \"quicksort\",\n pytest.param(\n \"heapsort\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\"na_position\", [\"first\", \"last\"], ids=[\"first\", \"last\"])\n@pytest.mark.parametrize(\n \"ignore_index\",\n bool_arg_values,\n ids=arg_keys(\"ignore_index\", bool_arg_keys),\n)\n@pytest.mark.parametrize(\"key\", [None, rotate_decimal_digits_or_symbols])\ndef test_sort_values(\n data, by, axis, ascending, inplace, kind, na_position, ignore_index, key\n):\n if ascending is None:\n pytest.skip(\"None is not a valid value for ascending.\")\n if (axis == 1 or axis == \"columns\") and ignore_index:\n pytest.skip(\"Pandas bug #39426 which is fixed in Pandas 1.3\")\n\n if ascending is None and key is not None:\n pytest.skip(\"Pandas bug #41318\")\n\n # If index is preserved and `key` function is ``None``,\n # it could be sorted along rows differently from pandas.\n # The order of NA rows, sorted by HDK, is different (but still valid)\n # from pandas. To make the index identical to pandas, we add the\n # index names to 'by'.\n by_index_names = None\n if (\n StorageFormat.get() == \"Hdk\"\n and not ignore_index\n and key is None\n and (axis == 0 or axis == \"rows\")\n ):\n by_index_names = []\n if \"multiindex\" in by:\n index = generate_multiindex(len(data[list(data.keys())[0]]), nlevels=2)\n columns = generate_multiindex(len(data.keys()), nlevels=2)\n data = {columns[ind]: data[key] for ind, key in enumerate(data)}\n if by_index_names is not None:\n by_index_names.extend(index.names)\n elif by_index_names is not None:\n index = pd.RangeIndex(0, len(next(iter(data.values()))), name=\"test_idx\")\n columns = None\n by_index_names.append(index.name)\n else:\n index = None\n columns = None\n\n modin_df = pd.DataFrame(data, index=index, columns=columns)\n pandas_df = pandas.DataFrame(data, index=index, columns=columns)\n\n index = modin_df.index if axis == 1 or axis == \"columns\" else modin_df.columns\n\n # Parse \"by\" spec\n by_list = []\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values.for_b_in_by_split__test_sort_values.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values.for_b_in_by_split__test_sort_values.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 608, "end_line": 642, "span_ids": ["test_sort_values"], "tokens": 604}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"by\",\n [\n pytest.param(\n \"first\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n pytest.param(\n \"first,last\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n \"first,last,middle\",\n ],\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\n \"ascending\",\n bool_arg_values + [\"list_first_True\", \"list_first_False\"],\n ids=arg_keys(\"ascending\", bool_arg_keys + [\"list_first_True\", \"list_first_False\"]),\n)\n@pytest.mark.parametrize(\n \"inplace\", bool_arg_values, ids=arg_keys(\"inplace\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"kind\",\n [\n pytest.param(\n \"mergesort\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n \"quicksort\",\n pytest.param(\n \"heapsort\",\n marks=pytest.mark.skipif(not extra_test_parameters, reason=\"extra\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\"na_position\", [\"first\", \"last\"], ids=[\"first\", \"last\"])\n@pytest.mark.parametrize(\n \"ignore_index\",\n bool_arg_values,\n ids=arg_keys(\"ignore_index\", bool_arg_keys),\n)\n@pytest.mark.parametrize(\"key\", [None, rotate_decimal_digits_or_symbols])\ndef test_sort_values(\n data, by, axis, ascending, inplace, kind, na_position, ignore_index, key\n):\n # ... other code\n for b in by.split(\",\"):\n if b == \"first\":\n by_list.append(index[0])\n elif b == \"last\":\n by_list.append(index[-1])\n elif b == \"middle\":\n by_list.append(index[len(index) // 2])\n elif b.startswith(\"multiindex_level\"):\n by_list.append(index.names[int(b[len(\"multiindex_level\") :])])\n else:\n raise Exception('Unknown \"by\" specifier:' + b)\n\n if by_index_names is not None:\n by_list.extend(by_index_names)\n\n # Create \"ascending\" list\n if ascending in [\"list_first_True\", \"list_first_False\"]:\n start = 0 if ascending == \"list_first_False\" else 1\n ascending = [i & 1 > 0 for i in range(start, len(by_list) + start)]\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.sort_values(\n by_list,\n axis=axis,\n ascending=ascending,\n inplace=inplace,\n kind=kind,\n na_position=na_position,\n ignore_index=ignore_index,\n key=key,\n ),\n __inplace__=inplace,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_descending_with_only_two_bins_test_sort_values_descending_with_only_two_bins.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_descending_with_only_two_bins_test_sort_values_descending_with_only_two_bins.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 645, "end_line": 658, "span_ids": ["test_sort_values_descending_with_only_two_bins"], "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": "def test_sort_values_descending_with_only_two_bins():\n # test case from https://github.com/modin-project/modin/issues/5781\n part1 = pd.DataFrame({\"a\": [1, 2, 3, 4]})\n part2 = pd.DataFrame({\"a\": [5, 6, 7, 8]})\n\n modin_df = pd.concat([part1, part2])\n pandas_df = modin_df._to_pandas()\n\n if StorageFormat.get() == \"Pandas\":\n assert modin_df._query_compiler._modin_frame._partitions.shape == (2, 1)\n\n eval_general(\n modin_df, pandas_df, lambda df: df.sort_values(by=\"a\", ascending=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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_preserve_index_names_test_sort_values_preserve_index_names.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_preserve_index_names_test_sort_values_preserve_index_names.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 661, "end_line": 687, "span_ids": ["test_sort_values_preserve_index_names"], "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": "@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/modin-project/modin/issues/3941\",\n)\n@pytest.mark.parametrize(\"ignore_index\", [True, False])\ndef test_sort_values_preserve_index_names(ignore_index):\n modin_df, pandas_df = create_test_dfs(\n np.random.choice(128, 128, replace=False).reshape((128, 1))\n )\n\n pandas_df.index.names, pandas_df.columns.names = [\"custom_name\"], [\"custom_name\"]\n modin_df.index.names, modin_df.columns.names = [\"custom_name\"], [\"custom_name\"]\n # workaround for #1618 to actually propagate index change\n modin_df.index = modin_df.index\n modin_df.columns = modin_df.columns\n\n def comparator(df1, df2):\n assert df1.index.names == df2.index.names\n assert df1.columns.names == df2.columns.names\n df_equals(df1, df2)\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.sort_values(df.columns[0], ignore_index=ignore_index),\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_one_partition_test_sort_values_with_one_partition.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_one_partition_test_sort_values_with_one_partition.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 690, "end_line": 702, "span_ids": ["test_sort_values_with_one_partition"], "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": "@pytest.mark.parametrize(\"ascending\", [True, False])\ndef test_sort_values_with_one_partition(ascending):\n # Test case from https://github.com/modin-project/modin/issues/5859\n modin_df, pandas_df = create_test_dfs(\n np.array([[\"hello\", \"goodbye\"], [\"hello\", \"Hello\"]])\n )\n\n if StorageFormat.get() == \"Pandas\":\n assert modin_df._query_compiler._modin_frame._partitions.shape == (1, 1)\n\n eval_general(\n modin_df, pandas_df, lambda df: df.sort_values(by=1, ascending=ascending)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_overpartitioned_df_test_sort_overpartitioned_df.try_.finally_.NPartitions_put_old_nptns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_overpartitioned_df_test_sort_overpartitioned_df.try_.finally_.NPartitions_put_old_nptns", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 705, "end_line": 762, "span_ids": ["test_sort_overpartitioned_df"], "tokens": 634}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sort_overpartitioned_df():\n # First we test when the final df will have only 1 row and column partition.\n data = [[4, 5, 6], [1, 2, 3]]\n modin_df = pd.concat([pd.DataFrame(row).T for row in data]).reset_index(drop=True)\n pandas_df = pandas.DataFrame(data)\n\n eval_general(modin_df, pandas_df, lambda df: df.sort_values(by=0))\n\n # Next we test when the final df will only have 1 row, but starts with multiple column\n # partitions.\n data = [list(range(100)), list(range(100, 200))]\n modin_df = pd.concat([pd.DataFrame(row).T for row in data]).reset_index(drop=True)\n pandas_df = pandas.DataFrame(data)\n\n eval_general(modin_df, pandas_df, lambda df: df.sort_values(by=0))\n\n # Next we test when the final df will have multiple row partitions.\n data = np.random.choice(650, 650, replace=False).reshape((65, 10))\n modin_df = pd.concat([pd.DataFrame(row).T for row in data]).reset_index(drop=True)\n pandas_df = pandas.DataFrame(data)\n\n eval_general(modin_df, pandas_df, lambda df: df.sort_values(by=0))\n\n old_nptns = NPartitions.get()\n NPartitions.put(24)\n try:\n # Next we test when there's only one row per partition.\n data = np.random.choice(650, 650, replace=False).reshape((65, 10))\n modin_df = pd.concat([pd.DataFrame(row).T for row in data]).reset_index(\n drop=True\n )\n pandas_df = pandas.DataFrame(data)\n\n eval_general(modin_df, pandas_df, lambda df: df.sort_values(by=0))\n\n # And again, when there's more than one column partition.\n data = np.random.choice(6500, 6500, replace=False).reshape((65, 100))\n modin_df = pd.concat([pd.DataFrame(row).T for row in data]).reset_index(\n drop=True\n )\n pandas_df = pandas.DataFrame(data)\n\n eval_general(modin_df, pandas_df, lambda df: df.sort_values(by=0))\n\n # Additionally, we should test when we have a number of partitions\n # that doesn't divide cleanly into our desired number of partitions.\n # In this case, we start with 17 partitions, and want 2.\n NPartitions.put(21)\n data = np.random.choice(6500, 6500, replace=False).reshape((65, 100))\n modin_df = pd.concat([pd.DataFrame(row).T for row in data]).reset_index(\n drop=True\n )\n pandas_df = pandas.DataFrame(data)\n\n eval_general(modin_df, pandas_df, lambda df: df.sort_values(by=0))\n\n finally:\n NPartitions.put(old_nptns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_duplicates_test_sort_values_with_duplicates.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_duplicates_test_sort_values_with_duplicates.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 765, "end_line": 776, "span_ids": ["test_sort_values_with_duplicates"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sort_values_with_duplicates():\n modin_df = pd.DataFrame({\"col\": [2, 1, 1]}, index=[1, 1, 0])\n pandas_df = pandas.DataFrame({\"col\": [2, 1, 1]}, index=[1, 1, 0])\n\n key = modin_df.columns[0]\n modin_result = modin_df.sort_values(key, inplace=False)\n pandas_result = pandas_df.sort_values(key, inplace=False)\n df_equals(modin_result, pandas_result)\n\n modin_df.sort_values(key, inplace=True)\n pandas_df.sort_values(key, inplace=True)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_string_index_test_sort_values_with_string_index.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_string_index_test_sort_values_with_string_index.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 779, "end_line": 790, "span_ids": ["test_sort_values_with_string_index"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sort_values_with_string_index():\n modin_df = pd.DataFrame({\"col\": [25, 17, 1]}, index=[\"ccc\", \"bbb\", \"aaa\"])\n pandas_df = pandas.DataFrame({\"col\": [25, 17, 1]}, index=[\"ccc\", \"bbb\", \"aaa\"])\n\n key = modin_df.columns[0]\n modin_result = modin_df.sort_values(key, inplace=False)\n pandas_result = pandas_df.sort_values(key, inplace=False)\n df_equals(modin_result, pandas_result)\n\n modin_df.sort_values(key, inplace=True)\n pandas_df.sort_values(key, inplace=True)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_only_one_non_na_row_in_partition_test_sort_values_with_only_one_non_na_row_in_partition.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_only_one_non_na_row_in_partition_test_sort_values_with_only_one_non_na_row_in_partition.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 793, "end_line": 813, "span_ids": ["test_sort_values_with_only_one_non_na_row_in_partition"], "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 StorageFormat.get() != \"Pandas\",\n reason=\"We only need to test this case where sort does not default to pandas.\",\n)\n@pytest.mark.parametrize(\"ascending\", [True, False], ids=[\"True\", \"False\"])\n@pytest.mark.parametrize(\"na_position\", [\"first\", \"last\"], ids=[\"first\", \"last\"])\ndef test_sort_values_with_only_one_non_na_row_in_partition(ascending, na_position):\n pandas_df = pandas.DataFrame(\n np.random.rand(1000, 100), columns=[f\"col {i}\" for i in range(100)]\n )\n # Need to ensure that one of the partitions has all NA values except for one row\n pandas_df.iloc[340:] = np.NaN\n pandas_df.iloc[-1] = -4.0\n modin_df = pd.DataFrame(pandas_df)\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.sort_values(\n \"col 3\", ascending=ascending, na_position=na_position\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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_sort_key_on_partition_boundary_test_sort_values_with_sort_key_on_partition_boundary.eval_general_modin_df_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_sort_values_with_sort_key_on_partition_boundary_test_sort_values_with_sort_key_on_partition_boundary.eval_general_modin_df_mo", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 816, "end_line": 825, "span_ids": ["test_sort_values_with_sort_key_on_partition_boundary"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() not in (\"Ray\", \"Unidist\", \"Dask\"),\n reason=\"We only need to test this case where sort does not default to pandas.\",\n)\ndef test_sort_values_with_sort_key_on_partition_boundary():\n modin_df = pd.DataFrame(\n np.random.rand(1000, 100), columns=[f\"col {i}\" for i in range(100)]\n )\n sort_key = modin_df.columns[modin_df._query_compiler._modin_frame.column_widths[0]]\n eval_general(modin_df, modin_df._to_pandas(), lambda df: df.sort_values(sort_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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_where_test_where.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_where_test_where.None_6", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 828, "end_line": 867, "span_ids": ["test_where"], "tokens": 496}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_where():\n columns = list(\"abcdefghij\")\n\n frame_data = random_state.randn(100, 10)\n modin_df, pandas_df = create_test_dfs(frame_data, columns=columns)\n pandas_cond_df = pandas_df % 5 < 2\n modin_cond_df = modin_df % 5 < 2\n\n pandas_result = pandas_df.where(pandas_cond_df, -pandas_df)\n modin_result = modin_df.where(modin_cond_df, -modin_df)\n assert all((to_pandas(modin_result) == pandas_result).all())\n\n # test case when other is Series\n other_data = random_state.randn(len(pandas_df))\n modin_other, pandas_other = pd.Series(other_data), pandas.Series(other_data)\n pandas_result = pandas_df.where(pandas_cond_df, pandas_other, axis=0)\n modin_result = modin_df.where(modin_cond_df, modin_other, axis=0)\n df_equals(modin_result, pandas_result)\n\n # Test that we choose the right values to replace when `other` == `True`\n # everywhere.\n other_data = np.full(shape=pandas_df.shape, fill_value=True)\n modin_other, pandas_other = create_test_dfs(other_data, columns=columns)\n pandas_result = pandas_df.where(pandas_cond_df, pandas_other)\n modin_result = modin_df.where(modin_cond_df, modin_other)\n df_equals(modin_result, pandas_result)\n\n other = pandas_df.loc[3]\n pandas_result = pandas_df.where(pandas_cond_df, other, axis=1)\n modin_result = modin_df.where(modin_cond_df, other, axis=1)\n assert all((to_pandas(modin_result) == pandas_result).all())\n\n other = pandas_df[\"e\"]\n pandas_result = pandas_df.where(pandas_cond_df, other, axis=0)\n modin_result = modin_df.where(modin_cond_df, other, axis=0)\n assert all((to_pandas(modin_result) == pandas_result).all())\n\n pandas_result = pandas_df.where(pandas_df < 2, True)\n modin_result = modin_df.where(modin_df < 2, True)\n assert all((to_pandas(modin_result) == pandas_result).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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_where_different_axis_order_test_where_different_axis_order.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_where_different_axis_order_test_where_different_axis_order.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 870, "end_line": 891, "span_ids": ["test_where_different_axis_order"], "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 test_where_different_axis_order():\n # Test `where` when `cond`, `df`, and `other` each have columns and index\n # in different orders.\n data = test_data[\"float_nan_data\"]\n pandas_df = pandas.DataFrame(data)\n pandas_cond_df = pandas_df % 5 < 2\n pandas_cond_df = pandas_cond_df.reindex(\n columns=pandas_df.columns[::-1], index=pandas_df.index[::-1]\n )\n pandas_other_df = -pandas_df\n pandas_other_df = pandas_other_df.reindex(\n columns=pandas_df.columns[-1:].append(pandas_df.columns[:-1]),\n index=pandas_df.index[-1:].append(pandas_df.index[:-1]),\n )\n\n modin_df = pd.DataFrame(pandas_df)\n modin_cond_df = pd.DataFrame(pandas_cond_df)\n modin_other_df = pd.DataFrame(pandas_other_df)\n\n pandas_result = pandas_df.where(pandas_cond_df, pandas_other_df)\n modin_result = modin_df.where(modin_cond_df, modin_other_df)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_join_sort.py_test_compare_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_join_sort.py", "file_name": "test_join_sort.py", "file_type": "text/x-python", "category": "test", "start_line": 894, "end_line": 932, "span_ids": ["test_compare"], "tokens": 450}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"align_axis\", [\"index\", \"columns\"])\n@pytest.mark.parametrize(\"keep_shape\", [False, True])\n@pytest.mark.parametrize(\"keep_equal\", [False, True])\ndef test_compare(align_axis, keep_shape, keep_equal):\n kwargs = {\n \"align_axis\": align_axis,\n \"keep_shape\": keep_shape,\n \"keep_equal\": keep_equal,\n }\n frame_data1 = random_state.randn(100, 10)\n frame_data2 = random_state.randn(100, 10)\n pandas_df = pandas.DataFrame(frame_data1, columns=list(\"abcdefghij\"))\n pandas_df2 = pandas.DataFrame(frame_data2, columns=list(\"abcdefghij\"))\n modin_df = pd.DataFrame(frame_data1, columns=list(\"abcdefghij\"))\n modin_df2 = pd.DataFrame(frame_data2, columns=list(\"abcdefghij\"))\n\n modin_result = modin_df.compare(modin_df2, **kwargs)\n pandas_result = pandas_df.compare(pandas_df2, **kwargs)\n assert to_pandas(modin_result).equals(pandas_result)\n\n modin_result = modin_df2.compare(modin_df, **kwargs)\n pandas_result = pandas_df2.compare(pandas_df, **kwargs)\n assert to_pandas(modin_result).equals(pandas_result)\n\n series_data1 = [\"a\", \"b\", \"c\", \"d\", \"e\"]\n series_data2 = [\"a\", \"a\", \"c\", \"b\", \"e\"]\n pandas_series1 = pandas.Series(series_data1)\n pandas_series2 = pandas.Series(series_data2)\n modin_series1 = pd.Series(series_data1)\n modin_series2 = pd.Series(series_data2)\n\n modin_result = modin_series1.compare(modin_series2, **kwargs)\n pandas_result = pandas_series1.compare(pandas_series2, **kwargs)\n assert to_pandas(modin_result).equals(pandas_result)\n\n modin_result = modin_series2.compare(modin_series1, **kwargs)\n pandas_result = pandas_series2.compare(pandas_series1, **kwargs)\n assert to_pandas(modin_result).equals(pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_pytest_eval_insert.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_pytest_eval_insert.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 78, "span_ids": ["eval_insert", "docstring"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport numpy as np\nimport pandas\nfrom pandas.testing import assert_index_equal, assert_series_equal\nimport matplotlib\nimport modin.pandas as pd\nfrom modin.utils import get_current_execution\n\nfrom modin.pandas.test.utils import (\n random_state,\n RAND_LOW,\n RAND_HIGH,\n df_equals,\n df_is_empty,\n arg_keys,\n name_contains,\n test_data,\n test_data_values,\n test_data_keys,\n test_data_with_duplicates_values,\n test_data_with_duplicates_keys,\n numeric_dfs,\n test_func_keys,\n test_func_values,\n indices_keys,\n indices_values,\n axis_keys,\n axis_values,\n bool_arg_keys,\n bool_arg_values,\n int_arg_keys,\n int_arg_values,\n eval_general,\n create_test_dfs,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions, StorageFormat\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom modin.core.dataframe.pandas.metadata import LazyProxyCategoricalDtype\nfrom modin.core.storage_formats.pandas.utils import split_result_of_axis_func_pandas\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\n\ndef eval_insert(modin_df, pandas_df, **kwargs):\n if \"col\" in kwargs and \"column\" not in kwargs:\n kwargs[\"column\"] = kwargs.pop(\"col\")\n _kwargs = {\"loc\": 0, \"column\": \"New column\"}\n _kwargs.update(kwargs)\n\n eval_general(\n modin_df,\n pandas_df,\n operation=lambda df, **kwargs: df.insert(**kwargs),\n __inplace__=True,\n **_kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_indexing_test_indexing.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_indexing_test_indexing.None_10", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 131, "span_ids": ["test_indexing"], "tokens": 498}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_indexing():\n modin_df = pd.DataFrame(\n dict(a=[1, 2, 3], b=[4, 5, 6], c=[7, 8, 9]), index=[\"a\", \"b\", \"c\"]\n )\n pandas_df = pandas.DataFrame(\n dict(a=[1, 2, 3], b=[4, 5, 6], c=[7, 8, 9]), index=[\"a\", \"b\", \"c\"]\n )\n\n modin_result = modin_df\n pandas_result = pandas_df\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df[\"b\"]\n pandas_result = pandas_df[\"b\"]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df[[\"b\"]]\n pandas_result = pandas_df[[\"b\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df[[\"b\", \"a\"]]\n pandas_result = pandas_df[[\"b\", \"a\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[\"b\"]\n pandas_result = pandas_df.loc[\"b\"]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[[\"b\"]]\n pandas_result = pandas_df.loc[[\"b\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[[\"b\", \"a\"]]\n pandas_result = pandas_df.loc[[\"b\", \"a\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[[\"b\", \"a\"], [\"a\", \"c\"]]\n pandas_result = pandas_df.loc[[\"b\", \"a\"], [\"a\", \"c\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[:, [\"a\", \"c\"]]\n pandas_result = pandas_df.loc[:, [\"a\", \"c\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[:, [\"c\"]]\n pandas_result = pandas_df.loc[:, [\"c\"]]\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.loc[[]]\n pandas_result = pandas_df.loc[[]]\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_empty_df_test_empty_df.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_empty_df_test_empty_df.None_12", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 134, "end_line": 181, "span_ids": ["test_empty_df"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_empty_df():\n df = pd.DataFrame(index=[\"a\", \"b\"])\n df_is_empty(df)\n assert_index_equal(df.index, pd.Index([\"a\", \"b\"]))\n assert len(df.columns) == 0\n\n df = pd.DataFrame(columns=[\"a\", \"b\"])\n df_is_empty(df)\n assert len(df.index) == 0\n assert_index_equal(df.columns, pd.Index([\"a\", \"b\"]))\n\n df = pd.DataFrame()\n df_is_empty(df)\n assert len(df.index) == 0\n assert len(df.columns) == 0\n\n df = pd.DataFrame(index=[\"a\", \"b\"])\n df_is_empty(df)\n assert_index_equal(df.index, pd.Index([\"a\", \"b\"]))\n assert len(df.columns) == 0\n\n df = pd.DataFrame(columns=[\"a\", \"b\"])\n df_is_empty(df)\n assert len(df.index) == 0\n assert_index_equal(df.columns, pd.Index([\"a\", \"b\"]))\n\n df = pd.DataFrame()\n df_is_empty(df)\n assert len(df.index) == 0\n assert len(df.columns) == 0\n\n df = pd.DataFrame()\n pd_df = pandas.DataFrame()\n df[\"a\"] = [1, 2, 3, 4, 5]\n pd_df[\"a\"] = [1, 2, 3, 4, 5]\n df_equals(df, pd_df)\n\n df = pd.DataFrame()\n pd_df = pandas.DataFrame()\n df[\"a\"] = list(\"ABCDEF\")\n pd_df[\"a\"] = list(\"ABCDEF\")\n df_equals(df, pd_df)\n\n df = pd.DataFrame()\n pd_df = pandas.DataFrame()\n df[\"a\"] = pd.Series([1, 2, 3, 4, 5])\n pd_df[\"a\"] = pandas.Series([1, 2, 3, 4, 5])\n df_equals(df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_abs_test_add_prefix.df_equals_new_modin_df_dt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_abs_test_add_prefix.df_equals_new_modin_df_dt", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 211, "span_ids": ["test_abs", "test_add_prefix"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_abs(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = pandas_df.abs()\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.abs()\n else:\n modin_result = modin_df.abs()\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"axis\", [None, 0, 1])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_add_prefix(data, axis):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n test_prefix = \"TEST\"\n new_modin_df = modin_df.add_prefix(test_prefix, axis=axis)\n new_pandas_df = pandas_df.add_prefix(test_prefix, axis=axis)\n df_equals(new_modin_df.columns, new_pandas_df.columns)\n # TODO(https://github.com/modin-project/modin/issues/3804):\n # make df_equals always check dtypes.\n df_equals(new_modin_df.dtypes, new_pandas_df.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_add_suffix_test_add_suffix.df_equals_new_modin_df_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_add_suffix_test_add_suffix.df_equals_new_modin_df_co", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 214, "end_line": 224, "span_ids": ["test_add_suffix"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [None, 0, 1])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_add_suffix(data, axis):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n test_suffix = \"TEST\"\n new_modin_df = modin_df.add_suffix(test_suffix, axis=axis)\n new_pandas_df = pandas_df.add_suffix(test_suffix, axis=axis)\n\n df_equals(new_modin_df.columns, new_pandas_df.columns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_applymap_test_applymap.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_applymap_test_applymap.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 227, "end_line": 239, "span_ids": ["test_applymap"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"testfunc\", test_func_values, ids=test_func_keys)\n@pytest.mark.parametrize(\n \"na_action\", [None, \"ignore\"], ids=[\"no_na_action\", \"ignore_na\"]\n)\ndef test_applymap(data, testfunc, na_action):\n modin_df, pandas_df = create_test_dfs(data)\n\n with pytest.raises(ValueError):\n x = 2\n modin_df.applymap(x)\n\n eval_general(modin_df, pandas_df, lambda df: df.applymap(testfunc, na_action))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_applymap_numeric_test_applymap_numeric.if_name_contains_request_.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_applymap_numeric_test_applymap_numeric.if_name_contains_request_.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 256, "span_ids": ["test_applymap_numeric"], "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.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"testfunc\", test_func_values, ids=test_func_keys)\ndef test_applymap_numeric(request, data, testfunc):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if name_contains(request.node.name, numeric_dfs):\n try:\n pandas_result = pandas_df.applymap(testfunc)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.applymap(testfunc)\n else:\n modin_result = modin_df.applymap(testfunc)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_at_test_axes.for_modin_axis_pd_axis_i.assert_np_array_equal_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_at_test_axes.for_modin_axis_pd_axis_i.assert_np_array_equal_mod", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 285, "span_ids": ["test_at", "test_axes"], "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.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_at(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n key1 = modin_df.columns[0]\n # Scalar\n df_equals(modin_df.at[0, key1], pandas_df.at[0, key1])\n\n # Series\n df_equals(modin_df.loc[0].at[key1], pandas_df.loc[0].at[key1])\n\n # Write Item\n modin_df_copy = modin_df.copy()\n pandas_df_copy = pandas_df.copy()\n modin_df_copy.at[1, key1] = modin_df.at[0, key1]\n pandas_df_copy.at[1, key1] = pandas_df.at[0, key1]\n df_equals(modin_df_copy, pandas_df_copy)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_axes(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n for modin_axis, pd_axis in zip(modin_df.axes, pandas_df.axes):\n assert np.array_equal(modin_axis, pd_axis)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_copy_test_copy.df_equals_modin_df_modin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_copy_test_copy.df_equals_modin_df_modin", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 288, "end_line": 320, "span_ids": ["test_copy"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_copy(data):\n modin_df = pd.DataFrame(data)\n\n # pandas_df is unused but there so there won't be confusing list comprehension\n # stuff in the pytest.mark.parametrize\n new_modin_df = modin_df.copy(deep=True)\n\n assert new_modin_df is not modin_df\n assert new_modin_df.index is not modin_df.index\n assert new_modin_df.columns is not modin_df.columns\n assert new_modin_df.dtypes is not modin_df.dtypes\n\n if get_current_execution() != \"BaseOnPython\":\n assert np.array_equal(\n new_modin_df._query_compiler._modin_frame._partitions,\n modin_df._query_compiler._modin_frame._partitions,\n )\n df_equals(new_modin_df, modin_df)\n\n # Shallow copy tests\n modin_df = pd.DataFrame(data)\n modin_df_cp = modin_df.copy(deep=False)\n\n assert modin_df_cp is not modin_df\n assert modin_df_cp.index is modin_df.index\n assert modin_df_cp.columns is modin_df.columns\n # FIXME: we're different from pandas here as modin doesn't copy dtypes for a shallow copy\n # https://github.com/modin-project/modin/issues/5602\n # assert modin_df_cp.dtypes is not modin_df.dtypes\n\n modin_df[modin_df.columns[0]] = 0\n df_equals(modin_df, modin_df_cp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dtypes_test_get.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dtypes_test_get.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 323, "end_line": 340, "span_ids": ["test_dtypes", "test_get"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dtypes(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.dtypes, pandas_df.dtypes)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"key\", indices_values, ids=indices_keys)\ndef test_get(data, key):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.get(key), pandas_df.get(key))\n df_equals(\n modin_df.get(key, default=\"default\"), pandas_df.get(key, default=\"default\")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_get_dummies_test_get_dummies.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_get_dummies_test_get_dummies.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 343, "end_line": 365, "span_ids": ["test_get_dummies"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"dummy_na\", bool_arg_values, ids=arg_keys(\"dummy_na\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"drop_first\", bool_arg_values, ids=arg_keys(\"drop_first\", bool_arg_keys)\n)\ndef test_get_dummies(request, data, dummy_na, drop_first):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = pandas.get_dummies(\n pandas_df, dummy_na=dummy_na, drop_first=drop_first\n )\n except Exception as err:\n with pytest.raises(type(err)):\n pd.get_dummies(modin_df, dummy_na=dummy_na, drop_first=drop_first)\n else:\n modin_result = pd.get_dummies(\n modin_df, dummy_na=dummy_na, drop_first=drop_first\n )\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_isna_test_isnull.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_isna_test_isnull.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 368, "end_line": 387, "span_ids": ["test_isna", "test_isnull"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_isna(data):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n pandas_result = pandas_df.isna()\n modin_result = modin_df.isna()\n\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_isnull(data):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n\n pandas_result = pandas_df.isnull()\n modin_result = modin_df.isnull()\n\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_test_astype.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_test_astype.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 390, "end_line": 437, "span_ids": ["test_astype"], "tokens": 503}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_astype():\n td = pandas.DataFrame(test_data[\"int_data\"])[[\"col1\", \"index\", \"col3\", \"col4\"]]\n modin_df = pd.DataFrame(td.values, index=td.index, columns=td.columns)\n expected_df = pandas.DataFrame(td.values, index=td.index, columns=td.columns)\n\n modin_df_casted = modin_df.astype(np.int32)\n expected_df_casted = expected_df.astype(np.int32)\n df_equals(modin_df_casted, expected_df_casted)\n\n modin_df_casted = modin_df.astype(np.float64)\n expected_df_casted = expected_df.astype(np.float64)\n df_equals(modin_df_casted, expected_df_casted)\n\n modin_df_casted = modin_df.astype(str)\n expected_df_casted = expected_df.astype(str)\n df_equals(modin_df_casted, expected_df_casted)\n\n modin_df_casted = modin_df.astype(\"category\")\n expected_df_casted = expected_df.astype(\"category\")\n df_equals(modin_df_casted, expected_df_casted)\n\n dtype_dict = {\"col1\": np.int32, \"index\": np.int64, \"col3\": str}\n modin_df_casted = modin_df.astype(dtype_dict)\n expected_df_casted = expected_df.astype(dtype_dict)\n df_equals(modin_df_casted, expected_df_casted)\n\n modin_df = pd.DataFrame(index=[\"row1\"], columns=[\"col1\"])\n modin_df[\"col1\"][\"row1\"] = 11\n modin_df_casted = modin_df.astype(int)\n expected_df = pandas.DataFrame(index=[\"row1\"], columns=[\"col1\"])\n expected_df[\"col1\"][\"row1\"] = 11\n expected_df_casted = expected_df.astype(int)\n df_equals(modin_df_casted, expected_df_casted)\n\n with pytest.raises(KeyError):\n modin_df.astype({\"not_exists\": np.uint8})\n\n # The dtypes series must have a unique index.\n eval_general(\n modin_df,\n expected_df,\n lambda df: df.astype(\n pd.Series([str, str], index=[\"col1\", \"col1\"])\n if isinstance(df, pd.DataFrame)\n else pandas.Series([str, str], index=[\"col1\", \"col1\"])\n ),\n check_exception_type=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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_errors_test_astype_errors.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_errors_test_astype_errors.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 440, "end_line": 450, "span_ids": ["test_astype_errors"], "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": "@pytest.mark.parametrize(\"errors\", [\"raise\", \"ignore\"])\ndef test_astype_errors(errors):\n data = {\"a\": [\"a\", 2, -1]}\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.astype(\"int\", errors=errors),\n # https://github.com/modin-project/modin/issues/5962\n comparator_kwargs={\"check_dtypes\": errors != \"ignore\"},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_copy_test_astype_copy.df_equals_s1_s2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_copy_test_astype_copy.df_equals_s1_s2_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 453, "end_line": 479, "span_ids": ["test_astype_copy"], "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": "@pytest.mark.parametrize(\n \"has_dtypes\",\n [\n pytest.param(\n False,\n marks=pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK does not support cases when `.dtypes` is None\",\n ),\n ),\n True,\n ],\n)\ndef test_astype_copy(has_dtypes):\n data = [1]\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n if not has_dtypes:\n modin_df._query_compiler._modin_frame.set_dtypes_cache(None)\n eval_general(modin_df, pandas_df, lambda df: df.astype(str, copy=False))\n\n # trivial case where copying can be avoided, behavior should match pandas\n s1 = pd.Series([1, 2])\n if not has_dtypes:\n modin_df._query_compiler._modin_frame.set_dtypes_cache(None)\n s2 = s1.astype(\"int64\", copy=False)\n s2[0] = 10\n df_equals(s1, s2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_dict_or_series_multiple_column_partitions_test_astype_dict_or_series_multiple_column_partitions.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_dict_or_series_multiple_column_partitions_test_astype_dict_or_series_multiple_column_partitions.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 482, "end_line": 500, "span_ids": ["test_astype_dict_or_series_multiple_column_partitions"], "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": "@pytest.mark.parametrize(\"dtypes_are_dict\", [True, False])\ndef test_astype_dict_or_series_multiple_column_partitions(dtypes_are_dict):\n # Test astype with a dtypes dict that is complex in that:\n # - It applies to columns spanning multiple column partitions\n # - Within a partition frame df:\n # - dtypes.index is not a subset of df.columns\n # - df.columns is not a subset of dtypes.index\n\n modin_df, pandas_df = create_test_dfs(test_data[\"int_data\"])\n if dtypes_are_dict:\n new_dtypes = {}\n else:\n new_dtypes = pandas.Series()\n for i, column in enumerate(pandas_df.columns):\n if i % 3 == 1:\n new_dtypes[column] = \"string\"\n elif i % 3 == 2:\n new_dtypes[column] = float\n eval_general(modin_df, pandas_df, lambda df: df.astype(new_dtypes))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_category_test_astype_category.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_category_test_astype_category.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 503, "end_line": 519, "span_ids": ["test_astype_category"], "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_astype_category():\n modin_df = pd.DataFrame(\n {\"col1\": [\"A\", \"A\", \"B\", \"B\", \"A\"], \"col2\": [1, 2, 3, 4, 5]}\n )\n pandas_df = pandas.DataFrame(\n {\"col1\": [\"A\", \"A\", \"B\", \"B\", \"A\"], \"col2\": [1, 2, 3, 4, 5]}\n )\n\n modin_result = modin_df.astype({\"col1\": \"category\"})\n pandas_result = pandas_df.astype({\"col1\": \"category\"})\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)\n\n modin_result = modin_df.astype(\"category\")\n pandas_result = pandas_df.astype(\"category\")\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_category_large_test_astype_category_large.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_category_large_test_astype_category_large.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 522, "end_line": 545, "span_ids": ["test_astype_category_large"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_astype_category_large():\n series_length = 10_000\n modin_df = pd.DataFrame(\n {\n \"col1\": [\"str{0}\".format(i) for i in range(0, series_length)],\n \"col2\": [i for i in range(0, series_length)],\n }\n )\n pandas_df = pandas.DataFrame(\n {\n \"col1\": [\"str{0}\".format(i) for i in range(0, series_length)],\n \"col2\": [i for i in range(0, series_length)],\n }\n )\n\n modin_result = modin_df.astype({\"col1\": \"category\"})\n pandas_result = pandas_df.astype({\"col1\": \"category\"})\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)\n\n modin_result = modin_df.astype(\"category\")\n pandas_result = pandas_df.astype(\"category\")\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_int64_to_astype_category_github_issue_6259_test_astype_int64_to_astype_category_github_issue_6259.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_astype_int64_to_astype_category_github_issue_6259_test_astype_int64_to_astype_category_github_issue_6259.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 548, "end_line": 562, "span_ids": ["test_astype_int64_to_astype_category_github_issue_6259"], "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": "@pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/modin-project/modin/issues/6268\",\n strict=True,\n)\ndef test_astype_int64_to_astype_category_github_issue_6259():\n eval_general(\n *create_test_dfs(\n {\"c0\": [0, 1, 2, 3, 4], \"par\": [\"foo\", \"boo\", \"bar\", \"foo\", \"boo\"]},\n index=[\"a\", \"b\", \"c\", \"d\", \"e\"],\n ),\n lambda df: df[\"c0\"].astype(\"Int64\").astype(\"category\"),\n # work around https://github.com/modin-project/modin/issues/6016\n raising_exceptions=(Exception,),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype_TestCategoricalProxyDtype._get_lazy_proxy.if_StorageFormat_get_.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype_TestCategoricalProxyDtype._get_lazy_proxy.if_StorageFormat_get_.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 565, "end_line": 611, "span_ids": ["TestCategoricalProxyDtype._get_lazy_proxy", "TestCategoricalProxyDtype"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\",\n reason=\"BaseOnPython doesn't have proxy categories\",\n)\nclass TestCategoricalProxyDtype:\n \"\"\"This class contains test and test usilities for the ``LazyProxyCategoricalDtype`` class.\"\"\"\n\n @staticmethod\n def _get_lazy_proxy():\n \"\"\"\n Build a dataframe containing a column that has a proxy type and return\n this proxy together with an original dtype that this proxy is emulating.\n\n Returns\n -------\n (LazyProxyCategoricalDtype, pandas.CategoricalDtype, modin.pandas.DataFrame)\n \"\"\"\n nchunks = 3\n pandas_df = pandas.DataFrame({\"a\": [1, 1, 2, 2, 3, 2], \"b\": [1, 2, 3, 4, 5, 6]})\n original_dtype = pandas_df.astype({\"a\": \"category\"}).dtypes[\"a\"]\n\n chunks = split_result_of_axis_func_pandas(\n axis=0, num_splits=nchunks, result=pandas_df, length_list=[2, 2, 2]\n )\n\n if StorageFormat.get() == \"Pandas\":\n df = pd.concat([pd.DataFrame(chunk) for chunk in chunks])\n assert df._query_compiler._modin_frame._partitions.shape == (nchunks, 1)\n\n df = df.astype({\"a\": \"category\"})\n return df.dtypes[\"a\"], original_dtype, df\n elif StorageFormat.get() == \"Hdk\":\n import pyarrow as pa\n from modin.pandas.utils import from_arrow\n\n at = pa.concat_tables(\n [\n pa.Table.from_pandas(chunk.astype({\"a\": \"category\"}))\n for chunk in chunks\n ]\n )\n assert len(at.column(0).chunks) == nchunks\n\n df = from_arrow(at)\n return df.dtypes[\"a\"], original_dtype, df\n else:\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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_update_proxy_TestCategoricalProxyDtype.test_update_proxy.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_update_proxy_TestCategoricalProxyDtype.test_update_proxy.None_6", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 613, "end_line": 646, "span_ids": ["TestCategoricalProxyDtype.test_update_proxy"], "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": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\",\n reason=\"BaseOnPython doesn't have proxy categories\",\n)\nclass TestCategoricalProxyDtype:\n\n def test_update_proxy(self):\n \"\"\"Verify that ``LazyProxyCategoricalDtype._update_proxy`` method works as expected.\"\"\"\n lazy_proxy, _, _ = self._get_lazy_proxy()\n new_parent = pd.DataFrame({\"a\": [10, 20, 30]})._query_compiler._modin_frame\n\n assert isinstance(lazy_proxy, LazyProxyCategoricalDtype)\n # When we try to create a new proxy from the same arguments it should return itself\n assert (\n lazy_proxy._update_proxy(lazy_proxy._parent, lazy_proxy._column_name)\n is lazy_proxy\n )\n\n # When any of the arguments is changing we should create a new proxy\n proxy_with_new_column = lazy_proxy._update_proxy(\n lazy_proxy._parent, \"other_column\"\n )\n assert proxy_with_new_column is not lazy_proxy and isinstance(\n proxy_with_new_column, LazyProxyCategoricalDtype\n )\n\n # When any of the arguments is changing we should create a new proxy\n proxy_with_new_parent = lazy_proxy._update_proxy(\n new_parent, lazy_proxy._column_name\n )\n assert proxy_with_new_parent is not lazy_proxy and isinstance(\n proxy_with_new_parent, LazyProxyCategoricalDtype\n )\n\n lazy_proxy.categories # trigger materialization\n # `._update_proxy` now should produce pandas Categoricals instead of a proxy as it already has materialized data\n assert (\n type(lazy_proxy._update_proxy(lazy_proxy._parent, lazy_proxy._column_name))\n == pandas.CategoricalDtype\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_update_proxy_implicit_TestCategoricalProxyDtype.test_update_proxy_implicit.None_1.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_update_proxy_implicit_TestCategoricalProxyDtype.test_update_proxy_implicit.None_1.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 648, "end_line": 682, "span_ids": ["TestCategoricalProxyDtype.test_update_proxy_implicit"], "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": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\",\n reason=\"BaseOnPython doesn't have proxy categories\",\n)\nclass TestCategoricalProxyDtype:\n\n def test_update_proxy_implicit(self):\n \"\"\"\n Verify that a lazy proxy correctly updates its parent when passed from one parent to another.\n \"\"\"\n lazy_proxy, _, parent = self._get_lazy_proxy()\n parent_frame = parent._query_compiler._modin_frame\n\n if StorageFormat.get() == \"Pandas\":\n assert lazy_proxy._parent is parent_frame\n elif StorageFormat.get() == \"Hdk\":\n arrow_table = parent_frame._partitions[0, 0].get()\n assert lazy_proxy._parent is arrow_table\n else:\n raise NotImplementedError(\n f\"The test is not implemented for {StorageFormat.get()} storage format\"\n )\n\n # Making a copy of the dataframe, the new proxy should now start pointing to the new parent\n new_parent = parent.copy()\n new_parent_frame = new_parent._query_compiler._modin_frame\n new_lazy_proxy = new_parent_frame.dtypes[lazy_proxy._column_name]\n\n if StorageFormat.get() == \"Pandas\":\n # Make sure that the old proxy still pointing to the old parent\n assert lazy_proxy._parent is parent_frame\n assert new_lazy_proxy._parent is new_parent_frame\n elif StorageFormat.get() == \"Hdk\":\n new_arrow_table = new_parent_frame._partitions[0, 0].get()\n # Make sure that the old proxy still pointing to the old parent\n assert lazy_proxy._parent is arrow_table\n assert new_lazy_proxy._parent is new_arrow_table\n else:\n raise NotImplementedError(\n f\"The test is not implemented for {StorageFormat.get()} storage format\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_if_proxy_lazy_TestCategoricalProxyDtype.test_if_proxy_lazy.assert_lazy_proxy__is_mat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_if_proxy_lazy_TestCategoricalProxyDtype.test_if_proxy_lazy.assert_lazy_proxy__is_mat", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 684, "end_line": 705, "span_ids": ["TestCategoricalProxyDtype.test_if_proxy_lazy"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\",\n reason=\"BaseOnPython doesn't have proxy categories\",\n)\nclass TestCategoricalProxyDtype:\n\n def test_if_proxy_lazy(self):\n \"\"\"Verify that proxy is able to pass simple comparison checks without triggering materialization.\"\"\"\n lazy_proxy, actual_dtype, _ = self._get_lazy_proxy()\n\n assert isinstance(lazy_proxy, LazyProxyCategoricalDtype)\n assert not lazy_proxy._is_materialized\n\n assert lazy_proxy == \"category\"\n assert isinstance(lazy_proxy, pd.CategoricalDtype)\n assert isinstance(lazy_proxy, pandas.CategoricalDtype)\n assert pandas.api.types.is_categorical_dtype(lazy_proxy)\n assert str(lazy_proxy) == \"category\"\n assert str(lazy_proxy) == str(actual_dtype)\n assert not lazy_proxy.ordered\n assert not lazy_proxy._is_materialized\n\n # Further, there are all checks that materialize categories\n assert lazy_proxy == actual_dtype\n assert actual_dtype == lazy_proxy\n assert repr(lazy_proxy) == repr(actual_dtype)\n assert lazy_proxy.categories.equals(actual_dtype.categories)\n assert lazy_proxy._is_materialized", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_proxy_as_dtype_TestCategoricalProxyDtype.test_proxy_as_dtype.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_proxy_as_dtype_TestCategoricalProxyDtype.test_proxy_as_dtype.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 707, "end_line": 719, "span_ids": ["TestCategoricalProxyDtype.test_proxy_as_dtype"], "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": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\",\n reason=\"BaseOnPython doesn't have proxy categories\",\n)\nclass TestCategoricalProxyDtype:\n\n def test_proxy_as_dtype(self):\n \"\"\"Verify that proxy can be used as an actual dtype.\"\"\"\n lazy_proxy, actual_dtype, _ = self._get_lazy_proxy()\n\n assert isinstance(lazy_proxy, LazyProxyCategoricalDtype)\n assert not lazy_proxy._is_materialized\n\n modin_df2, pandas_df2 = create_test_dfs({\"c\": [2, 2, 3, 4, 5, 6]})\n eval_general(\n (modin_df2, lazy_proxy),\n (pandas_df2, actual_dtype),\n lambda args: args[0].astype({\"c\": args[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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_proxy_with_pandas_constructor_test_infer_objects_single_partition.assert_modin_result_dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_TestCategoricalProxyDtype.test_proxy_with_pandas_constructor_test_infer_objects_single_partition.assert_modin_result_dtype", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 721, "end_line": 742, "span_ids": ["TestCategoricalProxyDtype.test_proxy_with_pandas_constructor", "test_infer_objects_single_partition"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\",\n reason=\"BaseOnPython doesn't have proxy categories\",\n)\nclass TestCategoricalProxyDtype:\n\n def test_proxy_with_pandas_constructor(self):\n \"\"\"Verify that users still can use pandas' constructor using `type(cat)(...)` notation.\"\"\"\n lazy_proxy, _, _ = self._get_lazy_proxy()\n assert isinstance(lazy_proxy, LazyProxyCategoricalDtype)\n\n new_cat_values = pandas.Index([3, 4, 5])\n new_category_dtype = type(lazy_proxy)(categories=new_cat_values, ordered=True)\n assert not lazy_proxy._is_materialized\n assert new_category_dtype._is_materialized\n assert new_category_dtype.categories.equals(new_cat_values)\n assert new_category_dtype.ordered\n\n\ndef test_infer_objects_single_partition():\n data = {\"a\": [\"s\", 2, 3]}\n modin_df = pd.DataFrame(data).iloc[1:]\n pandas_df = pandas.DataFrame(data).iloc[1:]\n modin_result = modin_df.infer_objects()\n pandas_result = pandas_df.infer_objects()\n\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_single_partition_test_convert_dtypes_single_partition.assert_modin_result_dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_single_partition_test_convert_dtypes_single_partition.assert_modin_result_dtype", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 745, "end_line": 784, "span_ids": ["test_convert_dtypes_single_partition"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"infer_objects\", bool_arg_values, ids=arg_keys(\"infer_objects\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"convert_string\", bool_arg_values, ids=arg_keys(\"convert_string\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"convert_integer\", bool_arg_values, ids=arg_keys(\"convert_integer\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"convert_boolean\", bool_arg_values, ids=arg_keys(\"convert_boolean\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"convert_floating\", bool_arg_values, ids=arg_keys(\"convert_floating\", bool_arg_keys)\n)\ndef test_convert_dtypes_single_partition(\n infer_objects, convert_string, convert_integer, convert_boolean, convert_floating\n):\n # Sanity check, copied from pandas documentation:\n # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.convert_dtypes.html\n data = {\n \"a\": pd.Series([1, 2, 3], dtype=np.dtype(\"int32\")),\n \"b\": pd.Series([\"x\", \"y\", \"z\"], dtype=np.dtype(\"O\")),\n \"c\": pd.Series([True, False, np.nan], dtype=np.dtype(\"O\")),\n \"d\": pd.Series([\"h\", \"i\", np.nan], dtype=np.dtype(\"O\")),\n \"e\": pd.Series([10, np.nan, 20], dtype=np.dtype(\"float\")),\n \"f\": pd.Series([np.nan, 100.5, 200], dtype=np.dtype(\"float\")),\n }\n kwargs = {\n \"infer_objects\": infer_objects,\n \"convert_string\": convert_string,\n \"convert_integer\": convert_integer,\n \"convert_boolean\": convert_boolean,\n \"convert_floating\": convert_floating,\n }\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_result = modin_df.convert_dtypes(**kwargs)\n pandas_result = pandas_df.convert_dtypes(**kwargs)\n assert modin_result.dtypes.equals(pandas_result.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_dtype_backend_test_convert_dtypes_dtype_backend.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_dtype_backend_test_convert_dtypes_dtype_backend.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 787, "end_line": 806, "span_ids": ["test_convert_dtypes_dtype_backend"], "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": "@pytest.mark.parametrize(\"dtype_backend\", [\"numpy_nullable\", \"pyarrow\"])\ndef test_convert_dtypes_dtype_backend(dtype_backend):\n data = {\n \"a\": pd.Series([1, 2, 3], dtype=np.dtype(\"int32\")),\n \"b\": pd.Series([\"x\", \"y\", \"z\"], dtype=np.dtype(\"O\")),\n \"c\": pd.Series([True, False, np.nan], dtype=np.dtype(\"O\")),\n \"d\": pd.Series([\"h\", \"i\", np.nan], dtype=np.dtype(\"O\")),\n \"e\": pd.Series([10, np.nan, 20], dtype=np.dtype(\"float\")),\n \"f\": pd.Series([np.nan, 100.5, 200], dtype=np.dtype(\"float\")),\n }\n\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_general(\n *create_test_dfs(data),\n lambda df: df.convert_dtypes(dtype_backend=dtype_backend),\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_multiple_row_partitions_test_convert_dtypes_multiple_row_partitions.assert_modin_result_dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_multiple_row_partitions_test_convert_dtypes_multiple_row_partitions.assert_modin_result_dtype", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 809, "end_line": 830, "span_ids": ["test_convert_dtypes_multiple_row_partitions"], "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": "@pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK does not support columns with different types\",\n)\ndef test_convert_dtypes_multiple_row_partitions():\n # Column 0 should have string dtype\n modin_part1 = pd.DataFrame([\"a\"]).convert_dtypes()\n # Column 0 should have an int dtype\n modin_part2 = pd.DataFrame([1]).convert_dtypes()\n modin_df = pd.concat([modin_part1, modin_part2])\n if StorageFormat.get() == \"Pandas\":\n assert modin_df._query_compiler._modin_frame._partitions.shape == (2, 1)\n pandas_df = pandas.DataFrame([\"a\", 1], index=[0, 0])\n # The initial dataframes should be the same\n df_equals(modin_df, pandas_df)\n # TODO(https://github.com/modin-project/modin/pull/3805): delete\n # this assert once df_equals checks dtypes\n assert modin_df.dtypes.equals(pandas_df.dtypes)\n modin_result = modin_df.convert_dtypes()\n pandas_result = pandas_df.convert_dtypes()\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_5653_test_convert_dtypes_5653.assert_modin_df_dtypes_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_convert_dtypes_5653_test_convert_dtypes_5653.assert_modin_df_dtypes_0_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 833, "end_line": 841, "span_ids": ["test_convert_dtypes_5653"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_convert_dtypes_5653():\n modin_part1 = pd.DataFrame({\"col1\": [\"a\", \"b\", \"c\", \"d\"]})\n modin_part2 = pd.DataFrame({\"col1\": [None, None, None, None]})\n modin_df = pd.concat([modin_part1, modin_part2])\n if StorageFormat.get() == \"Pandas\":\n assert modin_df._query_compiler._modin_frame._partitions.shape == (2, 1)\n modin_df = modin_df.convert_dtypes()\n assert len(modin_df.dtypes) == 1\n assert modin_df.dtypes[0] == \"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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_clip_test_clip.if_name_contains_request_.with_pytest_raises_ValueE.modin_df_clip_lower_1_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_clip_test_clip.if_name_contains_request_.with_pytest_raises_ValueE.modin_df_clip_lower_1_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 844, "end_line": 893, "span_ids": ["test_clip"], "tokens": 497}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"bound_type\", [\"list\", \"series\"], ids=[\"list\", \"series\"])\ndef test_clip(request, data, axis, bound_type):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if name_contains(request.node.name, numeric_dfs):\n ind_len = (\n len(modin_df.index)\n if not pandas.DataFrame()._get_axis_number(axis)\n else len(modin_df.columns)\n )\n # set bounds\n lower, upper = np.sort(random_state.random_integers(RAND_LOW, RAND_HIGH, 2))\n\n # test only upper scalar bound\n modin_result = modin_df.clip(None, upper, axis=axis)\n pandas_result = pandas_df.clip(None, upper, axis=axis)\n df_equals(modin_result, pandas_result)\n\n # test lower and upper scalar bound\n modin_result = modin_df.clip(lower, upper, axis=axis)\n pandas_result = pandas_df.clip(lower, upper, axis=axis)\n df_equals(modin_result, pandas_result)\n\n lower = random_state.random_integers(RAND_LOW, RAND_HIGH, ind_len)\n upper = random_state.random_integers(RAND_LOW, RAND_HIGH, ind_len)\n\n if bound_type == \"series\":\n modin_lower = pd.Series(lower)\n pandas_lower = pandas.Series(lower)\n modin_upper = pd.Series(upper)\n pandas_upper = pandas.Series(upper)\n else:\n modin_lower = pandas_lower = lower\n modin_upper = pandas_upper = upper\n\n # test lower and upper list bound on each column\n modin_result = modin_df.clip(modin_lower, modin_upper, axis=axis)\n pandas_result = pandas_df.clip(pandas_lower, pandas_upper, axis=axis)\n df_equals(modin_result, pandas_result)\n\n # test only upper list bound on each column\n modin_result = modin_df.clip(np.nan, modin_upper, axis=axis)\n pandas_result = pandas_df.clip(np.nan, pandas_upper, axis=axis)\n df_equals(modin_result, pandas_result)\n\n with pytest.raises(ValueError):\n modin_df.clip(lower=[1, 2, 3], axis=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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_test_drop.midx.pd_MultiIndex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_test_drop.midx.pd_MultiIndex_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 896, "end_line": 942, "span_ids": ["test_drop"], "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": "def test_drop():\n frame_data = {\"A\": [1, 2, 3, 4], \"B\": [0, 1, 2, 3]}\n simple = pandas.DataFrame(frame_data)\n modin_simple = pd.DataFrame(frame_data)\n df_equals(modin_simple.drop(\"A\", axis=1), simple[[\"B\"]])\n df_equals(modin_simple.drop([\"A\", \"B\"], axis=\"columns\"), simple[[]])\n df_equals(modin_simple.drop([0, 1, 3], axis=0), simple.loc[[2], :])\n df_equals(modin_simple.drop([0, 3], axis=\"index\"), simple.loc[[1, 2], :])\n\n pytest.raises(KeyError, modin_simple.drop, 5)\n pytest.raises(KeyError, modin_simple.drop, \"C\", axis=1)\n pytest.raises(KeyError, modin_simple.drop, [1, 5])\n pytest.raises(KeyError, modin_simple.drop, [\"A\", \"C\"], axis=1)\n\n # errors = 'ignore'\n df_equals(modin_simple.drop(5, errors=\"ignore\"), simple)\n df_equals(modin_simple.drop([0, 5], errors=\"ignore\"), simple.loc[[1, 2, 3], :])\n df_equals(modin_simple.drop(\"C\", axis=1, errors=\"ignore\"), simple)\n df_equals(modin_simple.drop([\"A\", \"C\"], axis=1, errors=\"ignore\"), simple[[\"B\"]])\n\n # non-unique\n nu_df = pandas.DataFrame(\n zip(range(3), range(-3, 1), list(\"abc\")), columns=[\"a\", \"a\", \"b\"]\n )\n modin_nu_df = pd.DataFrame(nu_df)\n df_equals(modin_nu_df.drop(\"a\", axis=1), nu_df[[\"b\"]])\n df_equals(modin_nu_df.drop(\"b\", axis=\"columns\"), nu_df[\"a\"])\n df_equals(modin_nu_df.drop([]), nu_df)\n\n nu_df = nu_df.set_index(pandas.Index([\"X\", \"Y\", \"X\"]))\n nu_df.columns = list(\"abc\")\n modin_nu_df = pd.DataFrame(nu_df)\n df_equals(modin_nu_df.drop(\"X\", axis=\"rows\"), nu_df.loc[[\"Y\"], :])\n df_equals(modin_nu_df.drop([\"X\", \"Y\"], axis=0), nu_df.loc[[], :])\n\n # inplace cache issue\n frame_data = random_state.randn(10, 3)\n df = pandas.DataFrame(frame_data, columns=list(\"abc\"))\n modin_df = pd.DataFrame(frame_data, columns=list(\"abc\"))\n expected = df[~(df.b > 0)]\n modin_df.drop(labels=df[df.b > 0].index, inplace=True)\n df_equals(modin_df, expected)\n\n midx = pd.MultiIndex(\n levels=[[\"lama\", \"cow\", \"falcon\"], [\"speed\", \"weight\", \"length\"]],\n codes=[[0, 0, 0, 1, 1, 1, 2, 2, 2], [0, 1, 2, 0, 1, 2, 0, 1, 2]],\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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop.df_13_test_drop.with_warns_that_defaultin.df_drop_index_length_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop.df_13_test_drop.with_warns_that_defaultin.df_drop_index_length_l", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 943, "end_line": 959, "span_ids": ["test_drop"], "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_drop():\n # ... other code\n df = pd.DataFrame(\n index=midx,\n columns=[\"big\", \"small\"],\n data=[\n [45, 30],\n [200, 100],\n [1.5, 1],\n [30, 20],\n [250, 150],\n [1.5, 0.8],\n [320, 250],\n [1, 0.8],\n [0.3, 0.2],\n ],\n )\n with warns_that_defaulting_to_pandas():\n df.drop(index=\"length\", level=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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_api_equivalence_test_drop_api_equivalence.None_2.modin_df_drop_axis_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_api_equivalence_test_drop_api_equivalence.None_2.modin_df_drop_axis_1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 962, "end_line": 995, "span_ids": ["test_drop_api_equivalence"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_drop_api_equivalence():\n # equivalence of the labels/axis and index/columns API's\n frame_data = [[1, 2, 3], [3, 4, 5], [5, 6, 7]]\n\n modin_df = pd.DataFrame(frame_data, index=[\"a\", \"b\", \"c\"], columns=[\"d\", \"e\", \"f\"])\n\n modin_df1 = modin_df.drop(\"a\")\n modin_df2 = modin_df.drop(index=\"a\")\n df_equals(modin_df1, modin_df2)\n\n modin_df1 = modin_df.drop(\"d\", axis=1)\n modin_df2 = modin_df.drop(columns=\"d\")\n df_equals(modin_df1, modin_df2)\n\n modin_df1 = modin_df.drop(labels=\"e\", axis=1)\n modin_df2 = modin_df.drop(columns=\"e\")\n df_equals(modin_df1, modin_df2)\n\n modin_df1 = modin_df.drop([\"a\"], axis=0)\n modin_df2 = modin_df.drop(index=[\"a\"])\n df_equals(modin_df1, modin_df2)\n\n modin_df1 = modin_df.drop([\"a\"], axis=0).drop([\"d\"], axis=1)\n modin_df2 = modin_df.drop(index=[\"a\"], columns=[\"d\"])\n df_equals(modin_df1, modin_df2)\n\n with pytest.raises(ValueError):\n modin_df.drop(labels=\"a\", index=\"b\")\n\n with pytest.raises(ValueError):\n modin_df.drop(labels=\"a\", columns=\"b\")\n\n with pytest.raises(ValueError):\n modin_df.drop(axis=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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_transpose_test_drop_transpose.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_transpose_test_drop_transpose.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 998, "end_line": 1012, "span_ids": ["test_drop_transpose"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_drop_transpose(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_result = modin_df.T.drop(columns=[0, 1, 2])\n pandas_result = pandas_df.T.drop(columns=[0, 1, 2])\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.T.drop(index=[\"col3\", \"col1\"])\n pandas_result = pandas_df.T.drop(index=[\"col3\", \"col1\"])\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.T.drop(columns=[0, 1, 2], index=[\"col3\", \"col1\"])\n pandas_result = pandas_df.T.drop(columns=[0, 1, 2], index=[\"col3\", \"col1\"])\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_droplevel_test_droplevel.df_droplevel_level_2_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_droplevel_test_droplevel.df_droplevel_level_2_a", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1015, "end_line": 1025, "span_ids": ["test_droplevel"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_droplevel():\n df = (\n pd.DataFrame([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]])\n .set_index([0, 1])\n .rename_axis([\"a\", \"b\"])\n )\n df.columns = pd.MultiIndex.from_tuples(\n [(\"c\", \"e\"), (\"d\", \"f\")], names=[\"level_1\", \"level_2\"]\n )\n df.droplevel(\"a\")\n df.droplevel(\"level_2\", axis=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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_test_drop_duplicates.None_1.else_.df_equals_modin_results_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_test_drop_duplicates.None_1.else_.df_equals_modin_results_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1028, "end_line": 1076, "span_ids": ["test_drop_duplicates"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"data\", test_data_with_duplicates_values, ids=test_data_with_duplicates_keys\n)\n@pytest.mark.parametrize(\n \"keep\", [\"last\", \"first\", False], ids=[\"last\", \"first\", \"False\"]\n)\n@pytest.mark.parametrize(\n \"subset\",\n [None, \"col1\", \"name\", (\"col1\", \"col3\"), [\"col1\", \"col3\", \"col7\"]],\n ids=[\"None\", \"string\", \"name\", \"tuple\", \"list\"],\n)\n@pytest.mark.parametrize(\"ignore_index\", [True, False], ids=[\"True\", \"False\"])\ndef test_drop_duplicates(data, keep, subset, ignore_index):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_df.drop_duplicates(\n keep=keep, inplace=False, subset=subset, ignore_index=ignore_index\n )\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.drop_duplicates(\n keep=keep, inplace=False, subset=subset, ignore_index=ignore_index\n )\n else:\n df_equals(\n pandas_df.drop_duplicates(\n keep=keep, inplace=False, subset=subset, ignore_index=ignore_index\n ),\n modin_df.drop_duplicates(\n keep=keep, inplace=False, subset=subset, ignore_index=ignore_index\n ),\n )\n\n try:\n pandas_results = pandas_df.drop_duplicates(\n keep=keep, inplace=True, subset=subset, ignore_index=ignore_index\n )\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.drop_duplicates(\n keep=keep, inplace=True, subset=subset, ignore_index=ignore_index\n )\n else:\n modin_results = modin_df.drop_duplicates(\n keep=keep, inplace=True, subset=subset, ignore_index=ignore_index\n )\n df_equals(modin_results, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_with_missing_index_values_test_drop_duplicates_with_missing_index_values.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_with_missing_index_values_test_drop_duplicates_with_missing_index_values.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1079, "end_line": 1154, "span_ids": ["test_drop_duplicates_with_missing_index_values"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_drop_duplicates_with_missing_index_values():\n data = {\n \"columns\": [\"value\", \"time\", \"id\"],\n \"index\": [\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n ],\n \"data\": [\n [\"3\", 1279213398000.0, 88.0],\n [\"3\", 1279204682000.0, 88.0],\n [\"0\", 1245772835000.0, 448.0],\n [\"0\", 1270564258000.0, 32.0],\n [\"0\", 1267106669000.0, 118.0],\n [\"7\", 1300621123000.0, 5.0],\n [\"0\", 1251130752000.0, 957.0],\n [\"0\", 1311683506000.0, 62.0],\n [\"9\", 1283692698000.0, 89.0],\n [\"9\", 1270234253000.0, 64.0],\n [\"0\", 1285088818000.0, 50.0],\n [\"0\", 1218212725000.0, 695.0],\n [\"2\", 1383933968000.0, 348.0],\n [\"0\", 1368227625000.0, 257.0],\n [\"1\", 1454514093000.0, 446.0],\n [\"1\", 1428497427000.0, 134.0],\n [\"1\", 1459184936000.0, 568.0],\n [\"1\", 1502293302000.0, 599.0],\n [\"1\", 1491833358000.0, 829.0],\n [\"1\", 1485431534000.0, 806.0],\n [\"8\", 1351800505000.0, 101.0],\n [\"0\", 1357247721000.0, 916.0],\n [\"0\", 1335804423000.0, 370.0],\n [\"24\", 1327547726000.0, 720.0],\n [\"0\", 1332334140000.0, 415.0],\n [\"0\", 1309543100000.0, 30.0],\n [\"18\", 1309541141000.0, 30.0],\n [\"0\", 1298979435000.0, 48.0],\n [\"14\", 1276098160000.0, 59.0],\n [\"0\", 1233936302000.0, 109.0],\n ],\n }\n\n pandas_df = pandas.DataFrame(\n data[\"data\"], index=data[\"index\"], columns=data[\"columns\"]\n )\n modin_df = pd.DataFrame(data[\"data\"], index=data[\"index\"], columns=data[\"columns\"])\n modin_result = modin_df.sort_values([\"id\", \"time\"]).drop_duplicates([\"id\"])\n pandas_result = pandas_df.sort_values([\"id\", \"time\"]).drop_duplicates([\"id\"])\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_after_sort_test_drop_duplicates_with_repeated_index_values.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_drop_duplicates_after_sort_test_drop_duplicates_with_repeated_index_values.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1157, "end_line": 1177, "span_ids": ["test_drop_duplicates_with_repeated_index_values", "test_drop_duplicates_after_sort"], "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_drop_duplicates_after_sort():\n data = [\n {\"value\": 1, \"time\": 2},\n {\"value\": 1, \"time\": 1},\n {\"value\": 2, \"time\": 1},\n {\"value\": 2, \"time\": 2},\n ]\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_result = modin_df.sort_values([\"value\", \"time\"]).drop_duplicates([\"value\"])\n pandas_result = pandas_df.sort_values([\"value\", \"time\"]).drop_duplicates([\"value\"])\n df_equals(modin_result, pandas_result)\n\n\ndef test_drop_duplicates_with_repeated_index_values():\n # This tests for issue #4467: https://github.com/modin-project/modin/issues/4467\n data = [[0], [1], [0]]\n index = [0, 0, 0]\n modin_df, pandas_df = create_test_dfs(data, index=index)\n eval_general(modin_df, pandas_df, lambda df: df.drop_duplicates())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_test_dropna.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_test_dropna.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1180, "end_line": 1198, "span_ids": ["test_dropna"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"how\", [\"any\", \"all\"], ids=[\"any\", \"all\"])\ndef test_dropna(data, axis, how):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n with pytest.raises(ValueError):\n modin_df.dropna(axis=axis, how=\"invalid\")\n\n with pytest.raises(TypeError):\n modin_df.dropna(axis=axis, how=None, thresh=None)\n\n with pytest.raises(KeyError):\n modin_df.dropna(axis=axis, subset=[\"NotExists\"], how=how)\n\n modin_result = modin_df.dropna(axis=axis, how=how)\n pandas_result = pandas_df.dropna(axis=axis, how=how)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_inplace_test_dropna_multiple_axes.None_1.modin_df_dropna_how_all_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_inplace_test_dropna_multiple_axes.None_1.modin_df_dropna_how_all_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1201, "end_line": 1229, "span_ids": ["test_dropna_inplace", "test_dropna_multiple_axes"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dropna_inplace(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n pandas_result = pandas_df.dropna()\n modin_df.dropna(inplace=True)\n df_equals(modin_df, pandas_result)\n\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n pandas_df.dropna(thresh=2, inplace=True)\n modin_df.dropna(thresh=2, inplace=True)\n df_equals(modin_df, pandas_df)\n\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n pandas_df.dropna(axis=1, how=\"any\", inplace=True)\n modin_df.dropna(axis=1, how=\"any\", inplace=True)\n df_equals(modin_df, pandas_df)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dropna_multiple_axes(data):\n modin_df = pd.DataFrame(data)\n\n with pytest.raises(TypeError):\n modin_df.dropna(how=\"all\", axis=[0, 1])\n with pytest.raises(TypeError):\n modin_df.dropna(how=\"all\", axis=(0, 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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_subset_test_dropna_subset.if_empty_data_not_in_re.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_subset_test_dropna_subset.if_empty_data_not_in_re.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1232, "end_line": 1256, "span_ids": ["test_dropna_subset"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dropna_subset(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if \"empty_data\" not in request.node.name:\n column_subset = modin_df.columns[0:2]\n df_equals(\n modin_df.dropna(how=\"all\", subset=column_subset),\n pandas_df.dropna(how=\"all\", subset=column_subset),\n )\n df_equals(\n modin_df.dropna(how=\"any\", subset=column_subset),\n pandas_df.dropna(how=\"any\", subset=column_subset),\n )\n\n row_subset = modin_df.index[0:2]\n df_equals(\n modin_df.dropna(how=\"all\", axis=1, subset=row_subset),\n pandas_df.dropna(how=\"all\", axis=1, subset=row_subset),\n )\n df_equals(\n modin_df.dropna(how=\"any\", axis=1, subset=row_subset),\n pandas_df.dropna(how=\"any\", axis=1, subset=row_subset),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_subset_error_test_insert_loc.eval_insert_modin_df_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_dropna_subset_error_test_insert_loc.eval_insert_modin_df_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1259, "end_line": 1287, "span_ids": ["test_insert_dtypes", "test_dropna_subset_error", "test_insert_loc"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis,subset\", [(0, list(\"EF\")), (1, [4, 5])])\ndef test_dropna_subset_error(data, axis, subset):\n eval_general(*create_test_dfs(data), lambda df: df.dropna(axis=axis, subset=subset))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"astype\", [\"category\", \"int32\", \"float\"])\ndef test_insert_dtypes(data, astype):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n # categories with NaN works incorrect for now\n if astype == \"category\" and pandas_df.iloc[:, 0].isnull().any():\n return\n\n eval_insert(\n modin_df,\n pandas_df,\n col=\"TypeSaver\",\n value=lambda df: df.iloc[:, 0].astype(astype),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"loc\", int_arg_values, ids=arg_keys(\"loc\", int_arg_keys))\ndef test_insert_loc(data, loc):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n eval_insert(modin_df, pandas_df, loc=loc, value=lambda df: df.iloc[:, 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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_insert_test_insert.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_insert_test_insert.None_10", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1290, "end_line": 1349, "span_ids": ["test_insert"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_insert(data):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n eval_insert(\n modin_df, pandas_df, col=\"Duplicate\", value=lambda df: df[df.columns[0]]\n )\n eval_insert(modin_df, pandas_df, col=\"Scalar\", value=100)\n eval_insert(\n pd.DataFrame(columns=list(\"ab\")),\n pandas.DataFrame(columns=list(\"ab\")),\n col=lambda df: df.columns[0],\n value=lambda df: df[df.columns[0]],\n )\n eval_insert(\n pd.DataFrame(index=modin_df.index),\n pandas.DataFrame(index=pandas_df.index),\n col=lambda df: df.columns[0],\n value=lambda df: df[df.columns[0]],\n )\n eval_insert(\n modin_df,\n pandas_df,\n col=\"DataFrame insert\",\n value=lambda df: df[[df.columns[0]]],\n )\n eval_insert(\n modin_df,\n pandas_df,\n col=\"Different indices\",\n value=lambda df: df[[df.columns[0]]].set_index(df.index[::-1]),\n )\n eval_insert(\n modin_df,\n pandas_df,\n col=\"2d list insert\",\n value=lambda df: [[1, 2]] * len(df),\n )\n\n # Bad inserts\n eval_insert(modin_df, pandas_df, col=\"Bad Column\", value=lambda df: df)\n eval_insert(\n modin_df,\n pandas_df,\n col=\"Too Short\",\n value=lambda df: list(df[df.columns[0]])[:-1],\n )\n eval_insert(\n modin_df,\n pandas_df,\n col=lambda df: df.columns[0],\n value=lambda df: df[df.columns[0]],\n )\n eval_insert(\n modin_df,\n pandas_df,\n loc=lambda df: len(df.columns) + 100,\n col=\"Bad Loc\",\n value=100,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_insert_4407_test_insert_4407.for_idx_value_in_enumera.eval_insert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_insert_4407_test_insert_4407.for_idx_value_in_enumera.eval_insert_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1352, "end_line": 1370, "span_ids": ["test_insert_4407"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_insert_4407():\n data = {\"col1\": [1, 2, 3], \"col2\": [2, 3, 4]}\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n def comparator(df1, df2):\n assert_series_equal(df1.dtypes, df2.dtypes, check_index=False)\n return df_equals(df1, df2)\n\n for idx, value in enumerate(\n (pandas_df.to_numpy(), np.array([[1]] * 3), np.array([[1, 2, 3], [4, 5, 6]]))\n ):\n eval_insert(\n modin_df,\n pandas_df,\n loc=0,\n col=f\"test_col{idx}\",\n value=value,\n comparator=lambda df1, df2: comparator(df1, df2),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_ndim_test_round.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_ndim_test_round.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1373, "end_line": 1403, "span_ids": ["test_ndim", "test_notna", "test_notnull", "test_round"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ndim(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n assert modin_df.ndim == pandas_df.ndim\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_notna(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.notna(), pandas_df.notna())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_notnull(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.notnull(), pandas_df.notnull())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_round(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.round(), pandas_df.round())\n df_equals(modin_df.round(1), pandas_df.round(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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_set_axis_test_set_axis.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_set_axis_test_set_axis.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1406, "end_line": 1432, "span_ids": ["test_set_axis"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\ndef test_set_axis(data, axis):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n x = pandas.DataFrame()._get_axis_number(axis)\n index = modin_df.columns if x else modin_df.index\n labels = [\"{0}_{1}\".format(index[i], i) for i in range(modin_df.shape[x])]\n\n eval_general(\n modin_df, pandas_df, lambda df: df.set_axis(labels, axis=axis, copy=True)\n )\n\n modin_df_copy = modin_df.copy()\n modin_df = modin_df.set_axis(labels, axis=axis, copy=False)\n\n # Check that the copy and original are different\n try:\n df_equals(modin_df, modin_df_copy)\n except AssertionError:\n assert True\n else:\n assert False\n\n pandas_df = pandas_df.set_axis(labels, axis=axis)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_set_index_test_size.assert_modin_df_size_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_set_index_test_size.assert_modin_df_size_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1435, "end_line": 1480, "span_ids": ["test_set_index", "test_shape", "test_size"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"drop\", bool_arg_values, ids=arg_keys(\"drop\", bool_arg_keys))\n@pytest.mark.parametrize(\n \"append\", bool_arg_values, ids=arg_keys(\"append\", bool_arg_keys)\n)\ndef test_set_index(request, data, drop, append):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if \"empty_data\" not in request.node.name:\n key = modin_df.columns[0]\n modin_result = modin_df.set_index(key, drop=drop, append=append, inplace=False)\n pandas_result = pandas_df.set_index(\n key, drop=drop, append=append, inplace=False\n )\n df_equals(modin_result, pandas_result)\n\n modin_df_copy = modin_df.copy()\n modin_df.set_index(key, drop=drop, append=append, inplace=True)\n\n # Check that the copy and original are different\n try:\n df_equals(modin_df, modin_df_copy)\n except AssertionError:\n assert True\n else:\n assert False\n\n pandas_df.set_index(key, drop=drop, append=append, inplace=True)\n df_equals(modin_df, pandas_df)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_shape(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n assert modin_df.shape == pandas_df.shape\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_size(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n assert modin_df.size == pandas_df.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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_squeeze_test_squeeze.df_equals_df_iloc_0_pf_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_squeeze_test_squeeze.df_equals_df_iloc_0_pf_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1483, "end_line": 1535, "span_ids": ["test_squeeze"], "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": "def test_squeeze():\n frame_data = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col4\": [12, 13, 14, 15],\n \"col5\": [0, 0, 0, 0],\n }\n frame_data_2 = {\"col1\": [0, 1, 2, 3]}\n frame_data_3 = {\n \"col1\": [0],\n \"col2\": [4],\n \"col3\": [8],\n \"col4\": [12],\n \"col5\": [0],\n }\n frame_data_4 = {\"col1\": [2]}\n frame_data_5 = {\"col1\": [\"string\"]}\n # Different data for different cases\n pandas_df = pandas.DataFrame(frame_data).squeeze()\n modin_df = pd.DataFrame(frame_data).squeeze()\n df_equals(modin_df, pandas_df)\n\n pandas_df_2 = pandas.DataFrame(frame_data_2).squeeze()\n modin_df_2 = pd.DataFrame(frame_data_2).squeeze()\n df_equals(modin_df_2, pandas_df_2)\n\n pandas_df_3 = pandas.DataFrame(frame_data_3).squeeze()\n modin_df_3 = pd.DataFrame(frame_data_3).squeeze()\n df_equals(modin_df_3, pandas_df_3)\n\n pandas_df_4 = pandas.DataFrame(frame_data_4).squeeze()\n modin_df_4 = pd.DataFrame(frame_data_4).squeeze()\n df_equals(modin_df_4, pandas_df_4)\n\n pandas_df_5 = pandas.DataFrame(frame_data_5).squeeze()\n modin_df_5 = pd.DataFrame(frame_data_5).squeeze()\n df_equals(modin_df_5, pandas_df_5)\n\n data = [\n [\n pd.Timestamp(\"2019-01-02\"),\n pd.Timestamp(\"2019-01-03\"),\n pd.Timestamp(\"2019-01-04\"),\n pd.Timestamp(\"2019-01-05\"),\n ],\n [1, 1, 1, 2],\n ]\n df = pd.DataFrame(data, index=[\"date\", \"value\"]).T\n pf = pandas.DataFrame(data, index=[\"date\", \"value\"]).T\n df.set_index(\"date\", inplace=True)\n pf.set_index(\"date\", inplace=True)\n df_equals(df.iloc[0], pf.iloc[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_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_transpose_test_transpose.df_equals_modin_df_T_notn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_transpose_test_transpose.df_equals_modin_df_T_notn", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1538, "end_line": 1551, "span_ids": ["test_transpose"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_transpose(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.T, pandas_df.T)\n df_equals(modin_df.transpose(), pandas_df.transpose())\n\n # Test for map across full axis for select indices\n df_equals(modin_df.T.dropna(), pandas_df.T.dropna())\n # Test for map across full axis\n df_equals(modin_df.T.nunique(), pandas_df.T.nunique())\n # Test for map across blocks\n df_equals(modin_df.T.notna(), pandas_df.T.notna())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_update_test_update.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_update_test_update.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1554, "end_line": 1585, "span_ids": ["test_update"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data, other_data\",\n [\n ({\"A\": [1, 2, 3], \"B\": [400, 500, 600]}, {\"B\": [4, 5, 6], \"C\": [7, 8, 9]}),\n (\n {\"A\": [\"a\", \"b\", \"c\"], \"B\": [\"x\", \"y\", \"z\"]},\n {\"B\": [\"d\", \"e\", \"f\", \"g\", \"h\", \"i\"]},\n ),\n ({\"A\": [1, 2, 3], \"B\": [400, 500, 600]}, {\"B\": [4, np.nan, 6]}),\n ],\n)\n@pytest.mark.parametrize(\n \"raise_errors\", bool_arg_values, ids=arg_keys(\"raise_errors\", bool_arg_keys)\n)\ndef test_update(data, other_data, raise_errors):\n modin_df, pandas_df = create_test_dfs(data)\n other_modin_df, other_pandas_df = create_test_dfs(other_data)\n\n if raise_errors:\n kwargs = {\"errors\": \"raise\"}\n else:\n kwargs = {}\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.update(other_modin_df)\n if isinstance(df, pd.DataFrame)\n else df.update(other_pandas_df),\n __inplace__=True,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___neg___test___hash__.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___neg___test___hash__.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1588, "end_line": 1621, "span_ids": ["test___hash__", "test___invert__", "test___neg__"], "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(\"data\", test_data_values, ids=test_data_keys)\ndef test___neg__(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = pandas_df.__neg__()\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.__neg__()\n else:\n modin_result = modin_df.__neg__()\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___invert__(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n try:\n pandas_result = ~pandas_df\n except Exception as err:\n with pytest.raises(type(err)):\n repr(~modin_df)\n else:\n modin_result = ~modin_df\n df_equals(modin_result, pandas_result)\n\n\ndef test___hash__():\n data = test_data_values[0]\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n eval_general(modin_df, pandas_df, hash)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___delitem___test___delitem__.if_empty_data_not_in_re.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___delitem___test___delitem__.if_empty_data_not_in_re.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1624, "end_line": 1642, "span_ids": ["test___delitem__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___delitem__(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if \"empty_data\" not in request.node.name:\n key = pandas_df.columns[0]\n\n modin_df = modin_df.copy()\n pandas_df = pandas_df.copy()\n modin_df.__delitem__(key)\n pandas_df.__delitem__(key)\n df_equals(modin_df, pandas_df)\n\n # Issue 2027\n last_label = pandas_df.iloc[:, -1].name\n modin_df.__delitem__(last_label)\n pandas_df.__delitem__(last_label)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___nonzero___test___round__.eval_general_pd_DataFrame": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test___nonzero___test___round__.eval_general_pd_DataFrame", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1645, "end_line": 1671, "span_ids": ["test___abs__", "test___round__", "test___nonzero__"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___nonzero__(data):\n modin_df = pd.DataFrame(data)\n\n with pytest.raises(ValueError):\n # Always raises ValueError\n modin_df.__nonzero__()\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___abs__(request, data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = abs(pandas_df)\n except Exception as err:\n with pytest.raises(type(err)):\n abs(modin_df)\n else:\n modin_result = abs(modin_df)\n df_equals(modin_result, pandas_result)\n\n\ndef test___round__():\n data = test_data_values[0]\n eval_general(pd.DataFrame(data), pandas.DataFrame(data), lambda df: df.__round__())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_from_modin_series_test_constructor_from_modin_series.df_equals_new_modin_new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_from_modin_series_test_constructor_from_modin_series.df_equals_new_modin_new_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1674, "end_line": 1708, "span_ids": ["test_constructor_from_modin_series"], "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": "@pytest.mark.parametrize(\n \"get_index\",\n [\n pytest.param(lambda idx: None, id=\"None_idx\"),\n pytest.param(lambda idx: [\"a\", \"b\", \"c\"], id=\"No_intersection_idx\"),\n pytest.param(lambda idx: idx, id=\"Equal_idx\"),\n pytest.param(lambda idx: idx[::-1], id=\"Reversed_idx\"),\n ],\n)\n@pytest.mark.parametrize(\n \"get_columns\",\n [\n pytest.param(lambda idx: None, id=\"None_idx\"),\n pytest.param(lambda idx: [\"a\", \"b\", \"c\"], id=\"No_intersection_idx\"),\n pytest.param(lambda idx: idx, id=\"Equal_idx\"),\n pytest.param(lambda idx: idx[::-1], id=\"Reversed_idx\"),\n ],\n)\n@pytest.mark.parametrize(\"dtype\", [None, \"str\"])\ndef test_constructor_from_modin_series(get_index, get_columns, dtype):\n modin_df, pandas_df = create_test_dfs(test_data_values[0])\n\n modin_data = {f\"new_col{i}\": modin_df.iloc[:, i] for i in range(modin_df.shape[1])}\n pandas_data = {\n f\"new_col{i}\": pandas_df.iloc[:, i] for i in range(pandas_df.shape[1])\n }\n\n index = get_index(modin_df.index)\n columns = get_columns(list(modin_data.keys()))\n\n new_modin = pd.DataFrame(modin_data, index=index, columns=columns, dtype=dtype)\n new_pandas = pandas.DataFrame(\n pandas_data, index=index, columns=columns, dtype=dtype\n )\n df_equals(new_modin, new_pandas)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_test_constructor.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_test_constructor.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1711, "end_line": 1719, "span_ids": ["test_constructor"], "tokens": 102}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_constructor(data):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(data)\n df_equals(pandas_df, modin_df)\n\n pandas_df = pandas.DataFrame({k: pandas.Series(v) for k, v in data.items()})\n modin_df = pd.DataFrame({k: pd.Series(v) for k, v in data.items()})\n df_equals(pandas_df, modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_dtypes_test_constructor_dtypes.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_dtypes_test_constructor_dtypes.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1722, "end_line": 1736, "span_ids": ["test_constructor_dtypes"], "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": "@pytest.mark.parametrize(\n \"data\",\n [\n np.arange(1, 10000, dtype=np.float32),\n [\n pd.Series([1, 2, 3], dtype=\"int32\"),\n pandas.Series([4, 5, 6], dtype=\"int64\"),\n np.array([7, 8, 9], dtype=np.float32),\n ],\n pandas.Categorical([1, 2, 3, 4, 5]),\n ],\n)\ndef test_constructor_dtypes(data):\n modin_df, pandas_df = create_test_dfs(data)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_columns_and_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_map_metadata.py_test_constructor_columns_and_index_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_map_metadata.py", "file_name": "test_map_metadata.py", "file_type": "text/x-python", "category": "test", "start_line": 1739, "end_line": 1782, "span_ids": ["test_constructor_columns_and_index", "test_constructor_from_index"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_constructor_columns_and_index():\n modin_df = pd.DataFrame(\n [[1, 1, 10], [2, 4, 20], [3, 7, 30]],\n index=[1, 2, 3],\n columns=[\"id\", \"max_speed\", \"health\"],\n )\n pandas_df = pandas.DataFrame(\n [[1, 1, 10], [2, 4, 20], [3, 7, 30]],\n index=[1, 2, 3],\n columns=[\"id\", \"max_speed\", \"health\"],\n )\n df_equals(modin_df, pandas_df)\n df_equals(pd.DataFrame(modin_df), pandas.DataFrame(pandas_df))\n df_equals(\n pd.DataFrame(modin_df, columns=[\"max_speed\", \"health\"]),\n pandas.DataFrame(pandas_df, columns=[\"max_speed\", \"health\"]),\n )\n df_equals(\n pd.DataFrame(modin_df, index=[1, 2]),\n pandas.DataFrame(pandas_df, index=[1, 2]),\n )\n df_equals(\n pd.DataFrame(modin_df, index=[1, 2], columns=[\"health\"]),\n pandas.DataFrame(pandas_df, index=[1, 2], columns=[\"health\"]),\n )\n df_equals(\n pd.DataFrame(modin_df.iloc[:, 0], index=[1, 2, 3]),\n pandas.DataFrame(pandas_df.iloc[:, 0], index=[1, 2, 3]),\n )\n df_equals(\n pd.DataFrame(modin_df.iloc[:, 0], columns=[\"NO_EXIST\"]),\n pandas.DataFrame(pandas_df.iloc[:, 0], columns=[\"NO_EXIST\"]),\n )\n with pytest.raises(NotImplementedError):\n pd.DataFrame(modin_df, index=[1, 2, 99999])\n with pytest.raises(NotImplementedError):\n pd.DataFrame(modin_df, columns=[\"NO_EXIST\"])\n\n\ndef test_constructor_from_index():\n data = pd.Index([1, 2, 3], name=\"pricing_date\")\n modin_df, pandas_df = create_test_dfs(data)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_pickle.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_pickle.py_pytest_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 58, "span_ids": ["persistent", "modin_column", "test_dataframe_pickle", "modin_df", "docstring", "test_column_pickle"], "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 pytest\nimport pickle\nimport numpy as np\n\nimport modin.pandas as pd\nfrom modin.config import PersistentPickle\n\nfrom modin.pandas.test.utils import df_equals\n\n\n@pytest.fixture\ndef modin_df():\n return pd.DataFrame({\"col1\": np.arange(1000), \"col2\": np.arange(2000, 3000)})\n\n\n@pytest.fixture\ndef modin_column(modin_df):\n return modin_df[\"col1\"]\n\n\n@pytest.fixture(params=[True, False])\ndef persistent(request):\n old = PersistentPickle.get()\n PersistentPickle.put(request.param)\n yield request.param\n PersistentPickle.put(old)\n\n\n@pytest.mark.parametrize(\n \"modin_df\", [pytest.param(modin_df), pytest.param(pd.DataFrame(), id=\"empty_df\")]\n)\ndef test_dataframe_pickle(modin_df, persistent):\n other = pickle.loads(pickle.dumps(modin_df))\n df_equals(modin_df, other)\n\n\ndef test_column_pickle(modin_column, modin_df, persistent):\n dmp = pickle.dumps(modin_column)\n other = pickle.loads(dmp)\n df_equals(modin_column.to_frame(), other.to_frame())\n\n # make sure we don't pickle the whole frame if doing persistent storage\n if persistent:\n assert len(dmp) < len(pickle.dumps(modin_df))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_pytest_pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_pytest_pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 52, "span_ids": ["docstring"], "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": "import pytest\nimport numpy as np\nimport pandas\nimport matplotlib\nfrom pandas._testing import assert_series_equal\n\nimport modin.pandas as pd\n\nfrom modin.pandas.test.utils import (\n df_equals,\n arg_keys,\n test_data,\n test_data_values,\n test_data_keys,\n axis_keys,\n axis_values,\n bool_arg_keys,\n bool_arg_values,\n int_arg_keys,\n int_arg_values,\n eval_general,\n create_test_dfs,\n test_data_diff_dtype,\n df_equals_with_non_stable_indices,\n test_data_large_categorical_dataframe,\n default_to_pandas_ignore_string,\n assert_dtypes_equal,\n)\nfrom modin.config import NPartitions, StorageFormat\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_all_any_test_all_any.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_all_any_test_all_any.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 68, "span_ids": ["test_all_any"], "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": "@pytest.mark.parametrize(\"method\", [\"all\", \"any\"])\n@pytest.mark.parametrize(\"is_transposed\", [False, True])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"data\", [test_data[\"float_nan_data\"]])\ndef test_all_any(data, axis, skipna, is_transposed, method):\n eval_general(\n *create_test_dfs(data),\n lambda df: getattr((df.T if is_transposed else df), method)(\n axis=axis, skipna=skipna, bool_only=None\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_all_any_specific_test_describe.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_all_any_specific_test_describe.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 122, "span_ids": ["test_all_any_specific", "test_describe", "test_count", "test_count_specific", "test_count_dtypes"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"method\", [\"all\", \"any\"])\n@pytest.mark.parametrize(\n \"bool_only\", bool_arg_values, ids=arg_keys(\"bool_only\", bool_arg_keys)\n)\ndef test_all_any_specific(bool_only, method):\n eval_general(\n *create_test_dfs(test_data_diff_dtype),\n lambda df: getattr(df, method)(bool_only=bool_only),\n )\n\n\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\n \"data\", [test_data[\"float_nan_data\"], test_data_large_categorical_dataframe]\n)\ndef test_count(data, axis):\n eval_general(\n *create_test_dfs(data),\n lambda df: df.count(axis=axis),\n )\n\n\n@pytest.mark.parametrize(\"numeric_only\", [True, False, None])\ndef test_count_specific(numeric_only):\n eval_general(\n *create_test_dfs(test_data_diff_dtype),\n lambda df: df.count(numeric_only=numeric_only),\n )\n\n\n@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/513\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_count_dtypes(data):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.isna().count(axis=0),\n )\n\n\n@pytest.mark.parametrize(\"percentiles\", [None, 0.10, 0.11, 0.44, 0.78, 0.99])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_describe(data, percentiles):\n eval_general(\n *create_test_dfs(data),\n lambda df: df.describe(percentiles=percentiles),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_2195_test_2195.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_2195_test_2195.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 141, "span_ids": ["test_2195"], "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": "@pytest.mark.parametrize(\"has_numeric_column\", [False, True])\ndef test_2195(has_numeric_column):\n data = {\n \"categorical\": pd.Categorical([\"d\"] * 10**2),\n \"date\": [np.datetime64(\"2000-01-01\")] * 10**2,\n }\n\n if has_numeric_column:\n data.update({\"numeric\": [5] * 10**2})\n\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.describe(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py__Issue_https_github_c_test_describe_column_partition_has_different_index.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py__Issue_https_github_c_test_describe_column_partition_has_different_index.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 151, "span_ids": ["test_describe_column_partition_has_different_index", "test_2195"], "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": "# Issue: https://github.com/modin-project/modin/issues/4641\ndef test_describe_column_partition_has_different_index():\n pandas_df = pandas.DataFrame(test_data[\"int_data\"])\n # We add a string column to test the case where partitions with mixed data\n # types have different 'describe' rows, which causes an index mismatch.\n pandas_df[\"string_column\"] = \"abc\"\n modin_df = pd.DataFrame(pandas_df)\n eval_general(modin_df, pandas_df, lambda df: df.describe(include=\"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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_specific_test_describe_specific.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_specific_test_describe_specific.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 170, "span_ids": ["test_describe_specific"], "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": "@pytest.mark.parametrize(\n \"exclude,include\",\n [\n ([np.float64], None),\n (np.float64, None),\n (None, [np.timedelta64, np.datetime64, np.object_, np.bool_]),\n (None, \"all\"),\n (None, np.number),\n ],\n)\ndef test_describe_specific(exclude, include):\n eval_general(\n *create_test_dfs(test_data_diff_dtype),\n lambda df: df.drop(\"str_col\", axis=1).describe(\n exclude=exclude, include=include\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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_str_test_describe_str.try_.except_AssertionError_.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_str_test_describe_str.try_.except_AssertionError_.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 187, "span_ids": ["test_describe_str"], "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": "@pytest.mark.parametrize(\"data\", [test_data[\"int_data\"]])\ndef test_describe_str(data):\n modin_df = pd.DataFrame(data).applymap(str)\n pandas_df = pandas.DataFrame(data).applymap(str)\n\n try:\n df_equals(modin_df.describe(), pandas_df.describe())\n except AssertionError:\n # We have to do this because we choose the highest count slightly differently\n # than pandas. Because there is no true guarantee which one will be first,\n # If they don't match, make sure that the `freq` is the same at least.\n df_equals(\n modin_df.describe().loc[[\"count\", \"unique\", \"freq\"]],\n pandas_df.describe().loc[[\"count\", \"unique\", \"freq\"]],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_dtypes_test_idxmin_idxmax.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_describe_dtypes_test_idxmin_idxmax.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 190, "end_line": 213, "span_ids": ["test_describe_dtypes", "test_idxmin_idxmax"], "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_describe_dtypes():\n data = {\n \"col1\": list(\"abc\"),\n \"col2\": list(\"abc\"),\n \"col3\": list(\"abc\"),\n \"col4\": [1, 2, 3],\n }\n eval_general(*create_test_dfs(data), lambda df: df.describe())\n\n\n@pytest.mark.parametrize(\"method\", [\"idxmin\", \"idxmax\"])\n@pytest.mark.parametrize(\"is_transposed\", [False, True])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"data\", [test_data[\"float_nan_data\"]])\ndef test_idxmin_idxmax(data, axis, skipna, is_transposed, method):\n eval_general(\n *create_test_dfs(data),\n lambda df: getattr((df.T if is_transposed else df), method)(\n axis=axis, skipna=skipna\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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_last_valid_index_test_memory_usage.eval_general_create_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_last_valid_index_test_memory_usage.eval_general_create_test", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 225, "span_ids": ["test_memory_usage", "test_last_valid_index"], "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(\"data\", test_data_values, ids=test_data_keys)\ndef test_last_valid_index(data):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n assert modin_df.last_valid_index() == pandas_df.last_valid_index()\n\n\n@pytest.mark.parametrize(\"index\", bool_arg_values, ids=arg_keys(\"index\", bool_arg_keys))\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_memory_usage(data, index):\n eval_general(*create_test_dfs(data), lambda df: df.memory_usage(index=index))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_min_max_mean_test_min_max_mean.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_min_max_mean_test_min_max_mean.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 228, "end_line": 244, "span_ids": ["test_min_max_mean"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"method\", [\"min\", \"max\", \"mean\"])\n@pytest.mark.parametrize(\"is_transposed\", [False, True])\n@pytest.mark.parametrize(\n \"numeric_only\", bool_arg_values, ids=arg_keys(\"numeric_only\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"data\", [test_data[\"float_nan_data\"]])\ndef test_min_max_mean(data, axis, skipna, numeric_only, is_transposed, method):\n eval_general(\n *create_test_dfs(data),\n lambda df: getattr((df.T if is_transposed else df), method)(\n axis=axis, skipna=skipna, numeric_only=numeric_only\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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_prod_test_prod.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_prod_test_prod.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 247, "end_line": 279, "span_ids": ["test_prod"], "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": "@pytest.mark.parametrize(\"method\", [\"prod\", \"product\"])\n@pytest.mark.parametrize(\"is_transposed\", [False, True])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"data\", [test_data[\"float_nan_data\"]])\ndef test_prod(\n data,\n axis,\n skipna,\n is_transposed,\n method,\n):\n eval_general(\n *create_test_dfs(data),\n lambda df, *args, **kwargs: getattr(df.T if is_transposed else df, method)(\n axis=axis,\n skipna=skipna,\n ),\n )\n\n # test for issue #1953\n arrays = [[\"1\", \"1\", \"2\", \"2\"], [\"1\", \"2\", \"3\", \"4\"]]\n modin_df = pd.DataFrame(\n [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]], index=arrays\n )\n pandas_df = pandas.DataFrame(\n [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]], index=arrays\n )\n modin_result = modin_df.prod()\n pandas_result = pandas_df.prod()\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_sum_test_sum.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_sum_test_sum.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 282, "end_line": 307, "span_ids": ["test_sum"], "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": "@pytest.mark.parametrize(\"is_transposed\", [False, True])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"data\", [test_data[\"float_nan_data\"]])\ndef test_sum(data, axis, skipna, is_transposed):\n eval_general(\n *create_test_dfs(data),\n lambda df: (df.T if is_transposed else df).sum(\n axis=axis,\n skipna=skipna,\n ),\n )\n\n # test for issue #1953\n arrays = [[\"1\", \"1\", \"2\", \"2\"], [\"1\", \"2\", \"3\", \"4\"]]\n modin_df = pd.DataFrame(\n [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]], index=arrays\n )\n pandas_df = pandas.DataFrame(\n [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]], index=arrays\n )\n modin_result = modin_df.sum()\n pandas_result = pandas_df.sum()\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_sum_prod_specific_test_sum_single_column.df_equals_modin_df_sum_ax": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_sum_prod_specific_test_sum_single_column.df_equals_modin_df_sum_ax", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 310, "end_line": 329, "span_ids": ["test_sum_prod_specific", "test_sum_single_column"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"fn\", [\"prod, sum\"])\n@pytest.mark.parametrize(\n \"numeric_only\", bool_arg_values, ids=arg_keys(\"numeric_only\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"min_count\", int_arg_values, ids=arg_keys(\"min_count\", int_arg_keys)\n)\ndef test_sum_prod_specific(fn, min_count, numeric_only):\n eval_general(\n *create_test_dfs(test_data_diff_dtype),\n lambda df: getattr(df, fn)(min_count=min_count, numeric_only=numeric_only),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_sum_single_column(data):\n modin_df = pd.DataFrame(data).iloc[:, [0]]\n pandas_df = pandas.DataFrame(data).iloc[:, [0]]\n df_equals(modin_df.sum(), pandas_df.sum())\n df_equals(modin_df.sum(axis=1), pandas_df.sum(axis=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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_reduce_specific_test_reduce_specific.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_reduce_specific_test_reduce_specific.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 332, "end_line": 343, "span_ids": ["test_reduce_specific"], "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": "@pytest.mark.parametrize(\n \"fn\", [\"max\", \"min\", \"median\", \"mean\", \"skew\", \"kurt\", \"sem\", \"std\", \"var\"]\n)\n@pytest.mark.parametrize(\"axis\", [0, 1, None])\n@pytest.mark.parametrize(\n \"numeric_only\", bool_arg_values, ids=arg_keys(\"numeric_only\", bool_arg_keys)\n)\ndef test_reduce_specific(fn, numeric_only, axis):\n eval_general(\n *create_test_dfs(test_data_diff_dtype),\n lambda df: getattr(df, fn)(numeric_only=numeric_only, axis=axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts_test_value_counts.comparator.if_sort_.else_.df_equals_md_res_sort_ind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts_test_value_counts.comparator.if_sort_.else_.df_equals_md_res_sort_ind", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 346, "end_line": 367, "span_ids": ["test_value_counts"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"subset_len\", [1, 2])\n@pytest.mark.parametrize(\"sort\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"normalize\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"dropna\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"ascending\", bool_arg_values, ids=bool_arg_keys)\ndef test_value_counts(subset_len, sort, normalize, dropna, ascending):\n def comparator(md_res, pd_res):\n if subset_len == 1:\n # 'pandas.DataFrame.value_counts' always returns frames with MultiIndex,\n # even when 'subset_len == 1' it returns MultiIndex with 'nlevels == 1'.\n # This behavior is expensive to mimic, so Modin 'value_counts' returns frame\n # with non-multi index in that case. That's why we flatten indices here.\n assert md_res.index.nlevels == pd_res.index.nlevels == 1\n for df in [md_res, pd_res]:\n df.index = df.index.get_level_values(0)\n\n if sort:\n # We sort indices for the result because of:\n # https://github.com/modin-project/modin/issues/1650\n df_equals_with_non_stable_indices(md_res, pd_res)\n else:\n df_equals(md_res.sort_index(), pd_res.sort_index())\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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts.data_test_value_counts.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts.data_test_value_counts.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 369, "end_line": 389, "span_ids": ["test_value_counts"], "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": "@pytest.mark.parametrize(\"subset_len\", [1, 2])\n@pytest.mark.parametrize(\"sort\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"normalize\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"dropna\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"ascending\", bool_arg_values, ids=bool_arg_keys)\ndef test_value_counts(subset_len, sort, normalize, dropna, ascending):\n # ... other code\n\n data = test_data_values[0]\n md_df, pd_df = create_test_dfs(data)\n # We're picking columns with different index signs to involve columns from different partitions\n subset = [pd_df.columns[-i if i % 2 else i] for i in range(subset_len)]\n\n eval_general(\n md_df,\n pd_df,\n lambda df: df.value_counts(\n subset=subset,\n sort=sort,\n normalize=normalize,\n dropna=dropna,\n ascending=ascending,\n ),\n comparator=comparator,\n # Modin's `sort_values` does not validate `ascending` type and so\n # does not raise an exception when it isn't a bool, when pandas do so,\n # visit modin-issue#3388 for more info.\n check_exception_type=None if sort and ascending is None else 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_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts_categorical_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_reduce.py_test_value_counts_categorical_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_reduce.py", "file_name": "test_reduce.py", "file_type": "text/x-python", "category": "test", "start_line": 392, "end_line": 420, "span_ids": ["test_value_counts_categorical"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_value_counts_categorical():\n # from issue #3571\n data = np.array([\"a\"] * 50000 + [\"b\"] * 10000 + [\"c\"] * 1000)\n random_state = np.random.RandomState(seed=42)\n random_state.shuffle(data)\n modin_df, pandas_df = create_test_dfs(\n {\"col1\": data, \"col2\": data}, dtype=\"category\"\n )\n\n if StorageFormat.get() == \"Hdk\":\n # The order of HDK categories is different from Pandas\n # and, thus, index comparison fails.\n def comparator(df1, df2):\n # Perform our own non-strict version of dtypes equality check\n assert_dtypes_equal(df1, df2)\n assert_series_equal(\n df1._to_pandas(), df2, check_index=False, check_dtype=False\n )\n\n else:\n comparator = df_equals\n\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.value_counts(),\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_pytest_pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_pytest_pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 58, "span_ids": ["docstring"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport numpy as np\nimport pandas\nimport matplotlib\nfrom modin.config import MinPartitionSize\nimport modin.pandas as pd\n\nfrom pandas.core.dtypes.common import is_list_like\nfrom pandas._libs.lib import no_default\nfrom modin.pandas.test.utils import (\n random_state,\n df_equals,\n test_data_values,\n test_data_keys,\n query_func_keys,\n query_func_values,\n agg_func_keys,\n agg_func_values,\n agg_func_except_keys,\n agg_func_except_values,\n eval_general,\n create_test_dfs,\n udf_func_values,\n udf_func_keys,\n test_data,\n bool_arg_keys,\n bool_arg_values,\n arg_keys,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom modin.utils import get_current_execution\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_dict_test_agg_dict.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_dict_test_agg_dict.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 70, "span_ids": ["test_agg_dict"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_agg_dict():\n md_df, pd_df = create_test_dfs(test_data_values[0])\n agg_dict = {pd_df.columns[0]: \"sum\", pd_df.columns[-1]: (\"sum\", \"count\")}\n eval_general(md_df, pd_df, lambda df: df.agg(agg_dict), raising_exceptions=True)\n\n agg_dict = {\n \"new_col1\": (pd_df.columns[0], \"sum\"),\n \"new_col2\": (pd_df.columns[-1], \"count\"),\n }\n eval_general(md_df, pd_df, lambda df: df.agg(**agg_dict), raising_exceptions=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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_apply_test_agg_apply.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_apply_test_agg_apply.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 85, "span_ids": ["test_agg_apply"], "tokens": 103}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"func\",\n agg_func_values + agg_func_except_values,\n ids=agg_func_keys + agg_func_except_keys,\n)\n@pytest.mark.parametrize(\"op\", [\"agg\", \"apply\"])\ndef test_agg_apply(axis, func, op):\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: getattr(df, op)(func, axis),\n check_exception_type=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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_apply_axis_names_test_agg_apply_axis_names.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_agg_apply_axis_names_test_agg_apply_axis_names.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 100, "span_ids": ["test_agg_apply_axis_names"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\n \"func\",\n agg_func_values + agg_func_except_values,\n ids=agg_func_keys + agg_func_except_keys,\n)\n@pytest.mark.parametrize(\"op\", [\"agg\", \"apply\"])\ndef test_agg_apply_axis_names(axis, func, op):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: getattr(df, op)(func, axis),\n check_exception_type=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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_aggregate_alias_test_aggregate_error_checking.with_pytest_raises_ValueE.modin_df_aggregate_NOT_E": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_aggregate_alias_test_aggregate_error_checking.with_pytest_raises_ValueE.modin_df_aggregate_NOT_E", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 117, "span_ids": ["test_aggregate_alias", "test_aggregate_error_checking"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_aggregate_alias():\n assert pd.DataFrame.agg == pd.DataFrame.aggregate\n\n\ndef test_aggregate_error_checking():\n modin_df = pd.DataFrame(test_data[\"float_nan_data\"])\n\n with warns_that_defaulting_to_pandas():\n modin_df.aggregate({modin_df.columns[0]: \"sum\", modin_df.columns[1]: \"mean\"})\n\n with warns_that_defaulting_to_pandas():\n modin_df.aggregate(\"cumproduct\")\n\n with pytest.raises(ValueError):\n modin_df.aggregate(\"NOT_EXISTS\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_key_error_test_apply_key_error.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_key_error_test_apply_key_error.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 136, "span_ids": ["test_apply_key_error"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"func\",\n agg_func_values + agg_func_except_values,\n ids=agg_func_keys + agg_func_except_keys,\n)\ndef test_apply_key_error(func):\n if not (is_list_like(func) or callable(func) or isinstance(func, str)):\n pytest.xfail(\n reason=\"Because index materialization is expensive Modin first\"\n + \"checks the validity of the function itself and only then the engine level\"\n + \"checks the validity of the indices. Pandas order of such checks is reversed,\"\n + \"so we get different errors when both (function and index) are invalid.\"\n )\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.apply({\"row\": func}, axis=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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_text_func_with_level_test_apply_text_func_with_level.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_text_func_with_level_test_apply_text_func_with_level.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 139, "end_line": 155, "span_ids": ["test_apply_text_func_with_level"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"level\", [no_default, None, -1, 0, 1])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", [\"kurt\", \"count\", \"sum\", \"mean\", \"all\", \"any\"])\ndef test_apply_text_func_with_level(level, data, func, axis):\n func_kwargs = {\"level\": level, \"axis\": axis}\n rows_number = len(next(iter(data.values()))) # length of the first data column\n level_0 = np.random.choice([0, 1, 2], rows_number)\n level_1 = np.random.choice([3, 4, 5], rows_number)\n index = pd.MultiIndex.from_arrays([level_0, level_1])\n\n eval_general(\n pd.DataFrame(data, index=index),\n pandas.DataFrame(data, index=index),\n lambda df, *args, **kwargs: df.apply(func, *args, **kwargs),\n **func_kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_explode_single_partition_test_explode_single_partition.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_explode_single_partition_test_explode_single_partition.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 158, "end_line": 177, "span_ids": ["test_explode_single_partition"], "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": "@pytest.mark.parametrize(\n \"column\", [\"A\", [\"A\", \"C\"]], ids=arg_keys(\"column\", [\"A\", [\"A\", \"C\"]])\n)\n@pytest.mark.parametrize(\n \"ignore_index\", bool_arg_values, ids=arg_keys(\"ignore_index\", bool_arg_keys)\n)\ndef test_explode_single_partition(column, ignore_index):\n # This test data has two columns where some items are lists that\n # explode() should expand. In some rows, the columns have list-like\n # elements that must be expanded, and in others, they have empty lists\n # or items that aren't list-like at all.\n data = {\n \"A\": [[0, 1, 2], \"foo\", [], [3, 4]],\n \"B\": 1,\n \"C\": [[\"a\", \"b\", \"c\"], np.nan, [], [\"d\", \"e\"]],\n }\n eval_general(\n *create_test_dfs(data),\n lambda df: df.explode(column, ignore_index=ignore_index),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_explode_all_partitions_test_explode_all_partitions.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_explode_all_partitions_test_explode_all_partitions.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 180, "end_line": 196, "span_ids": ["test_explode_all_partitions"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"column\", [\"A\", [\"A\", \"C\"]], ids=arg_keys(\"column\", [\"A\", [\"A\", \"C\"]])\n)\n@pytest.mark.parametrize(\n \"ignore_index\", bool_arg_values, ids=arg_keys(\"ignore_index\", bool_arg_keys)\n)\ndef test_explode_all_partitions(column, ignore_index):\n # Test explode with enough rows to fill all partitions. explode should\n # expand every row in the input data into two rows. It's especially\n # important that the input data has list-like elements that must be\n # expanded at the boundaries of the partitions, e.g. at row 31.\n num_rows = NPartitions.get() * MinPartitionSize.get()\n data = {\"A\": [[3, 4]] * num_rows, \"C\": [[\"a\", \"b\"]] * num_rows}\n eval_general(\n *create_test_dfs(data),\n lambda df: df.explode(column, ignore_index=ignore_index),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_args_test_apply_udf.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_args_test_apply_udf.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 199, "end_line": 239, "span_ids": ["test_apply_args", "test_apply_metadata", "test_apply_udf"], "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": "@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\"args\", [(1,), (\"_A\",)])\ndef test_apply_args(axis, args):\n def apply_func(series, y):\n try:\n return series + y\n except TypeError:\n return series.map(str) + str(y)\n\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.apply(apply_func, axis=axis, args=args),\n )\n\n\ndef test_apply_metadata():\n def add(a, b, c):\n return a + b + c\n\n data = {\"A\": [1, 2, 3], \"B\": [4, 5, 6], \"C\": [7, 8, 9]}\n\n modin_df = pd.DataFrame(data)\n modin_df[\"add\"] = modin_df.apply(\n lambda row: add(row[\"A\"], row[\"B\"], row[\"C\"]), axis=1\n )\n\n pandas_df = pandas.DataFrame(data)\n pandas_df[\"add\"] = pandas_df.apply(\n lambda row: add(row[\"A\"], row[\"B\"], row[\"C\"]), axis=1\n )\n df_equals(modin_df, pandas_df)\n\n\n@pytest.mark.parametrize(\"func\", udf_func_values, ids=udf_func_keys)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_apply_udf(data, func):\n eval_general(\n *create_test_dfs(data),\n lambda df, *args, **kwargs: df.apply(func, *args, **kwargs),\n other=lambda df: df,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_dict_4828_test_apply_dict_4828.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_dict_4828_test_apply_dict_4828.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 284, "span_ids": ["test_apply_dict_4828"], "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": "def test_apply_dict_4828():\n data = [[2, 4], [1, 3]]\n modin_df1, pandas_df1 = create_test_dfs(data)\n eval_general(\n modin_df1,\n pandas_df1,\n lambda df: df.apply({0: (lambda x: x**2)}),\n )\n eval_general(\n modin_df1,\n pandas_df1,\n lambda df: df.apply({0: (lambda x: x**2)}, axis=1),\n )\n\n # several partitions along axis 0\n modin_df2, pandas_df2 = create_test_dfs(data, index=[2, 3])\n modin_df3 = pd.concat([modin_df1, modin_df2], axis=0)\n pandas_df3 = pandas.concat([pandas_df1, pandas_df2], axis=0)\n eval_general(\n modin_df3,\n pandas_df3,\n lambda df: df.apply({0: (lambda x: x**2)}),\n )\n eval_general(\n modin_df3,\n pandas_df3,\n lambda df: df.apply({0: (lambda x: x**2)}, axis=1),\n )\n\n # several partitions along axis 1\n modin_df4, pandas_df4 = create_test_dfs(data, columns=[2, 3])\n modin_df5 = pd.concat([modin_df1, modin_df4], axis=1)\n pandas_df5 = pandas.concat([pandas_df1, pandas_df4], axis=1)\n eval_general(\n modin_df5,\n pandas_df5,\n lambda df: df.apply({0: (lambda x: x**2)}),\n )\n eval_general(\n modin_df5,\n pandas_df5,\n lambda df: df.apply({0: (lambda x: x**2)}, axis=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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_modin_func_4635_test_apply_modin_func_4635.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_apply_modin_func_4635_test_apply_modin_func_4635.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 300, "span_ids": ["test_apply_modin_func_4635"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_apply_modin_func_4635():\n data = [1]\n modin_df, pandas_df = create_test_dfs(data)\n df_equals(modin_df.apply(pd.Series.sum), pandas_df.apply(pandas.Series.sum))\n\n data = {\"a\": [1, 2, 3], \"b\": [1, 2, 3], \"c\": [1, 2, 3]}\n modin_df, pandas_df = create_test_dfs(data)\n modin_df = modin_df.set_index([\"a\"])\n pandas_df = pandas_df.set_index([\"a\"])\n\n df_equals(\n modin_df.groupby(\"a\", group_keys=False).apply(pd.DataFrame.sample, n=1),\n pandas_df.groupby(\"a\", group_keys=False).apply(pandas.DataFrame.sample, 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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_df_use_case_test_eval_df_use_case.df_equals_modin_df_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_df_use_case_test_eval_df_use_case.df_equals_modin_df_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 303, "end_line": 328, "span_ids": ["test_eval_df_use_case"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_eval_df_use_case():\n frame_data = {\"a\": random_state.randn(10), \"b\": random_state.randn(10)}\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n # test eval for series results\n tmp_pandas = df.eval(\"arctan2(sin(a), b)\", engine=\"python\", parser=\"pandas\")\n tmp_modin = modin_df.eval(\"arctan2(sin(a), b)\", engine=\"python\", parser=\"pandas\")\n\n assert isinstance(tmp_modin, pd.Series)\n df_equals(tmp_modin, tmp_pandas)\n\n # Test not inplace assignments\n tmp_pandas = df.eval(\"e = arctan2(sin(a), b)\", engine=\"python\", parser=\"pandas\")\n tmp_modin = modin_df.eval(\n \"e = arctan2(sin(a), b)\", engine=\"python\", parser=\"pandas\"\n )\n df_equals(tmp_modin, tmp_pandas)\n\n # Test inplace assignments\n df.eval(\"e = arctan2(sin(a), b)\", engine=\"python\", parser=\"pandas\", inplace=True)\n modin_df.eval(\n \"e = arctan2(sin(a), b)\", engine=\"python\", parser=\"pandas\", inplace=True\n )\n # TODO: Use a series equality validator.\n df_equals(modin_df, df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_df_arithmetic_subexpression_TEST_VAR.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_df_arithmetic_subexpression_TEST_VAR.2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 331, "end_line": 341, "span_ids": ["impl:5", "test_eval_df_arithmetic_subexpression"], "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_eval_df_arithmetic_subexpression():\n frame_data = {\"a\": random_state.randn(10), \"b\": random_state.randn(10)}\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n df.eval(\"not_e = sin(a + b)\", engine=\"python\", parser=\"pandas\", inplace=True)\n modin_df.eval(\"not_e = sin(a + b)\", engine=\"python\", parser=\"pandas\", inplace=True)\n # TODO: Use a series equality validator.\n df_equals(modin_df, df)\n\n\nTEST_VAR = 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_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_and_query_with_local_and_global_var_test_eval_and_query_with_local_and_global_var.for_expr_in_f_col1_op_.df_equals_getattr_modin_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_eval_and_query_with_local_and_global_var_test_eval_and_query_with_local_and_global_var.for_expr_in_f_col1_op_.df_equals_getattr_modin_d", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 344, "end_line": 351, "span_ids": ["test_eval_and_query_with_local_and_global_var"], "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.mark.parametrize(\"method\", [\"query\", \"eval\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"local_var\", [2])\ndef test_eval_and_query_with_local_and_global_var(method, data, local_var):\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n op = \"+\" if method == \"eval\" else \"<\"\n for expr in (f\"col1 {op} @local_var\", f\"col1 {op} @TEST_VAR\"):\n df_equals(getattr(modin_df, method)(expr), getattr(pandas_df, method)(expr))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_filter_test_filter.None_1.modin_df_filter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_filter_test_filter.None_1.modin_df_filter_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 354, "end_line": 377, "span_ids": ["test_filter"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_filter(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n by = {\"items\": [\"col1\", \"col5\"], \"regex\": \"4$|3$\", \"like\": \"col\"}\n df_equals(modin_df.filter(items=by[\"items\"]), pandas_df.filter(items=by[\"items\"]))\n\n df_equals(\n modin_df.filter(regex=by[\"regex\"], axis=0),\n pandas_df.filter(regex=by[\"regex\"], axis=0),\n )\n df_equals(\n modin_df.filter(regex=by[\"regex\"], axis=1),\n pandas_df.filter(regex=by[\"regex\"], axis=1),\n )\n\n df_equals(modin_df.filter(like=by[\"like\"]), pandas_df.filter(like=by[\"like\"]))\n\n with pytest.raises(TypeError):\n modin_df.filter(items=by[\"items\"], regex=by[\"regex\"])\n\n with pytest.raises(TypeError):\n modin_df.filter()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_pipe_test_pipe.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_pipe_test_pipe.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 380, "end_line": 407, "span_ids": ["test_pipe"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_pipe(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n n = len(modin_df.index)\n a, b, c = 2 % n, 0, 3 % n\n col = modin_df.columns[3 % len(modin_df.columns)]\n\n def h(x):\n return x.drop(columns=[col])\n\n def g(x, arg1=0):\n for _ in range(arg1):\n x = (pd if isinstance(x, pd.DataFrame) else pandas).concat((x, x))\n return x\n\n def f(x, arg2=0, arg3=0):\n return x.drop([arg2, arg3])\n\n df_equals(\n f(g(h(modin_df), arg1=a), arg2=b, arg3=c),\n (modin_df.pipe(h).pipe(g, arg1=a).pipe(f, arg2=b, arg3=c)),\n )\n df_equals(\n (modin_df.pipe(h).pipe(g, arg1=a).pipe(f, arg2=b, arg3=c)),\n (pandas_df.pipe(h).pipe(g, arg1=a).pipe(f, arg2=b, arg3=c)),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_query_test_empty_query.with_pytest_raises_ValueE.modin_df_query_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_query_test_empty_query.with_pytest_raises_ValueE.modin_df_query_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 410, "end_line": 437, "span_ids": ["test_empty_query", "test_query"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"funcs\", query_func_values, ids=query_func_keys)\ndef test_query(data, funcs):\n if get_current_execution() == \"BaseOnPython\" and funcs != \"col3 > col4\":\n pytest.xfail(\n reason=\"In this case, we are faced with the problem of handling empty data frames - #4934\"\n )\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = pandas_df.query(funcs)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.query(funcs)\n else:\n modin_result = modin_df.query(funcs)\n # `dtypes` must be evaluated after `query` so we need to check cache\n assert modin_result._query_compiler._modin_frame.has_dtypes_cache\n df_equals(modin_result, pandas_result)\n df_equals(modin_result.dtypes, pandas_result.dtypes)\n\n\ndef test_empty_query():\n modin_df = pd.DataFrame([1, 2, 3, 4, 5])\n\n with pytest.raises(ValueError):\n modin_df.query(\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_query_after_insert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_udf.py_test_query_after_insert_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_udf.py", "file_name": "test_udf.py", "file_type": "text/x-python", "category": "test", "start_line": 440, "end_line": 467, "span_ids": ["test_transform", "test_query_after_insert"], "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": "def test_query_after_insert():\n modin_df = pd.DataFrame({\"x\": [-1, 0, 1, None], \"y\": [1, 2, None, 3]})\n modin_df[\"z\"] = modin_df.eval(\"x / y\")\n modin_df = modin_df.query(\"z >= 0\")\n modin_result = modin_df.reset_index(drop=True)\n modin_result.columns = [\"a\", \"b\", \"c\"]\n\n pandas_df = pd.DataFrame({\"x\": [-1, 0, 1, None], \"y\": [1, 2, None, 3]})\n pandas_df[\"z\"] = pandas_df.eval(\"x / y\")\n pandas_df = pandas_df.query(\"z >= 0\")\n pandas_result = pandas_df.reset_index(drop=True)\n pandas_result.columns = [\"a\", \"b\", \"c\"]\n\n df_equals(modin_result, pandas_result)\n df_equals(modin_df, pandas_df)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"func\",\n agg_func_values + agg_func_except_values,\n ids=agg_func_keys + agg_func_except_keys,\n)\ndef test_transform(data, func):\n eval_general(\n *create_test_dfs(data), lambda df: df.transform(func), check_exception_type=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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_pytest_if_StorageFormat_get_.pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_pytest_if_StorageFormat_get_.pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 52, "span_ids": ["docstring"], "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": "import pytest\nimport numpy as np\nimport pandas\nimport matplotlib\nimport modin.pandas as pd\n\nfrom modin.pandas.test.utils import (\n random_state,\n df_equals,\n arg_keys,\n name_contains,\n test_data_values,\n test_data_keys,\n test_data_with_duplicates_values,\n test_data_with_duplicates_keys,\n no_numeric_dfs,\n quantiles_keys,\n quantiles_values,\n axis_keys,\n axis_values,\n bool_arg_keys,\n bool_arg_values,\n int_arg_keys,\n int_arg_values,\n test_data,\n eval_general,\n create_test_dfs,\n test_data_diff_dtype,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions, StorageFormat\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\nif StorageFormat.get() == \"Hdk\":\n pytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_cumprod_cummin_cummax_cumsum_test_cumprod_cummin_cummax_cumsum.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_cumprod_cummin_cummax_cumsum_test_cumprod_cummin_cummax_cumsum.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 64, "span_ids": ["test_cumprod_cummin_cummax_cumsum"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"method\", [\"cumprod\", \"cummin\", \"cummax\", \"cumsum\"])\ndef test_cumprod_cummin_cummax_cumsum(axis, skipna, method):\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: getattr(df, method)(axis=axis, skipna=skipna),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_cumprod_cummin_cummax_cumsum_transposed_test_diff_transposed.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_cumprod_cummin_cummax_cumsum_transposed_test_diff_transposed.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 110, "span_ids": ["test_diff", "test_cumprod_cummin_cummax_cumsum_transposed", "test_diff_transposed", "test_cummin_cummax_int_and_float", "test_diff_error_handling"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\"method\", [\"cumprod\", \"cummin\", \"cummax\", \"cumsum\"])\ndef test_cumprod_cummin_cummax_cumsum_transposed(axis, method):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: getattr(df.T, method)(axis=axis),\n )\n\n\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"method\", [\"cummin\", \"cummax\"])\ndef test_cummin_cummax_int_and_float(axis, method):\n data = {\"col1\": list(range(1000)), \"col2\": [i * 0.1 for i in range(1000)]}\n eval_general(*create_test_dfs(data), lambda df: getattr(df, method)(axis=axis))\n\n\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"periods\", int_arg_values, ids=arg_keys(\"periods\", int_arg_keys)\n)\ndef test_diff(axis, periods):\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: df.diff(axis=axis, periods=periods),\n )\n\n\ndef test_diff_error_handling():\n df = pd.DataFrame([[\"a\", \"b\", \"c\"]], columns=[\"col 0\", \"col 1\", \"col 2\"])\n with pytest.raises(\n ValueError, match=\"periods must be an int. got instead\"\n ):\n df.diff(axis=0, periods=\"1\")\n\n with pytest.raises(TypeError, match=\"unsupported operand type for -: got object\"):\n df.diff()\n\n\n@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\ndef test_diff_transposed(axis):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.T.diff(axis=axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_duplicated_test_ffill.df_equals_modin_df_ffill_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_duplicated_test_ffill.df_equals_modin_df_ffill_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 142, "span_ids": ["test_ffill", "test_duplicated"], "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": "@pytest.mark.parametrize(\n \"data\", test_data_with_duplicates_values, ids=test_data_with_duplicates_keys\n)\n@pytest.mark.parametrize(\n \"keep\", [\"last\", \"first\", False], ids=[\"last\", \"first\", \"False\"]\n)\ndef test_duplicated(data, keep):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n pandas_result = pandas_df.duplicated(keep=keep)\n modin_result = modin_df.duplicated(keep=keep)\n df_equals(modin_result, pandas_result)\n\n import random\n\n subset = random.sample(\n list(pandas_df.columns), random.randint(1, len(pandas_df.columns))\n )\n pandas_result = pandas_df.duplicated(keep=keep, subset=subset)\n modin_result = modin_df.duplicated(keep=keep, subset=subset)\n\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ffill(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n df_equals(modin_df.ffill(), pandas_df.ffill())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_test_fillna.if_axis_1_and_axis_.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_test_fillna.if_axis_1_and_axis_.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 145, "end_line": 166, "span_ids": ["test_fillna"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"method\",\n [\"backfill\", \"bfill\", \"pad\", \"ffill\", None],\n ids=[\"backfill\", \"bfill\", \"pad\", \"ffill\", \"None\"],\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\"limit\", int_arg_values, ids=int_arg_keys)\ndef test_fillna(data, method, axis, limit):\n # We are not testing when axis is over rows until pandas-17399 gets fixed.\n if axis != 1 and axis != \"columns\":\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = pandas_df.fillna(0, method=method, axis=axis, limit=limit)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.fillna(0, method=method, axis=axis, limit=limit)\n else:\n modin_result = modin_df.fillna(0, method=method, axis=axis, limit=limit)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_sanity_test_fillna_sanity.df_equals_modin_df_df_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_sanity_test_fillna_sanity.df_equals_modin_df_df_fi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 169, "end_line": 209, "span_ids": ["test_fillna_sanity"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"'datetime64[ns, pytz.FixedOffset(60)]' vs 'datetime64[ns, UTC+01:00]'\",\n)\ndef test_fillna_sanity():\n # with different dtype\n frame_data = [\n [\"a\", \"a\", np.nan, \"a\"],\n [\"b\", \"b\", np.nan, \"b\"],\n [\"c\", \"c\", np.nan, \"c\"],\n ]\n df = pandas.DataFrame(frame_data)\n\n result = df.fillna({2: \"foo\"})\n modin_df = pd.DataFrame(frame_data).fillna({2: \"foo\"})\n\n df_equals(modin_df, result)\n\n modin_df = pd.DataFrame(df)\n df.fillna({2: \"foo\"}, inplace=True)\n modin_df.fillna({2: \"foo\"}, inplace=True)\n df_equals(modin_df, result)\n\n frame_data = {\n \"Date\": [pandas.NaT, pandas.Timestamp(\"2014-1-1\")],\n \"Date2\": [pandas.Timestamp(\"2013-1-1\"), pandas.NaT],\n }\n df = pandas.DataFrame(frame_data)\n result = df.fillna(value={\"Date\": df[\"Date2\"]})\n modin_df = pd.DataFrame(frame_data).fillna(value={\"Date\": df[\"Date2\"]})\n df_equals(modin_df, result)\n\n frame_data = {\"A\": [pandas.Timestamp(\"2012-11-11 00:00:00+01:00\"), pandas.NaT]}\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n df_equals(modin_df.fillna(method=\"pad\"), df.fillna(method=\"pad\"))\n\n frame_data = {\"A\": [pandas.NaT, pandas.Timestamp(\"2012-11-11 00:00:00+01:00\")]}\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data).fillna(method=\"bfill\")\n df_equals(modin_df, df.fillna(method=\"bfill\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_downcast_test_fillna_4660.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_downcast_test_fillna_4660.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 212, "end_line": 231, "span_ids": ["test_fillna_downcast", "test_fillna_4660"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_fillna_downcast():\n # infer int64 from float64\n frame_data = {\"a\": [1.0, np.nan]}\n df = pandas.DataFrame(frame_data)\n result = df.fillna(0, downcast=\"infer\")\n modin_df = pd.DataFrame(frame_data).fillna(0, downcast=\"infer\")\n df_equals(modin_df, result)\n\n # infer int64 from float64 when fillna value is a dict\n df = pandas.DataFrame(frame_data)\n result = df.fillna({\"a\": 0}, downcast=\"infer\")\n modin_df = pd.DataFrame(frame_data).fillna({\"a\": 0}, downcast=\"infer\")\n df_equals(modin_df, result)\n\n\ndef test_fillna_4660():\n eval_general(\n *create_test_dfs({\"a\": [\"a\"], \"b\": [\"b\"], \"c\": [pd.NA]}, index=[\"row1\"]),\n lambda df: df[\"c\"].fillna(df[\"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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_inplace_test_fillna_inplace.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_inplace_test_fillna_inplace.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 234, "end_line": 267, "span_ids": ["test_fillna_inplace"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_fillna_inplace():\n frame_data = random_state.randn(10, 4)\n df = pandas.DataFrame(frame_data)\n df[1][:4] = np.nan\n df[3][-4:] = np.nan\n\n modin_df = pd.DataFrame(df)\n df.fillna(value=0, inplace=True)\n try:\n df_equals(modin_df, df)\n except AssertionError:\n pass\n else:\n assert False\n\n modin_df.fillna(value=0, inplace=True)\n df_equals(modin_df, df)\n\n modin_df = pd.DataFrame(df).fillna(value={0: 0}, inplace=True)\n assert modin_df is None\n\n df[1][:4] = np.nan\n df[3][-4:] = np.nan\n modin_df = pd.DataFrame(df)\n df.fillna(method=\"ffill\", inplace=True)\n try:\n df_equals(modin_df, df)\n except AssertionError:\n pass\n else:\n assert False\n\n modin_df.fillna(method=\"ffill\", inplace=True)\n df_equals(modin_df, df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_frame_fillna_limit_test_frame_fillna_limit.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_frame_fillna_limit_test_frame_fillna_limit.None_7", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 270, "end_line": 327, "span_ids": ["test_frame_fillna_limit"], "tokens": 524}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"limit\", [1, 2, 0.5, -1, -2, 1.5])\ndef test_frame_fillna_limit(data, limit):\n pandas_df = pandas.DataFrame(data)\n\n replace_pandas_series = pandas_df.columns.to_series().sample(frac=1)\n replace_dict = replace_pandas_series.to_dict()\n replace_pandas_df = pandas.DataFrame(\n {col: pandas_df.index.to_series() for col in pandas_df.columns},\n index=pandas_df.index,\n ).sample(frac=1)\n replace_modin_series = pd.Series(replace_pandas_series)\n replace_modin_df = pd.DataFrame(replace_pandas_df)\n\n index = pandas_df.index\n result = pandas_df[:2].reindex(index)\n modin_df = pd.DataFrame(result)\n\n if isinstance(limit, float):\n limit = int(len(modin_df) * limit)\n if limit is not None and limit < 0:\n limit = len(modin_df) + limit\n\n df_equals(\n modin_df.fillna(method=\"pad\", limit=limit),\n result.fillna(method=\"pad\", limit=limit),\n )\n df_equals(\n modin_df.fillna(replace_dict, limit=limit),\n result.fillna(replace_dict, limit=limit),\n )\n df_equals(\n modin_df.fillna(replace_modin_series, limit=limit),\n result.fillna(replace_pandas_series, limit=limit),\n )\n df_equals(\n modin_df.fillna(replace_modin_df, limit=limit),\n result.fillna(replace_pandas_df, limit=limit),\n )\n\n result = pandas_df[-2:].reindex(index)\n modin_df = pd.DataFrame(result)\n df_equals(\n modin_df.fillna(method=\"backfill\", limit=limit),\n result.fillna(method=\"backfill\", limit=limit),\n )\n df_equals(\n modin_df.fillna(replace_dict, limit=limit),\n result.fillna(replace_dict, limit=limit),\n )\n df_equals(\n modin_df.fillna(replace_modin_series, limit=limit),\n result.fillna(replace_pandas_series, limit=limit),\n )\n df_equals(\n modin_df.fillna(replace_modin_df, limit=limit),\n result.fillna(replace_pandas_df, limit=limit),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_frame_pad_backfill_limit_test_frame_pad_backfill_limit.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_frame_pad_backfill_limit_test_frame_pad_backfill_limit.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 330, "end_line": 347, "span_ids": ["test_frame_pad_backfill_limit"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_frame_pad_backfill_limit(data):\n pandas_df = pandas.DataFrame(data)\n\n index = pandas_df.index\n\n result = pandas_df[:2].reindex(index)\n modin_df = pd.DataFrame(result)\n df_equals(\n modin_df.fillna(method=\"pad\", limit=2), result.fillna(method=\"pad\", limit=2)\n )\n\n result = pandas_df[-2:].reindex(index)\n modin_df = pd.DataFrame(result)\n df_equals(\n modin_df.fillna(method=\"backfill\", limit=2),\n result.fillna(method=\"backfill\", limit=2),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dtype_conversion_test_fillna_skip_certain_blocks.df_equals_modin_df_fillna": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dtype_conversion_test_fillna_skip_certain_blocks.df_equals_modin_df_fillna", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 350, "end_line": 369, "span_ids": ["test_fillna_skip_certain_blocks", "test_fillna_dtype_conversion"], "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_fillna_dtype_conversion():\n # make sure that fillna on an empty frame works\n df = pandas.DataFrame(index=range(3), columns=[\"A\", \"B\"], dtype=\"float64\")\n modin_df = pd.DataFrame(index=range(3), columns=[\"A\", \"B\"], dtype=\"float64\")\n df_equals(modin_df.fillna(\"nan\"), df.fillna(\"nan\"))\n\n frame_data = {\"A\": [1, np.nan], \"B\": [1.0, 2.0]}\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n for v in [\"\", 1, np.nan, 1.0]:\n df_equals(modin_df.fillna(v), df.fillna(v))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_fillna_skip_certain_blocks(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n # don't try to fill boolean, int blocks\n df_equals(modin_df.fillna(np.nan), pandas_df.fillna(np.nan))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dict_series_test_fillna_dict_series.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dict_series_test_fillna_dict_series.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 372, "end_line": 389, "span_ids": ["test_fillna_dict_series"], "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_fillna_dict_series():\n frame_data = {\n \"a\": [np.nan, 1, 2, np.nan, np.nan],\n \"b\": [1, 2, 3, np.nan, np.nan],\n \"c\": [np.nan, 1, 2, 3, 4],\n }\n df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n df_equals(modin_df.fillna({\"a\": 0, \"b\": 5}), df.fillna({\"a\": 0, \"b\": 5}))\n\n df_equals(\n modin_df.fillna({\"a\": 0, \"b\": 5, \"d\": 7}),\n df.fillna({\"a\": 0, \"b\": 5, \"d\": 7}),\n )\n\n # Series treated same as dict\n df_equals(modin_df.fillna(modin_df.max()), df.fillna(df.max()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dataframe_test_fillna_dataframe.df_equals_modin_df_fillna": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_dataframe_test_fillna_dataframe.df_equals_modin_df_fillna", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 392, "end_line": 409, "span_ids": ["test_fillna_dataframe"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_fillna_dataframe():\n frame_data = {\n \"a\": [np.nan, 1, 2, np.nan, np.nan],\n \"b\": [1, 2, 3, np.nan, np.nan],\n \"c\": [np.nan, 1, 2, 3, 4],\n }\n df = pandas.DataFrame(frame_data, index=list(\"VWXYZ\"))\n modin_df = pd.DataFrame(frame_data, index=list(\"VWXYZ\"))\n\n # df2 may have different index and columns\n df2 = pandas.DataFrame(\n {\"a\": [np.nan, 10, 20, 30, 40], \"b\": [50, 60, 70, 80, 90], \"foo\": [\"bar\"] * 5},\n index=list(\"VWXuZ\"),\n )\n modin_df2 = pd.DataFrame(df2)\n\n # only those columns and indices which are shared get filled\n df_equals(modin_df.fillna(modin_df2), df.fillna(df2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_columns_test_fillna_columns.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_columns_test_fillna_columns.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 412, "end_line": 425, "span_ids": ["test_fillna_columns"], "tokens": 109}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_fillna_columns(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(\n modin_df.fillna(method=\"ffill\", axis=1),\n pandas_df.fillna(method=\"ffill\", axis=1),\n )\n\n df_equals(\n modin_df.fillna(method=\"ffill\", axis=1),\n pandas_df.fillna(method=\"ffill\", axis=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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_invalid_method_test_fillna_col_reordering.df_equals_modin_df_fillna": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_invalid_method_test_fillna_col_reordering.df_equals_modin_df_fillna", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 428, "end_line": 452, "span_ids": ["test_fillna_invalid_value", "test_fillna_invalid_method", "test_fillna_col_reordering"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_fillna_invalid_method(data):\n modin_df = pd.DataFrame(data)\n\n with pytest.raises(ValueError):\n modin_df.fillna(method=\"ffil\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_fillna_invalid_value(data):\n modin_df = pd.DataFrame(data)\n # list\n pytest.raises(TypeError, modin_df.fillna, [1, 2])\n # tuple\n pytest.raises(TypeError, modin_df.fillna, (1, 2))\n # frame with series\n pytest.raises(TypeError, modin_df.iloc[:, 0].fillna, modin_df)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_fillna_col_reordering(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n df_equals(modin_df.fillna(method=\"ffill\"), pandas_df.fillna(method=\"ffill\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_datetime_columns_test_fillna_datetime_columns.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_fillna_datetime_columns_test_fillna_datetime_columns.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 455, "end_line": 478, "span_ids": ["test_fillna_datetime_columns"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_fillna_datetime_columns():\n frame_data = {\n \"A\": [-1, -2, np.nan],\n \"B\": pd.date_range(\"20130101\", periods=3),\n \"C\": [\"foo\", \"bar\", None],\n \"D\": [\"foo2\", \"bar2\", None],\n }\n df = pandas.DataFrame(frame_data, index=pd.date_range(\"20130110\", periods=3))\n modin_df = pd.DataFrame(frame_data, index=pd.date_range(\"20130110\", periods=3))\n df_equals(modin_df.fillna(\"?\"), df.fillna(\"?\"))\n\n frame_data = {\n \"A\": [-1, -2, np.nan],\n \"B\": [\n pandas.Timestamp(\"2013-01-01\"),\n pandas.Timestamp(\"2013-01-02\"),\n pandas.NaT,\n ],\n \"C\": [\"foo\", \"bar\", None],\n \"D\": [\"foo2\", \"bar2\", None],\n }\n df = pandas.DataFrame(frame_data, index=pd.date_range(\"20130110\", periods=3))\n modin_df = pd.DataFrame(frame_data, index=pd.date_range(\"20130110\", periods=3))\n df_equals(modin_df.fillna(\"?\"), df.fillna(\"?\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_median_skew_test_median_skew_std_var_rank_sem_specific.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_median_skew_test_median_skew_std_var_rank_sem_specific.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 481, "end_line": 508, "span_ids": ["test_median_skew_std_var_rank_sem_specific", "test_median_skew", "test_median_skew_transposed"], "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": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"method\", [\"median\", \"skew\"])\ndef test_median_skew(axis, skipna, method):\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: getattr(df, method)(axis=axis, skipna=skipna),\n )\n\n\n@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\"method\", [\"median\", \"skew\"])\ndef test_median_skew_transposed(axis, method):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: getattr(df.T, method)(axis=axis),\n )\n\n\n@pytest.mark.parametrize(\"numeric_only\", [True, False, None])\n@pytest.mark.parametrize(\"method\", [\"median\", \"skew\", \"std\", \"var\", \"rank\", \"sem\"])\ndef test_median_skew_std_var_rank_sem_specific(numeric_only, method):\n eval_general(\n *create_test_dfs(test_data_diff_dtype),\n lambda df: getattr(df, method)(numeric_only=numeric_only),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_median_skew_std_var_sem_1953_test_median_skew_std_var_sem_1953.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_median_skew_std_var_sem_1953_test_median_skew_std_var_sem_1953.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 511, "end_line": 519, "span_ids": ["test_median_skew_std_var_sem_1953"], "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": "@pytest.mark.parametrize(\"method\", [\"median\", \"skew\", \"std\", \"var\", \"sem\"])\ndef test_median_skew_std_var_sem_1953(method):\n # See #1953 for details\n arrays = [[\"1\", \"1\", \"2\", \"2\"], [\"1\", \"2\", \"3\", \"4\"]]\n data = [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]]\n modin_df = pd.DataFrame(data, index=arrays)\n pandas_df = pandas.DataFrame(data, index=arrays)\n\n eval_general(modin_df, pandas_df, lambda df: getattr(df, method)())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_mode_test_mode.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_mode_test_mode.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 522, "end_line": 538, "span_ids": ["test_mode"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\n \"numeric_only\", bool_arg_values, ids=arg_keys(\"numeric_only\", bool_arg_keys)\n)\ndef test_mode(request, data, axis, numeric_only):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n try:\n pandas_result = pandas_df.mode(axis=axis, numeric_only=numeric_only)\n except Exception:\n with pytest.raises(TypeError):\n modin_df.mode(axis=axis, numeric_only=numeric_only)\n else:\n modin_result = modin_df.mode(axis=axis, numeric_only=numeric_only)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nlargest_test_nlargest.df_equals_modin_df_nlarge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nlargest_test_nlargest.df_equals_modin_df_nlarge", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 541, "end_line": 570, "span_ids": ["test_nlargest"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_nlargest():\n data = {\n \"population\": [\n 59000000,\n 65000000,\n 434000,\n 434000,\n 434000,\n 337000,\n 11300,\n 11300,\n 11300,\n ],\n \"GDP\": [1937894, 2583560, 12011, 4520, 12128, 17036, 182, 38, 311],\n \"alpha-2\": [\"IT\", \"FR\", \"MT\", \"MV\", \"BN\", \"IS\", \"NR\", \"TV\", \"AI\"],\n }\n index = [\n \"Italy\",\n \"France\",\n \"Malta\",\n \"Maldives\",\n \"Brunei\",\n \"Iceland\",\n \"Nauru\",\n \"Tuvalu\",\n \"Anguilla\",\n ]\n modin_df = pd.DataFrame(data=data, index=index)\n pandas_df = pandas.DataFrame(data=data, index=index)\n df_equals(modin_df.nlargest(3, \"population\"), pandas_df.nlargest(3, \"population\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nsmallest_test_nsmallest.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nsmallest_test_nsmallest.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 573, "end_line": 609, "span_ids": ["test_nsmallest"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_nsmallest():\n data = {\n \"population\": [\n 59000000,\n 65000000,\n 434000,\n 434000,\n 434000,\n 337000,\n 11300,\n 11300,\n 11300,\n ],\n \"GDP\": [1937894, 2583560, 12011, 4520, 12128, 17036, 182, 38, 311],\n \"alpha-2\": [\"IT\", \"FR\", \"MT\", \"MV\", \"BN\", \"IS\", \"NR\", \"TV\", \"AI\"],\n }\n index = [\n \"Italy\",\n \"France\",\n \"Malta\",\n \"Maldives\",\n \"Brunei\",\n \"Iceland\",\n \"Nauru\",\n \"Tuvalu\",\n \"Anguilla\",\n ]\n modin_df = pd.DataFrame(data=data, index=index)\n pandas_df = pandas.DataFrame(data=data, index=index)\n df_equals(\n modin_df.nsmallest(n=3, columns=\"population\"),\n pandas_df.nsmallest(n=3, columns=\"population\"),\n )\n df_equals(\n modin_df.nsmallest(n=2, columns=[\"population\", \"GDP\"], keep=\"all\"),\n pandas_df.nsmallest(n=2, columns=[\"population\", \"GDP\"], keep=\"all\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nunique_test_nunique.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_nunique_test_nunique.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 612, "end_line": 627, "span_ids": ["test_nunique"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\n \"dropna\", bool_arg_values, ids=arg_keys(\"dropna\", bool_arg_keys)\n)\ndef test_nunique(data, axis, dropna):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_result = modin_df.nunique(axis=axis, dropna=dropna)\n pandas_result = pandas_df.nunique(axis=axis, dropna=dropna)\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_df.T.nunique(axis=axis, dropna=dropna)\n pandas_result = pandas_df.T.nunique(axis=axis, dropna=dropna)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_quantile_test_quantile.None_1.else_.with_pytest_raises_ValueE.modin_df_T_quantile_q_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_quantile_test_quantile.None_1.else_.with_pytest_raises_ValueE.modin_df_T_quantile_q_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 630, "end_line": 666, "span_ids": ["test_quantile"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"q\", quantiles_values, ids=quantiles_keys)\ndef test_quantile(request, data, q):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n if not name_contains(request.node.name, no_numeric_dfs):\n df_equals(modin_df.quantile(q), pandas_df.quantile(q))\n df_equals(modin_df.quantile(q, axis=1), pandas_df.quantile(q, axis=1))\n\n try:\n pandas_result = pandas_df.quantile(q, axis=1, numeric_only=False)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.quantile(q, axis=1, numeric_only=False)\n else:\n modin_result = modin_df.quantile(q, axis=1, numeric_only=False)\n df_equals(modin_result, pandas_result)\n else:\n with pytest.raises(ValueError):\n modin_df.quantile(q)\n\n if not name_contains(request.node.name, no_numeric_dfs):\n df_equals(modin_df.T.quantile(q), pandas_df.T.quantile(q))\n df_equals(modin_df.T.quantile(q, axis=1), pandas_df.T.quantile(q, axis=1))\n\n try:\n pandas_result = pandas_df.T.quantile(q, axis=1, numeric_only=False)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_df.T.quantile(q, axis=1, numeric_only=False)\n else:\n modin_result = modin_df.T.quantile(q, axis=1, numeric_only=False)\n df_equals(modin_result, pandas_result)\n else:\n with pytest.raises(ValueError):\n modin_df.T.quantile(q)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_rank_transposed_test_sem_int_only.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_rank_transposed_test_sem_int_only.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 669, "end_line": 697, "span_ids": ["test_rank_transposed", "test_sem_float_nan_only", "test_sem_int_only"], "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": "@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\n \"na_option\", [\"keep\", \"top\", \"bottom\"], ids=[\"keep\", \"top\", \"bottom\"]\n)\ndef test_rank_transposed(axis, na_option):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.rank(axis=axis, na_option=na_option),\n )\n\n\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\ndef test_sem_float_nan_only(skipna, ddof):\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: df.sem(skipna=skipna, ddof=ddof),\n )\n\n\n@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\ndef test_sem_int_only(axis, ddof):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: df.sem(axis=axis, ddof=ddof),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_std_var_rank_test_std_var_rank.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_std_var_rank_test_std_var_rank.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 700, "end_line": 709, "span_ids": ["test_std_var_rank"], "tokens": 103}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"method\", [\"std\", \"var\", \"rank\"])\ndef test_std_var_rank(axis, skipna, method):\n eval_general(\n *create_test_dfs(test_data[\"float_nan_data\"]),\n lambda df: getattr(df, method)(axis=axis, skipna=skipna),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_std_var_transposed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/dataframe/test_window.py_test_std_var_transposed_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/dataframe/test_window.py", "file_name": "test_window.py", "file_type": "text/x-python", "category": "test", "start_line": 712, "end_line": 728, "span_ids": ["test_values", "test_std_var_transposed"], "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": "@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\n@pytest.mark.parametrize(\"method\", [\"std\", \"var\"])\ndef test_std_var_transposed(axis, ddof, method):\n eval_general(\n *create_test_dfs(test_data[\"int_data\"]),\n lambda df: getattr(df.T, method)(axis=axis, ddof=ddof),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_values(data):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n np.testing.assert_equal(modin_df.values, pandas_df.values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/integrations/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/integrations/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/pandas/test/integrations/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/pandas/test/integrations/test_lazy_import.py_lazy_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/integrations/test_lazy_import.py_lazy_import_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/integrations/test_lazy_import.py", "file_name": "test_lazy_import.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 23, "span_ids": ["test_dataframe_constructor", "docstring"], "tokens": 70}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import lazy_import\n\npandas = lazy_import.lazy_module(\"pandas\")\npyarrow = lazy_import.lazy_module(\"pyarrow\")\nfrom modin import pandas as pd # noqa: E402\n\n\ndef test_dataframe_constructor():\n pd.DataFrame({\"col1\": [1, 2, 3], \"col2\": list(\"abc\")})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/pandas/test/internals/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/pandas/test/internals/test_benchmark_mode.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/test_benchmark_mode.py_mock_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/internals/test_benchmark_mode.py", "file_name": "test_benchmark_mode.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 72, "span_ids": ["test_turn_off", "test_turn_on", "test_from_environment_variable", "docstring"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest.mock as mock\n\nimport modin.pandas as pd\nfrom modin.pandas.test.utils import test_data_values\nfrom modin.config import BenchmarkMode, Engine\n\n\nengine = Engine.get()\n\n# We have to explicitly mock subclass implementations of wait_partitions.\nif engine == \"Ray\":\n wait_method = (\n \"modin.core.execution.ray.implementations.\"\n + \"pandas_on_ray.partitioning.\"\n + \"PandasOnRayDataframePartitionManager.wait_partitions\"\n )\nelif engine == \"Dask\":\n wait_method = (\n \"modin.core.execution.dask.implementations.\"\n + \"pandas_on_dask.partitioning.\"\n + \"PandasOnDaskDataframePartitionManager.wait_partitions\"\n )\nelif engine == \"Unidist\":\n wait_method = (\n \"modin.core.execution.unidist.implementations.\"\n + \"pandas_on_unidist.partitioning.\"\n + \"PandasOnUnidistDataframePartitionManager.wait_partitions\"\n )\nelse:\n wait_method = (\n \"modin.core.dataframe.pandas.partitioning.\"\n + \"partition_manager.PandasDataframePartitionManager.wait_partitions\"\n )\n\n\ndef test_from_environment_variable():\n assert BenchmarkMode.get()\n with mock.patch(wait_method) as wait:\n pd.DataFrame(test_data_values[0]).mean()\n\n wait.assert_called()\n\n\ndef test_turn_off():\n df = pd.DataFrame([0])\n BenchmarkMode.put(False)\n with mock.patch(wait_method) as wait:\n df.dropna()\n wait.assert_not_called()\n\n\ndef test_turn_on():\n BenchmarkMode.put(False)\n df = pd.DataFrame([0])\n BenchmarkMode.put(True)\n with mock.patch(wait_method) as wait:\n df.dropna()\n wait.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_modin-project__modin/modin/pandas/test/internals/test_repartition.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/internals/test_repartition.py_pytest_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/internals/test_repartition.py", "file_name": "test_repartition.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 61, "span_ids": ["test_repartition", "docstring"], "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 pytest\n\nimport modin.pandas as pd\nfrom modin.config import NPartitions\n\nNPartitions.put(4)\n\n\n@pytest.mark.parametrize(\"axis\", [0, 1, None])\n@pytest.mark.parametrize(\"dtype\", [\"DataFrame\", \"Series\"])\ndef test_repartition(axis, dtype):\n if axis in (1, None) and dtype == \"Series\":\n # no sense for Series\n return\n\n df = pd.DataFrame({\"col1\": [1, 2], \"col2\": [5, 6]})\n df2 = pd.DataFrame({\"col3\": [9, 4]})\n\n df = pd.concat([df, df2], axis=1)\n df = pd.concat([df, df], axis=0)\n\n obj = df if dtype == \"DataFrame\" else df[\"col1\"]\n\n source_shapes = {\n \"DataFrame\": (2, 2),\n \"Series\": (2, 1),\n }\n # check that the test makes sense\n assert obj._query_compiler._modin_frame._partitions.shape == source_shapes[dtype]\n\n kwargs = {\"axis\": axis} if dtype == \"DataFrame\" else {}\n obj = obj._repartition(**kwargs)\n\n if dtype == \"DataFrame\":\n results = {\n None: (1, 1),\n 0: (1, 2),\n 1: (2, 1),\n }\n else:\n results = {\n None: (1, 1),\n 0: (1, 1),\n 1: (2, 1),\n }\n\n assert obj._query_compiler._modin_frame._partitions.shape == results[axis]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_pandas_test_top_level_api_equality._Check_that_we_have_no_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_pandas_test_top_level_api_equality._Check_that_we_have_no_e", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 116, "span_ids": ["test_top_level_api_equality", "docstring"], "tokens": 729}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport inspect\nimport pytest\nimport numpy as np\n\nimport modin.pandas as pd\n\n\ndef test_top_level_api_equality():\n modin_dir = [obj for obj in dir(pd) if obj[0] != \"_\"]\n pandas_dir = [obj for obj in dir(pandas) if obj[0] != \"_\"]\n missing_from_modin = set(pandas_dir) - set(modin_dir)\n extra_in_modin = set(modin_dir) - set(pandas_dir)\n ignore_pandas = [\n \"annotations\",\n \"np\",\n \"testing\",\n \"tests\",\n \"pandas\",\n \"core\",\n \"compat\",\n \"util\",\n \"offsets\",\n \"datetime\",\n \"arrays\",\n \"api\",\n \"tseries\",\n \"errors\",\n \"to_msgpack\", # This one is experimental, and doesn't look finished\n \"Panel\", # This is deprecated and throws a warning every time.\n \"SparseSeries\", # depreceted since pandas 1.0, not present in 1.4+\n \"SparseDataFrame\", # depreceted since pandas 1.0, not present in 1.4+\n ]\n\n ignore_modin = [\n \"indexing\",\n \"iterator\",\n \"series\",\n \"accessor\",\n \"base\",\n \"utils\",\n \"dataframe\",\n \"groupby\",\n \"general\",\n \"datetime\",\n \"warnings\",\n \"os\",\n \"series_utils\",\n \"window\",\n ]\n\n assert not len(\n missing_from_modin - set(ignore_pandas)\n ), \"Differences found in API: {}\".format(missing_from_modin - set(ignore_pandas))\n\n assert not len(\n extra_in_modin - set(ignore_modin)\n ), \"Differences found in API: {}\".format(extra_in_modin - set(ignore_modin))\n\n difference = []\n allowed_different = [\"Interval\", \"datetime\"]\n\n # Check that we have all keywords and defaults in pandas\n for m in set(pandas_dir) - set(ignore_pandas):\n if m in allowed_different:\n continue\n try:\n pandas_sig = dict(inspect.signature(getattr(pandas, m)).parameters)\n except (TypeError, ValueError):\n continue\n try:\n modin_sig = dict(inspect.signature(getattr(pd, m)).parameters)\n except (TypeError, ValueError):\n continue\n\n if not pandas_sig == modin_sig:\n try:\n append_val = (\n m,\n {\n i: pandas_sig[i]\n for i in pandas_sig.keys()\n if i not in modin_sig\n or pandas_sig[i].default != modin_sig[i].default\n and not (\n pandas_sig[i].default is np.nan\n and modin_sig[i].default is np.nan\n )\n },\n )\n except Exception:\n raise\n try:\n # This validates that there are actually values to add to the difference\n # based on the condition above.\n if len(list(append_val[-1])[-1]) > 0:\n difference.append(append_val)\n except IndexError:\n pass\n\n assert not len(difference), \"Missing params found in API: {}\".format(difference)\n\n # Check that we have no extra keywords or defaults\n for m in set(pandas_dir) - set(ignore_pandas):\n # ... other code\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_modin-project__modin/modin/pandas/test/test_api.py_test_top_level_api_equality.None_1_test_top_level_api_equality.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_top_level_api_equality.None_1_test_top_level_api_equality.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 117, "end_line": 148, "span_ids": ["test_top_level_api_equality"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_top_level_api_equality():\n # ... other code\n\n assert not len(\n extra_in_modin - set(ignore_modin)\n ), \"Differences found in API: {}\".format(extra_in_modin - set(ignore_modin))\n # ... other code\n for m in set(pandas_dir) - set(ignore_pandas):\n if m in allowed_different:\n continue\n try:\n pandas_sig = dict(inspect.signature(getattr(pandas, m)).parameters)\n except (TypeError, ValueError):\n continue\n try:\n modin_sig = dict(inspect.signature(getattr(pd, m)).parameters)\n except (TypeError, ValueError):\n continue\n if not pandas_sig == modin_sig:\n try:\n append_val = (\n m,\n {\n i: modin_sig[i]\n for i in modin_sig.keys()\n if i not in pandas_sig and i != \"query_compiler\"\n },\n )\n except Exception:\n raise\n try:\n # This validates that there are actually values to add to the difference\n # based on the condition above.\n if len(list(append_val[-1])[-1]) > 0:\n difference.append(append_val)\n except IndexError:\n pass\n\n assert not len(difference), \"Extra params found in API: {}\".format(difference)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_dataframe_api_equality_test_dataframe_api_equality.assert_parameters_eq_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_dataframe_api_equality_test_dataframe_api_equality.assert_parameters_eq_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 151, "end_line": 167, "span_ids": ["test_dataframe_api_equality"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dataframe_api_equality():\n modin_dir = [obj for obj in dir(pd.DataFrame) if obj[0] != \"_\"]\n pandas_dir = [obj for obj in dir(pandas.DataFrame) if obj[0] != \"_\"]\n\n ignore = [\"timetuple\"]\n missing_from_modin = set(pandas_dir) - set(modin_dir)\n assert not len(\n missing_from_modin - set(ignore)\n ), \"Differences found in API: {}\".format(len(missing_from_modin - set(ignore)))\n assert not len(\n set(modin_dir) - set(pandas_dir)\n ), \"Differences found in API: {}\".format(set(modin_dir) - set(pandas_dir))\n\n # These have to be checked manually\n allowed_different = [\"to_hdf\", \"hist\"]\n\n assert_parameters_eq((pandas.DataFrame, pd.DataFrame), modin_dir, allowed_different)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_str_api_equality_test_series_str_api_equality.assert_parameters_eq_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_str_api_equality_test_series_str_api_equality.assert_parameters_eq_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 182, "span_ids": ["test_series_str_api_equality"], "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_series_str_api_equality():\n modin_dir = [obj for obj in dir(pd.Series.str) if obj[0] != \"_\"]\n pandas_dir = [obj for obj in dir(pandas.Series.str) if obj[0] != \"_\"]\n\n missing_from_modin = set(pandas_dir) - set(modin_dir)\n assert not len(missing_from_modin), \"Differences found in API: {}\".format(\n missing_from_modin\n )\n extra_in_modin = set(modin_dir) - set(pandas_dir)\n assert not len(extra_in_modin), \"Differences found in API: {}\".format(\n extra_in_modin\n )\n assert_parameters_eq((pandas.Series.str, pd.Series.str), modin_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_modin-project__modin/modin/pandas/test/test_api.py_test_series_dt_api_equality_test_series_dt_api_equality.assert_parameters_eq_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_dt_api_equality_test_series_dt_api_equality.assert_parameters_eq_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 185, "end_line": 200, "span_ids": ["test_series_dt_api_equality"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_series_dt_api_equality():\n modin_dir = [obj for obj in dir(pd.Series.dt) if obj[0] != \"_\"]\n pandas_dir = [obj for obj in dir(pandas.Series.dt) if obj[0] != \"_\"]\n\n # should be deleted, but for some reason the check fails\n # https://github.com/pandas-dev/pandas/pull/33595\n ignore = [\"week\", \"weekofyear\"]\n missing_from_modin = set(pandas_dir) - set(modin_dir) - set(ignore)\n assert not len(missing_from_modin), \"Differences found in API: {}\".format(\n missing_from_modin\n )\n extra_in_modin = set(modin_dir) - set(pandas_dir)\n assert not len(extra_in_modin), \"Differences found in API: {}\".format(\n extra_in_modin\n )\n assert_parameters_eq((pandas.Series.dt, pd.Series.dt), modin_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_modin-project__modin/modin/pandas/test/test_api.py_test_series_cat_api_equality_test_series_cat_api_equality.assert_parameters_eq_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_cat_api_equality_test_series_cat_api_equality.assert_parameters_eq_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 203, "end_line": 217, "span_ids": ["test_series_cat_api_equality"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_series_cat_api_equality():\n modin_dir = [obj for obj in dir(pd.Series.cat) if obj[0] != \"_\"]\n pandas_dir = [obj for obj in dir(pandas.Series.cat) if obj[0] != \"_\"]\n\n missing_from_modin = set(pandas_dir) - set(modin_dir)\n assert not len(missing_from_modin), \"Differences found in API: {}\".format(\n len(missing_from_modin)\n )\n extra_in_modin = set(modin_dir) - set(pandas_dir)\n assert not len(extra_in_modin), \"Differences found in API: {}\".format(\n extra_in_modin\n )\n # all methods of `pandas.Series.cat` don't have any information about parameters,\n # just method(*args, **kwargs)\n assert_parameters_eq((pandas.core.arrays.Categorical, pd.Series.cat), modin_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_modin-project__modin/modin/pandas/test/test_api.py_test_sparse_accessor_api_equality_test_sparse_accessor_api_equality.assert_not_len_extra_in_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_sparse_accessor_api_equality_test_sparse_accessor_api_equality.assert_not_len_extra_in_m", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 220, "end_line": 232, "span_ids": ["test_sparse_accessor_api_equality"], "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": "@pytest.mark.parametrize(\"obj\", [\"DataFrame\", \"Series\"])\ndef test_sparse_accessor_api_equality(obj):\n modin_dir = [x for x in dir(getattr(pd, obj).sparse) if x[0] != \"_\"]\n pandas_dir = [x for x in dir(getattr(pandas, obj).sparse) if x[0] != \"_\"]\n\n missing_from_modin = set(pandas_dir) - set(modin_dir)\n assert not len(missing_from_modin), \"Differences found in API: {}\".format(\n len(missing_from_modin)\n )\n extra_in_modin = set(modin_dir) - set(pandas_dir)\n assert not len(extra_in_modin), \"Differences found in API: {}\".format(\n extra_in_modin\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_groupby_api_equality_test_groupby_api_equality.assert_parameters_eq_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_groupby_api_equality_test_groupby_api_equality.assert_parameters_eq_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 235, "end_line": 256, "span_ids": ["test_groupby_api_equality"], "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": "@pytest.mark.parametrize(\"obj\", [\"SeriesGroupBy\", \"DataFrameGroupBy\"])\ndef test_groupby_api_equality(obj):\n modin_dir = [x for x in dir(getattr(pd.groupby, obj)) if x[0] != \"_\"]\n pandas_dir = [x for x in dir(getattr(pandas.core.groupby, obj)) if x[0] != \"_\"]\n # These attributes are hidden in the DataFrameGroupBy/SeriesGroupBy instance,\n # but available in the DataFrameGroupBy/SeriesGroupBy class in pandas.\n ignore = [\"keys\", \"level\"]\n missing_from_modin = set(pandas_dir) - set(modin_dir) - set(ignore)\n assert not len(missing_from_modin), \"Differences found in API: {}\".format(\n len(missing_from_modin)\n )\n # FIXME: wrong inheritance\n ignore = (\n [\"boxplot\", \"corrwith\", \"dtypes\"] if obj == \"SeriesGroupBy\" else [\"boxplot\"]\n )\n extra_in_modin = set(modin_dir) - set(pandas_dir) - set(ignore)\n assert not len(extra_in_modin), \"Differences found in API: {}\".format(\n extra_in_modin\n )\n assert_parameters_eq(\n (getattr(pandas.core.groupby, obj), getattr(pd.groupby, obj)), modin_dir, ignore\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_api_equality_test_series_api_equality.assert_parameters_eq_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_test_series_api_equality_test_series_api_equality.assert_parameters_eq_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 278, "span_ids": ["test_series_api_equality"], "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_series_api_equality():\n modin_dir = [obj for obj in dir(pd.Series) if obj[0] != \"_\"]\n pandas_dir = [obj for obj in dir(pandas.Series) if obj[0] != \"_\"]\n\n ignore = [\"timetuple\"]\n missing_from_modin = set(pandas_dir) - set(modin_dir) - set(ignore)\n assert not len(missing_from_modin), \"Differences found in API: {}\".format(\n missing_from_modin\n )\n extra_in_modin = set(modin_dir) - set(pandas_dir)\n assert not len(extra_in_modin), \"Differences found in API: {}\".format(\n extra_in_modin\n )\n\n # These have to be checked manually\n allowed_different = [\"to_hdf\", \"hist\"]\n # skip verifying .rename_axis() due to https://github.com/modin-project/modin/issues/5077\n allowed_different.append(\"rename_axis\")\n\n assert_parameters_eq((pandas.Series, pd.Series), modin_dir, allowed_different)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_assert_parameters_eq_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_api.py_assert_parameters_eq_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 281, "end_line": 348, "span_ids": ["assert_parameters_eq"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_parameters_eq(objects, attributes, allowed_different):\n pandas_obj, modin_obj = objects\n difference = []\n\n # Check that Modin functions/methods don't have extra params\n for m in attributes:\n if m in allowed_different:\n continue\n try:\n pandas_sig = dict(inspect.signature(getattr(pandas_obj, m)).parameters)\n except TypeError:\n continue\n try:\n modin_sig = dict(inspect.signature(getattr(modin_obj, m)).parameters)\n except TypeError:\n continue\n\n if not pandas_sig == modin_sig:\n append_val = (\n m,\n {\n i: pandas_sig[i]\n for i in pandas_sig.keys()\n if i not in modin_sig\n or pandas_sig[i].default != modin_sig[i].default\n and not (\n pandas_sig[i].default is np.nan\n and modin_sig[i].default is np.nan\n )\n },\n )\n try:\n # This validates that there are actually values to add to the difference\n # based on the condition above.\n if len(list(append_val[-1])[-1]) > 0:\n difference.append(append_val)\n except IndexError:\n pass\n assert not len(difference), \"Missing params found in API: {}\".format(difference)\n\n difference = []\n # Check that Modin functions/methods have all params as pandas\n for m in attributes:\n if m in allowed_different:\n continue\n try:\n pandas_sig = dict(inspect.signature(getattr(pandas_obj, m)).parameters)\n except TypeError:\n continue\n try:\n modin_sig = dict(inspect.signature(getattr(modin_obj, m)).parameters)\n except TypeError:\n continue\n\n if not pandas_sig == modin_sig:\n append_val = (\n m,\n {i: modin_sig[i] for i in modin_sig.keys() if i not in pandas_sig},\n )\n try:\n # This validates that there are actually values to add to the difference\n # based on the condition above.\n if len(list(append_val[-1])[-1]) > 0:\n difference.append(append_val)\n except IndexError:\n pass\n assert not len(difference), \"Extra params found in API: {}\".format(difference)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_np_test_concat.df_equals_pd_concat_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_np_test_concat.df_equals_pd_concat_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 49, "span_ids": ["test_concat", "test_df_concat", "docstring"], "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 numpy as np\nimport pytest\nimport pandas\n\nimport modin.pandas as pd\nfrom modin.pandas.utils import from_pandas\nfrom .utils import (\n df_equals,\n generate_dfs,\n generate_multiindex_dfs,\n generate_none_dfs,\n create_test_dfs,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions, StorageFormat\nfrom modin.utils import get_current_execution\n\nNPartitions.put(4)\n\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\n# Initialize env for storage format detection in @pytest.mark.*\npd.DataFrame()\n\n\ndef test_df_concat():\n df, df2 = generate_dfs()\n\n df_equals(pd.concat([df, df2]), pandas.concat([df, df2]))\n\n\ndef test_concat():\n df, df2 = generate_dfs()\n modin_df, modin_df2 = from_pandas(df), from_pandas(df2)\n\n df_equals(pd.concat([modin_df, modin_df2]), pandas.concat([df, df2]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_with_series_test_concat_with_series.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_with_series_test_concat_with_series.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 65, "span_ids": ["test_concat_with_series"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_with_series():\n df, df2 = generate_dfs()\n modin_df, modin_df2 = from_pandas(df), from_pandas(df2)\n pandas_series = pandas.Series([1, 2, 3, 4], name=\"new_col\")\n\n df_equals(\n pd.concat([modin_df, modin_df2, pandas_series], axis=0),\n pandas.concat([df, df2, pandas_series], axis=0),\n )\n\n df_equals(\n pd.concat([modin_df, modin_df2, pandas_series], axis=1),\n pandas.concat([df, df2, pandas_series], axis=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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_on_index_test_concat_on_index.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_on_index_test_concat_on_index.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 84, "span_ids": ["test_concat_on_index"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_on_index():\n df, df2 = generate_dfs()\n modin_df, modin_df2 = from_pandas(df), from_pandas(df2)\n\n df_equals(\n pd.concat([modin_df, modin_df2], axis=\"index\"),\n pandas.concat([df, df2], axis=\"index\"),\n )\n\n df_equals(\n pd.concat([modin_df, modin_df2], axis=\"rows\"),\n pandas.concat([df, df2], axis=\"rows\"),\n )\n\n df_equals(\n pd.concat([modin_df, modin_df2], axis=0), pandas.concat([df, df2], axis=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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_on_column_test_concat_on_column.assert_modin_result_dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_on_column_test_concat_on_column.assert_modin_result_dtype", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 87, "end_line": 116, "span_ids": ["test_concat_on_column"], "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": "@pytest.mark.parametrize(\"no_dup_cols\", [True, False])\n@pytest.mark.parametrize(\"different_len\", [True, False])\ndef test_concat_on_column(no_dup_cols, different_len):\n df, df2 = generate_dfs()\n if no_dup_cols:\n df = df.drop(set(df.columns) & set(df2.columns), axis=\"columns\")\n if different_len:\n df = pandas.concat([df, df], ignore_index=True)\n\n modin_df, modin_df2 = from_pandas(df), from_pandas(df2)\n\n df_equals(\n pd.concat([modin_df, modin_df2], axis=1), pandas.concat([df, df2], axis=1)\n )\n\n df_equals(\n pd.concat([modin_df, modin_df2], axis=\"columns\"),\n pandas.concat([df, df2], axis=\"columns\"),\n )\n\n modin_result = pd.concat(\n [pd.Series(np.ones(10)), pd.Series(np.ones(10))], axis=1, ignore_index=True\n )\n pandas_result = pandas.concat(\n [pandas.Series(np.ones(10)), pandas.Series(np.ones(10))],\n axis=1,\n ignore_index=True,\n )\n df_equals(modin_result, pandas_result)\n assert modin_result.dtypes.equals(pandas_result.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_invalid_axis_errors_test_ignore_index_concat.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_invalid_axis_errors_test_ignore_index_concat.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 165, "span_ids": ["test_ignore_index_concat", "test_mixed_none_concat", "test_mixed_concat", "test_mixed_inner_concat", "test_invalid_axis_errors"], "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": "def test_invalid_axis_errors():\n df, df2 = generate_dfs()\n modin_df, modin_df2 = from_pandas(df), from_pandas(df2)\n\n with pytest.raises(ValueError):\n pd.concat([modin_df, modin_df2], axis=2)\n\n\ndef test_mixed_concat():\n df, df2 = generate_dfs()\n df3 = df.copy()\n\n mixed_dfs = [from_pandas(df), from_pandas(df2), df3]\n\n df_equals(pd.concat(mixed_dfs), pandas.concat([df, df2, df3]))\n\n\ndef test_mixed_inner_concat():\n df, df2 = generate_dfs()\n df3 = df.copy()\n\n mixed_dfs = [from_pandas(df), from_pandas(df2), df3]\n\n df_equals(\n pd.concat(mixed_dfs, join=\"inner\"),\n pandas.concat([df, df2, df3], join=\"inner\"),\n # https://github.com/modin-project/modin/issues/5963\n check_dtypes=False,\n )\n\n\ndef test_mixed_none_concat():\n df, df2 = generate_none_dfs()\n df3 = df.copy()\n\n mixed_dfs = [from_pandas(df), from_pandas(df2), df3]\n\n df_equals(pd.concat(mixed_dfs), pandas.concat([df, df2, df3]))\n\n\ndef test_ignore_index_concat():\n df, df2 = generate_dfs()\n\n df_equals(\n pd.concat([df, df2], ignore_index=True),\n pandas.concat([df, df2], ignore_index=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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_non_subscriptable_keys_test_concat_non_subscriptable_keys.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_non_subscriptable_keys_test_concat_non_subscriptable_keys.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 168, "end_line": 177, "span_ids": ["test_concat_non_subscriptable_keys"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_non_subscriptable_keys():\n frame_data = np.random.randint(0, 100, size=(2**10, 2**6))\n df = pd.DataFrame(frame_data).add_prefix(\"col\")\n pdf = pandas.DataFrame(frame_data).add_prefix(\"col\")\n\n modin_dict = {\"c\": df.copy(), \"b\": df.copy()}\n pandas_dict = {\"c\": pdf.copy(), \"b\": pdf.copy()}\n modin_result = pd.concat(modin_dict.values(), keys=modin_dict.keys())\n pandas_result = pandas.concat(pandas_dict.values(), keys=pandas_dict.keys())\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_series_only_test_concat_5776.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_series_only_test_concat_5776.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 180, "end_line": 196, "span_ids": ["test_concat_series_only", "test_concat_5776"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_series_only():\n modin_series = pd.Series(list(range(1000)))\n pandas_series = pandas.Series(list(range(1000)))\n\n df_equals(\n pd.concat([modin_series, modin_series]),\n pandas.concat([pandas_series, pandas_series]),\n )\n\n\ndef test_concat_5776():\n modin_data = {key: pd.Series(index=range(3)) for key in [\"a\", \"b\"]}\n pandas_data = {key: pandas.Series(index=range(3)) for key in [\"a\", \"b\"]}\n df_equals(\n pd.concat(modin_data, axis=\"columns\"),\n pandas.concat(pandas_data, axis=\"columns\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_with_empty_frame_test_concat_with_empty_frame.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_with_empty_frame_test_concat_with_empty_frame.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 199, "end_line": 219, "span_ids": ["test_concat_with_empty_frame"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_with_empty_frame():\n modin_empty_df = pd.DataFrame()\n pandas_empty_df = pandas.DataFrame()\n modin_row = pd.Series({0: \"a\", 1: \"b\"})\n pandas_row = pandas.Series({0: \"a\", 1: \"b\"})\n df_equals(\n pd.concat([modin_empty_df, modin_row]),\n pandas.concat([pandas_empty_df, pandas_row]),\n )\n\n md_empty1, pd_empty1 = create_test_dfs(index=[1, 2, 3])\n md_empty2, pd_empty2 = create_test_dfs(index=[2, 3, 4])\n\n df_equals(\n pd.concat([md_empty1, md_empty2], axis=0),\n pandas.concat([pd_empty1, pd_empty2], axis=0),\n )\n df_equals(\n pd.concat([md_empty1, md_empty2], axis=1),\n pandas.concat([pd_empty1, pd_empty2], axis=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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_multiindex_test_concat_multiindex.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_multiindex_test_concat_multiindex.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 222, "end_line": 237, "span_ids": ["test_concat_multiindex"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"names\", [False, True])\ndef test_concat_multiindex(axis, names):\n pd_df1, pd_df2 = generate_multiindex_dfs(axis=axis)\n md_df1, md_df2 = map(from_pandas, [pd_df1, pd_df2])\n\n keys = [\"first\", \"second\"]\n if names:\n names = [str(i) for i in np.arange(pd_df1.axes[axis].nlevels + 1)]\n else:\n names = None\n\n df_equals(\n pd.concat([md_df1, md_df2], keys=keys, axis=axis, names=names),\n pandas.concat([pd_df1, pd_df2], keys=keys, axis=axis, names=names),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_dictionary_test_concat_dictionary.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_dictionary_test_concat_dictionary.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 248, "span_ids": ["test_concat_dictionary"], "tokens": 103}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"axis\", [0, 1])\ndef test_concat_dictionary(axis):\n pandas_df, pandas_df2 = generate_dfs()\n modin_df, modin_df2 = from_pandas(pandas_df), from_pandas(pandas_df2)\n\n df_equals(\n pd.concat({\"A\": modin_df, \"B\": modin_df2}, axis=axis),\n pandas.concat({\"A\": pandas_df, \"B\": pandas_df2}, axis=axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_sort_order_test_sort_order.assert_list_pandas_concat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_sort_order_test_sort_order.assert_list_pandas_concat", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 251, "end_line": 266, "span_ids": ["test_sort_order"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"sort\", [False, True])\n@pytest.mark.parametrize(\"join\", [\"inner\", \"outer\"])\n@pytest.mark.parametrize(\"axis\", [0, 1])\ndef test_sort_order(sort, join, axis):\n pandas_df = pandas.DataFrame({\"c\": [3], \"d\": [4]}, columns=[\"d\", \"c\"])\n pandas_df2 = pandas.DataFrame({\"a\": [1], \"b\": [2]}, columns=[\"b\", \"a\"])\n modin_df, modin_df2 = from_pandas(pandas_df), from_pandas(pandas_df2)\n pandas_concat = pandas.concat([pandas_df, pandas_df2], join=join, sort=sort)\n modin_concat = pd.concat([modin_df, modin_df2], join=join, sort=sort)\n df_equals(\n pandas_concat,\n modin_concat,\n # https://github.com/modin-project/modin/issues/5963\n check_dtypes=join != \"inner\",\n )\n assert list(pandas_concat.columns) == list(modin_concat.columns)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_empty_test_concat_empty.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_empty_test_concat_empty.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 269, "end_line": 295, "span_ids": ["test_concat_empty"], "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": "@pytest.mark.parametrize(\n \"data1, index1, data2, index2\",\n [\n (None, None, None, None),\n (None, None, {\"A\": [1, 2, 3]}, pandas.Index([1, 2, 3], name=\"Test\")),\n ({\"A\": [1, 2, 3]}, pandas.Index([1, 2, 3], name=\"Test\"), None, None),\n ({\"A\": [1, 2, 3]}, None, None, None),\n (None, None, {\"A\": [1, 2, 3]}, None),\n (None, pandas.Index([1, 2, 3], name=\"Test\"), None, None),\n (None, None, None, pandas.Index([1, 2, 3], name=\"Test\")),\n ],\n)\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"join\", [\"inner\", \"outer\"])\ndef test_concat_empty(data1, index1, data2, index2, axis, join):\n pdf1 = pandas.DataFrame(data1, index=index1)\n pdf2 = pandas.DataFrame(data2, index=index2)\n pdf = pandas.concat((pdf1, pdf2), axis=axis, join=join)\n mdf1 = pd.DataFrame(data1, index=index1)\n mdf2 = pd.DataFrame(data2, index=index2)\n mdf = pd.concat((mdf1, mdf2), axis=axis, join=join)\n df_equals(\n pdf,\n mdf,\n # https://github.com/modin-project/modin/issues/5963\n check_dtypes=join != \"inner\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_empty_df_series_test_concat_empty_df_series.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_empty_df_series_test_concat_empty_df_series.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 298, "end_line": 314, "span_ids": ["test_concat_empty_df_series"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_empty_df_series():\n pdf = pandas.concat((pandas.DataFrame({\"A\": [1, 2, 3]}), pandas.Series()))\n mdf = pd.concat((pd.DataFrame({\"A\": [1, 2, 3]}), pd.Series()))\n df_equals(\n pdf,\n mdf,\n # https://github.com/modin-project/modin/issues/5964\n check_dtypes=False,\n )\n pdf = pandas.concat((pandas.DataFrame(), pandas.Series([1, 2, 3])))\n mdf = pd.concat((pd.DataFrame(), pd.Series([1, 2, 3])))\n df_equals(\n pdf,\n mdf,\n # https://github.com/modin-project/modin/issues/5964\n check_dtypes=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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_different_num_cols_test_concat_different_num_cols.create_frame.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_different_num_cols_test_concat_different_num_cols.create_frame.return.df", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 317, "end_line": 358, "span_ids": ["test_concat_different_num_cols"], "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": "@pytest.mark.skipif(\n StorageFormat.get() not in (\"Hdk\", \"Base\"),\n reason=\"https://github.com/modin-project/modin/issues/5696\",\n)\n@pytest.mark.parametrize(\"col_type\", [None, \"str\"])\n@pytest.mark.parametrize(\"df1_cols\", [0, 90, 100])\n@pytest.mark.parametrize(\"df2_cols\", [0, 90, 100])\n@pytest.mark.parametrize(\"df1_rows\", [0, 100])\n@pytest.mark.parametrize(\"df2_rows\", [0, 100])\n@pytest.mark.parametrize(\"idx_type\", [None, \"str\"])\n@pytest.mark.parametrize(\"ignore_index\", [True, False])\n@pytest.mark.parametrize(\"sort\", [True, False])\n@pytest.mark.parametrize(\"join\", [\"inner\", \"outer\"])\ndef test_concat_different_num_cols(\n col_type,\n df1_cols,\n df2_cols,\n df1_rows,\n df2_rows,\n idx_type,\n ignore_index,\n sort,\n join,\n):\n def create_frame(frame_type, ncols, nrows):\n def to_str(val):\n return f\"str_{val}\"\n\n off = 0\n data = {}\n for n in range(1, ncols + 1):\n row = range(off + 1, off + nrows + 1)\n if col_type == \"str\":\n row = map(to_str, row)\n data[f\"Col_{n}\"] = list(row)\n off += nrows\n\n idx = None\n if idx_type == \"str\":\n idx = pandas.Index(map(to_str, range(1, nrows + 1)), name=f\"Index_{nrows}\")\n df = frame_type(data=data, index=idx)\n return df\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_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_different_num_cols.concat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_concat.py_test_concat_different_num_cols.concat_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_concat.py", "file_name": "test_concat.py", "file_type": "text/x-python", "category": "test", "start_line": 360, "end_line": 377, "span_ids": ["test_concat_different_num_cols"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n StorageFormat.get() not in (\"Hdk\", \"Base\"),\n reason=\"https://github.com/modin-project/modin/issues/5696\",\n)\n@pytest.mark.parametrize(\"col_type\", [None, \"str\"])\n@pytest.mark.parametrize(\"df1_cols\", [0, 90, 100])\n@pytest.mark.parametrize(\"df2_cols\", [0, 90, 100])\n@pytest.mark.parametrize(\"df1_rows\", [0, 100])\n@pytest.mark.parametrize(\"df2_rows\", [0, 100])\n@pytest.mark.parametrize(\"idx_type\", [None, \"str\"])\n@pytest.mark.parametrize(\"ignore_index\", [True, False])\n@pytest.mark.parametrize(\"sort\", [True, False])\n@pytest.mark.parametrize(\"join\", [\"inner\", \"outer\"])\ndef test_concat_different_num_cols(\n col_type,\n df1_cols,\n df2_cols,\n df1_rows,\n df2_rows,\n idx_type,\n ignore_index,\n sort,\n join,\n):\n # ... other code\n\n def concat(frame_type, lib):\n df1 = create_frame(frame_type, df1_cols, df1_rows)\n df2 = create_frame(frame_type, df2_cols, df2_rows)\n return lib.concat([df1, df2], ignore_index=ignore_index, sort=sort, join=join)\n\n mdf = concat(pd.DataFrame, pd)\n pdf = concat(pandas.DataFrame, pandas)\n df_equals(\n pdf,\n mdf,\n # Empty slicing causes this bug:\n # https://github.com/modin-project/modin/issues/5974\n check_dtypes=not (\n get_current_execution() == \"BaseOnPython\"\n and any(o == 0 for o in (df1_cols, df2_cols, df1_rows, df2_rows))\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_modin-project__modin/modin/pandas/test/test_expanding.py_pytest_create_test_series.return.modin_series_pandas_seri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_pytest_create_test_series.return.modin_series_pandas_seri", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_expanding.py", "file_name": "test_expanding.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 40, "span_ids": ["create_test_series", "docstring"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport numpy as np\nimport pandas\nimport modin.pandas as pd\n\nfrom .utils import (\n df_equals,\n test_data,\n test_data_values,\n test_data_keys,\n eval_general,\n create_test_dfs,\n)\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom modin.config import NPartitions\n\nNPartitions.put(4)\n\n\ndef create_test_series(vals):\n if isinstance(vals, dict):\n modin_series = pd.Series(vals[next(iter(vals.keys()))])\n pandas_series = pandas.Series(vals[next(iter(vals.keys()))])\n else:\n modin_series = pd.Series(vals)\n pandas_series = pandas.Series(vals)\n return modin_series, pandas_series", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_test_dataframe.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_test_dataframe.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_expanding.py", "file_name": "test_expanding.py", "file_type": "text/x-python", "category": "test", "start_line": 43, "end_line": 70, "span_ids": ["test_dataframe"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"method, kwargs\",\n [\n (\"count\", {}),\n (\"sum\", {}),\n (\"mean\", {}),\n (\"median\", {}),\n (\"skew\", {}),\n (\"kurt\", {}),\n (\"var\", {\"ddof\": 0}),\n (\"std\", {\"ddof\": 0}),\n (\"min\", {}),\n (\"max\", {}),\n (\"rank\", {}),\n (\"sem\", {\"ddof\": 0}),\n (\"quantile\", {\"q\": 0.1}),\n ],\n)\ndef test_dataframe(data, min_periods, axis, method, kwargs):\n eval_general(\n *create_test_dfs(data),\n lambda df: getattr(df.expanding(min_periods=min_periods, axis=axis), method)(\n **kwargs\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_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_corr_cov_test_dataframe_corr_cov_with_self.with_warns_that_defaultin.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_corr_cov_test_dataframe_corr_cov_with_self.with_warns_that_defaultin.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_expanding.py", "file_name": "test_expanding.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 97, "span_ids": ["test_dataframe_corr_cov_with_self", "test_dataframe_corr_cov"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"method\", [\"corr\", \"cov\"])\ndef test_dataframe_corr_cov(data, min_periods, axis, method):\n with warns_that_defaulting_to_pandas():\n eval_general(\n *create_test_dfs(data),\n lambda df: getattr(\n df.expanding(min_periods=min_periods, axis=axis), method\n )()\n )\n\n\n@pytest.mark.parametrize(\"method\", [\"corr\", \"cov\"])\ndef test_dataframe_corr_cov_with_self(method):\n mdf, pdf = create_test_dfs(test_data[\"float_nan_data\"])\n with warns_that_defaulting_to_pandas():\n eval_general(\n mdf,\n pdf,\n lambda df, other: getattr(df.expanding(), method)(other=other),\n other=pdf,\n md_extra_kwargs={\"other\": mdf},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_agg_test_dataframe_agg.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_dataframe_agg_test_dataframe_agg.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_expanding.py", "file_name": "test_expanding.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 118, "span_ids": ["test_dataframe_agg"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\ndef test_dataframe_agg(data, min_periods):\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n pandas_expanded = pandas_df.expanding(\n min_periods=min_periods,\n axis=0,\n )\n modin_expanded = modin_df.expanding(\n min_periods=min_periods,\n axis=0,\n )\n # aggregates are only supported on axis 0\n df_equals(modin_expanded.aggregate(np.sum), pandas_expanded.aggregate(np.sum))\n df_equals(\n pandas_expanded.aggregate([np.sum, np.mean]),\n modin_expanded.aggregate([np.sum, np.mean]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_series_test_series.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_series_test_series.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_expanding.py", "file_name": "test_expanding.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 147, "span_ids": ["test_series"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\n \"method, kwargs\",\n [\n (\"count\", {}),\n (\"sum\", {}),\n (\"mean\", {}),\n (\"median\", {}),\n (\"skew\", {}),\n (\"kurt\", {}),\n (\"corr\", {}),\n (\"cov\", {}),\n (\"var\", {\"ddof\": 0}),\n (\"std\", {\"ddof\": 0}),\n (\"min\", {}),\n (\"max\", {}),\n (\"rank\", {}),\n (\"sem\", {\"ddof\": 0}),\n (\"quantile\", {\"q\": 0.1}),\n ],\n)\ndef test_series(data, min_periods, method, kwargs):\n eval_general(\n *create_test_series(data),\n lambda df: getattr(df.expanding(min_periods=min_periods), method)(**kwargs)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_series_agg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_expanding.py_test_series_agg_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_expanding.py", "file_name": "test_expanding.py", "file_type": "text/x-python", "category": "test", "start_line": 150, "end_line": 174, "span_ids": ["test_series_agg", "test_series_corr_cov_with_self"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\ndef test_series_agg(data, min_periods):\n modin_series, pandas_series = create_test_series(data)\n pandas_expanded = pandas_series.expanding(min_periods=min_periods)\n modin_expanded = modin_series.expanding(min_periods=min_periods)\n\n df_equals(modin_expanded.aggregate(np.sum), pandas_expanded.aggregate(np.sum))\n df_equals(\n pandas_expanded.aggregate([np.sum, np.mean]),\n modin_expanded.aggregate([np.sum, np.mean]),\n )\n\n\n@pytest.mark.parametrize(\"method\", [\"corr\", \"cov\"])\ndef test_series_corr_cov_with_self(method):\n mdf, pdf = create_test_series(test_data[\"float_nan_data\"])\n eval_general(\n mdf,\n pdf,\n lambda df, other: getattr(df.expanding(), method)(other=other),\n other=pdf,\n md_extra_kwargs={\"other\": mdf},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_contextlib__nullcontext.yield": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_contextlib__nullcontext.yield", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 45, "span_ids": ["_nullcontext", "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": "import contextlib\nimport pandas\nimport pytest\nimport modin.pandas as pd\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nfrom modin.utils import get_current_execution, to_pandas\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom modin.config import StorageFormat\nfrom pandas.testing import assert_frame_equal\n\nfrom .utils import (\n create_test_dfs,\n test_data_values,\n test_data_keys,\n df_equals,\n sort_index_for_equal_values,\n eval_general,\n bool_arg_values,\n bool_arg_keys,\n default_to_pandas_ignore_string,\n)\n\n\nif StorageFormat.get() == \"Hdk\":\n pytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\n\n@contextlib.contextmanager\ndef _nullcontext():\n \"\"\"Replacement for contextlib.nullcontext missing in older Python.\"\"\"\n yield", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_isna_isnull_notna_notnull_test_isna_isnull_notna_notnull.assert_pd_isna_np_nan_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_isna_isnull_notna_notnull_test_isna_isnull_notna_notnull.assert_pd_isna_np_nan_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 68, "span_ids": ["test_isna_isnull_notna_notnull"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"append_na\", [True, False])\n@pytest.mark.parametrize(\"op\", [\"isna\", \"isnull\", \"notna\", \"notnull\"])\ndef test_isna_isnull_notna_notnull(data, append_na, op):\n pandas_df = pandas.DataFrame(data)\n modin_df = pd.DataFrame(pandas_df)\n if append_na:\n pandas_df[\"NONE_COL\"] = None\n pandas_df[\"NAN_COL\"] = np.nan\n modin_df[\"NONE_COL\"] = None\n modin_df[\"NAN_COL\"] = np.nan\n\n pandas_result = getattr(pandas, op)(pandas_df)\n modin_result = getattr(pd, op)(modin_df)\n df_equals(modin_result, pandas_result)\n\n modin_result = getattr(pd, op)(pd.Series([1, np.nan, 2]))\n pandas_result = getattr(pandas, op)(pandas.Series([1, np.nan, 2]))\n df_equals(modin_result, pandas_result)\n\n assert pd.isna(np.nan) == pandas.isna(np.nan)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_test_merge.with_pytest_raises_TypeEr.pd_merge_Non_valid_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_test_merge.with_pytest_raises_TypeEr.pd_merge_Non_valid_type_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 155, "span_ids": ["test_merge"], "tokens": 804}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge():\n frame_data = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 0, 1],\n \"col4\": [2, 4, 5, 6],\n }\n\n modin_df = pd.DataFrame(frame_data)\n pandas_df = pandas.DataFrame(frame_data)\n\n frame_data2 = {\"col1\": [0, 1, 2], \"col2\": [1, 5, 6]}\n modin_df2 = pd.DataFrame(frame_data2)\n pandas_df2 = pandas.DataFrame(frame_data2)\n\n join_types = [\"outer\", \"inner\"]\n for how in join_types:\n with warns_that_defaulting_to_pandas() if how == \"outer\" else _nullcontext():\n modin_result = pd.merge(modin_df, modin_df2, how=how)\n pandas_result = pandas.merge(pandas_df, pandas_df2, how=how)\n df_equals(modin_result, pandas_result)\n\n # left_on and right_index\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge(\n modin_df, modin_df2, how=how, left_on=\"col1\", right_index=True\n )\n pandas_result = pandas.merge(\n pandas_df, pandas_df2, how=how, left_on=\"col1\", right_index=True\n )\n df_equals(modin_result, pandas_result)\n\n # left_index and right_on\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge(\n modin_df, modin_df2, how=how, left_index=True, right_on=\"col1\"\n )\n pandas_result = pandas.merge(\n pandas_df, pandas_df2, how=how, left_index=True, right_on=\"col1\"\n )\n df_equals(modin_result, pandas_result)\n\n # left_on and right_on col1\n if how == \"outer\":\n warning_catcher = warns_that_defaulting_to_pandas()\n else:\n warning_catcher = _nullcontext()\n with warning_catcher:\n modin_result = pd.merge(\n modin_df, modin_df2, how=how, left_on=\"col1\", right_on=\"col1\"\n )\n pandas_result = pandas.merge(\n pandas_df, pandas_df2, how=how, left_on=\"col1\", right_on=\"col1\"\n )\n df_equals(modin_result, pandas_result)\n\n # left_on and right_on col2\n if how == \"outer\":\n warning_catcher = warns_that_defaulting_to_pandas()\n else:\n warning_catcher = _nullcontext()\n with warning_catcher:\n modin_result = pd.merge(\n modin_df, modin_df2, how=how, left_on=\"col2\", right_on=\"col2\"\n )\n pandas_result = pandas.merge(\n pandas_df, pandas_df2, how=how, left_on=\"col2\", right_on=\"col2\"\n )\n df_equals(modin_result, pandas_result)\n\n # left_index and right_index\n modin_result = pd.merge(\n modin_df, modin_df2, how=how, left_index=True, right_index=True\n )\n pandas_result = pandas.merge(\n pandas_df, pandas_df2, how=how, left_index=True, right_index=True\n )\n df_equals(modin_result, pandas_result)\n\n s = pd.Series(frame_data.get(\"col1\"))\n with pytest.raises(ValueError):\n pd.merge(s, modin_df2)\n\n with pytest.raises(TypeError):\n pd.merge(\"Non-valid type\", modin_df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_ordered_test_merge_ordered.with_pytest_raises_TypeEr.pd_merge_ordered_data_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_ordered_test_merge_ordered.with_pytest_raises_TypeEr.pd_merge_ordered_data_a_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 158, "end_line": 176, "span_ids": ["test_merge_ordered"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge_ordered():\n data_a = {\n \"key\": list(\"aceace\"),\n \"lvalue\": [1, 2, 3, 1, 2, 3],\n \"group\": list(\"aaabbb\"),\n }\n data_b = {\"key\": list(\"bcd\"), \"rvalue\": [1, 2, 3]}\n\n modin_df_a = pd.DataFrame(data_a)\n modin_df_b = pd.DataFrame(data_b)\n\n with warns_that_defaulting_to_pandas():\n df = pd.merge_ordered(\n modin_df_a, modin_df_b, fill_method=\"ffill\", left_by=\"group\"\n )\n assert isinstance(df, pd.DataFrame)\n\n with pytest.raises(TypeError):\n pd.merge_ordered(data_a, data_b, fill_method=\"ffill\", left_by=\"group\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_test_merge_asof.with_pytest_raises_ValueE.pd_merge_asof_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_test_merge_asof.with_pytest_raises_ValueE.pd_merge_asof_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 179, "end_line": 215, "span_ids": ["test_merge_asof"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"right_index\", [None, [0] * 5], ids=[\"default\", \"non_unique\"])\ndef test_merge_asof(right_index):\n left = pd.DataFrame({\"a\": [1, 5, 10], \"left_val\": [\"a\", \"b\", \"c\"]})\n right = pd.DataFrame(\n {\"a\": [1, 2, 3, 6, 7], \"right_val\": [1, 2, 3, 6, 7]}, index=right_index\n )\n\n with warns_that_defaulting_to_pandas():\n df = pd.merge_asof(left, right, on=\"a\")\n assert isinstance(df, pd.DataFrame)\n\n with warns_that_defaulting_to_pandas():\n df = pd.merge_asof(left, right, on=\"a\", allow_exact_matches=False)\n assert isinstance(df, pd.DataFrame)\n\n with warns_that_defaulting_to_pandas():\n df = pd.merge_asof(left, right, on=\"a\", direction=\"forward\")\n assert isinstance(df, pd.DataFrame)\n\n with warns_that_defaulting_to_pandas():\n df = pd.merge_asof(left, right, on=\"a\", direction=\"nearest\")\n assert isinstance(df, pd.DataFrame)\n\n left = pd.DataFrame({\"left_val\": [\"a\", \"b\", \"c\"]}, index=[1, 5, 10])\n right = pd.DataFrame({\"right_val\": [1, 2, 3, 6, 7]}, index=[1, 2, 3, 6, 7])\n\n with warns_that_defaulting_to_pandas():\n df = pd.merge_asof(left, right, left_index=True, right_index=True)\n assert isinstance(df, pd.DataFrame)\n\n with pytest.raises(ValueError):\n pd.merge_asof(\n {\"left_val\": [\"a\", \"b\", \"c\"]},\n {\"right_val\": [1, 2, 3, 6, 7]},\n left_index=True,\n right_index=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_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_on_variations_test_merge_asof_on_variations.for_on_arguments_in_.df_equals_pandas_merged_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_on_variations_test_merge_asof_on_variations.for_on_arguments_in_.df_equals_pandas_merged_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 218, "end_line": 242, "span_ids": ["test_merge_asof_on_variations"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge_asof_on_variations():\n \"\"\"on=,left_on=,right_on=,right_index=,left_index= options match Pandas.\"\"\"\n left = {\"a\": [1, 5, 10], \"left_val\": [\"a\", \"b\", \"c\"]}\n left_index = [6, 8, 12]\n right = {\"a\": [1, 2, 3, 6, 7], \"right_val\": [\"d\", \"e\", \"f\", \"g\", \"h\"]}\n right_index = [6, 7, 8, 9, 15]\n pandas_left, pandas_right = (\n pandas.DataFrame(left, index=left_index),\n pandas.DataFrame(right, index=right_index),\n )\n modin_left, modin_right = (\n pd.DataFrame(left, index=left_index),\n pd.DataFrame(right, index=right_index),\n )\n for on_arguments in [\n {\"on\": \"a\"},\n {\"left_on\": \"a\", \"right_on\": \"a\"},\n {\"left_on\": \"a\", \"right_index\": True},\n {\"left_index\": True, \"right_on\": \"a\"},\n {\"left_index\": True, \"right_index\": True},\n ]:\n pandas_merged = pandas.merge_asof(pandas_left, pandas_right, **on_arguments)\n with warns_that_defaulting_to_pandas():\n modin_merged = pd.merge_asof(modin_left, modin_right, **on_arguments)\n df_equals(pandas_merged, modin_merged)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_suffixes_test_merge_asof_suffixes.None_2.pd_merge_asof_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_suffixes_test_merge_asof_suffixes.None_2.pd_merge_asof_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 245, "end_line": 284, "span_ids": ["test_merge_asof_suffixes"], "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": "def test_merge_asof_suffixes():\n \"\"\"Suffix variations are handled the same as Pandas.\"\"\"\n left = {\"a\": [1, 5, 10]}\n right = {\"a\": [2, 3, 6]}\n pandas_left, pandas_right = (pandas.DataFrame(left), pandas.DataFrame(right))\n modin_left, modin_right = pd.DataFrame(left), pd.DataFrame(right)\n for suffixes in [(\"a\", \"b\"), (False, \"c\"), (\"d\", False)]:\n pandas_merged = pandas.merge_asof(\n pandas_left,\n pandas_right,\n left_index=True,\n right_index=True,\n suffixes=suffixes,\n )\n with warns_that_defaulting_to_pandas():\n modin_merged = pd.merge_asof(\n modin_left,\n modin_right,\n left_index=True,\n right_index=True,\n suffixes=suffixes,\n )\n df_equals(pandas_merged, modin_merged)\n\n with pytest.raises(ValueError):\n pandas.merge_asof(\n pandas_left,\n pandas_right,\n left_index=True,\n right_index=True,\n suffixes=(False, False),\n )\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(\n modin_left,\n modin_right,\n left_index=True,\n right_index=True,\n suffixes=(False, 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_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_bad_arguments_test_merge_asof_bad_arguments.None_17.pd_merge_asof_modin_left_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_bad_arguments_test_merge_asof_bad_arguments.None_17.pd_merge_asof_modin_left_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 349, "span_ids": ["test_merge_asof_bad_arguments"], "tokens": 841}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge_asof_bad_arguments():\n left = {\"a\": [1, 5, 10], \"b\": [5, 7, 9]}\n right = {\"a\": [2, 3, 6], \"b\": [6, 5, 20]}\n pandas_left, pandas_right = (pandas.DataFrame(left), pandas.DataFrame(right))\n modin_left, modin_right = pd.DataFrame(left), pd.DataFrame(right)\n\n # Can't mix by with left_by/right_by\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pandas.merge_asof(\n pandas_left, pandas_right, on=\"a\", by=\"b\", left_by=\"can't do with by\"\n )\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(\n modin_left, modin_right, on=\"a\", by=\"b\", left_by=\"can't do with by\"\n )\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pandas.merge_asof(\n pandas_left, pandas_right, by=\"b\", on=\"a\", right_by=\"can't do with by\"\n )\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(\n modin_left, modin_right, by=\"b\", on=\"a\", right_by=\"can't do with by\"\n )\n\n # Can't mix on with left_on/right_on\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pandas.merge_asof(pandas_left, pandas_right, on=\"a\", left_on=\"can't do with by\")\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right, on=\"a\", left_on=\"can't do with by\")\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pandas.merge_asof(\n pandas_left, pandas_right, on=\"a\", right_on=\"can't do with by\"\n )\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right, on=\"a\", right_on=\"can't do with by\")\n\n # Can't mix left_index with left_on or on, similarly for right.\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right, on=\"a\", right_index=True)\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(\n modin_left, modin_right, left_on=\"a\", right_on=\"a\", right_index=True\n )\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right, on=\"a\", left_index=True)\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(\n modin_left, modin_right, left_on=\"a\", right_on=\"a\", left_index=True\n )\n\n # Need both left and right\n with pytest.raises(Exception): # Pandas bug, didn't validate inputs sufficiently\n pandas.merge_asof(pandas_left, pandas_right, left_on=\"a\")\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right, left_on=\"a\")\n with pytest.raises(Exception): # Pandas bug, didn't validate inputs sufficiently\n pandas.merge_asof(pandas_left, pandas_right, right_on=\"a\")\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right, right_on=\"a\")\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pandas.merge_asof(pandas_left, pandas_right)\n with pytest.raises(ValueError), warns_that_defaulting_to_pandas():\n pd.merge_asof(modin_left, modin_right)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_merge_options_test_merge_asof_merge_options._Tolerance": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_merge_options_test_merge_asof_merge_options._Tolerance", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 352, "end_line": 426, "span_ids": ["test_merge_asof_merge_options"], "tokens": 751}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge_asof_merge_options():\n modin_quotes = pd.DataFrame(\n {\n \"time\": [\n pd.Timestamp(\"2016-05-25 13:30:00.023\"),\n pd.Timestamp(\"2016-05-25 13:30:00.023\"),\n pd.Timestamp(\"2016-05-25 13:30:00.030\"),\n pd.Timestamp(\"2016-05-25 13:30:00.041\"),\n pd.Timestamp(\"2016-05-25 13:30:00.048\"),\n pd.Timestamp(\"2016-05-25 13:30:00.049\"),\n pd.Timestamp(\"2016-05-25 13:30:00.072\"),\n pd.Timestamp(\"2016-05-25 13:30:00.075\"),\n ],\n \"ticker\": [\"GOOG\", \"MSFT\", \"MSFT\", \"MSFT\", \"GOOG\", \"AAPL\", \"GOOG\", \"MSFT\"],\n \"bid\": [720.50, 51.95, 51.97, 51.99, 720.50, 97.99, 720.50, 52.01],\n \"ask\": [720.93, 51.96, 51.98, 52.00, 720.93, 98.01, 720.88, 52.03],\n }\n )\n modin_trades = pd.DataFrame(\n {\n \"time\": [\n pd.Timestamp(\"2016-05-25 13:30:00.023\"),\n pd.Timestamp(\"2016-05-25 13:30:00.038\"),\n pd.Timestamp(\"2016-05-25 13:30:00.048\"),\n pd.Timestamp(\"2016-05-25 13:30:00.048\"),\n pd.Timestamp(\"2016-05-25 13:30:00.048\"),\n ],\n \"ticker2\": [\"MSFT\", \"MSFT\", \"GOOG\", \"GOOG\", \"AAPL\"],\n \"price\": [51.95, 51.95, 720.77, 720.92, 98.0],\n \"quantity\": [75, 155, 100, 100, 100],\n }\n )\n pandas_quotes, pandas_trades = to_pandas(modin_quotes), to_pandas(modin_trades)\n\n # left_by + right_by\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge_asof(\n modin_quotes,\n modin_trades,\n on=\"time\",\n left_by=\"ticker\",\n right_by=\"ticker2\",\n )\n df_equals(\n pandas.merge_asof(\n pandas_quotes,\n pandas_trades,\n on=\"time\",\n left_by=\"ticker\",\n right_by=\"ticker2\",\n ),\n modin_result,\n )\n\n # Just by:\n pandas_trades[\"ticker\"] = pandas_trades[\"ticker2\"]\n modin_trades[\"ticker\"] = modin_trades[\"ticker2\"]\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge_asof(\n modin_quotes,\n modin_trades,\n on=\"time\",\n by=\"ticker\",\n )\n df_equals(\n pandas.merge_asof(\n pandas_quotes,\n pandas_trades,\n on=\"time\",\n by=\"ticker\",\n ),\n modin_result,\n )\n\n # Tolerance\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_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_merge_options.None_2_test_merge_asof_merge_options.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_merge_asof_merge_options.None_2_test_merge_asof_merge_options.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 427, "end_line": 486, "span_ids": ["test_merge_asof_merge_options"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merge_asof_merge_options():\n # ... other code\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge_asof(\n modin_quotes,\n modin_trades,\n on=\"time\",\n by=\"ticker\",\n tolerance=pd.Timedelta(\"2ms\"),\n )\n df_equals(\n pandas.merge_asof(\n pandas_quotes,\n pandas_trades,\n on=\"time\",\n by=\"ticker\",\n tolerance=pd.Timedelta(\"2ms\"),\n ),\n modin_result,\n )\n\n # Direction\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge_asof(\n modin_quotes,\n modin_trades,\n on=\"time\",\n by=\"ticker\",\n direction=\"forward\",\n )\n df_equals(\n pandas.merge_asof(\n pandas_quotes,\n pandas_trades,\n on=\"time\",\n by=\"ticker\",\n direction=\"forward\",\n ),\n modin_result,\n )\n\n # Allow exact matches\n with warns_that_defaulting_to_pandas():\n modin_result = pd.merge_asof(\n modin_quotes,\n modin_trades,\n on=\"time\",\n by=\"ticker\",\n tolerance=pd.Timedelta(\"10ms\"),\n allow_exact_matches=False,\n )\n df_equals(\n pandas.merge_asof(\n pandas_quotes,\n pandas_trades,\n on=\"time\",\n by=\"ticker\",\n tolerance=pd.Timedelta(\"10ms\"),\n allow_exact_matches=False,\n ),\n modin_result,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_test_pivot.if_get_current_execution_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_test_pivot.if_get_current_execution_.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 489, "end_line": 516, "span_ids": ["test_pivot"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pivot():\n test_df = pd.DataFrame(\n {\n \"foo\": [\"one\", \"one\", \"one\", \"two\", \"two\", \"two\"],\n \"bar\": [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\"],\n \"baz\": [1, 2, 3, 4, 5, 6],\n \"zoo\": [\"x\", \"y\", \"z\", \"q\", \"w\", \"t\"],\n }\n )\n\n df = pd.pivot(test_df, index=\"foo\", columns=\"bar\", values=\"baz\")\n assert isinstance(df, pd.DataFrame)\n\n with pytest.raises(ValueError):\n pd.pivot(test_df[\"bar\"], index=\"foo\", columns=\"bar\", values=\"baz\")\n\n if get_current_execution() != \"BaseOnPython\" and StorageFormat.get() != \"Hdk\":\n # FIXME: Failed for some reason on 'BaseOnPython' and 'HDK'\n # https://github.com/modin-project/modin/issues/6240\n df_equals(\n pd.pivot(test_df, columns=\"bar\"),\n pandas.pivot(test_df._to_pandas(), columns=\"bar\"),\n )\n\n df_equals(\n pd.pivot(test_df, index=\"foo\", columns=\"bar\"),\n pandas.pivot(test_df._to_pandas(), index=\"foo\", columns=\"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_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_values_is_none_test_pivot_values_is_none.assert_isinstance_df_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_values_is_none_test_pivot_values_is_none.assert_isinstance_df_pd_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 519, "end_line": 529, "span_ids": ["test_pivot_values_is_none"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pivot_values_is_none():\n test_df = pd.DataFrame(\n {\n \"foo\": [\"one\", \"one\", \"one\", \"two\", \"two\", \"two\"],\n \"bar\": [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\"],\n \"baz\": [1, 2, 3, 4, 5, 6],\n \"zoo\": [\"x\", \"y\", \"z\", \"q\", \"w\", \"t\"],\n }\n )\n df = pd.pivot(test_df, index=\"foo\", columns=\"bar\")\n assert isinstance(df, pd.DataFrame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_table_test_pivot_table.with_pytest_raises_ValueE.pd_pivot_table_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_pivot_table_test_pivot_table.with_pytest_raises_ValueE.pd_pivot_table_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 532, "end_line": 561, "span_ids": ["test_pivot_table"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pivot_table():\n test_df = pd.DataFrame(\n {\n \"A\": [\"foo\", \"foo\", \"foo\", \"foo\", \"foo\", \"bar\", \"bar\", \"bar\", \"bar\"],\n \"B\": [\"one\", \"one\", \"one\", \"two\", \"two\", \"one\", \"one\", \"two\", \"two\"],\n \"C\": [\n \"small\",\n \"large\",\n \"large\",\n \"small\",\n \"small\",\n \"large\",\n \"small\",\n \"small\",\n \"large\",\n ],\n \"D\": [1, 2, 2, 3, 3, 4, 5, 6, 7],\n \"E\": [2, 4, 5, 5, 6, 6, 8, 9, 9],\n }\n )\n\n df = pd.pivot_table(\n test_df, values=\"D\", index=[\"A\", \"B\"], columns=[\"C\"], aggfunc=np.sum\n )\n assert isinstance(df, pd.DataFrame)\n\n with pytest.raises(ValueError):\n pd.pivot_table(\n test_df[\"C\"], values=\"D\", index=[\"A\", \"B\"], columns=[\"C\"], aggfunc=np.sum\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_unique_test_unique.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_unique_test_unique.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 564, "end_line": 625, "span_ids": ["test_unique"], "tokens": 503}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_unique():\n modin_result = pd.unique([2, 1, 3, 3])\n pandas_result = pandas.unique([2, 1, 3, 3])\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.unique(pd.Series([2] + [1] * 5))\n pandas_result = pandas.unique(pandas.Series([2] + [1] * 5))\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.unique(\n pd.Series([pd.Timestamp(\"20160101\"), pd.Timestamp(\"20160101\")])\n )\n pandas_result = pandas.unique(\n pandas.Series([pandas.Timestamp(\"20160101\"), pandas.Timestamp(\"20160101\")])\n )\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.unique(\n pd.Series(\n [\n pd.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n pd.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n ]\n )\n )\n pandas_result = pandas.unique(\n pandas.Series(\n [\n pandas.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n pandas.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n ]\n )\n )\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.unique(\n pd.Index(\n [\n pd.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n pd.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n ]\n )\n )\n pandas_result = pandas.unique(\n pandas.Index(\n [\n pandas.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n pandas.Timestamp(\"20160101\", tz=\"US/Eastern\"),\n ]\n )\n )\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.unique(pd.Series(pd.Categorical(list(\"baabc\"))))\n pandas_result = pandas.unique(pandas.Series(pandas.Categorical(list(\"baabc\"))))\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_value_counts_test_value_counts.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_value_counts_test_value_counts.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 628, "end_line": 659, "span_ids": ["test_value_counts"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/modin-project/modin/issues/2896\",\n)\n@pytest.mark.parametrize(\"normalize, bins, dropna\", [(True, 3, False)])\ndef test_value_counts(normalize, bins, dropna):\n # We sort indices for Modin and pandas result because of issue #1650\n values = np.array([3, 1, 2, 3, 4, np.nan])\n modin_result = sort_index_for_equal_values(\n pd.value_counts(values, normalize=normalize, ascending=False), False\n )\n pandas_result = sort_index_for_equal_values(\n pandas.value_counts(values, normalize=normalize, ascending=False), False\n )\n df_equals(modin_result, pandas_result)\n\n with warns_that_defaulting_to_pandas():\n modin_result = sort_index_for_equal_values(\n pd.value_counts(values, bins=bins, ascending=False), False\n )\n pandas_result = sort_index_for_equal_values(\n pandas.value_counts(values, bins=bins, ascending=False), False\n )\n df_equals(modin_result, pandas_result)\n\n modin_result = sort_index_for_equal_values(\n pd.value_counts(values, dropna=dropna, ascending=True), True\n )\n pandas_result = sort_index_for_equal_values(\n pandas.value_counts(values, dropna=dropna, ascending=True), True\n )\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_general.py_test_to_datetime_test_to_datetime.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_datetime_test_to_datetime.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 662, "end_line": 681, "span_ids": ["test_to_datetime"], "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": "def test_to_datetime():\n # DataFrame input for to_datetime\n modin_df = pd.DataFrame({\"year\": [2015, 2016], \"month\": [2, 3], \"day\": [4, 5]})\n pandas_df = pandas.DataFrame({\"year\": [2015, 2016], \"month\": [2, 3], \"day\": [4, 5]})\n df_equals(pd.to_datetime(modin_df), pandas.to_datetime(pandas_df))\n\n # Series input for to_datetime\n modin_s = pd.Series([\"3/11/2000\", \"3/12/2000\", \"3/13/2000\"] * 1000)\n pandas_s = pandas.Series([\"3/11/2000\", \"3/12/2000\", \"3/13/2000\"] * 1000)\n df_equals(pd.to_datetime(modin_s), pandas.to_datetime(pandas_s))\n\n # Other inputs for to_datetime\n value = 1490195805\n assert pd.to_datetime(value, unit=\"s\") == pandas.to_datetime(value, unit=\"s\")\n value = 1490195805433502912\n assert pd.to_datetime(value, unit=\"ns\") == pandas.to_datetime(value, unit=\"ns\")\n value = [1, 2, 3]\n assert pd.to_datetime(value, unit=\"D\", origin=pd.Timestamp(\"2000-01-01\")).equals(\n pandas.to_datetime(value, unit=\"D\", origin=pandas.Timestamp(\"2000-01-01\"))\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_datetime_inplace_side_effect_test_to_datetime_inplace_side_effect.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_datetime_inplace_side_effect_test_to_datetime_inplace_side_effect.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 684, "end_line": 693, "span_ids": ["test_to_datetime_inplace_side_effect"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_to_datetime_inplace_side_effect():\n # See GH#3063\n times = list(range(1617993360, 1618193360))\n values = list(range(215441, 415441))\n modin_df = pd.DataFrame({\"time\": times, \"value\": values})\n pandas_df = pandas.DataFrame({\"time\": times, \"value\": values})\n df_equals(\n pd.to_datetime(modin_df[\"time\"], unit=\"s\"),\n pandas.to_datetime(pandas_df[\"time\"], unit=\"s\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_numeric_test_to_numeric.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_to_numeric_test_to_numeric.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 696, "end_line": 711, "span_ids": ["test_to_numeric"], "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": "@pytest.mark.parametrize(\n \"data, errors, downcast\",\n [\n ([\"1.0\", \"2\", -3], \"raise\", None),\n ([\"1.0\", \"2\", -3], \"raise\", \"float\"),\n ([\"1.0\", \"2\", -3], \"raise\", \"signed\"),\n ([\"apple\", \"1.0\", \"2\", -3], \"ignore\", None),\n ([\"apple\", \"1.0\", \"2\", -3], \"coerce\", None),\n ],\n)\ndef test_to_numeric(data, errors, downcast):\n modin_series = pd.Series(data)\n pandas_series = pandas.Series(data)\n modin_result = pd.to_numeric(modin_series, errors=errors, downcast=downcast)\n pandas_result = pandas.to_numeric(pandas_series, errors=errors, downcast=downcast)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_general.py_test_qcut_test_qcut.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_qcut_test_qcut.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 714, "end_line": 733, "span_ids": ["test_qcut"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"retbins\", bool_arg_values, ids=bool_arg_keys)\ndef test_qcut(retbins):\n # test case from https://github.com/modin-project/modin/issues/5610\n pandas_series = pandas.Series(range(10))\n modin_series = pd.Series(range(10))\n pandas_result = pandas.qcut(pandas_series, 4, retbins=retbins)\n with warns_that_defaulting_to_pandas():\n modin_result = pd.qcut(modin_series, 4, retbins=retbins)\n if retbins:\n df_equals(modin_result[0], pandas_result[0])\n df_equals(modin_result[0].cat.categories, pandas_result[0].cat.categories)\n assert_array_equal(modin_result[1], pandas_result[1])\n else:\n df_equals(modin_result, pandas_result)\n df_equals(modin_result.cat.categories, pandas_result.cat.categories)\n\n # test case for fallback to pandas, taken from pandas docs\n pandas_result = pandas.qcut(range(5), 4)\n modin_result = pd.qcut(range(5), 4)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_general.py_test_cut_test_cut.try_.else_.if_not_isinstance_pd_resu.else_.for_pd_res_md_res_in_zip.if_isinstance_pd_res_pan.else_.np_testing_assert_array_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_cut_test_cut.try_.else_.if_not_isinstance_pd_resu.else_.for_pd_res_md_res_in_zip.if_isinstance_pd_res_pan.else_.np_testing_assert_array_e", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 736, "end_line": 804, "span_ids": ["test_cut"], "tokens": 685}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"bins, labels\",\n [\n pytest.param(\n [-int(1e18), -1000, 0, 1000, 2000, int(1e18)],\n [\n \"-inf_to_-1000\",\n \"-1000_to_0\",\n \"0_to_1000\",\n \"1000_to_2000\",\n \"2000_to_inf\",\n ],\n id=\"bin_list_spanning_entire_range_with_custom_labels\",\n ),\n pytest.param(\n [-int(1e18), -1000, 0, 1000, 2000, int(1e18)],\n None,\n id=\"bin_list_spanning_entire_range_with_default_labels\",\n ),\n pytest.param(\n [-1000, 0, 1000, 2000], None, id=\"bin_list_not_spanning_entire_range\"\n ),\n pytest.param(\n 10,\n [f\"custom_label{i}\" for i in range(9)],\n id=\"int_bin_10_with_custom_labels\",\n ),\n pytest.param(1, None, id=\"int_bin_1_with_default_labels\"),\n pytest.param(-1, None, id=\"int_bin_-1_with_default_labels\"),\n pytest.param(111, None, id=\"int_bin_111_with_default_labels\"),\n ],\n)\n@pytest.mark.parametrize(\"retbins\", bool_arg_values, ids=bool_arg_keys)\ndef test_cut(retbins, bins, labels):\n # Would use `eval_general` here, but `eval_general` expects the operation\n # to be supported by Modin, and so errors out when we give the defaulting\n # to pandas UserWarning. We could get around this by using\n # @pytest.mark.filterwarnings(\"ignore\"), but then `eval_general` fails because\n # sometimes the return type of pd.cut is an np.ndarray, and `eval_general` does\n # not know how to handle that.\n try:\n pd_result = pandas.cut(\n pandas.Series(range(1000)), retbins=retbins, bins=bins, labels=labels\n )\n except Exception as pd_e:\n with pytest.raises(Exception) as md_e:\n with warns_that_defaulting_to_pandas():\n md_result = pd.cut(\n pd.Series(range(1000)), retbins=retbins, bins=bins, labels=labels\n )\n assert isinstance(\n md_e.value, type(pd_e)\n ), f\"Got Modin Exception type {type(md_e.value)}, but pandas Exception type {type(pd_e)} was expected\"\n else:\n with warns_that_defaulting_to_pandas():\n md_result = pd.cut(\n pd.Series(range(1000)), retbins=retbins, bins=bins, labels=labels\n )\n if not isinstance(pd_result, tuple):\n df_equals(md_result, pd_result)\n else:\n assert isinstance(\n md_result, tuple\n ), \"Modin returned single value, but pandas returned tuple of values\"\n for pd_res, md_res in zip(pd_result, md_result):\n if isinstance(pd_res, pandas.Series):\n df_equals(pd_res, md_res)\n else:\n np.testing.assert_array_equal(pd_res, md_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_modin-project__modin/modin/pandas/test/test_general.py_test_cut_fallback_test_to_pandas_indices.for_axis_in_0_1_.assert_not_hasattr_md_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_cut_fallback_test_to_pandas_indices.for_axis_in_0_1_.assert_not_hasattr_md_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 807, "end_line": 840, "span_ids": ["test_to_pandas_indices", "test_cut_fallback"], "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 test_cut_fallback():\n # Test case for falling back to pandas for cut.\n pandas_result = pandas.cut(range(5), 4)\n with warns_that_defaulting_to_pandas():\n modin_result = pd.cut(range(5), 4)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\n \"data\", [test_data_values[0], []], ids=[\"test_data_values[0]\", \"[]\"]\n)\ndef test_to_pandas_indices(data):\n md_df = pd.DataFrame(data)\n index = pandas.MultiIndex.from_tuples(\n [(i, i * 2) for i in np.arange(len(md_df) + 1)], names=[\"A\", \"B\"]\n ).drop(0)\n columns = pandas.MultiIndex.from_tuples(\n [(i, i * 2) for i in np.arange(len(md_df.columns) + 1)], names=[\"A\", \"B\"]\n ).drop(0)\n\n md_df.index = index\n md_df.columns = columns\n\n pd_df = md_df._to_pandas()\n\n for axis in [0, 1]:\n assert md_df.axes[axis].equals(\n pd_df.axes[axis]\n ), f\"Indices at axis {axis} are different!\"\n assert not hasattr(md_df.axes[axis], \"equal_levels\") or md_df.axes[\n axis\n ].equal_levels(\n pd_df.axes[axis]\n ), f\"Levels of indices at axis {axis} are different!\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_create_categorical_dataframe_with_duplicate_column_name_test_create_categorical_dataframe_with_duplicate_column_name.assert_frame_equal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_create_categorical_dataframe_with_duplicate_column_name_test_create_categorical_dataframe_with_duplicate_column_name.assert_frame_equal_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 843, "end_line": 866, "span_ids": ["test_create_categorical_dataframe_with_duplicate_column_name"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_create_categorical_dataframe_with_duplicate_column_name():\n # This tests for https://github.com/modin-project/modin/issues/4312\n pd_df = pandas.DataFrame(\n {\n \"a\": pandas.Categorical([1, 2]),\n \"b\": [4, 5],\n \"c\": pandas.Categorical([7, 8]),\n }\n )\n pd_df.columns = [\"a\", \"b\", \"a\"]\n md_df = pd.DataFrame(pd_df)\n # Use assert_frame_equal instead of the common modin util df_equals because\n # we should check dtypes of the new categorical with check_dtype=True.\n # TODO(https://github.com/modin-project/modin/issues/3804): Make\n # df_equals set check_dtype=True and use df_equals instead.\n assert_frame_equal(\n md_df._to_pandas(),\n pd_df,\n check_dtype=True,\n check_index_type=True,\n check_column_type=True,\n check_names=True,\n check_categorical=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_modin-project__modin/modin/pandas/test/test_general.py_test_default_to_pandas_warning_message_test_default_to_pandas_warning_message.with_pytest_warns_UserWar.func_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_default_to_pandas_warning_message_test_default_to_pandas_warning_message.with_pytest_warns_UserWar.func_df_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 869, "end_line": 892, "span_ids": ["test_default_to_pandas_warning_message"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n get_current_execution() != \"BaseOnPython\",\n reason=\"This test make sense only on BaseOnPython execution.\",\n)\n@pytest.mark.parametrize(\n \"func, regex\",\n [\n (lambda df: df.mean(), r\"DataFrame\\.mean\"),\n (lambda df: df + df, r\"DataFrame\\.add\"),\n (lambda df: df.index, r\"DataFrame\\.get_axis\\(0\\)\"),\n (\n lambda df: df.drop(columns=\"col1\").squeeze().repeat(2),\n r\"Series\\.repeat\",\n ),\n (lambda df: df.groupby(\"col1\").prod(), r\"GroupBy\\.prod\"),\n (lambda df: df.rolling(1).count(), r\"Rolling\\.count\"),\n ],\n)\ndef test_default_to_pandas_warning_message(func, regex):\n data = {\"col1\": [1, 2, 3], \"col2\": [4, 5, 6]}\n df = pd.DataFrame(data)\n\n with pytest.warns(UserWarning, match=regex):\n func(df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_empty_dataframe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_general.py_test_empty_dataframe_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 895, "end_line": 936, "span_ids": ["test_empty_dataframe", "test_get", "test_series_to_timedelta", "test_empty_series", "test_to_timedelta"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_empty_dataframe():\n df = pd.DataFrame(columns=[\"a\", \"b\"])\n with warns_that_defaulting_to_pandas() if StorageFormat.get() != \"Hdk\" else _nullcontext():\n df[(df.a == 1) & (df.b == 2)]\n\n\ndef test_empty_series():\n s = pd.Series([])\n pd.to_numeric(s)\n\n\n@pytest.mark.parametrize(\n \"arg\",\n [[1, 2], [\"a\"], 1, \"a\"],\n ids=[\"list_of_ints\", \"list_of_invalid_strings\", \"scalar\", \"invalid_scalar\"],\n)\ndef test_to_timedelta(arg):\n # This test case comes from\n # https://github.com/modin-project/modin/issues/4966\n eval_general(pd, pandas, lambda lib: lib.to_timedelta(arg))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_series_to_timedelta(data):\n def make_frame(lib):\n series = lib.Series(\n next(iter(data.values())) if isinstance(data, dict) else data\n )\n return lib.to_timedelta(series).to_frame(name=\"timedelta\")\n\n eval_general(pd, pandas, make_frame)\n\n\n@pytest.mark.parametrize(\n \"key\",\n [[\"col0\"], \"col0\", \"col1\"],\n ids=[\"valid_list_of_string\", \"valid_string\", \"invalid_string\"],\n)\ndef test_get(key):\n modin_df, pandas_df = create_test_dfs({\"col0\": [0, 1]})\n eval_general(modin_df, pandas_df, lambda df: df.get(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_modin-project__modin/modin/pandas/test/test_groupby.py_pytest_pytestmark.pytest_mark_filterwarning": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_pytest_pytestmark.pytest_mark_filterwarning", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 61, "span_ids": ["docstring"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport itertools\nimport pandas\nimport numpy as np\nfrom unittest import mock\nimport datetime\n\nfrom modin.config import StorageFormat\nfrom modin.config.envvars import ExperimentalGroupbyImpl\nfrom modin.core.dataframe.pandas.partitioning.axis_partition import (\n PandasDataframeAxisPartition,\n)\nimport modin.pandas as pd\nfrom modin.utils import (\n try_cast_to_pandas,\n get_current_execution,\n hashable,\n MODIN_UNNAMED_SERIES_LABEL,\n)\nfrom modin.core.dataframe.algebra.default2pandas.groupby import GroupBy\nfrom modin.pandas.utils import from_pandas, is_scalar\nfrom .utils import (\n df_equals,\n check_df_columns_have_nans,\n create_test_dfs,\n eval_general,\n test_data,\n test_data_values,\n modin_df_almost_equals_pandas,\n try_modin_df_almost_equals_compare,\n generate_multiindex,\n test_groupby_data,\n dict_equals,\n value_equals,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\n\n\nNPartitions.put(4)\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_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_modin-project__modin/modin/pandas/test/test_groupby.py_modin_groupby_equals_pandas_eval_aggregation.return.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_modin_groupby_equals_pandas_eval_aggregation.return.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 88, "span_ids": ["eval_aggregation", "modin_groupby_equals_pandas"], "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 modin_groupby_equals_pandas(modin_groupby, pandas_groupby):\n eval_general(\n modin_groupby, pandas_groupby, lambda grp: grp.indices, comparator=dict_equals\n )\n eval_general(\n modin_groupby, pandas_groupby, lambda grp: grp.groups, comparator=dict_equals\n )\n\n for g1, g2 in itertools.zip_longest(modin_groupby, pandas_groupby):\n value_equals(g1[0], g2[0])\n df_equals(g1[1], g2[1])\n\n\ndef eval_aggregation(md_df, pd_df, operation=None, by=None, *args, **kwargs):\n if by is None:\n by = md_df.columns[0]\n if operation is None:\n operation = {}\n return eval_general(\n md_df,\n pd_df,\n lambda df, *args, **kwargs: df.groupby(by=by).agg(operation, *args, **kwargs),\n *args,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_build_types_asserter_build_types_asserter.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_build_types_asserter_build_types_asserter.return.wrapper", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 99, "span_ids": ["build_types_asserter"], "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 build_types_asserter(comparator):\n def wrapper(obj1, obj2, *args, **kwargs):\n error_str = f\"obj1 and obj2 has incorrect types: {type(obj1)} and {type(obj2)}\"\n assert not (is_scalar(obj1) ^ is_scalar(obj2)), error_str\n assert obj1.__module__.split(\".\")[0] == \"modin\", error_str\n assert obj2.__module__.split(\".\")[0] == \"pandas\", error_str\n comparator(obj1, obj2, *args, **kwargs)\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_dtypes_groupby_test_mixed_dtypes_groupby.for_by_in_by_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_dtypes_groupby_test_mixed_dtypes_groupby.for_by_in_by_values_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 292, "span_ids": ["test_mixed_dtypes_groupby"], "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": "@pytest.mark.parametrize(\"as_index\", [True, False])\ndef test_mixed_dtypes_groupby(as_index):\n frame_data = np.random.RandomState(42).randint(97, 198, size=(2**6, 2**4))\n pandas_df = pandas.DataFrame(frame_data).add_prefix(\"col\")\n # Convert every other column to string\n for col in pandas_df.iloc[\n :, [i for i in range(len(pandas_df.columns)) if i % 2 == 0]\n ]:\n pandas_df[col] = [str(chr(i)) for i in pandas_df[col]]\n modin_df = from_pandas(pandas_df)\n\n n = 1\n\n by_values = [\n (\"col1\",),\n (lambda x: x % 2,),\n (modin_df[\"col0\"].copy(), pandas_df[\"col0\"].copy()),\n (\"col3\",),\n ]\n\n for by in by_values:\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_dtypes_groupby.for_by_in_by_values_.if_isinstance_by_0_str__test_mixed_dtypes_groupby.for_by_in_by_values_.eval_groups_modin_groupby": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_dtypes_groupby.for_by_in_by_values_.if_isinstance_by_0_str__test_mixed_dtypes_groupby.for_by_in_by_values_.eval_groups_modin_groupby", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 292, "span_ids": ["test_mixed_dtypes_groupby"], "tokens": 1617}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"as_index\", [True, False])\ndef test_mixed_dtypes_groupby(as_index):\n\n for by in by_values:\n if isinstance(by[0], str) and by[0] == \"col3\":\n modin_groupby = modin_df.set_index(by[0]).groupby(\n by=by[0], as_index=as_index\n )\n pandas_groupby = pandas_df.set_index(by[0]).groupby(\n by=by[-1], as_index=as_index\n )\n # difference in behaviour between .groupby().ffill() and\n # .groupby.fillna(method='ffill') on duplicated indices\n # caused by https://github.com/pandas-dev/pandas/issues/43412\n # is hurting the tests, for now sort the frames\n md_sorted_grpby = (\n modin_df.set_index(by[0])\n .sort_index()\n .groupby(by=by[0], as_index=as_index)\n )\n pd_sorted_grpby = (\n pandas_df.set_index(by[0])\n .sort_index()\n .groupby(by=by[0], as_index=as_index)\n )\n else:\n modin_groupby = modin_df.groupby(by=by[0], as_index=as_index)\n pandas_groupby = pandas_df.groupby(by=by[-1], as_index=as_index)\n md_sorted_grpby, pd_sorted_grpby = modin_groupby, pandas_groupby\n\n modin_groupby_equals_pandas(modin_groupby, pandas_groupby)\n eval_ngroups(modin_groupby, pandas_groupby)\n eval_general(\n md_sorted_grpby,\n pd_sorted_grpby,\n lambda df: df.ffill(),\n comparator=lambda *dfs: df_equals(\n *sort_index_if_experimental_groupby(*dfs)\n ),\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sem(),\n modin_df_almost_equals_pandas,\n )\n eval_general(\n modin_groupby, pandas_groupby, lambda df: df.sample(random_state=1)\n )\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ewm(com=0.5).std())\n eval_shift(modin_groupby, pandas_groupby)\n eval_mean(modin_groupby, pandas_groupby, numeric_only=True)\n eval_any(modin_groupby, pandas_groupby)\n eval_min(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmax())\n eval_ndim(modin_groupby, pandas_groupby)\n eval_cumsum(modin_groupby, pandas_groupby, numeric_only=True)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pct_change(),\n modin_df_almost_equals_pandas,\n )\n eval_cummax(modin_groupby, pandas_groupby, numeric_only=True)\n\n # TODO Add more apply functions\n apply_functions = [lambda df: df.sum(), min]\n for func in apply_functions:\n eval_apply(modin_groupby, pandas_groupby, func)\n\n eval_dtypes(modin_groupby, pandas_groupby)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.first(),\n comparator=lambda *dfs: df_equals(\n *sort_index_if_experimental_groupby(*dfs)\n ),\n )\n eval_cummin(modin_groupby, pandas_groupby, numeric_only=True)\n eval_general(\n md_sorted_grpby,\n pd_sorted_grpby,\n lambda df: df.bfill(),\n comparator=lambda *dfs: df_equals(\n *sort_index_if_experimental_groupby(*dfs)\n ),\n )\n # numeric_only=False doesn't work\n eval_general(\n modin_groupby, pandas_groupby, lambda df: df.idxmin(numeric_only=True)\n )\n eval_prod(modin_groupby, pandas_groupby, numeric_only=True)\n if as_index:\n eval_std(modin_groupby, pandas_groupby, numeric_only=True)\n eval_var(modin_groupby, pandas_groupby, numeric_only=True)\n eval_skew(modin_groupby, pandas_groupby, numeric_only=True)\n\n agg_functions = [\n lambda df: df.sum(),\n \"min\",\n min,\n \"max\",\n max,\n sum,\n {\"col2\": \"sum\"},\n {\"col2\": sum},\n {\"col2\": \"max\", \"col4\": \"sum\", \"col5\": \"min\"},\n {\"col2\": max, \"col4\": sum, \"col5\": \"min\"},\n # Intersection of 'by' and agg cols for TreeReduce impl\n {\"col0\": \"count\", \"col1\": \"count\", \"col2\": \"count\"},\n # Intersection of 'by' and agg cols for FullAxis impl\n {\"col0\": \"nunique\", \"col1\": \"nunique\", \"col2\": \"nunique\"},\n ]\n for func in agg_functions:\n eval_agg(modin_groupby, pandas_groupby, func)\n eval_aggregate(modin_groupby, pandas_groupby, func)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.last())\n eval_max(modin_groupby, pandas_groupby)\n eval_len(modin_groupby, pandas_groupby)\n eval_sum(modin_groupby, pandas_groupby)\n if not ExperimentalGroupbyImpl.get():\n # `.group` fails with experimental groupby\n # https://github.com/modin-project/modin/issues/6083\n eval_ngroup(modin_groupby, pandas_groupby)\n eval_nunique(modin_groupby, pandas_groupby)\n eval_value_counts(modin_groupby, pandas_groupby)\n eval_median(modin_groupby, pandas_groupby, numeric_only=True)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.head(n),\n comparator=lambda *dfs: df_equals(\n *sort_index_if_experimental_groupby(*dfs)\n ),\n )\n eval_cumprod(modin_groupby, pandas_groupby, numeric_only=True)\n # numeric_only=False doesn't work\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.cov(numeric_only=True),\n modin_df_almost_equals_pandas,\n )\n\n transform_functions = [lambda df: df, lambda df: df + df]\n for func in transform_functions:\n eval_transform(modin_groupby, pandas_groupby, func)\n\n pipe_functions = [lambda dfgb: dfgb.sum()]\n for func in pipe_functions:\n eval_pipe(modin_groupby, pandas_groupby, func)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.corr(numeric_only=True),\n modin_df_almost_equals_pandas,\n )\n eval_fillna(modin_groupby, pandas_groupby)\n eval_count(modin_groupby, pandas_groupby)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.tail(n),\n comparator=lambda *dfs: df_equals(\n *sort_index_if_experimental_groupby(*dfs)\n ),\n )\n eval_quantile(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.take([0]))\n eval___getattr__(modin_groupby, pandas_groupby, \"col2\")\n eval_groups(modin_groupby, pandas_groupby)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_GetColumn_test_simple_row_groupby.maybe_get_columns.if_isinstance_by_list_.else_.return.by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_GetColumn_test_simple_row_groupby.maybe_get_columns.if_isinstance_by_list_.else_.return.by", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 295, "end_line": 379, "span_ids": ["GetColumn", "test_simple_row_groupby", "GetColumn.__init__", "GetColumn.__call__"], "tokens": 807}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetColumn:\n \"\"\"Indicate to the test that it should do gc(df).\"\"\"\n\n def __init__(self, name):\n self.name = name\n\n def __call__(self, df):\n return df[self.name]\n\n\n@pytest.mark.parametrize(\n \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n pandas_df = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, np.NaN, 7],\n \"col3\": [np.NaN, np.NaN, 12, 10],\n \"col4\": [17, 13, 16, 15],\n \"col5\": [-4, -5, -6, -7],\n }\n )\n\n if col1_category:\n pandas_df = pandas_df.astype({\"col1\": \"category\"})\n # As of pandas 1.4.0 operators like min cause TypeErrors to be raised on unordered\n # categorical columns. We need to specify the categorical column as ordered to bypass this.\n pandas_df[\"col1\"] = pandas_df[\"col1\"].cat.as_ordered()\n\n modin_df = from_pandas(pandas_df)\n n = 1\n\n def maybe_get_columns(df, by):\n if isinstance(by, list):\n return [o(df) if isinstance(o, GetColumn) else o for o in by]\n else:\n return by\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.modin_groupby_test_simple_row_groupby.eval_general_modin_groupb": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.modin_groupby_test_simple_row_groupby.eval_general_modin_groupb", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 381, "end_line": 391, "span_ids": ["test_simple_row_groupby"], "tokens": 654}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n\n modin_groupby = modin_df.groupby(\n by=maybe_get_columns(modin_df, by), as_index=as_index\n )\n\n pandas_by = maybe_get_columns(pandas_df, try_cast_to_pandas(by))\n pandas_groupby = pandas_df.groupby(by=pandas_by, as_index=as_index)\n\n modin_groupby_equals_pandas(modin_groupby, pandas_groupby)\n eval_ngroups(modin_groupby, pandas_groupby)\n eval_shift(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ffill())\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_as_index__test_simple_row_groupby.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_as_index__test_simple_row_groupby.None_8", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 392, "end_line": 413, "span_ids": ["test_simple_row_groupby"], "tokens": 763}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n if as_index:\n eval_general(modin_groupby, pandas_groupby, lambda df: df.nth(0))\n else:\n # FIXME: df.groupby(as_index=False).nth() does not produce correct index in Modin,\n # it should maintain values from df.index, not create a new one or re-order it;\n # it also produces completely wrong result for multi-column `by` :(\n if not isinstance(pandas_by, list) or len(pandas_by) <= 1:\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.nth(0).sort_values(\"col1\").reset_index(drop=True),\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sem(),\n modin_df_almost_equals_pandas,\n )\n eval_mean(modin_groupby, pandas_groupby, numeric_only=True)\n eval_any(modin_groupby, pandas_groupby)\n eval_min(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmax())\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.eval_ndim_modin_groupby__test_simple_row_groupby.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.eval_ndim_modin_groupby__test_simple_row_groupby.None_10", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 414, "end_line": 430, "span_ids": ["test_simple_row_groupby"], "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": "@pytest.mark.parametrize(\n \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n eval_ndim(modin_groupby, pandas_groupby)\n if not check_df_columns_have_nans(modin_df, by):\n # cum* functions produce undefined results for columns with NaNs so we run them only when \"by\" columns contain no NaNs\n eval_general(modin_groupby, pandas_groupby, lambda df: df.cumsum(axis=0))\n eval_general(modin_groupby, pandas_groupby, lambda df: df.cummax(axis=0))\n eval_general(modin_groupby, pandas_groupby, lambda df: df.cummin(axis=0))\n eval_general(modin_groupby, pandas_groupby, lambda df: df.cumprod(axis=0))\n eval_general(modin_groupby, pandas_groupby, lambda df: df.cumcount())\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pct_change(\n periods=2, fill_method=\"pad\", limit=1, freq=None, axis=1\n ),\n modin_df_almost_equals_pandas,\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.apply_functions_test_simple_row_groupby.agg_functions._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.apply_functions_test_simple_row_groupby.agg_functions._", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 432, "end_line": 466, "span_ids": ["test_simple_row_groupby"], "tokens": 834}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n\n apply_functions = [\n lambda df: df.sum(numeric_only=True),\n lambda df: pandas.Series([1, 2, 3, 4], name=\"result\"),\n min,\n ]\n for func in apply_functions:\n eval_apply(modin_groupby, pandas_groupby, func)\n\n eval_dtypes(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.first())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.bfill())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmin())\n # TypeError: category type does not support prod operations\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda grp: grp.prod(),\n )\n\n if as_index:\n eval_std(modin_groupby, pandas_groupby)\n eval_var(modin_groupby, pandas_groupby, numeric_only=True)\n eval_skew(modin_groupby, pandas_groupby, numeric_only=True)\n\n agg_functions = [\n lambda df: df.sum(),\n \"min\",\n \"max\",\n min,\n sum,\n # Intersection of 'by' and agg cols for TreeReduce impl\n {\"col1\": \"count\", \"col2\": \"count\"},\n # Intersection of 'by' and agg cols for FullAxis impl\n {\"col1\": \"nunique\", \"col2\": \"nunique\"},\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.for_func_in_agg_functions_test_simple_row_groupby.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.for_func_in_agg_functions_test_simple_row_groupby.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 467, "end_line": 490, "span_ids": ["test_simple_row_groupby"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n for func in agg_functions:\n # Pandas raises an exception when 'by' contains categorical key and `as_index=False`\n # because of this bug: https://github.com/pandas-dev/pandas/issues/36698\n # Modin correctly processes the result, that's why `check_exception_type=None` in some cases\n is_pandas_bug_case = not as_index and col1_category and isinstance(func, dict)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda grp: grp.agg(func),\n check_exception_type=None if is_pandas_bug_case else True,\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda grp: grp.aggregate(func),\n check_exception_type=None if is_pandas_bug_case else True,\n )\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.last())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.rank())\n eval_max(modin_groupby, pandas_groupby)\n eval_len(modin_groupby, pandas_groupby)\n # TypeError: category type does not support sum operations\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.None_20_test_simple_row_groupby.None_25": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.None_20_test_simple_row_groupby.None_25", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 491, "end_line": 521, "span_ids": ["test_simple_row_groupby"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sum(),\n )\n\n eval_ngroup(modin_groupby, pandas_groupby)\n # Pandas raising exception when 'by' contains categorical key and `as_index=False`\n # because of a bug: https://github.com/pandas-dev/pandas/issues/36698\n # Modin correctly processes the result, so that's why `check_exception_type=None` in some cases\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.nunique(),\n check_exception_type=None if (col1_category and not as_index) else True,\n )\n # TypeError: category type does not support median operations\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.median(),\n modin_df_almost_equals_pandas,\n )\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.head(n))\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.cov(),\n modin_df_almost_equals_pandas,\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.None_6_test_simple_row_groupby.eval_count_modin_groupby_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.None_6_test_simple_row_groupby.eval_count_modin_groupby_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 523, "end_line": 550, "span_ids": ["test_simple_row_groupby"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n\n if not check_df_columns_have_nans(modin_df, by):\n # Pandas groupby.transform does not work correctly with NaN values in grouping columns. See Pandas bug 17093.\n transform_functions = [lambda df: df + 4, lambda df: -df - 10]\n for func in transform_functions:\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.transform(func),\n check_exception_type=None,\n )\n\n pipe_functions = [lambda dfgb: dfgb.sum()]\n for func in pipe_functions:\n # TypeError: category type does not support sum operations\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pipe(func),\n )\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.corr(),\n modin_df_almost_equals_pandas,\n )\n eval_fillna(modin_groupby, pandas_groupby)\n eval_count(modin_groupby, pandas_groupby)\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_get_current_execution__test_simple_row_groupby._Intersection_of_the_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_get_current_execution__test_simple_row_groupby._Intersection_of_the_sel", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 551, "end_line": 568, "span_ids": ["test_simple_row_groupby"], "tokens": 728}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n if get_current_execution() != \"BaseOnPython\":\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.size(),\n check_exception_type=None,\n )\n eval_general(modin_groupby, pandas_groupby, lambda df: df.tail(n))\n eval_quantile(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.take([0]))\n if isinstance(by, list) and not any(\n isinstance(o, (pd.Series, pandas.Series)) for o in by\n ):\n # Not yet supported for non-original-column-from-dataframe Series in by:\n eval___getattr__(modin_groupby, pandas_groupby, \"col3\")\n eval___getitem__(modin_groupby, pandas_groupby, \"col3\")\n eval_groups(modin_groupby, pandas_groupby)\n # Intersection of the selection and 'by' columns is not yet supported\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.non_by_cols_test_simple_row_groupby._that_this_workaround_wo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.non_by_cols_test_simple_row_groupby._that_this_workaround_wo", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 569, "end_line": 579, "span_ids": ["test_simple_row_groupby"], "tokens": 667}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n non_by_cols = (\n # Potential selection starts only from the second column, because the first may\n # be categorical in this test, which is not yet supported\n [col for col in pandas_df.columns[1:] if col not in modin_groupby._internal_by]\n if isinstance(by, list)\n else [\"col3\", \"col4\"]\n )\n eval___getitem__(modin_groupby, pandas_groupby, non_by_cols)\n # When GroupBy.__getitem__ meets an intersection of the selection and 'by' columns\n # it throws a warning with the suggested workaround. The following code tests\n # that this workaround works as expected.\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_len_modin_groupby__int_test_simple_row_groupby.if_len_modin_groupby__int.eval___getitem___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_row_groupby.if_len_modin_groupby__int_test_simple_row_groupby.if_len_modin_groupby__int.eval___getitem___", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 580, "end_line": 600, "span_ids": ["test_simple_row_groupby"], "tokens": 740}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\",\n [\n [1, 2, 1, 2],\n lambda x: x % 3,\n \"col1\",\n [\"col1\"],\n # col2 contains NaN, is it necessary to test functions like size()\n \"col2\",\n [\"col2\"], # 5\n pytest.param(\n [\"col1\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col2\", \"col4\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n pytest.param(\n [\"col3\", \"col4\", \"col2\"],\n marks=pytest.mark.xfail(reason=\"Excluded because of bug #1554\"),\n ),\n # but cum* functions produce undefined results with NaNs so we need to test the same combinations without NaN too\n [\"col5\"], # 10\n [\"col1\", \"col5\"],\n [\"col5\", \"col4\"],\n [\"col4\", \"col5\"],\n [\"col5\", \"col4\", \"col1\"],\n [\"col1\", pd.Series([1, 5, 7, 8])], # 15\n [pd.Series([1, 5, 7, 8])],\n [\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n pd.Series([1, 5, 7, 8]),\n ],\n [\"col1\", GetColumn(\"col5\")],\n [GetColumn(\"col1\"), GetColumn(\"col5\")],\n [GetColumn(\"col1\")], # 20\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False], ids=lambda v: f\"as_index={v}\")\n@pytest.mark.parametrize(\n \"col1_category\", [True, False], ids=lambda v: f\"col1_category={v}\"\n)\ndef test_simple_row_groupby(by, as_index, col1_category):\n # ... other code\n if len(modin_groupby._internal_by) != 0:\n if not isinstance(by, list):\n by = [by]\n by_from_workaround = [\n modin_df[getattr(col, \"name\", col)].copy()\n if (hashable(col) and col in modin_groupby._internal_by)\n or isinstance(col, GetColumn)\n else col\n for col in by\n ]\n # GroupBy result with 'as_index=False' depends on the 'by' origin, since we forcibly changed\n # the origin of 'by' for modin by doing a copy, set 'as_index=True' to compare results.\n modin_groupby = modin_df.groupby(\n maybe_get_columns(modin_df, by_from_workaround), as_index=True\n )\n pandas_groupby = pandas_df.groupby(pandas_by, as_index=True)\n eval___getitem__(\n modin_groupby,\n pandas_groupby,\n list(modin_groupby._internal_by) + non_by_cols[: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_modin-project__modin/modin/pandas/test/test_groupby.py_test_single_group_row_groupby_test_single_group_row_groupby.None_31": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_single_group_row_groupby_test_single_group_row_groupby.None_31", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 603, "end_line": 682, "span_ids": ["test_single_group_row_groupby"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_group_row_groupby():\n pandas_df = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 36, 7],\n \"col3\": [3, 8, 12, 10],\n \"col4\": [17, 3, 16, 15],\n \"col5\": [-4, 5, -6, -7],\n }\n )\n\n modin_df = from_pandas(pandas_df)\n\n by = [\"1\", \"1\", \"1\", \"1\"]\n n = 6\n\n modin_groupby = modin_df.groupby(by=by)\n pandas_groupby = pandas_df.groupby(by=by)\n\n modin_groupby_equals_pandas(modin_groupby, pandas_groupby)\n eval_ngroups(modin_groupby, pandas_groupby)\n eval_shift(modin_groupby, pandas_groupby)\n eval_skew(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ffill())\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sem(),\n modin_df_almost_equals_pandas,\n )\n eval_mean(modin_groupby, pandas_groupby)\n eval_any(modin_groupby, pandas_groupby)\n eval_min(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmax())\n eval_ndim(modin_groupby, pandas_groupby)\n eval_cumsum(modin_groupby, pandas_groupby)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pct_change(),\n modin_df_almost_equals_pandas,\n )\n eval_cummax(modin_groupby, pandas_groupby)\n\n apply_functions = [lambda df: df.sum(), lambda df: -df]\n for func in apply_functions:\n eval_apply(modin_groupby, pandas_groupby, func)\n\n eval_dtypes(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.first())\n eval_cummin(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.bfill())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmin())\n eval_prod(modin_groupby, pandas_groupby)\n eval_std(modin_groupby, pandas_groupby)\n\n agg_functions = [\n lambda df: df.sum(),\n \"min\",\n \"max\",\n max,\n sum,\n {\"col2\": \"sum\"},\n {\"col2\": \"max\", \"col4\": \"sum\", \"col5\": \"min\"},\n ]\n for func in agg_functions:\n eval_agg(modin_groupby, pandas_groupby, func)\n eval_aggregate(modin_groupby, pandas_groupby, func)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.last())\n eval_rank(modin_groupby, pandas_groupby)\n eval_max(modin_groupby, pandas_groupby)\n eval_var(modin_groupby, pandas_groupby)\n eval_len(modin_groupby, pandas_groupby)\n eval_sum(modin_groupby, pandas_groupby)\n eval_ngroup(modin_groupby, pandas_groupby)\n eval_nunique(modin_groupby, pandas_groupby)\n eval_value_counts(modin_groupby, pandas_groupby)\n eval_median(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.head(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_modin-project__modin/modin/pandas/test/test_groupby.py_test_single_group_row_groupby.eval_cumprod_modin_groupb_test_single_group_row_groupby.eval_groups_modin_groupby": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_single_group_row_groupby.eval_cumprod_modin_groupb_test_single_group_row_groupby.eval_groups_modin_groupby", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 683, "end_line": 712, "span_ids": ["test_single_group_row_groupby"], "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": "def test_single_group_row_groupby():\n # ... other code\n eval_cumprod(modin_groupby, pandas_groupby)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.cov(),\n modin_df_almost_equals_pandas,\n )\n\n transform_functions = [lambda df: df + 4, lambda df: -df - 10]\n for func in transform_functions:\n eval_transform(modin_groupby, pandas_groupby, func)\n\n pipe_functions = [lambda dfgb: dfgb.sum()]\n for func in pipe_functions:\n eval_pipe(modin_groupby, pandas_groupby, func)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.corr(),\n modin_df_almost_equals_pandas,\n )\n eval_fillna(modin_groupby, pandas_groupby)\n eval_count(modin_groupby, pandas_groupby)\n eval_size(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.tail(n))\n eval_quantile(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.take([0]))\n eval___getattr__(modin_groupby, pandas_groupby, \"col2\")\n eval_groups(modin_groupby, pandas_groupby)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_large_row_groupby_test_large_row_groupby.eval_ngroup_modin_groupby": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_large_row_groupby_test_large_row_groupby.eval_ngroup_modin_groupby", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 715, "end_line": 807, "span_ids": ["test_large_row_groupby"], "tokens": 794}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"is_by_category\", [True, False])\ndef test_large_row_groupby(is_by_category):\n pandas_df = pandas.DataFrame(\n np.random.randint(0, 8, size=(100, 4)), columns=list(\"ABCD\")\n )\n\n modin_df = from_pandas(pandas_df)\n\n by = [str(i) for i in pandas_df[\"A\"].tolist()]\n\n if is_by_category:\n by = pandas.Categorical(by)\n\n n = 4\n\n modin_groupby = modin_df.groupby(by=by)\n pandas_groupby = pandas_df.groupby(by=by)\n\n modin_groupby_equals_pandas(modin_groupby, pandas_groupby)\n eval_ngroups(modin_groupby, pandas_groupby)\n eval_shift(modin_groupby, pandas_groupby)\n eval_skew(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ffill())\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sem(),\n modin_df_almost_equals_pandas,\n )\n eval_mean(modin_groupby, pandas_groupby)\n eval_any(modin_groupby, pandas_groupby)\n eval_min(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmax())\n eval_ndim(modin_groupby, pandas_groupby)\n eval_cumsum(modin_groupby, pandas_groupby)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.diff(periods=2),\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.diff(periods=-1),\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.diff(axis=1),\n )\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pct_change(),\n modin_df_almost_equals_pandas,\n )\n eval_cummax(modin_groupby, pandas_groupby)\n\n apply_functions = [lambda df: df.sum(), lambda df: -df]\n for func in apply_functions:\n eval_apply(modin_groupby, pandas_groupby, func)\n\n eval_dtypes(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.first())\n eval_cummin(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.bfill())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmin())\n # eval_prod(modin_groupby, pandas_groupby) causes overflows\n eval_std(modin_groupby, pandas_groupby)\n\n agg_functions = [\n lambda df: df.sum(),\n \"min\",\n \"max\",\n min,\n sum,\n {\"A\": \"sum\"},\n {\"A\": lambda df: df.sum()},\n {\"A\": \"max\", \"B\": \"sum\", \"C\": \"min\"},\n ]\n for func in agg_functions:\n eval_agg(modin_groupby, pandas_groupby, func)\n eval_aggregate(modin_groupby, pandas_groupby, func)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.last())\n eval_rank(modin_groupby, pandas_groupby)\n eval_max(modin_groupby, pandas_groupby)\n eval_var(modin_groupby, pandas_groupby)\n eval_len(modin_groupby, pandas_groupby)\n eval_sum(modin_groupby, pandas_groupby)\n eval_ngroup(modin_groupby, pandas_groupby)\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_large_row_groupby.eval_nunique_modin_groupb_test_large_row_groupby.eval_groups_modin_groupby": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_large_row_groupby.eval_nunique_modin_groupb_test_large_row_groupby.eval_groups_modin_groupby", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 808, "end_line": 840, "span_ids": ["test_large_row_groupby"], "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": "@pytest.mark.parametrize(\"is_by_category\", [True, False])\ndef test_large_row_groupby(is_by_category):\n # ... other code\n eval_nunique(modin_groupby, pandas_groupby)\n eval_value_counts(modin_groupby, pandas_groupby)\n eval_median(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.head(n))\n # eval_cumprod(modin_groupby, pandas_groupby) causes overflows\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.cov(),\n modin_df_almost_equals_pandas,\n )\n\n transform_functions = [lambda df: df + 4, lambda df: -df - 10]\n for func in transform_functions:\n eval_transform(modin_groupby, pandas_groupby, func)\n\n pipe_functions = [lambda dfgb: dfgb.sum()]\n for func in pipe_functions:\n eval_pipe(modin_groupby, pandas_groupby, func)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.corr(),\n modin_df_almost_equals_pandas,\n )\n eval_fillna(modin_groupby, pandas_groupby)\n eval_count(modin_groupby, pandas_groupby)\n eval_size(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.tail(n))\n eval_quantile(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.take([0]))\n eval_groups(modin_groupby, pandas_groupby)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_col_groupby_test_simple_col_groupby.transform_functions._lambda_df_df_4_lambd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_col_groupby_test_simple_col_groupby.transform_functions._lambda_df_df_4_lambd", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 843, "end_line": 920, "span_ids": ["test_simple_col_groupby"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_simple_col_groupby():\n pandas_df = pandas.DataFrame(\n {\n \"col1\": [0, 3, 2, 3],\n \"col2\": [4, 1, 6, 7],\n \"col3\": [3, 8, 2, 10],\n \"col4\": [1, 13, 6, 15],\n \"col5\": [-4, 5, 6, -7],\n }\n )\n\n modin_df = from_pandas(pandas_df)\n\n by = [1, 2, 3, 2, 1]\n\n modin_groupby = modin_df.groupby(axis=1, by=by)\n pandas_groupby = pandas_df.groupby(axis=1, by=by)\n\n modin_groupby_equals_pandas(modin_groupby, pandas_groupby)\n eval_ngroups(modin_groupby, pandas_groupby)\n eval_shift(modin_groupby, pandas_groupby)\n eval_skew(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ffill())\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sem(),\n modin_df_almost_equals_pandas,\n )\n eval_mean(modin_groupby, pandas_groupby)\n eval_any(modin_groupby, pandas_groupby)\n eval_min(modin_groupby, pandas_groupby)\n eval_ndim(modin_groupby, pandas_groupby)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmax())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmin())\n eval_quantile(modin_groupby, pandas_groupby)\n\n # https://github.com/pandas-dev/pandas/issues/21127\n # eval_cumsum(modin_groupby, pandas_groupby)\n # eval_cummax(modin_groupby, pandas_groupby)\n # eval_cummin(modin_groupby, pandas_groupby)\n # eval_cumprod(modin_groupby, pandas_groupby)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pct_change(),\n modin_df_almost_equals_pandas,\n )\n apply_functions = [lambda df: -df, lambda df: df.sum(axis=1)]\n for func in apply_functions:\n eval_apply(modin_groupby, pandas_groupby, func)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.first())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.bfill())\n eval_prod(modin_groupby, pandas_groupby)\n eval_std(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.last())\n eval_max(modin_groupby, pandas_groupby)\n eval_var(modin_groupby, pandas_groupby)\n eval_len(modin_groupby, pandas_groupby)\n eval_sum(modin_groupby, pandas_groupby)\n\n # Pandas fails on this case with ValueError\n # eval_ngroup(modin_groupby, pandas_groupby)\n # eval_nunique(modin_groupby, pandas_groupby)\n # NotImplementedError: DataFrameGroupBy.value_counts only handles axis=0\n # eval_value_counts(modin_groupby, pandas_groupby)\n eval_median(modin_groupby, pandas_groupby)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.cov(),\n modin_df_almost_equals_pandas,\n )\n\n transform_functions = [lambda df: df + 4, lambda df: -df - 10]\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_col_groupby.for_func_in_transform_fun_test_simple_col_groupby.eval_groups_modin_groupby": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_simple_col_groupby.for_func_in_transform_fun_test_simple_col_groupby.eval_groups_modin_groupby", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 921, "end_line": 938, "span_ids": ["test_simple_col_groupby"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_simple_col_groupby():\n # ... other code\n for func in transform_functions:\n eval_transform(modin_groupby, pandas_groupby, func)\n\n pipe_functions = [lambda dfgb: dfgb.sum()]\n for func in pipe_functions:\n eval_pipe(modin_groupby, pandas_groupby, func)\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.corr(),\n modin_df_almost_equals_pandas,\n )\n eval_fillna(modin_groupby, pandas_groupby)\n eval_count(modin_groupby, pandas_groupby)\n eval_size(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.take([0]))\n eval_groups(modin_groupby, pandas_groupby)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_series_groupby_test_series_groupby.n.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_series_groupby_test_series_groupby.n.1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 941, "end_line": 966, "span_ids": ["test_series_groupby"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"by\", [np.random.randint(0, 100, size=2**8), lambda x: x % 3, None]\n)\n@pytest.mark.parametrize(\"as_index_series_or_dataframe\", [0, 1, 2])\ndef test_series_groupby(by, as_index_series_or_dataframe):\n if as_index_series_or_dataframe <= 1:\n as_index = as_index_series_or_dataframe == 1\n series_data = np.random.randint(97, 198, size=2**8)\n modin_series = pd.Series(series_data)\n pandas_series = pandas.Series(series_data)\n else:\n as_index = True\n pandas_series = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [3, 8, 12, 10],\n \"col4\": [17, 13, 16, 15],\n \"col5\": [-4, -5, -6, -7],\n }\n )\n modin_series = from_pandas(pandas_series)\n if isinstance(by, np.ndarray) or by is None:\n by = np.random.randint(0, 100, size=len(pandas_series.index))\n\n n = 1\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_series_groupby.try__test_series_groupby.try_.else_.eval_groups_modin_groupby": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_series_groupby.try__test_series_groupby.try_.else_.eval_groups_modin_groupby", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 968, "end_line": 1082, "span_ids": ["test_series_groupby"], "tokens": 1227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"by\", [np.random.randint(0, 100, size=2**8), lambda x: x % 3, None]\n)\n@pytest.mark.parametrize(\"as_index_series_or_dataframe\", [0, 1, 2])\ndef test_series_groupby(by, as_index_series_or_dataframe):\n # ... other code\n\n try:\n pandas_groupby = pandas_series.groupby(by, as_index=as_index)\n if as_index_series_or_dataframe == 2:\n pandas_groupby = pandas_groupby[\"col1\"]\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.groupby(by, as_index=as_index)\n else:\n modin_groupby = modin_series.groupby(by, as_index=as_index)\n if as_index_series_or_dataframe == 2:\n modin_groupby = modin_groupby[\"col1\"]\n\n modin_groupby_equals_pandas(modin_groupby, pandas_groupby)\n eval_ngroups(modin_groupby, pandas_groupby)\n eval_shift(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ffill())\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.sem(),\n modin_df_almost_equals_pandas,\n )\n eval_general(\n modin_groupby, pandas_groupby, lambda df: df.sample(random_state=1)\n )\n eval_general(modin_groupby, pandas_groupby, lambda df: df.ewm(com=0.5).std())\n eval_general(\n modin_groupby, pandas_groupby, lambda df: df.is_monotonic_decreasing\n )\n eval_general(\n modin_groupby, pandas_groupby, lambda df: df.is_monotonic_increasing\n )\n eval_general(modin_groupby, pandas_groupby, lambda df: df.nlargest())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.nsmallest())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.unique())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.dtype)\n eval_mean(modin_groupby, pandas_groupby)\n eval_any(modin_groupby, pandas_groupby)\n eval_min(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmax())\n eval_ndim(modin_groupby, pandas_groupby)\n eval_cumsum(modin_groupby, pandas_groupby)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.pct_change(),\n modin_df_almost_equals_pandas,\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.diff(periods=2),\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda df: df.diff(periods=-1),\n )\n eval_cummax(modin_groupby, pandas_groupby)\n\n apply_functions = [lambda df: df.sum(), min]\n for func in apply_functions:\n eval_apply(modin_groupby, pandas_groupby, func)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.first())\n eval_cummin(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.bfill())\n eval_general(modin_groupby, pandas_groupby, lambda df: df.idxmin())\n eval_prod(modin_groupby, pandas_groupby)\n if as_index:\n eval_std(modin_groupby, pandas_groupby)\n eval_var(modin_groupby, pandas_groupby)\n eval_skew(modin_groupby, pandas_groupby)\n\n agg_functions = [\n lambda df: df.sum(),\n \"min\",\n \"max\",\n max,\n sum,\n np.mean,\n [\"min\", \"max\"],\n [np.mean, np.std, np.var, np.max, np.min],\n ]\n for func in agg_functions:\n eval_agg(modin_groupby, pandas_groupby, func)\n eval_aggregate(modin_groupby, pandas_groupby, func)\n\n eval_general(modin_groupby, pandas_groupby, lambda df: df.last())\n eval_rank(modin_groupby, pandas_groupby)\n eval_max(modin_groupby, pandas_groupby)\n eval_len(modin_groupby, pandas_groupby)\n eval_sum(modin_groupby, pandas_groupby)\n eval_size(modin_groupby, pandas_groupby)\n eval_ngroup(modin_groupby, pandas_groupby)\n eval_nunique(modin_groupby, pandas_groupby)\n eval_value_counts(modin_groupby, pandas_groupby)\n eval_median(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.head(n))\n eval_cumprod(modin_groupby, pandas_groupby)\n\n transform_functions = [lambda df: df + 4, lambda df: -df - 10]\n for func in transform_functions:\n eval_transform(modin_groupby, pandas_groupby, func)\n\n pipe_functions = [lambda dfgb: dfgb.sum()]\n for func in pipe_functions:\n eval_pipe(modin_groupby, pandas_groupby, func)\n\n eval_fillna(modin_groupby, pandas_groupby)\n eval_count(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.tail(n))\n eval_quantile(modin_groupby, pandas_groupby)\n eval_general(modin_groupby, pandas_groupby, lambda df: df.take([0]))\n eval_groups(modin_groupby, pandas_groupby)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_multi_column_groupby_test_multi_column_groupby.with_pytest_raises_KeyErr.modin_df_groupby_by_axis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_multi_column_groupby_test_multi_column_groupby.with_pytest_raises_KeyErr.modin_df_groupby_by_axis", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1085, "end_line": 1108, "span_ids": ["test_multi_column_groupby"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multi_column_groupby():\n pandas_df = pandas.DataFrame(\n {\n \"col1\": np.random.randint(0, 100, size=1000),\n \"col2\": np.random.randint(0, 100, size=1000),\n \"col3\": np.random.randint(0, 100, size=1000),\n \"col4\": np.random.randint(0, 100, size=1000),\n \"col5\": np.random.randint(0, 100, size=1000),\n },\n index=[\"row{}\".format(i) for i in range(1000)],\n )\n\n modin_df = from_pandas(pandas_df)\n by = [\"col1\", \"col2\"]\n\n df_equals(modin_df.groupby(by).count(), pandas_df.groupby(by).count())\n\n with pytest.warns(UserWarning):\n for k, _ in modin_df.groupby(by):\n assert isinstance(k, tuple)\n\n by = [\"row0\", \"row1\"]\n with pytest.raises(KeyError):\n modin_df.groupby(by, axis=1).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_modin-project__modin/modin/pandas/test/test_groupby.py_sort_index_if_experimental_groupby_eval_rank.df_equals_modin_groupby_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_sort_index_if_experimental_groupby_eval_rank.df_equals_modin_groupby_r", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1111, "end_line": 1210, "span_ids": ["eval_any", "sort_index_if_experimental_groupby", "eval_ngroups", "eval_skew", "eval_min", "eval_cumsum", "eval_aggregate", "eval_prod", "eval_apply", "eval_ndim", "eval_cummin", "eval_mean", "eval_agg", "eval_std", "eval_dtypes", "eval_rank", "eval_cummax"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def sort_index_if_experimental_groupby(*dfs):\n \"\"\"\n This method should be applied before comparing results of ``groupby.transform`` as\n the experimental implementation changes the order of rows for that:\n https://github.com/modin-project/modin/issues/5924\n \"\"\"\n if ExperimentalGroupbyImpl.get():\n return tuple(df.sort_index() for df in dfs)\n return dfs\n\n\ndef eval_ngroups(modin_groupby, pandas_groupby):\n assert modin_groupby.ngroups == pandas_groupby.ngroups\n\n\ndef eval_skew(modin_groupby, pandas_groupby, numeric_only=False):\n modin_df_almost_equals_pandas(\n modin_groupby.skew(numeric_only=numeric_only),\n pandas_groupby.skew(numeric_only=numeric_only),\n )\n\n\ndef eval_mean(modin_groupby, pandas_groupby, numeric_only=False):\n modin_df_almost_equals_pandas(\n modin_groupby.mean(numeric_only=numeric_only),\n pandas_groupby.mean(numeric_only=numeric_only),\n )\n\n\ndef eval_any(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.any(), pandas_groupby.any())\n\n\ndef eval_min(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.min(), pandas_groupby.min())\n\n\ndef eval_ndim(modin_groupby, pandas_groupby):\n assert modin_groupby.ndim == pandas_groupby.ndim\n\n\ndef eval_cumsum(modin_groupby, pandas_groupby, axis=0, numeric_only=False):\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.cumsum(axis=axis, numeric_only=numeric_only),\n pandas_groupby.cumsum(axis=axis, numeric_only=numeric_only),\n )\n )\n\n\ndef eval_cummax(modin_groupby, pandas_groupby, axis=0, numeric_only=False):\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.cummax(axis=axis, numeric_only=numeric_only),\n pandas_groupby.cummax(axis=axis, numeric_only=numeric_only),\n )\n )\n\n\ndef eval_cummin(modin_groupby, pandas_groupby, axis=0, numeric_only=False):\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.cummin(axis=axis, numeric_only=numeric_only),\n pandas_groupby.cummin(axis=axis, numeric_only=numeric_only),\n )\n )\n\n\ndef eval_apply(modin_groupby, pandas_groupby, func):\n df_equals(modin_groupby.apply(func), pandas_groupby.apply(func))\n\n\ndef eval_dtypes(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.dtypes, pandas_groupby.dtypes)\n\n\ndef eval_prod(modin_groupby, pandas_groupby, numeric_only=False):\n df_equals(\n modin_groupby.prod(numeric_only=numeric_only),\n pandas_groupby.prod(numeric_only=numeric_only),\n )\n\n\ndef eval_std(modin_groupby, pandas_groupby, numeric_only=False):\n modin_df_almost_equals_pandas(\n modin_groupby.std(numeric_only=numeric_only),\n pandas_groupby.std(numeric_only=numeric_only),\n )\n\n\ndef eval_aggregate(modin_groupby, pandas_groupby, func):\n df_equals(modin_groupby.aggregate(func), pandas_groupby.aggregate(func))\n\n\ndef eval_agg(modin_groupby, pandas_groupby, func):\n df_equals(modin_groupby.agg(func), pandas_groupby.agg(func))\n\n\ndef eval_rank(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.rank(), pandas_groupby.rank())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_max_eval_median.modin_df_almost_equals_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_max_eval_median.modin_df_almost_equals_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1213, "end_line": 1248, "span_ids": ["eval_sum", "eval_nunique", "eval_max", "eval_median", "eval_value_counts", "eval_len", "eval_ngroup", "eval_var"], "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": "def eval_max(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.max(), pandas_groupby.max())\n\n\ndef eval_var(modin_groupby, pandas_groupby, numeric_only=False):\n modin_df_almost_equals_pandas(\n modin_groupby.var(numeric_only=numeric_only),\n pandas_groupby.var(numeric_only=numeric_only),\n )\n\n\ndef eval_len(modin_groupby, pandas_groupby):\n assert len(modin_groupby) == len(pandas_groupby)\n\n\ndef eval_sum(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.sum(), pandas_groupby.sum())\n\n\ndef eval_ngroup(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.ngroup(), pandas_groupby.ngroup())\n\n\ndef eval_nunique(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.nunique(), pandas_groupby.nunique())\n\n\ndef eval_value_counts(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.value_counts(), pandas_groupby.value_counts())\n\n\ndef eval_median(modin_groupby, pandas_groupby, numeric_only=False):\n modin_df_almost_equals_pandas(\n modin_groupby.median(numeric_only=numeric_only),\n pandas_groupby.median(numeric_only=numeric_only),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_cumprod_eval_cumprod.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_cumprod_eval_cumprod.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1251, "end_line": 1263, "span_ids": ["eval_cumprod"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_cumprod(modin_groupby, pandas_groupby, axis=0, numeric_only=False):\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.cumprod(numeric_only=numeric_only),\n pandas_groupby.cumprod(numeric_only=numeric_only),\n )\n )\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.cumprod(axis=axis, numeric_only=numeric_only),\n pandas_groupby.cumprod(axis=axis, numeric_only=numeric_only),\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_modin-project__modin/modin/pandas/test/test_groupby.py_eval_transform_eval___getattr__.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_transform_eval___getattr__.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1266, "end_line": 1316, "span_ids": ["eval___getattr__", "eval_fillna", "eval_quantile", "eval_size", "eval_count", "eval_pipe", "eval_transform"], "tokens": 364}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_transform(modin_groupby, pandas_groupby, func):\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.transform(func), pandas_groupby.transform(func)\n )\n )\n\n\ndef eval_fillna(modin_groupby, pandas_groupby):\n df_equals(\n *sort_index_if_experimental_groupby(\n modin_groupby.fillna(method=\"ffill\"), pandas_groupby.fillna(method=\"ffill\")\n )\n )\n\n\ndef eval_count(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.count(), pandas_groupby.count())\n\n\ndef eval_size(modin_groupby, pandas_groupby):\n df_equals(modin_groupby.size(), pandas_groupby.size())\n\n\ndef eval_pipe(modin_groupby, pandas_groupby, func):\n df_equals(modin_groupby.pipe(func), pandas_groupby.pipe(func))\n\n\ndef eval_quantile(modin_groupby, pandas_groupby):\n try:\n pandas_result = pandas_groupby.quantile(q=0.4, numeric_only=True)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_groupby.quantile(q=0.4, numeric_only=True)\n else:\n df_equals(modin_groupby.quantile(q=0.4, numeric_only=True), pandas_result)\n\n\ndef eval___getattr__(modin_groupby, pandas_groupby, item):\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda grp: grp[item].count(),\n comparator=build_types_asserter(df_equals),\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda grp: getattr(grp, item).count(),\n comparator=build_types_asserter(df_equals),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval___getitem___eval___getitem__.build_list_agg.return.test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval___getitem___eval___getitem__.build_list_agg.return.test", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1319, "end_line": 1346, "span_ids": ["eval___getitem__"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval___getitem__(md_grp, pd_grp, item):\n eval_general(\n md_grp,\n pd_grp,\n lambda grp: grp[item].mean(),\n comparator=build_types_asserter(df_equals),\n )\n eval_general(\n md_grp,\n pd_grp,\n lambda grp: grp[item].count(),\n comparator=build_types_asserter(df_equals),\n )\n\n def build_list_agg(fns):\n def test(grp):\n res = grp[item].agg(fns)\n if res.ndim == 2:\n # `as_index=False` case\n new_axis = fns\n if \"index\" in res.columns:\n new_axis = [\"index\"] + new_axis\n # Modin's frame has an extra level in the result. Alligning columns to compare.\n # https://github.com/modin-project/modin/issues/3490\n res = res.set_axis(new_axis, axis=1)\n return res\n\n return test\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_modin-project__modin/modin/pandas/test/test_groupby.py_eval___getitem__.None_2_eval_groups.for_name_in_pandas_groupb.df_equals_modin_groupby_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval___getitem__.None_2_eval_groups.for_name_in_pandas_groupb.df_equals_modin_groupby_g", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1348, "end_line": 1381, "span_ids": ["eval___getitem__", "eval_groups"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval___getitem__(md_grp, pd_grp, item):\n # ... other code\n\n eval_general(\n md_grp,\n pd_grp,\n build_list_agg([\"mean\"]),\n comparator=build_types_asserter(df_equals),\n )\n eval_general(\n md_grp,\n pd_grp,\n build_list_agg([\"mean\", \"count\"]),\n comparator=build_types_asserter(df_equals),\n )\n\n # Explicit default-to-pandas test\n eval_general(\n md_grp,\n pd_grp,\n # Defaulting to pandas only for Modin groupby objects\n lambda grp: grp[item].sum()\n if not isinstance(grp, pd.groupby.DataFrameGroupBy)\n else grp[item]._default_to_pandas(lambda df: df.sum()),\n comparator=build_types_asserter(df_equals),\n )\n\n\ndef eval_groups(modin_groupby, pandas_groupby):\n for k, v in modin_groupby.groups.items():\n assert v.equals(pandas_groupby.groups[k])\n if ExperimentalGroupbyImpl.get():\n # `.get_group()` doesn't work correctly with experimental groupby:\n # https://github.com/modin-project/modin/issues/6093\n return\n for name in pandas_groupby.groups:\n df_equals(modin_groupby.get_group(name), pandas_groupby.get_group(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_modin-project__modin/modin/pandas/test/test_groupby.py_eval_shift_eval_shift.if_get_current_execution_.if_isinstance_pandas_grou.else_.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_eval_shift_eval_shift.if_get_current_execution_.if_isinstance_pandas_grou.else_.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1384, "end_line": 1430, "span_ids": ["eval_shift"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_shift(modin_groupby, pandas_groupby):\n def comparator(df1, df2):\n df_equals(*sort_index_if_experimental_groupby(df1, df2))\n\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda groupby: groupby.shift(),\n comparator=comparator,\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda groupby: groupby.shift(periods=0),\n comparator=comparator,\n )\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda groupby: groupby.shift(periods=-3),\n comparator=comparator,\n )\n\n # Disabled for `BaseOnPython` because of the issue with `getitem_array`.\n # groupby.shift internally masks the source frame with a Series boolean mask,\n # doing so ends up in the `getitem_array` method, that is broken for `BaseOnPython`:\n # https://github.com/modin-project/modin/issues/3701\n if get_current_execution() != \"BaseOnPython\":\n if isinstance(pandas_groupby, pandas.core.groupby.DataFrameGroupBy):\n pandas_res = pandas_groupby.shift(axis=1, fill_value=777)\n modin_res = modin_groupby.shift(axis=1, fill_value=777)\n # Pandas produces unexpected index order (pandas GH 44269).\n # Here we align index of Modin result with pandas to make test passed.\n import pandas.core.algorithms as algorithms\n\n indexer, _ = modin_res.index.get_indexer_non_unique(modin_res.index._values)\n indexer = algorithms.unique1d(indexer)\n modin_res = modin_res.take(indexer)\n\n comparator(modin_res, pandas_res)\n else:\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda groupby: groupby.shift(axis=1, fill_value=777),\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_index_values_with_loop_test_groupby_on_index_values_with_loop.None_1.df_equals_modin_dict_k_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_index_values_with_loop_test_groupby_on_index_values_with_loop.None_1.df_equals_modin_dict_k_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1433, "end_line": 1459, "span_ids": ["test_groupby_on_index_values_with_loop"], "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 test_groupby_on_index_values_with_loop():\n length = 2**6\n data = {\n \"a\": np.random.randint(0, 100, size=length),\n \"b\": np.random.randint(0, 100, size=length),\n \"c\": np.random.randint(0, 100, size=length),\n }\n idx = [\"g1\" if i % 3 != 0 else \"g2\" for i in range(length)]\n modin_df = pd.DataFrame(data, index=idx, columns=list(\"aba\"))\n pandas_df = pandas.DataFrame(data, index=idx, columns=list(\"aba\"))\n modin_groupby_obj = modin_df.groupby(modin_df.index)\n pandas_groupby_obj = pandas_df.groupby(pandas_df.index)\n\n modin_dict = {k: v for k, v in modin_groupby_obj}\n pandas_dict = {k: v for k, v in pandas_groupby_obj}\n\n for k in modin_dict:\n df_equals(modin_dict[k], pandas_dict[k])\n\n modin_groupby_obj = modin_df.groupby(modin_df.columns, axis=1)\n pandas_groupby_obj = pandas_df.groupby(pandas_df.columns, axis=1)\n\n modin_dict = {k: v for k, v in modin_groupby_obj}\n pandas_dict = {k: v for k, v in pandas_groupby_obj}\n\n for k in modin_dict:\n df_equals(modin_dict[k], pandas_dict[k])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_getitem_preserves_key_order_issue_6154_test_groupby_getitem_preserves_key_order_issue_6154.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_getitem_preserves_key_order_issue_6154_test_groupby_getitem_preserves_key_order_issue_6154.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1462, "end_line": 1471, "span_ids": ["test_groupby_getitem_preserves_key_order_issue_6154"], "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_groupby_getitem_preserves_key_order_issue_6154():\n a = np.tile([\"a\", \"b\", \"c\", \"d\", \"e\"], (1, 10))\n np.random.shuffle(a[0])\n df = pd.DataFrame(\n np.hstack((a.T, np.arange(100).reshape((50, 2)))),\n columns=[\"col 1\", \"col 2\", \"col 3\"],\n )\n eval_general(\n df, df._to_pandas(), lambda df: df.groupby(\"col 1\")[[\"col 3\", \"col 2\"]].count()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_multiindex_test_groupby_multiindex.df_equals_md_grp_first_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_multiindex_test_groupby_multiindex.df_equals_md_grp_first_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1474, "end_line": 1513, "span_ids": ["test_groupby_multiindex"], "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": "@pytest.mark.parametrize(\n \"groupby_kwargs\",\n [\n pytest.param({\"level\": 1, \"axis\": 1}, id=\"level_idx_axis=1\"),\n pytest.param({\"level\": 1}, id=\"level_idx\"),\n pytest.param({\"level\": [1, \"four\"]}, id=\"level_idx+name\"),\n pytest.param({\"by\": \"four\"}, id=\"level_name\"),\n pytest.param({\"by\": [\"one\", \"two\"]}, id=\"level_name_multi_by\"),\n pytest.param({\"by\": [\"item0\", \"one\", \"two\"]}, id=\"col_name+level_name\"),\n ],\n)\ndef test_groupby_multiindex(groupby_kwargs):\n frame_data = np.random.randint(0, 100, size=(2**6, 2**4))\n modin_df = pd.DataFrame(frame_data)\n pandas_df = pandas.DataFrame(frame_data)\n\n new_index = pandas.Index([f\"item{i}\" for i in range(len(pandas_df))])\n new_columns = pandas.MultiIndex.from_tuples(\n [(i // 4, i // 2, i) for i in modin_df.columns], names=[\"four\", \"two\", \"one\"]\n )\n modin_df.columns = new_columns\n modin_df.index = new_index\n pandas_df.columns = new_columns\n pandas_df.index = new_index\n\n if groupby_kwargs.get(\"axis\", 0) == 0:\n modin_df = modin_df.T\n pandas_df = pandas_df.T\n\n md_grp, pd_grp = (\n modin_df.groupby(**groupby_kwargs),\n pandas_df.groupby(**groupby_kwargs),\n )\n modin_groupby_equals_pandas(md_grp, pd_grp)\n df_equals(md_grp.sum(), pd_grp.sum())\n df_equals(md_grp.size(), pd_grp.size())\n # Grouping on level works incorrect in case of aggregation:\n # https://github.com/modin-project/modin/issues/2912\n # df_equals(md_grp.quantile(), pd_grp.quantile())\n df_equals(md_grp.first(), pd_grp.first())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_kwarg_dropna_test_groupby_with_kwarg_dropna.if_not_not_dropna_and_le.df_equals_md_grp__default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_kwarg_dropna_test_groupby_with_kwarg_dropna.if_not_not_dropna_and_le.df_equals_md_grp__default", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1516, "end_line": 1585, "span_ids": ["test_groupby_with_kwarg_dropna"], "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": "@pytest.mark.parametrize(\"dropna\", [True, False])\n@pytest.mark.parametrize(\n \"groupby_kwargs\",\n [\n pytest.param({\"level\": 1, \"axis\": 1}, id=\"level_idx_axis=1\"),\n pytest.param({\"level\": 1}, id=\"level_idx\"),\n pytest.param({\"level\": [1, \"four\"]}, id=\"level_idx+name\"),\n pytest.param({\"by\": \"four\"}, id=\"level_name\"),\n pytest.param({\"by\": [\"one\", \"two\"]}, id=\"level_name_multi_by\"),\n pytest.param(\n {\"by\": [\"item0\", \"one\", \"two\"]},\n id=\"col_name+level_name\",\n ),\n pytest.param(\n {\"by\": [\"item0\"]},\n id=\"col_name\",\n ),\n pytest.param(\n {\"by\": [\"item0\", \"item1\"]},\n id=\"col_name_multi_by\",\n ),\n ],\n)\ndef test_groupby_with_kwarg_dropna(groupby_kwargs, dropna):\n modin_df = pd.DataFrame(test_data[\"float_nan_data\"])\n pandas_df = pandas.DataFrame(test_data[\"float_nan_data\"])\n\n new_index = pandas.Index([f\"item{i}\" for i in range(len(pandas_df))])\n new_columns = pandas.MultiIndex.from_tuples(\n [(i // 4, i // 2, i) for i in range(len(modin_df.columns))],\n names=[\"four\", \"two\", \"one\"],\n )\n modin_df.columns = new_columns\n modin_df.index = new_index\n pandas_df.columns = new_columns\n pandas_df.index = new_index\n\n if groupby_kwargs.get(\"axis\", 0) == 0:\n modin_df = modin_df.T\n pandas_df = pandas_df.T\n\n md_grp, pd_grp = (\n modin_df.groupby(**groupby_kwargs, dropna=dropna),\n pandas_df.groupby(**groupby_kwargs, dropna=dropna),\n )\n modin_groupby_equals_pandas(md_grp, pd_grp)\n\n by_kwarg = groupby_kwargs.get(\"by\", [])\n # Disabled because of broken `dropna=False` for TreeReduce implemented aggs:\n # https://github.com/modin-project/modin/issues/3817\n if not (\n not dropna\n and len(by_kwarg) > 1\n and any(col in modin_df.columns for col in by_kwarg)\n ):\n df_equals(md_grp.sum(), pd_grp.sum())\n df_equals(md_grp.size(), pd_grp.size())\n # Grouping on level works incorrect in case of aggregation:\n # https://github.com/modin-project/modin/issues/2912\n # \"BaseOnPython\" tests are disabled because of the bug:\n # https://github.com/modin-project/modin/issues/3827\n if get_current_execution() != \"BaseOnPython\" and any(\n col in modin_df.columns for col in by_kwarg\n ):\n df_equals(md_grp.quantile(), pd_grp.quantile())\n # Default-to-pandas tests are disabled for multi-column 'by' because of the bug:\n # https://github.com/modin-project/modin/issues/3827\n if not (not dropna and len(by_kwarg) > 1):\n df_equals(md_grp.first(), pd_grp.first())\n df_equals(md_grp._default_to_pandas(lambda df: df.sum()), pd_grp.sum())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_shift_freq_test_shift_freq.for__by_in_by_.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_shift_freq_test_shift_freq.for__by_in_by_.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1588, "end_line": 1618, "span_ids": ["test_shift_freq"], "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(\"groupby_axis\", [0, 1])\n@pytest.mark.parametrize(\"shift_axis\", [0, 1])\n@pytest.mark.parametrize(\"groupby_sort\", [True, False])\ndef test_shift_freq(groupby_axis, shift_axis, groupby_sort):\n pandas_df = pandas.DataFrame(\n {\n \"col1\": [1, 0, 2, 3],\n \"col2\": [4, 5, np.NaN, 7],\n \"col3\": [np.NaN, np.NaN, 12, 10],\n \"col4\": [17, 13, 16, 15],\n }\n )\n modin_df = from_pandas(pandas_df)\n\n new_index = pandas.date_range(\"1/12/2020\", periods=4, freq=\"S\")\n if groupby_axis == 0 and shift_axis == 0:\n pandas_df.index = modin_df.index = new_index\n by = [[\"col2\", \"col3\"], [\"col2\"], [\"col4\"], [0, 1, 0, 2]]\n else:\n pandas_df.index = modin_df.index = new_index\n pandas_df.columns = modin_df.columns = new_index\n by = [[0, 1, 0, 2]]\n\n for _by in by:\n pandas_groupby = pandas_df.groupby(by=_by, axis=groupby_axis, sort=groupby_sort)\n modin_groupby = modin_df.groupby(by=_by, axis=groupby_axis, sort=groupby_sort)\n eval_general(\n modin_groupby,\n pandas_groupby,\n lambda groupby: groupby.shift(axis=shift_axis, freq=\"S\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_func_None_rename_test_agg_func_None_rename.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_func_None_rename_test_agg_func_None_rename.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1621, "end_line": 1676, "span_ids": ["test_agg_func_None_rename"], "tokens": 463}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"by_and_agg_dict\",\n [\n {\n \"by\": [\n list(test_data[\"int_data\"].keys())[0],\n list(test_data[\"int_data\"].keys())[1],\n ],\n \"agg_dict\": {\n \"max\": (list(test_data[\"int_data\"].keys())[2], np.max),\n \"min\": (list(test_data[\"int_data\"].keys())[2], np.min),\n },\n },\n {\n \"by\": [\"col1\"],\n \"agg_dict\": {\n \"max\": (list(test_data[\"int_data\"].keys())[0], np.max),\n \"min\": (list(test_data[\"int_data\"].keys())[-1], np.min),\n },\n },\n {\n \"by\": [\n list(test_data[\"int_data\"].keys())[0],\n list(test_data[\"int_data\"].keys())[-1],\n ],\n \"agg_dict\": {\n \"max\": (list(test_data[\"int_data\"].keys())[1], max),\n \"min\": (list(test_data[\"int_data\"].keys())[-2], min),\n },\n },\n pytest.param(\n {\n \"by\": [\n list(test_data[\"int_data\"].keys())[0],\n list(test_data[\"int_data\"].keys())[-1],\n ],\n \"agg_dict\": {\n \"max\": (list(test_data[\"int_data\"].keys())[1], max),\n \"min\": (list(test_data[\"int_data\"].keys())[-1], min),\n },\n },\n marks=pytest.mark.skip(\"See Modin issue #3602\"),\n ),\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False])\ndef test_agg_func_None_rename(by_and_agg_dict, as_index):\n modin_df, pandas_df = create_test_dfs(test_data[\"int_data\"])\n\n modin_result = modin_df.groupby(by_and_agg_dict[\"by\"], as_index=as_index).agg(\n **by_and_agg_dict[\"agg_dict\"]\n )\n pandas_result = pandas_df.groupby(by_and_agg_dict[\"by\"], as_index=as_index).agg(\n **by_and_agg_dict[\"agg_dict\"]\n )\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_groupby.py_test_dict_agg_rename_mi_columns_test_dict_agg_rename_mi_columns.df_equals_md_res_pd_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_dict_agg_rename_mi_columns_test_dict_agg_rename_mi_columns.df_equals_md_res_pd_res_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1679, "end_line": 1726, "span_ids": ["test_dict_agg_rename_mi_columns"], "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": "@pytest.mark.parametrize(\n \"as_index\",\n [\n True,\n pytest.param(\n False,\n marks=pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\"\n or ExperimentalGroupbyImpl.get(),\n reason=\"See Pandas issue #39103\",\n ),\n ),\n ],\n)\n@pytest.mark.parametrize(\"by_length\", [1, 3])\n@pytest.mark.parametrize(\n \"agg_fns\",\n [[\"sum\", \"min\", \"max\"], [\"mean\", \"quantile\"]],\n ids=[\"reduce\", \"aggregation\"],\n)\n@pytest.mark.parametrize(\n \"intersection_with_by_cols\",\n [pytest.param(True, marks=pytest.mark.skip(\"See Modin issue #3602\")), False],\n)\ndef test_dict_agg_rename_mi_columns(\n as_index, by_length, agg_fns, intersection_with_by_cols\n):\n md_df, pd_df = create_test_dfs(test_data[\"int_data\"])\n mi_columns = generate_multiindex(len(md_df.columns), nlevels=4)\n\n md_df.columns, pd_df.columns = mi_columns, mi_columns\n\n by = list(md_df.columns[:by_length])\n agg_cols = (\n list(md_df.columns[by_length - 1 : by_length + 2])\n if intersection_with_by_cols\n else list(md_df.columns[by_length : by_length + 3])\n )\n\n agg_dict = {\n f\"custom-{i}\" + str(agg_fns[i % len(agg_fns)]): (col, agg_fns[i % len(agg_fns)])\n for i, col in enumerate(agg_cols)\n }\n\n md_res = md_df.groupby(by, as_index=as_index).agg(**agg_dict)\n pd_res = pd_df.groupby(by, as_index=as_index).agg(**agg_dict)\n\n df_equals(md_res, pd_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_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_4604_test_agg_4604.eval_agg_modin_groupby_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_4604_test_agg_4604.eval_agg_modin_groupby_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1729, "end_line": 1744, "span_ids": ["test_agg_4604"], "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_agg_4604():\n data = {\"col1\": [1, 2], \"col2\": [3, 4]}\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n # add another partition\n modin_df[\"col3\"] = modin_df[\"col1\"]\n pandas_df[\"col3\"] = pandas_df[\"col1\"]\n\n # problem only with custom aggregation function\n def col3(x):\n return np.max(x)\n\n by = [\"col1\"]\n agg_func = {\"col2\": [\"sum\", \"min\"], \"col3\": col3}\n\n modin_groupby, pandas_groupby = modin_df.groupby(by), pandas_df.groupby(by)\n eval_agg(modin_groupby, pandas_groupby, agg_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_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_exceptions_test_agg_exceptions.eval_aggregation_create_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_agg_exceptions_test_agg_exceptions.eval_aggregation_create_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1747, "end_line": 1814, "span_ids": ["test_agg_exceptions"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"operation\",\n [\n \"quantile\",\n \"mean\",\n pytest.param(\n \"sum\", marks=pytest.mark.skip(\"See Modin issue #2255 for details\")\n ),\n \"median\",\n \"unique\",\n \"cumprod\",\n ],\n)\ndef test_agg_exceptions(operation):\n N = 256\n fill_data = [\n (\n \"nan_column\",\n [\n np.datetime64(\"2010\"),\n None,\n np.datetime64(\"2007\"),\n np.datetime64(\"2010\"),\n np.datetime64(\"2006\"),\n np.datetime64(\"2012\"),\n None,\n np.datetime64(\"2011\"),\n ]\n * (N // 8),\n ),\n (\n \"date_column\",\n [\n np.datetime64(\"2010\"),\n np.datetime64(\"2011\"),\n np.datetime64(\"2011-06-15T00:00\"),\n np.datetime64(\"2009-01-01\"),\n ]\n * (N // 4),\n ),\n ]\n\n data1 = {\n \"column_to_by\": [\"foo\", \"bar\", \"baz\", \"bar\"] * (N // 4),\n # Earlier, the type of this column was `object`. In such a situation,\n # when performing aggregation on different column partitions, different\n # exceptions were thrown. The exception that engines return to the main\n # process was non-deterministic, either `TypeError` or `NotImplementedError`.\n \"nan_column\": [np.nan] * N,\n }\n\n data2 = {\n f\"{key}{i}\": value\n for key, value in fill_data\n for i in range(N // len(fill_data))\n }\n\n data = {**data1, **data2}\n\n def comparator(df1, df2):\n from modin.core.dataframe.algebra.default2pandas.groupby import GroupBy\n\n if GroupBy.is_transformation_kernel(operation):\n df1, df2 = sort_index_if_experimental_groupby(df1, df2)\n\n df_equals(df1, df2)\n\n eval_aggregation(*create_test_dfs(data), operation=operation, comparator=comparator)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_to_pandas_convertion_test_to_pandas_convertion.eval_aggregation_create_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_to_pandas_convertion_test_to_pandas_convertion.eval_aggregation_create_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1817, "end_line": 1846, "span_ids": ["test_to_pandas_convertion"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skip(\n \"Pandas raises a ValueError on empty dictionary aggregation since 1.2.0\"\n + \"It's unclear is that was made on purpose or it is a bug. That question\"\n + \"was asked in https://github.com/pandas-dev/pandas/issues/39609.\"\n + \"So until the answer this test is disabled.\"\n)\n@pytest.mark.parametrize(\n \"kwargs\",\n [\n {\n \"Max\": (\"cnt\", np.max),\n \"Sum\": (\"cnt\", np.sum),\n \"Num\": (\"c\", pd.Series.nunique),\n \"Num1\": (\"c\", pandas.Series.nunique),\n },\n {\n \"func\": {\n \"Max\": (\"cnt\", np.max),\n \"Sum\": (\"cnt\", np.sum),\n \"Num\": (\"c\", pd.Series.nunique),\n \"Num1\": (\"c\", pandas.Series.nunique),\n }\n },\n ],\n)\ndef test_to_pandas_convertion(kwargs):\n data = {\"a\": [1, 2], \"b\": [3, 4], \"c\": [5, 6]}\n by = [\"a\", \"b\"]\n\n eval_aggregation(*create_test_dfs(data), by=by, **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_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_columns_test_mixed_columns.df_equals_ref_exp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_columns_test_mixed_columns.df_equals_ref_exp_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1849, "end_line": 1874, "span_ids": ["test_mixed_columns"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n # When True, do df[name], otherwise just use name\n \"columns\",\n [\n [(False, \"a\"), (False, \"b\"), (False, \"c\")],\n [(False, \"a\"), (False, \"b\")],\n [(True, \"a\"), (True, \"b\"), (True, \"c\")],\n [(True, \"a\"), (True, \"b\")],\n [(False, \"a\"), (False, \"b\"), (True, \"c\")],\n [(False, \"a\"), (True, \"c\")],\n ],\n)\ndef test_mixed_columns(columns):\n def get_columns(df):\n return [df[name] if lookup else name for (lookup, name) in columns]\n\n data = {\"a\": [1, 1, 2], \"b\": [11, 11, 22], \"c\": [111, 111, 222]}\n\n df1 = pandas.DataFrame(data)\n df1 = pandas.concat([df1])\n ref = df1.groupby(get_columns(df1)).size()\n\n df2 = pd.DataFrame(data)\n df2 = pd.concat([df2])\n exp = df2.groupby(get_columns(df2)).size()\n df_equals(ref, exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_internal_by_detection_test_internal_by_detection.assert_ref_exp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_internal_by_detection_test_internal_by_detection.assert_ref_exp", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1877, "end_line": 1905, "span_ids": ["test_internal_by_detection"], "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": "@pytest.mark.parametrize(\n # When True, use (df[name] + 1), otherwise just use name\n \"columns\",\n [\n [(True, \"a\"), (True, \"b\"), (True, \"c\")],\n [(True, \"a\"), (True, \"b\")],\n [(False, \"a\"), (False, \"b\"), (True, \"c\")],\n [(False, \"a\"), (True, \"c\")],\n [(False, \"a\"), (True, \"c\"), (False, [1, 1, 2])],\n [(False, \"a\"), (False, \"b\"), (False, \"c\")],\n [(False, \"a\"), (False, \"b\"), (False, \"c\"), (False, [1, 1, 2])],\n ],\n)\ndef test_internal_by_detection(columns):\n def get_columns(df):\n return [(df[name] + 1) if lookup else name for (lookup, name) in columns]\n\n data = {\"a\": [1, 1, 2], \"b\": [11, 11, 22], \"c\": [111, 111, 222]}\n\n md_df = pd.DataFrame(data)\n by = get_columns(md_df)\n md_grp = md_df.groupby(by)\n\n ref = frozenset(\n col for is_lookup, col in columns if not is_lookup and hashable(col)\n )\n exp = frozenset(md_grp._internal_by)\n\n assert ref == exp", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_columns_not_from_df_test_mixed_columns_not_from_df.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mixed_columns_not_from_df_test_mixed_columns_not_from_df.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1908, "end_line": 1941, "span_ids": ["test_mixed_columns_not_from_df"], "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": "@pytest.mark.parametrize(\n # When True, use (df[name] + 1), otherwise just use name\n \"columns\",\n [\n [(True, \"a\"), (True, \"b\"), (True, \"c\")],\n [(True, \"a\"), (True, \"b\")],\n [(False, \"a\"), (False, \"b\"), (True, \"c\")],\n [(False, \"a\"), (True, \"c\")],\n [(False, \"a\"), (True, \"c\"), (False, [1, 1, 2])],\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False])\ndef test_mixed_columns_not_from_df(columns, as_index):\n \"\"\"\n Unlike the previous test, in this case the Series is not just a column from\n the original DataFrame, so you can't use a fasttrack.\n \"\"\"\n\n def get_columns(df):\n return [(df[name] + 1) if lookup else name for (lookup, name) in columns]\n\n data = {\"a\": [1, 1, 2], \"b\": [11, 11, 22], \"c\": [111, 111, 222]}\n groupby_kw = {\"as_index\": as_index}\n\n md_df, pd_df = create_test_dfs(data)\n by_md, by_pd = map(get_columns, [md_df, pd_df])\n\n pd_grp = pd_df.groupby(by_pd, **groupby_kw)\n md_grp = md_df.groupby(by_md, **groupby_kw)\n\n modin_groupby_equals_pandas(md_grp, pd_grp)\n eval_general(md_grp, pd_grp, lambda grp: grp.size())\n eval_general(md_grp, pd_grp, lambda grp: grp.apply(lambda df: df.sum()))\n eval_general(md_grp, pd_grp, lambda grp: grp.first())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_unknown_groupby_test_unknown_groupby.None_1.modin_df_groupby_by_get_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_unknown_groupby_test_unknown_groupby.None_1.modin_df_groupby_by_get_c", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1944, "end_line": 1969, "span_ids": ["test_unknown_groupby"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n # When True, do df[obj], otherwise just use the obj\n \"columns\",\n [\n [(False, \"a\")],\n [(False, \"a\"), (False, \"b\"), (False, \"c\")],\n [(False, \"a\"), (False, \"b\")],\n [(False, \"b\"), (False, \"a\")],\n [(True, \"a\"), (True, \"b\"), (True, \"c\")],\n [(True, \"a\"), (True, \"b\")],\n [(False, \"a\"), (False, \"b\"), (True, \"c\")],\n [(False, \"a\"), (True, \"c\")],\n [(False, \"a\"), (False, pd.Series([5, 6, 7, 8]))],\n ],\n)\ndef test_unknown_groupby(columns):\n def get_columns(df):\n return [df[name] if lookup else name for (lookup, name) in columns]\n\n data = {\"b\": [11, 11, 22, 200], \"c\": [111, 111, 222, 7000]}\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n\n with pytest.raises(KeyError):\n pandas_df.groupby(by=get_columns(pandas_df))\n with pytest.raises(KeyError):\n modin_df.groupby(by=get_columns(modin_df))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_multi_column_groupby_different_partitions_test_multi_column_groupby_different_partitions.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_multi_column_groupby_different_partitions_test_multi_column_groupby_different_partitions.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 1972, "end_line": 2115, "span_ids": ["test_multi_column_groupby_different_partitions"], "tokens": 1130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"func_to_apply\",\n [\n lambda df: df.sum(),\n lambda df: df.size(),\n lambda df: df.quantile(),\n lambda df: df.dtypes,\n lambda df: df.apply(lambda df: df.sum()),\n pytest.param(\n lambda df: df.apply(lambda df: pandas.Series([1, 2, 3, 4])),\n marks=pytest.mark.skip(\"See modin issue #2511\"),\n ),\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: (max, min, sum),\n list(test_data_values[0].keys())[-2]: (sum, min, max),\n }\n ),\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: [\n (\"new_sum\", \"sum\"),\n (\"new_min\", \"min\"),\n ],\n list(test_data_values[0].keys())[-2]: np.sum,\n }\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: [\n (\"new_sum\", \"sum\"),\n (\"new_mean\", \"mean\"),\n ],\n list(test_data_values[0].keys())[-2]: \"skew\",\n }\n ),\n id=\"renaming_aggs_at_different_partitions\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: [\n (\"new_sum\", \"sum\"),\n (\"new_mean\", \"mean\"),\n ],\n list(test_data_values[0].keys())[2]: \"skew\",\n }\n ),\n id=\"renaming_aggs_at_same_partition\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: \"mean\",\n list(test_data_values[0].keys())[-2]: \"skew\",\n }\n ),\n id=\"custom_aggs_at_different_partitions\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: \"mean\",\n list(test_data_values[0].keys())[2]: \"skew\",\n }\n ),\n id=\"custom_aggs_at_same_partition\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: \"mean\",\n list(test_data_values[0].keys())[-2]: \"sum\",\n }\n ),\n id=\"native_and_custom_aggs_at_different_partitions\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: \"mean\",\n list(test_data_values[0].keys())[2]: \"sum\",\n }\n ),\n id=\"native_and_custom_aggs_at_same_partition\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: (max, \"mean\", sum),\n list(test_data_values[0].keys())[-1]: (sum, \"skew\", max),\n }\n ),\n id=\"Agg_and_by_intersection_TreeReduce_implementation\",\n ),\n pytest.param(\n lambda grp: grp.agg(\n {\n list(test_data_values[0].keys())[1]: (max, \"mean\", \"nunique\"),\n list(test_data_values[0].keys())[-1]: (sum, min, max),\n }\n ),\n id=\"Agg_and_by_intersection_FullAxis_implementation\",\n ),\n pytest.param(\n lambda grp: grp.agg({list(test_data_values[0].keys())[0]: \"count\"}),\n id=\"Agg_and_by_intersection_issue_3376\",\n ),\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False])\n@pytest.mark.parametrize(\"by_length\", [1, 2])\n@pytest.mark.parametrize(\n \"categorical_by\",\n [pytest.param(True, marks=pytest.mark.skip(\"See modin issue #2513\")), False],\n)\ndef test_multi_column_groupby_different_partitions(\n func_to_apply, as_index, by_length, categorical_by\n):\n data = test_data_values[0]\n md_df, pd_df = create_test_dfs(data)\n\n by = [pd_df.columns[-i if i % 2 else i] for i in range(by_length)]\n\n if categorical_by:\n md_df = md_df.astype({by[0]: \"category\"})\n pd_df = pd_df.astype({by[0]: \"category\"})\n\n md_grp, pd_grp = (\n md_df.groupby(by, as_index=as_index),\n pd_df.groupby(by, as_index=as_index),\n )\n eval_general(\n md_grp,\n pd_grp,\n func_to_apply,\n # 'skew' and 'mean' results are not 100% equal to pandas as they use\n # different formulas and so precision errors come into play. Thus\n # using a custom comparator that allows slight numeric deviations.\n comparator=try_modin_df_almost_equals_compare,\n )\n eval___getitem__(md_grp, pd_grp, md_df.columns[1])\n eval___getitem__(md_grp, pd_grp, [md_df.columns[1], md_df.columns[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_modin-project__modin/modin/pandas/test/test_groupby.py_test_not_str_by_test_not_str_by.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_not_str_by_test_not_str_by.None_5", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2118, "end_line": 2145, "span_ids": ["test_not_str_by"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"by\",\n [\n 0,\n 1.5,\n \"str\",\n pandas.Timestamp(\"2020-02-02\"),\n [0, \"str\"],\n [pandas.Timestamp(\"2020-02-02\"), 1.5],\n ],\n)\n@pytest.mark.parametrize(\"as_index\", [True, False])\ndef test_not_str_by(by, as_index):\n columns = pandas.Index([0, 1.5, \"str\", pandas.Timestamp(\"2020-02-02\")])\n data = {col: np.arange(5) for col in columns}\n md_df, pd_df = create_test_dfs(data)\n\n md_grp, pd_grp = (\n md_df.groupby(by, as_index=as_index),\n pd_df.groupby(by, as_index=as_index),\n )\n\n modin_groupby_equals_pandas(md_grp, pd_grp)\n eval_general(md_grp, pd_grp, lambda grp: grp.sum())\n eval_general(md_grp, pd_grp, lambda grp: grp.size())\n eval_general(md_grp, pd_grp, lambda grp: grp.agg(lambda df: df.mean()))\n eval_general(md_grp, pd_grp, lambda grp: grp.dtypes)\n eval_general(md_grp, pd_grp, lambda grp: grp.first())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index_test_handle_as_index.if_has_categorical_by_.df.df_astype_df_columns_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index_test_handle_as_index.if_has_categorical_by_.df.df_astype_df_columns_1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2148, "end_line": 2219, "span_ids": ["test_handle_as_index"], "tokens": 699}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"internal_by_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"external_by_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"has_categorical_by\", [True, False])\n@pytest.mark.parametrize(\n \"agg_func\",\n [\n pytest.param(\n lambda grp: grp.apply(lambda df: df.dtypes), id=\"modin_dtypes_impl\"\n ),\n pytest.param(\n lambda grp: grp.apply(lambda df: df.sum(numeric_only=True)), id=\"apply_sum\"\n ),\n pytest.param(lambda grp: grp.count(), id=\"count\"),\n pytest.param(lambda grp: grp.nunique(), id=\"nunique\"),\n # Integer key means the index of the column to replace it with.\n # 0 and -1 are considered to be the indices of the columns to group on.\n pytest.param({1: \"sum\", 2: \"nunique\"}, id=\"dict_agg_no_intersection_with_by\"),\n pytest.param(\n {0: \"mean\", 1: \"sum\", 2: \"nunique\"},\n id=\"dict_agg_has_intersection_with_by\",\n ),\n pytest.param(\n {1: \"sum\", 2: \"nunique\", -1: \"nunique\"},\n id=\"dict_agg_has_intersection_with_categorical_by\",\n ),\n ],\n)\n# There are two versions of the `handle_as_index` method: the one accepting pandas.DataFrame from\n# the execution kernel and backend agnostic. This parameter indicates which one implementation to use.\n@pytest.mark.parametrize(\"use_backend_agnostic_method\", [True, False])\ndef test_handle_as_index(\n internal_by_length,\n external_by_length,\n has_categorical_by,\n agg_func,\n use_backend_agnostic_method,\n request,\n):\n \"\"\"\n Test ``modin.core.dataframe.algebra.default2pandas.groupby.GroupBy.handle_as_index``.\n\n The role of the ``handle_as_index`` method is to build a groupby result considering\n ``as_index=False`` from the result that was computed with ``as_index=True``.\n\n So the testing flow is the following:\n 1. Compute GroupBy result with the ``as_index=True`` parameter via Modin.\n 2. Build ``as_index=False`` result from the ``as_index=True`` using ``handle_as_index`` method.\n 3. Compute GroupBy result with the ``as_index=False`` parameter via pandas as the reference result.\n 4. Compare the result from the second step with the reference.\n \"\"\"\n by_length = internal_by_length + external_by_length\n if by_length == 0:\n pytest.skip(\"No keys to group on were passed, skipping the test.\")\n\n if (\n has_categorical_by\n and by_length > 1\n and (\n isinstance(agg_func, dict)\n or (\"nunique\" in request.node.callspec.id.split(\"-\"))\n )\n ):\n pytest.skip(\n \"The linked bug makes pandas raise an exception when 'by' is categorical: \"\n + \"https://github.com/pandas-dev/pandas/issues/36698\"\n )\n\n df = pandas.DataFrame(test_groupby_data)\n external_by_cols = GroupBy.validate_by(df.add_prefix(\"external_\"))\n\n if has_categorical_by:\n df = df.astype({df.columns[-1]: \"category\"})\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index.if_isinstance_agg_func_d_test_handle_as_index.agg_reference.agg_func_grp_reference_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index.if_isinstance_agg_func_d_test_handle_as_index.agg_reference.agg_func_grp_reference_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2221, "end_line": 2242, "span_ids": ["test_handle_as_index"], "tokens": 594}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"internal_by_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"external_by_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"has_categorical_by\", [True, False])\n@pytest.mark.parametrize(\n \"agg_func\",\n [\n pytest.param(\n lambda grp: grp.apply(lambda df: df.dtypes), id=\"modin_dtypes_impl\"\n ),\n pytest.param(\n lambda grp: grp.apply(lambda df: df.sum(numeric_only=True)), id=\"apply_sum\"\n ),\n pytest.param(lambda grp: grp.count(), id=\"count\"),\n pytest.param(lambda grp: grp.nunique(), id=\"nunique\"),\n # Integer key means the index of the column to replace it with.\n # 0 and -1 are considered to be the indices of the columns to group on.\n pytest.param({1: \"sum\", 2: \"nunique\"}, id=\"dict_agg_no_intersection_with_by\"),\n pytest.param(\n {0: \"mean\", 1: \"sum\", 2: \"nunique\"},\n id=\"dict_agg_has_intersection_with_by\",\n ),\n pytest.param(\n {1: \"sum\", 2: \"nunique\", -1: \"nunique\"},\n id=\"dict_agg_has_intersection_with_categorical_by\",\n ),\n ],\n)\n# There are two versions of the `handle_as_index` method: the one accepting pandas.DataFrame from\n# the execution kernel and backend agnostic. This parameter indicates which one implementation to use.\n@pytest.mark.parametrize(\"use_backend_agnostic_method\", [True, False])\ndef test_handle_as_index(\n internal_by_length,\n external_by_length,\n has_categorical_by,\n agg_func,\n use_backend_agnostic_method,\n request,\n):\n # ... other code\n\n if isinstance(agg_func, dict):\n agg_func = {df.columns[key]: value for key, value in agg_func.items()}\n selection = list(agg_func.keys())\n agg_dict = agg_func\n agg_func = lambda grp: grp.agg(agg_dict) # noqa: E731 (lambda assignment)\n else:\n selection = None\n\n # Selecting 'by' columns from both sides of the frame so they located in different partitions\n internal_by = df.columns[\n range(-internal_by_length // 2, internal_by_length // 2)\n ].tolist()\n external_by = external_by_cols[:external_by_length]\n\n pd_by = internal_by + external_by\n md_by = internal_by + [pd.Series(ser) for ser in external_by]\n\n grp_result = pd.DataFrame(df).groupby(md_by, as_index=True)\n grp_reference = df.groupby(pd_by, as_index=False)\n\n agg_result = agg_func(grp_result)\n agg_reference = agg_func(grp_reference)\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index.if_use_backend_agnostic_m_test_handle_as_index.df_equals_agg_result_agg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_handle_as_index.if_use_backend_agnostic_m_test_handle_as_index.df_equals_agg_result_agg", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2244, "end_line": 2272, "span_ids": ["test_handle_as_index"], "tokens": 615}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"internal_by_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"external_by_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"has_categorical_by\", [True, False])\n@pytest.mark.parametrize(\n \"agg_func\",\n [\n pytest.param(\n lambda grp: grp.apply(lambda df: df.dtypes), id=\"modin_dtypes_impl\"\n ),\n pytest.param(\n lambda grp: grp.apply(lambda df: df.sum(numeric_only=True)), id=\"apply_sum\"\n ),\n pytest.param(lambda grp: grp.count(), id=\"count\"),\n pytest.param(lambda grp: grp.nunique(), id=\"nunique\"),\n # Integer key means the index of the column to replace it with.\n # 0 and -1 are considered to be the indices of the columns to group on.\n pytest.param({1: \"sum\", 2: \"nunique\"}, id=\"dict_agg_no_intersection_with_by\"),\n pytest.param(\n {0: \"mean\", 1: \"sum\", 2: \"nunique\"},\n id=\"dict_agg_has_intersection_with_by\",\n ),\n pytest.param(\n {1: \"sum\", 2: \"nunique\", -1: \"nunique\"},\n id=\"dict_agg_has_intersection_with_categorical_by\",\n ),\n ],\n)\n# There are two versions of the `handle_as_index` method: the one accepting pandas.DataFrame from\n# the execution kernel and backend agnostic. This parameter indicates which one implementation to use.\n@pytest.mark.parametrize(\"use_backend_agnostic_method\", [True, False])\ndef test_handle_as_index(\n internal_by_length,\n external_by_length,\n has_categorical_by,\n agg_func,\n use_backend_agnostic_method,\n request,\n):\n # ... other code\n\n if use_backend_agnostic_method:\n reset_index, drop, lvls_to_drop, cols_to_drop = GroupBy.handle_as_index(\n result_cols=agg_result.columns,\n result_index_names=agg_result.index.names,\n internal_by_cols=internal_by,\n by_cols_dtypes=df[internal_by].dtypes.values,\n by_length=len(md_by),\n selection=selection,\n drop=len(internal_by) != 0,\n )\n\n if len(lvls_to_drop) > 0:\n agg_result.index = agg_result.index.droplevel(lvls_to_drop)\n if len(cols_to_drop) > 0:\n agg_result = agg_result.drop(columns=cols_to_drop)\n if reset_index:\n agg_result = agg_result.reset_index(drop=drop)\n else:\n GroupBy.handle_as_index_for_dataframe(\n result=agg_result,\n internal_by_cols=internal_by,\n by_cols_dtypes=df[internal_by].dtypes.values,\n by_length=len(md_by),\n selection=selection,\n drop=len(internal_by) != 0,\n inplace=True,\n )\n\n df_equals(agg_result, agg_reference)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_validate_by_test_validate_by.compare_reference_by_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_validate_by_test_validate_by.compare_reference_by_res", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2275, "end_line": 2309, "span_ids": ["test_validate_by"], "tokens": 497}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_validate_by():\n \"\"\"Test ``modin.core.dataframe.algebra.default2pandas.groupby.GroupBy.validate_by``.\"\"\"\n\n def compare(obj1, obj2):\n assert type(obj1) == type(\n obj2\n ), f\"Both objects must be instances of the same type: {type(obj1)} != {type(obj2)}.\"\n if isinstance(obj1, list):\n for val1, val2 in itertools.zip_longest(obj1, obj2):\n df_equals(val1, val2)\n else:\n df_equals(obj1, obj2)\n\n # This emulates situation when the Series's query compiler being passed as a 'by':\n # 1. The Series at the QC level is represented as a single-column frame with the `MODIN_UNNAMED_SERIES_LABEL` columns.\n # 2. The valid representation of such QC is an unnamed Series.\n reduced_frame = pandas.DataFrame({MODIN_UNNAMED_SERIES_LABEL: [1, 2, 3]})\n series_result = GroupBy.validate_by(reduced_frame)\n series_reference = [pandas.Series([1, 2, 3], name=None)]\n compare(series_reference, series_result)\n\n # This emulates situation when several 'by' columns of the group frame are passed as a single QueryCompiler:\n # 1. If grouping on several columns the 'by' at the QC level is the following: ``df[by]._query_compiler``.\n # 2. The valid representation of such QC is a list of Series.\n splited_df = [pandas.Series([1, 2, 3], name=f\"col{i}\") for i in range(3)]\n splited_df_result = GroupBy.validate_by(\n pandas.concat(splited_df, axis=1, copy=True)\n )\n compare(splited_df, splited_df_result)\n\n # This emulates situation of mixed by (two column names and an external Series):\n by = [\"col1\", \"col2\", pandas.DataFrame({MODIN_UNNAMED_SERIES_LABEL: [1, 2, 3]})]\n result_by = GroupBy.validate_by(by)\n reference_by = [\"col1\", \"col2\", pandas.Series([1, 2, 3], name=None)]\n compare(reference_by, result_by)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_virtual_partitions_test_groupby_with_virtual_partitions.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_virtual_partitions_test_groupby_with_virtual_partitions.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2312, "end_line": 2331, "span_ids": ["test_groupby_with_virtual_partitions"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n get_current_execution() == \"BaseOnPython\" or StorageFormat.get() == \"Hdk\",\n reason=\"The test only make sense for partitioned executions\",\n)\ndef test_groupby_with_virtual_partitions():\n # from https://github.com/modin-project/modin/issues/4464\n modin_df, pandas_df = create_test_dfs(test_data[\"int_data\"])\n\n # Concatenate DataFrames here to make virtual partitions.\n big_modin_df = pd.concat([modin_df for _ in range(5)])\n big_pandas_df = pandas.concat([pandas_df for _ in range(5)])\n\n # Check that the constructed Modin DataFrame has virtual partitions when\n assert issubclass(\n type(big_modin_df._query_compiler._modin_frame._partitions[0][0]),\n PandasDataframeAxisPartition,\n )\n eval_general(\n big_modin_df, big_pandas_df, lambda df: df.groupby(df.columns[0]).count()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_sort_test_groupby_sort.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_sort_test_groupby_sort.None_6", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2334, "end_line": 2357, "span_ids": ["test_groupby_sort"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"sort\", [True, False])\n@pytest.mark.parametrize(\"is_categorical_by\", [True, False])\ndef test_groupby_sort(sort, is_categorical_by):\n # from issue #3571\n by = np.array([\"a\"] * 50000 + [\"b\"] * 10000 + [\"c\"] * 1000)\n random_state = np.random.RandomState(seed=42)\n random_state.shuffle(by)\n\n data = {\"key_col\": by, \"data_col\": np.arange(len(by))}\n md_df, pd_df = create_test_dfs(data)\n\n if is_categorical_by:\n md_df = md_df.astype({\"key_col\": \"category\"})\n pd_df = pd_df.astype({\"key_col\": \"category\"})\n\n md_grp = md_df.groupby(\"key_col\", sort=sort)\n pd_grp = pd_df.groupby(\"key_col\", sort=sort)\n\n modin_groupby_equals_pandas(md_grp, pd_grp)\n eval_general(md_grp, pd_grp, lambda grp: grp.sum(numeric_only=True))\n eval_general(md_grp, pd_grp, lambda grp: grp.size())\n eval_general(md_grp, pd_grp, lambda grp: grp.agg(lambda df: df.mean()))\n eval_general(md_grp, pd_grp, lambda grp: grp.dtypes)\n eval_general(md_grp, pd_grp, lambda grp: grp.first())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_sum_with_level_test_sum_with_level.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_sum_with_level_test_sum_with_level.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2360, "end_line": 2368, "span_ids": ["test_sum_with_level"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sum_with_level():\n data = {\n \"A\": [\"0.0\", \"1.0\", \"2.0\", \"3.0\", \"4.0\"],\n \"B\": [\"0.0\", \"1.0\", \"0.0\", \"1.0\", \"0.0\"],\n \"C\": [\"foo1\", \"foo2\", \"foo3\", \"foo4\", \"foo5\"],\n \"D\": pandas.bdate_range(\"1/1/2009\", periods=5),\n }\n modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)\n eval_general(modin_df, pandas_df, lambda df: df.set_index(\"C\").groupby(\"C\").sum())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_frozenlist_test_groupby_with_frozenlist.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_frozenlist_test_groupby_with_frozenlist.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2371, "end_line": 2375, "span_ids": ["test_groupby_with_frozenlist"], "tokens": 99}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_groupby_with_frozenlist():\n pandas_df = pandas.DataFrame(data={\"a\": [1, 2, 3], \"b\": [1, 2, 3], \"c\": [1, 2, 3]})\n pandas_df = pandas_df.set_index([\"a\", \"b\"])\n modin_df = from_pandas(pandas_df)\n eval_general(modin_df, pandas_df, lambda df: df.groupby(df.index.names).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_modin-project__modin/modin/pandas/test/test_groupby.py_test_mean_with_datetime_test_mean_with_datetime.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_mean_with_datetime_test_mean_with_datetime.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2378, "end_line": 2394, "span_ids": ["test_mean_with_datetime"], "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": "@pytest.mark.parametrize(\n \"by_func\",\n [\n lambda df: \"timestamp0\",\n lambda df: [\"timestamp0\", \"timestamp1\"],\n lambda df: [\"timestamp0\", df[\"timestamp1\"]],\n ],\n)\ndef test_mean_with_datetime(by_func):\n data = {\n \"timestamp0\": [pd.to_datetime(1490195805, unit=\"s\")],\n \"timestamp1\": [pd.to_datetime(1490195805, unit=\"s\")],\n \"numeric\": [0],\n }\n\n modin_df, pandas_df = create_test_dfs(data)\n eval_general(modin_df, pandas_df, lambda df: df.groupby(by=by_func(df)).mean())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_ohlc_test_groupby_ohlc.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_ohlc_test_groupby_ohlc.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2397, "end_line": 2417, "span_ids": ["test_groupby_ohlc"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_groupby_ohlc():\n pandas_df = pandas.DataFrame(\n np.random.randint(0, 100, (50, 2)), columns=[\"stock A\", \"stock B\"]\n )\n pandas_df[\"Date\"] = pandas.concat(\n [pandas.date_range(\"1/1/2000\", periods=10, freq=\"min\").to_series()] * 5\n ).reset_index(drop=True)\n modin_df = pd.DataFrame(pandas_df)\n eval_general(modin_df, pandas_df, lambda df: df.groupby(\"Date\")[\"stock A\"].ohlc())\n pandas_multiindex_result = pandas_df.groupby(\"Date\")[[\"stock A\"]].ohlc()\n\n with warns_that_defaulting_to_pandas():\n modin_multiindex_result = modin_df.groupby(\"Date\")[[\"stock A\"]].ohlc()\n df_equals(modin_multiindex_result, pandas_multiindex_result)\n\n pandas_multiindex_result = pandas_df.groupby(\"Date\")[[\"stock A\", \"stock B\"]].ohlc()\n with warns_that_defaulting_to_pandas():\n modin_multiindex_result = modin_df.groupby(\"Date\")[\n [\"stock A\", \"stock B\"]\n ].ohlc()\n df_equals(modin_multiindex_result, pandas_multiindex_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_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data_test_groupby_on_empty_data.ModinDfConstructor.frame_with_deferred_index.return.df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data_test_groupby_on_empty_data.ModinDfConstructor.frame_with_deferred_index.return.df", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2420, "end_line": 2444, "span_ids": ["test_groupby_on_empty_data"], "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": "@pytest.mark.parametrize(\n \"modin_df_recipe\",\n [\"non_lazy_frame\", \"frame_with_deferred_index\", \"lazy_frame\"],\n)\ndef test_groupby_on_empty_data(modin_df_recipe):\n class ModinDfConstructor:\n def __init__(self, recipe, df_kwargs):\n self._recipe = recipe\n self._mock_obj = None\n self._df_kwargs = df_kwargs\n\n def non_lazy_frame(self):\n return pd.DataFrame(**self._df_kwargs)\n\n def frame_with_deferred_index(self):\n df = pd.DataFrame(**self._df_kwargs)\n try:\n # The frame would stop being lazy once index computation is triggered\n df._query_compiler._modin_frame.set_index_cache(None)\n except AttributeError:\n pytest.skip(\n reason=\"Selected execution doesn't support deferred indices.\"\n )\n\n return df\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.ModinDfConstructor.lazy_frame_test_groupby_on_empty_data.ModinDfConstructor.__exit__.if_self__mock_obj_is_not_.self__mock_obj___exit___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.ModinDfConstructor.lazy_frame_test_groupby_on_empty_data.ModinDfConstructor.__exit__.if_self__mock_obj_is_not_.self__mock_obj___exit___", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2446, "end_line": 2466, "span_ids": ["test_groupby_on_empty_data"], "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": "@pytest.mark.parametrize(\n \"modin_df_recipe\",\n [\"non_lazy_frame\", \"frame_with_deferred_index\", \"lazy_frame\"],\n)\ndef test_groupby_on_empty_data(modin_df_recipe):\n class ModinDfConstructor:\n\n def lazy_frame(self):\n donor_obj = pd.DataFrame()._query_compiler\n\n self._mock_obj = mock.patch(\n f\"{donor_obj.__module__}.{donor_obj.__class__.__name__}.lazy_execution\",\n new_callable=mock.PropertyMock,\n )\n patch_obj = self._mock_obj.__enter__()\n patch_obj.return_value = True\n\n df = pd.DataFrame(**self._df_kwargs)\n # The frame is lazy until `self.__exit__()` is called\n assert df._query_compiler.lazy_execution\n return df\n\n def __enter__(self):\n return getattr(self, self._recipe)()\n\n def __exit__(self, *args, **kwargs):\n if self._mock_obj is not None:\n self._mock_obj.__exit__(*args, **kwargs)\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.run_test_test_groupby_on_empty_data.run_test.with_ModinDfConstructor_m.eval_function_modin_grp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.run_test_test_groupby_on_empty_data.run_test.with_ModinDfConstructor_m.eval_function_modin_grp_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2468, "end_line": 2476, "span_ids": ["test_groupby_on_empty_data"], "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": "@pytest.mark.parametrize(\n \"modin_df_recipe\",\n [\"non_lazy_frame\", \"frame_with_deferred_index\", \"lazy_frame\"],\n)\ndef test_groupby_on_empty_data(modin_df_recipe):\n # ... other code\n\n def run_test(eval_function, *args, **kwargs):\n df_kwargs = {\"columns\": [\"a\", \"b\", \"c\"]}\n with ModinDfConstructor(modin_df_recipe, df_kwargs) as modin_df:\n pandas_df = pandas.DataFrame(**df_kwargs)\n\n modin_grp = modin_df.groupby(modin_df.columns[0])\n pandas_grp = pandas_df.groupby(pandas_df.columns[0])\n\n eval_function(modin_grp, pandas_grp, *args, **kwargs)\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_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.run_test_eval___getattr___test_groupby_on_empty_data._run_test_eval_std_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_on_empty_data.run_test_eval___getattr___test_groupby_on_empty_data._run_test_eval_std_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2478, "end_line": 2523, "span_ids": ["test_groupby_on_empty_data"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"modin_df_recipe\",\n [\"non_lazy_frame\", \"frame_with_deferred_index\", \"lazy_frame\"],\n)\ndef test_groupby_on_empty_data(modin_df_recipe):\n # ... other code\n\n run_test(eval___getattr__, item=\"b\")\n run_test(eval___getitem__, item=\"b\")\n run_test(eval_agg, func=lambda df: df.mean())\n run_test(eval_aggregate, func=lambda df: df.mean())\n run_test(eval_any)\n run_test(eval_apply, func=lambda df: df.mean())\n run_test(eval_count)\n run_test(eval_cummax, numeric_only=True)\n run_test(eval_cummin, numeric_only=True)\n run_test(eval_cumprod, numeric_only=True)\n run_test(eval_cumsum, numeric_only=True)\n run_test(eval_dtypes)\n run_test(eval_fillna)\n run_test(eval_groups)\n run_test(eval_len)\n run_test(eval_max)\n run_test(eval_mean)\n run_test(eval_median)\n run_test(eval_min)\n run_test(eval_ndim)\n run_test(eval_ngroup)\n run_test(eval_ngroups)\n run_test(eval_nunique)\n run_test(eval_prod)\n run_test(eval_quantile)\n run_test(eval_rank)\n run_test(eval_size)\n run_test(eval_skew)\n run_test(eval_sum)\n run_test(eval_var)\n\n if modin_df_recipe != \"lazy_frame\":\n # TODO: these functions have their specific implementations in the\n # front-end that are unable to operate on empty frames and thus\n # fail on an empty lazy frame.\n # https://github.com/modin-project/modin/issues/5505\n # https://github.com/modin-project/modin/issues/5506\n run_test(eval_pipe, func=lambda df: df.mean())\n run_test(eval_shift)\n\n # TODO: these functions fail in case of empty data in the pandas itself,\n # we have to modify the `eval_*` functions to be able to check for\n # exceptions equality:\n # https://github.com/modin-project/modin/issues/5441\n # run_test(eval_transform, func=lambda df: df.mean())\n # run_test(eval_std)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_skew_corner_cases_test_skew_corner_cases.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_skew_corner_cases_test_skew_corner_cases.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2526, "end_line": 2547, "span_ids": ["test_skew_corner_cases"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_skew_corner_cases():\n \"\"\"\n This test was inspired by https://github.com/modin-project/modin/issues/5545.\n\n The test verifies that modin acts exactly as pandas when the input data is\n bad for the 'skew' and so some components of the 'skew' formula appears to be invalid:\n ``(count * (count - 1) ** 0.5 / (count - 2)) * (m3 / m2**1.5)``\n \"\"\"\n # When 'm2 == m3 == 0' thus causing 0 / 0 division in the second multiplier.\n # Note: mX = 'sum((col - mean(col)) ^ x)'\n modin_df, pandas_df = create_test_dfs({\"col0\": [1, 1, 1], \"col1\": [10, 10, 10]})\n eval_general(modin_df, pandas_df, lambda df: df.groupby(\"col0\").skew())\n\n # When 'count < 3' thus causing dividing by zero in the first multiplier\n # Note: count = group_size\n modin_df, pandas_df = create_test_dfs({\"col0\": [1, 1], \"col1\": [1, 2]})\n eval_general(modin_df, pandas_df, lambda df: df.groupby(\"col0\").skew())\n\n # When 'count < 3' and 'm3 / m2 != 0'. The case comes from:\n # https://github.com/modin-project/modin/issues/5545\n modin_df, pandas_df = create_test_dfs({\"col0\": [1, 1], \"col1\": [171, 137]})\n eval_general(modin_df, pandas_df, lambda df: df.groupby(\"col0\").skew())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_grouper_test_groupby_with_grouper.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_with_grouper_test_groupby_with_grouper.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2550, "end_line": 2574, "span_ids": ["test_groupby_with_grouper"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"by\",\n [\n pandas.Grouper(key=\"time_stamp\", freq=\"3D\"),\n [pandas.Grouper(key=\"time_stamp\", freq=\"1M\"), \"count\"],\n ],\n)\ndef test_groupby_with_grouper(by):\n # See https://github.com/modin-project/modin/issues/5091 for more details\n # Generate larger data so that it can handle partitioning cases\n data = {\n \"id\": [i for i in range(200)],\n \"time_stamp\": [\n pd.Timestamp(\"2000-01-02\") + datetime.timedelta(days=x) for x in range(200)\n ],\n }\n for i in range(200):\n data[f\"count_{i}\"] = [i, i + 1] * 100\n\n modin_df, pandas_df = create_test_dfs(data)\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df.groupby(by).mean(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_preserves_by_order_test_groupby_preserves_by_order.df_equals_modin_res_pand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_preserves_by_order_test_groupby_preserves_by_order.df_equals_modin_res_pand", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2577, "end_line": 2583, "span_ids": ["test_groupby_preserves_by_order"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_groupby_preserves_by_order():\n modin_df, pandas_df = create_test_dfs({\"col0\": [1, 1, 1], \"col1\": [10, 10, 10]})\n\n modin_res = modin_df.groupby([pd.Series([100, 100, 100]), \"col0\"]).mean()\n pandas_res = pandas_df.groupby([pandas.Series([100, 100, 100]), \"col0\"]).mean()\n\n df_equals(modin_res, pandas_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_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_agg_with_empty_column_partition_6175_test_groupby_agg_with_empty_column_partition_6175.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_agg_with_empty_column_partition_6175_test_groupby_agg_with_empty_column_partition_6175.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2586, "end_line": 2633, "span_ids": ["test_groupby_agg_with_empty_column_partition_6175"], "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": "@pytest.mark.parametrize(\n \"method\",\n # test all aggregations from pandas.core.groupby.base.reduction_kernels except\n # nth and corrwith, both of which require extra arguments.\n [\n \"all\",\n \"any\",\n \"count\",\n \"first\",\n \"idxmax\",\n \"idxmin\",\n \"last\",\n \"max\",\n \"mean\",\n \"median\",\n \"min\",\n \"nunique\",\n \"prod\",\n \"quantile\",\n \"sem\",\n \"size\",\n \"skew\",\n \"std\",\n \"sum\",\n \"var\",\n ],\n)\n@pytest.mark.skipif(\n StorageFormat.get() != \"Pandas\",\n reason=\"only relevant to pandas execution\",\n)\ndef test_groupby_agg_with_empty_column_partition_6175(method):\n df = pd.concat(\n [\n pd.DataFrame({\"col33\": [0, 1], \"index\": [2, 3]}),\n pd.DataFrame({\"col34\": [4, 5]}),\n ],\n axis=1,\n )\n assert df._query_compiler._modin_frame._partitions.shape == (1, 2)\n eval_general(\n df,\n df._to_pandas(),\n lambda df: getattr(df.groupby([\"col33\", \"index\"]), method)(),\n # work around https://github.com/modin-project/modin/issues/6016: we don't\n # expect any exceptions.\n raising_exceptions=(Exception,),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_pct_change_diff_6194_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_groupby.py_test_groupby_pct_change_diff_6194_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_groupby.py", "file_name": "test_groupby.py", "file_type": "text/x-python", "category": "test", "start_line": 2636, "end_line": 2654, "span_ids": ["test_groupby_pct_change_diff_6194"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_groupby_pct_change_diff_6194():\n df = pd.DataFrame(\n {\n \"by\": [\"a\", \"b\", \"c\", \"a\", \"c\"],\n \"value\": [1, 2, 4, 5, 1],\n }\n )\n # These methods should not crash\n eval_general(\n df,\n df._to_pandas(),\n lambda df: df.groupby(by=\"by\").pct_change(),\n )\n eval_general(\n df,\n df._to_pandas(),\n lambda df: df.groupby(by=\"by\").diff(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_mock_assert_files_eq.with_open_path1_rb_as.if_file1_content_file2.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_mock_assert_files_eq.with_open_path1_rb_as.if_file1_content_file2.else_.return.False", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 138, "span_ids": ["impl:3", "assert_files_eq", "_nullcontext", "docstring"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest.mock as mock\nimport inspect\nimport contextlib\nimport pytest\nimport numpy as np\nfrom packaging import version\nimport pandas\nfrom pandas.errors import ParserWarning\nimport pandas._libs.lib as lib\nfrom pandas.core.dtypes.common import is_list_like\nfrom pandas._testing import ensure_clean\nfrom pathlib import Path\nfrom collections import OrderedDict, defaultdict\nfrom modin.config.envvars import MinPartitionSize\nfrom modin.db_conn import (\n ModinDatabaseConnection,\n UnsupportedDatabaseException,\n)\nfrom modin.config import (\n TestDatasetSize,\n Engine,\n StorageFormat,\n IsExperimental,\n TestReadFromPostgres,\n TestReadFromSqlServer,\n ReadSqlEngine,\n AsyncReadMode,\n)\nfrom modin.utils import to_pandas\nfrom modin.pandas.utils import from_arrow\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nimport pyarrow as pa\nimport os\nfrom scipy import sparse\nimport sys\nimport sqlalchemy as sa\nimport csv\nfrom typing import Dict\n\nfrom .utils import (\n check_file_leaks,\n df_equals,\n json_short_string,\n json_short_bytes,\n json_long_string,\n json_long_bytes,\n get_unique_filename,\n io_ops_bad_exc,\n eval_io_from_str,\n dummy_decorator,\n create_test_dfs,\n COMP_TO_EXT,\n generate_dataframe,\n default_to_pandas_ignore_string,\n parse_dates_values_by_id,\n time_parsing_csv_path,\n test_data as utils_test_data,\n eval_general,\n)\n\nif StorageFormat.get() == \"Hdk\":\n from modin.experimental.core.execution.native.implementations.hdk_on_native.test.utils import (\n eval_io,\n align_datetime_dtypes,\n )\nelse:\n from .utils import eval_io\n\nif StorageFormat.get() == \"Pandas\":\n import modin.pandas as pd\nelse:\n import modin.experimental.pandas as pd\n\ntry:\n import ray\n\n EXCEPTIONS = (ray.exceptions.WorkerCrashedError,)\nexcept ImportError:\n EXCEPTIONS = ()\n\n\nfrom modin.config import NPartitions\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\nNPartitions.put(4)\n\nDATASET_SIZE_DICT = {\n \"Small\": 64,\n \"Normal\": 2000,\n \"Big\": 20000,\n}\n\n# Number of rows in the test file\nNROWS = DATASET_SIZE_DICT.get(TestDatasetSize.get(), DATASET_SIZE_DICT[\"Small\"])\n\nTEST_DATA = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col4\": [12, 13, 14, 15],\n \"col5\": [0, 0, 0, 0],\n}\n\n\n@contextlib.contextmanager\ndef _nullcontext():\n \"\"\"Replacement for contextlib.nullcontext missing in older Python.\"\"\"\n yield\n\n\ndef assert_files_eq(path1, path2):\n with open(path1, \"rb\") as file1, open(path2, \"rb\") as file2:\n file1_content = file1.read()\n file2_content = file2.read()\n\n if file1_content == file2_content:\n return True\n else:\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_modin-project__modin/modin/pandas/test/test_io.py_setup_clipboard_parquet_eval_to_file.df_equals_pandas_df_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_setup_clipboard_parquet_eval_to_file.df_equals_pandas_df_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 141, "end_line": 173, "span_ids": ["setup_clipboard", "parquet_eval_to_file"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_clipboard(row_size=NROWS):\n df = pandas.DataFrame({\"col1\": np.arange(row_size), \"col2\": np.arange(row_size)})\n df.to_clipboard()\n\n\ndef parquet_eval_to_file(tmp_dir, modin_obj, pandas_obj, fn, extension, **fn_kwargs):\n \"\"\"\n Helper function to test `to_parquet` method.\n\n Parameters\n ----------\n tmp_dir : Union[str, Path]\n Temporary directory.\n modin_obj : pd.DataFrame\n A Modin DataFrame or a Series to test `to_parquet` method.\n pandas_obj: pandas.DataFrame\n A pandas DataFrame or a Series to test `to_parquet` method.\n fn : str\n Name of the method, that should be tested.\n extension : str\n Extension of the test file.\n \"\"\"\n unique_filename_modin = get_unique_filename(extension=extension, data_dir=tmp_dir)\n unique_filename_pandas = get_unique_filename(extension=extension, data_dir=tmp_dir)\n\n engine = fn_kwargs.get(\"engine\", \"auto\")\n\n getattr(modin_obj, fn)(unique_filename_modin, **fn_kwargs)\n getattr(pandas_obj, fn)(unique_filename_pandas, **fn_kwargs)\n\n pandas_df = pandas.read_parquet(unique_filename_pandas, engine=engine)\n modin_df = pd.read_parquet(unique_filename_modin, engine=engine)\n df_equals(pandas_df, modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_eval_to_file_eval_to_file.assert_assert_files_eq_un": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_eval_to_file_eval_to_file.assert_assert_files_eq_un", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 176, "end_line": 213, "span_ids": ["eval_to_file"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_to_file(tmp_dir, modin_obj, pandas_obj, fn, extension, **fn_kwargs):\n \"\"\"\n Test `fn` method of `modin_obj` and `pandas_obj`.\n\n Parameters\n ----------\n tmp_dir : Union[str, Path]\n Temporary directory.\n modin_obj: Modin DataFrame or Series\n Object to test.\n pandas_obj: Pandas DataFrame or Series\n Object to test.\n fn: str\n Name of the method, that should be tested.\n extension: str\n Extension of the test file.\n \"\"\"\n unique_filename_modin = get_unique_filename(extension=extension, data_dir=tmp_dir)\n unique_filename_pandas = get_unique_filename(extension=extension, data_dir=tmp_dir)\n\n # parameter `max_retries=0` is set for `to_csv` function on Ray engine,\n # in order to increase the stability of tests, we repeat the call of\n # the entire function manually\n last_exception = None\n for _ in range(3):\n try:\n getattr(modin_obj, fn)(unique_filename_modin, **fn_kwargs)\n except EXCEPTIONS as err:\n last_exception = err\n continue\n break\n # If we do have an exception that's valid let's raise it\n if last_exception:\n raise last_exception\n\n getattr(pandas_obj, fn)(unique_filename_pandas, **fn_kwargs)\n\n assert assert_files_eq(unique_filename_modin, unique_filename_pandas)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_eval_to_csv_file_eval_to_csv_file.if_force_read_or_not_asse.df_equals_pandas_obj_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_eval_to_csv_file_eval_to_csv_file.if_force_read_or_not_asse.df_equals_pandas_obj_mod", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 251, "span_ids": ["eval_to_csv_file"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_to_csv_file(tmp_dir, modin_obj, pandas_obj, extension, **kwargs):\n if extension is None:\n kwargs[\"mode\"] = \"t\"\n kwargs[\"compression\"] = \"infer\"\n modin_csv = modin_obj.to_csv(**kwargs)\n pandas_csv = pandas_obj.to_csv(**kwargs)\n if modin_csv == pandas_csv:\n return\n\n force_read = True\n modin_file = get_unique_filename(extension=\"csv\", data_dir=tmp_dir)\n pandas_file = get_unique_filename(extension=\"csv\", data_dir=tmp_dir)\n with open(modin_file, \"w\") as file:\n file.write(modin_csv)\n with open(pandas_file, \"w\") as file:\n file.write(pandas_csv)\n else:\n force_read = extension != \"csv\" or kwargs.get(\"compression\", None)\n modin_file = get_unique_filename(extension=extension, data_dir=tmp_dir)\n pandas_file = get_unique_filename(extension=extension, data_dir=tmp_dir)\n modin_obj.to_csv(modin_file, **kwargs)\n pandas_obj.to_csv(pandas_file, **kwargs)\n\n if force_read or not assert_files_eq(modin_file, pandas_file):\n # If the files are not identical, make sure they can\n # be read by pandas and contains identical data.\n read_kwargs = {}\n if kwargs.get(\"index\", None) is not False:\n read_kwargs[\"index_col\"] = 0\n if (value := kwargs.get(\"sep\", None)) is not None:\n read_kwargs[\"sep\"] = value\n if (value := kwargs.get(\"compression\", None)) is not None:\n read_kwargs[\"compression\"] = value\n modin_obj = pandas.read_csv(modin_file, **read_kwargs)\n pandas_obj = pandas.read_csv(pandas_file, **read_kwargs)\n df_equals(pandas_obj, modin_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_modin-project__modin/modin/pandas/test/test_io.py_make_parquet_dir_TestCsv.test_read_csv_delimiters.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_make_parquet_dir_TestCsv.test_read_csv_delimiters.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 298, "span_ids": ["make_parquet_dir", "TestCsv", "TestCsv.test_read_csv_delimiters"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef make_parquet_dir(tmp_path):\n def _make_parquet_dir(\n dfs_by_filename: Dict[str, pandas.DataFrame], row_group_size: int\n ):\n for filename, df in dfs_by_filename.items():\n df.to_parquet(\n os.path.join(tmp_path, filename), row_group_size=row_group_size\n )\n return tmp_path\n\n yield _make_parquet_dir\n\n\n@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n # delimiter tests\n @pytest.mark.parametrize(\"sep\", [None, \"_\", \",\", \".\", \"\\n\"])\n @pytest.mark.parametrize(\"delimiter\", [\"_\", \",\", \".\", \"\\n\"])\n @pytest.mark.parametrize(\"decimal\", [\".\", \"_\"])\n @pytest.mark.parametrize(\"thousands\", [None, \",\", \"_\", \" \"])\n def test_read_csv_delimiters(\n self, make_csv_file, sep, delimiter, decimal, thousands\n ):\n with ensure_clean(\".csv\") as unique_filename:\n make_csv_file(\n filename=unique_filename,\n delimiter=delimiter,\n thousands_separator=thousands,\n decimal_separator=decimal,\n )\n\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=unique_filename,\n delimiter=delimiter,\n sep=sep,\n decimal=decimal,\n thousands=thousands,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_dtype_backend_TestCsv._Column_and_Index_Locati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_dtype_backend_TestCsv._Column_and_Index_Locati", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 300, "end_line": 319, "span_ids": ["TestCsv.test_read_csv_dtype_backend"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n def test_read_csv_dtype_backend(self, make_csv_file, dtype_backend):\n with ensure_clean(\".csv\") as unique_filename:\n make_csv_file(filename=unique_filename)\n\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=unique_filename,\n dtype_backend=dtype_backend,\n comparator=comparator,\n )\n\n # Column and Index Locations and Names 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_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_col_handling_TestCsv.test_read_csv_col_handling.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_col_handling_TestCsv.test_read_csv_col_handling.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 320, "end_line": 352, "span_ids": ["TestCsv.test_read_csv_col_handling"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n @pytest.mark.parametrize(\"header\", [\"infer\", None, 0])\n @pytest.mark.parametrize(\"index_col\", [None, \"col1\"])\n @pytest.mark.parametrize(\n \"names\", [lib.no_default, [\"col1\"], [\"c1\", \"c2\", \"c3\", \"c4\", \"c5\", \"c6\", \"c7\"]]\n )\n @pytest.mark.parametrize(\n \"usecols\", [None, [\"col1\"], [\"col1\", \"col2\", \"col6\"], [0, 1, 5]]\n )\n @pytest.mark.parametrize(\"skip_blank_lines\", [True, False])\n def test_read_csv_col_handling(\n self,\n header,\n index_col,\n names,\n usecols,\n skip_blank_lines,\n ):\n if names is lib.no_default:\n pytest.skip(\"some parameters combiantions fails: issue #2312\")\n if header in [\"infer\", None] and names is not lib.no_default:\n pytest.skip(\n \"Heterogeneous data in a column is not cast to a common type: issue #3346\"\n )\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_blank_lines\"],\n header=header,\n index_col=index_col,\n names=names,\n usecols=usecols,\n skip_blank_lines=skip_blank_lines,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_from_csv_with_callable_usecols_TestCsv.test_read_csv_parsing_1.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_from_csv_with_callable_usecols_TestCsv.test_read_csv_parsing_1.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 354, "end_line": 401, "span_ids": ["TestCsv.test_from_csv_with_callable_usecols", "TestCsv.test_read_csv_parsing_1"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"usecols\", [lambda col_name: col_name in [\"a\", \"b\", \"e\"]])\n def test_from_csv_with_callable_usecols(self, usecols):\n fname = \"modin/pandas/test/data/test_usecols.csv\"\n pandas_df = pandas.read_csv(fname, usecols=usecols)\n modin_df = pd.read_csv(fname, usecols=usecols)\n df_equals(modin_df, pandas_df)\n\n # General Parsing Configuration\n @pytest.mark.parametrize(\"dtype\", [None, True])\n @pytest.mark.parametrize(\"engine\", [None, \"python\", \"c\"])\n @pytest.mark.parametrize(\n \"converters\",\n [\n None,\n {\n \"col1\": lambda x: np.int64(x) * 10,\n \"col2\": pandas.to_datetime,\n \"col4\": lambda x: x.replace(\":\", \";\"),\n },\n ],\n )\n @pytest.mark.parametrize(\"skipfooter\", [0, 10])\n def test_read_csv_parsing_1(\n self,\n dtype,\n engine,\n converters,\n skipfooter,\n ):\n if dtype:\n dtype = {\n col: \"object\"\n for col in pandas.read_csv(\n pytest.csvs_names[\"test_read_csv_regular\"], nrows=1\n ).columns\n }\n\n eval_io(\n fn_name=\"read_csv\",\n raising_exceptions=None,\n check_kwargs_callable=not callable(converters),\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n dtype=dtype,\n engine=engine,\n converters=converters,\n skipfooter=skipfooter,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parsing_2_TestCsv.test_read_csv_parsing_2.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parsing_2_TestCsv.test_read_csv_parsing_2.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 403, "end_line": 472, "span_ids": ["TestCsv.test_read_csv_parsing_2"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"header\", [\"infer\", None, 0])\n @pytest.mark.parametrize(\n \"skiprows\",\n [\n 2,\n lambda x: x % 2,\n lambda x: x > 25,\n lambda x: x > 128,\n np.arange(10, 50),\n np.arange(10, 50, 2),\n ],\n )\n @pytest.mark.parametrize(\"nrows\", [35, None])\n @pytest.mark.parametrize(\n \"names\",\n [\n [f\"c{col_number}\" for col_number in range(4)],\n [f\"c{col_number}\" for col_number in range(6)],\n None,\n ],\n )\n @pytest.mark.parametrize(\"encoding\", [\"latin1\", \"windows-1251\", None])\n def test_read_csv_parsing_2(\n self,\n make_csv_file,\n request,\n header,\n skiprows,\n nrows,\n names,\n encoding,\n ):\n if request.config.getoption(\n \"--simulate-cloud\"\n ).lower() != \"off\" and is_list_like(skiprows):\n pytest.xfail(\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\"\n )\n with ensure_clean(\".csv\") as unique_filename:\n if encoding:\n make_csv_file(\n filename=unique_filename,\n encoding=encoding,\n )\n kwargs = {\n \"filepath_or_buffer\": unique_filename\n if encoding\n else pytest.csvs_names[\"test_read_csv_regular\"],\n \"header\": header,\n \"skiprows\": skiprows,\n \"nrows\": nrows,\n \"names\": names,\n \"encoding\": encoding,\n }\n\n if Engine.get() != \"Python\":\n df = pandas.read_csv(**dict(kwargs, nrows=1))\n # in that case first partition will contain str\n if df[df.columns[0]][df.index[0]] in [\"c1\", \"col1\", \"c3\", \"col3\"]:\n pytest.xfail(\n \"read_csv incorrect output with float data - issue #2634\"\n )\n\n eval_io(\n fn_name=\"read_csv\",\n raising_exceptions=None,\n check_kwargs_callable=not callable(skiprows),\n # read_csv kwargs\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parsing_3_TestCsv.test_read_csv_parsing_3.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parsing_3_TestCsv.test_read_csv_parsing_3.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 474, "end_line": 502, "span_ids": ["TestCsv.test_read_csv_parsing_3"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"true_values\", [[\"Yes\"], [\"Yes\", \"true\"], None])\n @pytest.mark.parametrize(\"false_values\", [[\"No\"], [\"No\", \"false\"], None])\n @pytest.mark.parametrize(\"skipfooter\", [0, 10])\n @pytest.mark.parametrize(\"nrows\", [35, None])\n def test_read_csv_parsing_3(\n self,\n true_values,\n false_values,\n skipfooter,\n nrows,\n ):\n xfail_case = (\n (false_values or true_values)\n and Engine.get() != \"Python\"\n and StorageFormat.get() != \"Hdk\"\n )\n if xfail_case:\n pytest.xfail(\"modin and pandas dataframes differs - issue #2446\")\n\n eval_io(\n fn_name=\"read_csv\",\n raising_exceptions=None,\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_yes_no\"],\n true_values=true_values,\n false_values=false_values,\n skipfooter=skipfooter,\n nrows=nrows,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skipinitialspace_TestCsv._NA_and_Missing_Data_Han": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skipinitialspace_TestCsv._NA_and_Missing_Data_Han", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 504, "end_line": 515, "span_ids": ["TestCsv.test_read_csv_skipinitialspace"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_read_csv_skipinitialspace(self):\n with ensure_clean(\".csv\") as unique_filename:\n str_initial_spaces = (\n \"col1,col2,col3,col4\\n\"\n + \"five, six, seven, eight\\n\"\n + \" five, six, seven, eight\\n\"\n + \"five, six, seven, eight\\n\"\n )\n\n eval_io_from_str(str_initial_spaces, unique_filename, skipinitialspace=True)\n\n # NA and Missing Data Handling 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_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_nans_handling_TestCsv._Datetime_Handling_tests": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_nans_handling_TestCsv._Datetime_Handling_tests", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 516, "end_line": 540, "span_ids": ["TestCsv.test_read_csv_nans_handling"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n @pytest.mark.parametrize(\"na_values\", [\"custom_nan\", \"73\"])\n @pytest.mark.parametrize(\"keep_default_na\", [True, False])\n @pytest.mark.parametrize(\"na_filter\", [True, False])\n @pytest.mark.parametrize(\"verbose\", [True, False])\n @pytest.mark.parametrize(\"skip_blank_lines\", [True, False])\n def test_read_csv_nans_handling(\n self,\n na_values,\n keep_default_na,\n na_filter,\n verbose,\n skip_blank_lines,\n ):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_nans\"],\n na_values=na_values,\n keep_default_na=keep_default_na,\n na_filter=na_filter,\n verbose=verbose,\n skip_blank_lines=skip_blank_lines,\n )\n\n # Datetime Handling 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_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_datetime_TestCsv.test_read_csv_datetime.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_datetime_TestCsv.test_read_csv_datetime.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 541, "end_line": 579, "span_ids": ["TestCsv.test_read_csv_datetime"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n @pytest.mark.parametrize(\n \"parse_dates\", [True, False, [\"col2\"], [\"col2\", \"col4\"], [1, 3]]\n )\n @pytest.mark.parametrize(\"infer_datetime_format\", [True, False])\n @pytest.mark.parametrize(\"keep_date_col\", [True, False])\n @pytest.mark.parametrize(\n \"date_parser\",\n [lib.no_default, lambda x: pandas.to_datetime(x, format=\"%Y-%m-%d\")],\n )\n @pytest.mark.parametrize(\"dayfirst\", [True, False])\n @pytest.mark.parametrize(\"cache_dates\", [True, False])\n def test_read_csv_datetime(\n self,\n parse_dates,\n infer_datetime_format,\n keep_date_col,\n date_parser,\n dayfirst,\n cache_dates,\n ):\n raising_exceptions = io_ops_bad_exc # default value\n if isinstance(parse_dates, dict) and callable(date_parser):\n # In this case raised TypeError: () takes 1 positional argument but 2 were given\n raising_exceptions = list(io_ops_bad_exc)\n raising_exceptions.remove(TypeError)\n\n eval_io(\n fn_name=\"read_csv\",\n check_kwargs_callable=not callable(date_parser),\n raising_exceptions=raising_exceptions,\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n parse_dates=parse_dates,\n infer_datetime_format=infer_datetime_format,\n keep_date_col=keep_date_col,\n date_parser=date_parser,\n dayfirst=dayfirst,\n cache_dates=cache_dates,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_dtype_parse_dates_TestCsv._Iteration_tests": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_dtype_parse_dates_TestCsv._Iteration_tests", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 581, "end_line": 596, "span_ids": ["TestCsv.test_read_csv_dtype_parse_dates"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"date\", [\"2023-01-01 00:00:01.000000000\", \"2023\"])\n @pytest.mark.parametrize(\"dtype\", [None, \"str\", {\"id\": \"int64\"}])\n @pytest.mark.parametrize(\"parse_dates\", [None, [], [\"date\"], [1]])\n def test_read_csv_dtype_parse_dates(self, date, dtype, parse_dates):\n with ensure_clean(\".csv\") as filename:\n with open(filename, \"w\") as file:\n file.write(f\"id,date\\n1,{date}\")\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=filename,\n dtype=dtype,\n parse_dates=parse_dates,\n )\n\n # Iteration 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_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_iteration_TestCsv.test_read_csv_iteration.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_iteration_TestCsv.test_read_csv_iteration.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 597, "end_line": 625, "span_ids": ["TestCsv.test_read_csv_iteration"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n @pytest.mark.parametrize(\"iterator\", [True, False])\n def test_read_csv_iteration(self, iterator):\n filename = pytest.csvs_names[\"test_read_csv_regular\"]\n\n # Tests __next__ and correctness of reader as an iterator\n # Use larger chunksize to read through file quicker\n rdf_reader = pd.read_csv(filename, chunksize=500, iterator=iterator)\n pd_reader = pandas.read_csv(filename, chunksize=500, iterator=iterator)\n\n for modin_df, pd_df in zip(rdf_reader, pd_reader):\n df_equals(modin_df, pd_df)\n\n # Tests that get_chunk works correctly\n rdf_reader = pd.read_csv(filename, chunksize=1, iterator=iterator)\n pd_reader = pandas.read_csv(filename, chunksize=1, iterator=iterator)\n\n modin_df = rdf_reader.get_chunk(1)\n pd_df = pd_reader.get_chunk(1)\n\n df_equals(modin_df, pd_df)\n\n # Tests that read works correctly\n rdf_reader = pd.read_csv(filename, chunksize=1, iterator=iterator)\n pd_reader = pandas.read_csv(filename, chunksize=1, iterator=iterator)\n\n modin_df = rdf_reader.read()\n pd_df = pd_reader.read()\n\n df_equals(modin_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_encoding_976_TestCsv._Quoting_Compression_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_encoding_976_TestCsv._Quoting_Compression_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 627, "end_line": 645, "span_ids": ["TestCsv.test_read_csv_encoding_976"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_read_csv_encoding_976(self):\n file_name = \"modin/pandas/test/data/issue_976.csv\"\n names = [str(i) for i in range(11)]\n\n kwargs = {\n \"sep\": \";\",\n \"names\": names,\n \"encoding\": \"windows-1251\",\n }\n df1 = pd.read_csv(file_name, **kwargs)\n df2 = pandas.read_csv(file_name, **kwargs)\n # these columns contain data of various types in partitions\n # see #1931 for details;\n df1 = df1.drop([\"4\", \"5\"], axis=1)\n df2 = df2.drop([\"4\", \"5\"], axis=1)\n\n df_equals(df1, df2)\n\n # Quoting, Compression parameters 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_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_compression_TestCsv.test_read_csv_compression.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_compression_TestCsv.test_read_csv_compression.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 646, "end_line": 667, "span_ids": ["TestCsv.test_read_csv_compression"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n @pytest.mark.parametrize(\"compression\", [\"infer\", \"gzip\", \"bz2\", \"xz\", \"zip\"])\n @pytest.mark.parametrize(\"encoding\", [None, \"latin8\", \"utf16\"])\n @pytest.mark.parametrize(\"engine\", [None, \"python\", \"c\"])\n def test_read_csv_compression(self, make_csv_file, compression, encoding, engine):\n with ensure_clean(\".csv\") as unique_filename:\n make_csv_file(\n filename=unique_filename, encoding=encoding, compression=compression\n )\n compressed_file_path = (\n f\"{unique_filename}.{COMP_TO_EXT[compression]}\"\n if compression != \"infer\"\n else unique_filename\n )\n\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=compressed_file_path,\n compression=compression,\n encoding=encoding,\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_encoding_TestCsv.test_read_csv_encoding.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_encoding_TestCsv.test_read_csv_encoding.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 669, "end_line": 703, "span_ids": ["TestCsv.test_read_csv_encoding"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"encoding\",\n [\n None,\n \"ISO-8859-1\",\n \"latin1\",\n \"iso-8859-1\",\n \"cp1252\",\n \"utf8\",\n pytest.param(\n \"unicode_escape\",\n marks=pytest.mark.skipif(\n condition=sys.version_info < (3, 9),\n reason=\"https://bugs.python.org/issue45461\",\n ),\n ),\n \"raw_unicode_escape\",\n \"utf_16_le\",\n \"utf_16_be\",\n \"utf32\",\n \"utf_32_le\",\n \"utf_32_be\",\n \"utf-8-sig\",\n ],\n )\n def test_read_csv_encoding(self, make_csv_file, encoding):\n with ensure_clean(\".csv\") as unique_filename:\n make_csv_file(filename=unique_filename, encoding=encoding)\n\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=unique_filename,\n encoding=encoding,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_file_format_TestCsv.test_read_csv_file_format.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_file_format_TestCsv.test_read_csv_file_format.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 705, "end_line": 767, "span_ids": ["TestCsv.test_read_csv_file_format"], "tokens": 524}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"thousands\", [None, \",\", \"_\", \" \"])\n @pytest.mark.parametrize(\"decimal\", [\".\", \"_\"])\n @pytest.mark.parametrize(\"lineterminator\", [None, \"x\", \"\\n\"])\n @pytest.mark.parametrize(\"escapechar\", [None, \"d\", \"x\"])\n @pytest.mark.parametrize(\"dialect\", [\"test_csv_dialect\", \"use_dialect_name\", None])\n def test_read_csv_file_format(\n self,\n make_csv_file,\n thousands,\n decimal,\n lineterminator,\n escapechar,\n dialect,\n ):\n with ensure_clean(\".csv\") as unique_filename:\n if dialect:\n test_csv_dialect_params = {\n \"delimiter\": \"_\",\n \"doublequote\": False,\n \"escapechar\": \"\\\\\",\n \"quotechar\": \"d\",\n \"quoting\": csv.QUOTE_ALL,\n }\n csv.register_dialect(dialect, **test_csv_dialect_params)\n if dialect != \"use_dialect_name\":\n # otherwise try with dialect name instead of `_csv.Dialect` object\n dialect = csv.get_dialect(dialect)\n make_csv_file(filename=unique_filename, **test_csv_dialect_params)\n else:\n make_csv_file(\n filename=unique_filename,\n thousands_separator=thousands,\n decimal_separator=decimal,\n escapechar=escapechar,\n lineterminator=lineterminator,\n )\n\n if (\n (StorageFormat.get() == \"Hdk\")\n and (escapechar is not None)\n and (lineterminator is None)\n and (thousands is None)\n and (decimal == \".\")\n ):\n with open(unique_filename, \"r\") as f:\n if any(\n line.find(f',\"{escapechar}') != -1 for _, line in enumerate(f)\n ):\n pytest.xfail(\n \"Tests with this character sequence fail due to #5649\"\n )\n\n eval_io(\n raising_exceptions=None,\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=unique_filename,\n thousands=thousands,\n decimal=decimal,\n lineterminator=lineterminator,\n escapechar=escapechar,\n dialect=dialect,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_quoting_TestCsv.test_read_csv_quoting.with_ensure_clean_csv_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_quoting_TestCsv.test_read_csv_quoting.with_ensure_clean_csv_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 769, "end_line": 809, "span_ids": ["TestCsv.test_read_csv_quoting"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"quoting\",\n [csv.QUOTE_ALL, csv.QUOTE_MINIMAL, csv.QUOTE_NONNUMERIC, csv.QUOTE_NONE],\n )\n @pytest.mark.parametrize(\"quotechar\", ['\"', \"_\", \"d\"])\n @pytest.mark.parametrize(\"doublequote\", [True, False])\n @pytest.mark.parametrize(\"comment\", [None, \"#\", \"x\"])\n def test_read_csv_quoting(\n self,\n make_csv_file,\n quoting,\n quotechar,\n doublequote,\n comment,\n ):\n # in these cases escapechar should be set, otherwise error occures\n # _csv.Error: need to escape, but no escapechar set\"\n use_escapechar = (\n not doublequote and quotechar != '\"' and quoting != csv.QUOTE_NONE\n )\n escapechar = \"\\\\\" if use_escapechar else None\n with ensure_clean(\".csv\") as unique_filename:\n make_csv_file(\n filename=unique_filename,\n quoting=quoting,\n quotechar=quotechar,\n doublequote=doublequote,\n escapechar=escapechar,\n comment_col_char=comment,\n )\n\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=unique_filename,\n quoting=quoting,\n quotechar=quotechar,\n doublequote=doublequote,\n escapechar=escapechar,\n comment=comment,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv._Error_Handling_paramete_TestCsv._Internal_parameters_tes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv._Error_Handling_paramete_TestCsv._Internal_parameters_tes", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 811, "end_line": 831, "span_ids": ["TestCsv.test_read_csv_error_handling", "TestCsv.test_read_csv_quoting"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n # Error Handling parameters tests\n @pytest.mark.skip(reason=\"https://github.com/modin-project/modin/issues/6239\")\n @pytest.mark.parametrize(\"on_bad_lines\", [\"error\", \"warn\", \"skip\", None])\n def test_read_csv_error_handling(self, on_bad_lines):\n # in that case exceptions are raised both by Modin and pandas\n # and tests pass\n raise_exception_case = on_bad_lines is not None\n if (\n not raise_exception_case\n and Engine.get() not in [\"Python\", \"Cloudpython\"]\n and StorageFormat.get() != \"Hdk\"\n ):\n pytest.xfail(\"read_csv doesn't raise `bad lines` exceptions - issue #2500\")\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_bad_lines\"],\n on_bad_lines=on_bad_lines,\n )\n\n # Internal parameters 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_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_internal_TestCsv.test_read_csv_internal.with_ensure_clean_csv_.if_use_str_data_.else_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_internal_TestCsv.test_read_csv_internal.with_ensure_clean_csv_.if_use_str_data_.else_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 832, "end_line": 898, "span_ids": ["TestCsv.test_read_csv_internal"], "tokens": 531}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n @pytest.mark.parametrize(\"use_str_data\", [True, False])\n @pytest.mark.parametrize(\"engine\", [None, \"python\", \"c\"])\n @pytest.mark.parametrize(\"delimiter\", [\",\", \" \"])\n @pytest.mark.parametrize(\"delim_whitespace\", [True, False])\n @pytest.mark.parametrize(\"low_memory\", [True, False])\n @pytest.mark.parametrize(\"memory_map\", [True, False])\n @pytest.mark.parametrize(\"float_precision\", [None, \"high\", \"round_trip\"])\n def test_read_csv_internal(\n self,\n make_csv_file,\n use_str_data,\n engine,\n delimiter,\n delim_whitespace,\n low_memory,\n memory_map,\n float_precision,\n ):\n # In this case raised TypeError: cannot use a string pattern on a bytes-like object,\n # so TypeError should be excluded from raising_exceptions list in order to check, that\n # the same exceptions are raised by Pandas and Modin\n case_with_TypeError_exc = (\n engine == \"python\"\n and delimiter == \",\"\n and delim_whitespace\n and low_memory\n and memory_map\n and float_precision is None\n )\n\n raising_exceptions = io_ops_bad_exc # default value\n if case_with_TypeError_exc:\n raising_exceptions = list(io_ops_bad_exc)\n raising_exceptions.remove(TypeError)\n\n kwargs = {\n \"engine\": engine,\n \"delimiter\": delimiter,\n \"delim_whitespace\": delim_whitespace,\n \"low_memory\": low_memory,\n \"memory_map\": memory_map,\n \"float_precision\": float_precision,\n }\n\n with ensure_clean(\".csv\") as unique_filename:\n if use_str_data:\n str_delim_whitespaces = (\n \"col1 col2 col3 col4\\n5 6 7 8\\n9 10 11 12\\n\"\n )\n eval_io_from_str(\n str_delim_whitespaces,\n unique_filename,\n raising_exceptions=raising_exceptions,\n **kwargs,\n )\n else:\n make_csv_file(\n filename=unique_filename,\n delimiter=delimiter,\n )\n\n eval_io(\n filepath_or_buffer=unique_filename,\n fn_name=\"read_csv\",\n raising_exceptions=raising_exceptions,\n **kwargs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv._Issue_related_specific_TestCsv.test_read_csv_google_cloud_storage.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv._Issue_related_specific_TestCsv.test_read_csv_google_cloud_storage.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 900, "end_line": 924, "span_ids": ["TestCsv.test_read_csv_internal", "TestCsv.test_read_csv_bad_quotes", "TestCsv.test_read_csv_google_cloud_storage", "TestCsv.test_read_csv_categories"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n # Issue related, specific or corner cases\n @pytest.mark.parametrize(\"nrows\", [2, None])\n def test_read_csv_bad_quotes(self, nrows):\n csv_bad_quotes = (\n '1, 2, 3, 4\\none, two, three, four\\nfive, \"six\", seven, \"eight\\n'\n )\n\n with ensure_clean(\".csv\") as unique_filename:\n eval_io_from_str(csv_bad_quotes, unique_filename, nrows=nrows)\n\n def test_read_csv_categories(self):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"modin/pandas/test/data/test_categories.csv\",\n names=[\"one\", \"two\"],\n dtype={\"one\": \"int64\", \"two\": \"category\"},\n )\n\n def test_read_csv_google_cloud_storage(self):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"gs://modin-testing/testing/multiple_csv/test_data0.csv\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parse_dates_TestCsv.test_read_csv_parse_dates.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_parse_dates_TestCsv.test_read_csv_parse_dates.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 926, "end_line": 971, "span_ids": ["TestCsv.test_read_csv_parse_dates"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"encoding\", [None, \"utf-8\"])\n @pytest.mark.parametrize(\"encoding_errors\", [\"strict\", \"ignore\"])\n @pytest.mark.parametrize(\n \"parse_dates\",\n [pytest.param(value, id=id) for id, value in parse_dates_values_by_id.items()],\n )\n @pytest.mark.parametrize(\"index_col\", [None, 0, 5])\n @pytest.mark.parametrize(\"header\", [\"infer\", 0])\n @pytest.mark.parametrize(\n \"names\",\n [\n None,\n [\n \"timestamp\",\n \"year\",\n \"month\",\n \"date\",\n \"symbol\",\n \"high\",\n \"low\",\n \"open\",\n \"close\",\n \"spread\",\n \"volume\",\n ],\n ],\n )\n def test_read_csv_parse_dates(\n self, names, header, index_col, parse_dates, encoding, encoding_errors\n ):\n if names is not None and header == \"infer\":\n pytest.xfail(\n \"read_csv with Ray engine works incorrectly with date data and names parameter provided - issue #2509\"\n )\n\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=time_parsing_csv_path,\n names=names,\n header=header,\n index_col=index_col,\n parse_dates=parse_dates,\n encoding=encoding,\n encoding_errors=encoding_errors,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_s3_TestCsv.test_read_csv_s3.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_s3_TestCsv.test_read_csv_s3.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 973, "end_line": 986, "span_ids": ["TestCsv.test_read_csv_s3"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"storage_options\",\n [{\"anon\": False}, {\"anon\": True}, {\"key\": \"123\", \"secret\": \"123\"}, None],\n )\n @pytest.mark.xfail(\n reason=\"S3 file gone missing, see https://github.com/modin-project/modin/issues/4875\"\n )\n def test_read_csv_s3(self, storage_options):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"s3://noaa-ghcn-pds/csv/1788.csv\",\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_s3_issue4658_TestCsv._has_pandas_fallback_reason.return.Engine_get_Python_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_s3_issue4658_TestCsv._has_pandas_fallback_reason.return.Engine_get_Python_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 988, "end_line": 1011, "span_ids": ["TestCsv.test_read_csv_skiprows_names", "TestCsv._has_pandas_fallback_reason", "TestCsv.test_read_csv_s3_issue4658"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_read_csv_s3_issue4658(self):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"s3://dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv\",\n nrows=10,\n storage_options={\"anon\": True},\n )\n\n @pytest.mark.parametrize(\"names\", [list(\"XYZ\"), None])\n @pytest.mark.parametrize(\"skiprows\", [1, 2, 3, 4, None])\n def test_read_csv_skiprows_names(self, names, skiprows):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"modin/pandas/test/data/issue_2239.csv\",\n names=names,\n skiprows=skiprows,\n )\n\n def _has_pandas_fallback_reason(self):\n # The Python engine does not use custom IO dispatchers, so specialized error messages\n # won't appear\n return Engine.get() != \"Python\" and StorageFormat.get() != \"Hdk\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_default_to_pandas_TestCsv.test_read_csv_default_to_pandas.with_warns_that_defaultin.with_open_pytest_csvs_nam.pd_read_csv_StringIO__f_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_default_to_pandas_TestCsv.test_read_csv_default_to_pandas.with_warns_that_defaultin.with_open_pytest_csvs_nam.pd_read_csv_StringIO__f_r", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1013, "end_line": 1027, "span_ids": ["TestCsv.test_read_csv_default_to_pandas"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n )\n def test_read_csv_default_to_pandas(self):\n if self._has_pandas_fallback_reason():\n warning_suffix = \"buffers\"\n else:\n warning_suffix = \"\"\n with warns_that_defaulting_to_pandas(suffix=warning_suffix):\n # This tests that we default to pandas on a buffer\n from io import StringIO\n\n with open(pytest.csvs_names[\"test_read_csv_regular\"], \"r\") as _f:\n pd.read_csv(StringIO(_f.read()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_url_TestCsv.test_read_csv_url.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_url_TestCsv.test_read_csv_url.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1029, "end_line": 1042, "span_ids": ["TestCsv.test_read_csv_url"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n )\n def test_read_csv_url(self):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"https://raw.githubusercontent.com/modin-project/modin/master/modin/pandas/test/data/blah.csv\",\n # It takes about ~17Gb of RAM for HDK to import the whole table from this test\n # because of too many (~1000) string columns in it. Taking a subset of columns\n # to be able to run this test on low-RAM machines.\n usecols=[0, 1, 2, 3] if StorageFormat.get() == \"Hdk\" else None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_newlines_in_quotes_TestCsv.test_read_csv_newlines_in_quotes.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_newlines_in_quotes_TestCsv.test_read_csv_newlines_in_quotes.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1044, "end_line": 1054, "span_ids": ["TestCsv.test_read_csv_newlines_in_quotes"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"nrows\", [21, 5, None])\n @pytest.mark.parametrize(\"skiprows\", [4, 1, 500, None])\n def test_read_csv_newlines_in_quotes(self, nrows, skiprows):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"modin/pandas/test/data/newlines.csv\",\n nrows=nrows,\n skiprows=skiprows,\n cast_to_str=StorageFormat.get() != \"Hdk\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skiprows_with_usecols_TestCsv.test_read_csv_skiprows_with_usecols.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skiprows_with_usecols_TestCsv.test_read_csv_skiprows_with_usecols.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1056, "end_line": 1066, "span_ids": ["TestCsv.test_read_csv_skiprows_with_usecols"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"skiprows\", [None, 0, [], [1, 2], np.arange(0, 2)])\n def test_read_csv_skiprows_with_usecols(self, skiprows):\n usecols = {\"float_data\": \"float64\"}\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"modin/pandas/test/data/issue_4543.csv\",\n skiprows=skiprows,\n usecols=usecols.keys(),\n dtype=usecols,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_sep_none_TestCsv.test_read_csv_incorrect_data.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_sep_none_TestCsv.test_read_csv_incorrect_data.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1068, "end_line": 1086, "span_ids": ["TestCsv.test_read_csv_sep_none", "TestCsv.test_read_csv_incorrect_data"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_read_csv_sep_none(self):\n eval_io(\n fn_name=\"read_csv\",\n modin_warning=ParserWarning,\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n sep=None,\n )\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n )\n def test_read_csv_incorrect_data(self):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"modin/pandas/test/data/test_categories.json\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_names_neq_num_cols_TestCsv.test_read_csv_wrong_path.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_names_neq_num_cols_TestCsv.test_read_csv_wrong_path.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1088, "end_line": 1113, "span_ids": ["TestCsv.test_read_csv_wrong_path", "TestCsv.test_read_csv_names_neq_num_cols"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"kwargs\",\n [\n {\"names\": [5, 1, 3, 4, 2, 6]},\n {\"names\": [0]},\n {\"names\": None, \"usecols\": [1, 0, 2]},\n {\"names\": [3, 1, 2, 5], \"usecols\": [4, 1, 3, 2]},\n ],\n )\n def test_read_csv_names_neq_num_cols(self, kwargs):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=\"modin/pandas/test/data/issue_2074.csv\",\n **kwargs,\n )\n\n def test_read_csv_wrong_path(self):\n raising_exceptions = [e for e in io_ops_bad_exc if e != FileNotFoundError]\n\n eval_io(\n fn_name=\"read_csv\",\n raising_exceptions=raising_exceptions,\n # read_csv kwargs\n filepath_or_buffer=\"/some/wrong/path.csv\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_to_csv_TestCsv.test_to_csv.eval_to_csv_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_to_csv_TestCsv.test_to_csv.eval_to_csv_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1115, "end_line": 1159, "span_ids": ["TestCsv.test_to_csv"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"extension\", [None, \"csv\", \"csv.gz\"])\n @pytest.mark.parametrize(\"sep\", [\" \"])\n @pytest.mark.parametrize(\"header\", [False, True, \"sfx-\"])\n @pytest.mark.parametrize(\"mode\", [\"w\", \"wb+\"])\n @pytest.mark.parametrize(\"idx_name\", [None, \"Index\"])\n @pytest.mark.parametrize(\"index\", [True, False, \"New index\"])\n @pytest.mark.parametrize(\"index_label\", [None, False, \"New index\"])\n @pytest.mark.parametrize(\"columns\", [None, [\"col1\", \"col3\", \"col5\"]])\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n )\n def test_to_csv(\n self,\n tmp_path,\n extension,\n sep,\n header,\n mode,\n idx_name,\n index,\n index_label,\n columns,\n ):\n pandas_df = generate_dataframe(idx_name=idx_name)\n modin_df = pd.DataFrame(pandas_df)\n\n if isinstance(header, str):\n if columns is None:\n header = [f\"{header}{c}\" for c in modin_df.columns]\n else:\n header = [f\"{header}{c}\" for c in columns]\n\n eval_to_csv_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n extension=extension,\n sep=sep,\n header=header,\n mode=mode,\n index=index,\n index_label=index_label,\n columns=columns,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_dataframe_to_csv_TestCsv.test_dataframe_to_csv.eval_to_csv_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_dataframe_to_csv_TestCsv.test_dataframe_to_csv.eval_to_csv_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1161, "end_line": 1173, "span_ids": ["TestCsv.test_dataframe_to_csv"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n )\n def test_dataframe_to_csv(self, tmp_path):\n pandas_df = pandas.read_csv(pytest.csvs_names[\"test_read_csv_regular\"])\n modin_df = pd.DataFrame(pandas_df)\n eval_to_csv_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n extension=\"csv\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_series_to_csv_TestCsv.test_series_to_csv.eval_to_csv_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_series_to_csv_TestCsv.test_series_to_csv.eval_to_csv_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1175, "end_line": 1189, "span_ids": ["TestCsv.test_series_to_csv"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n )\n def test_series_to_csv(self, tmp_path):\n pandas_s = pandas.read_csv(\n pytest.csvs_names[\"test_read_csv_regular\"], usecols=[\"col1\"]\n ).squeeze()\n modin_s = pd.Series(pandas_s)\n eval_to_csv_file(\n tmp_path,\n modin_obj=modin_s,\n pandas_obj=pandas_s,\n extension=\"csv\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_within_decorator_TestCsv.test_read_csv_within_decorator.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_within_decorator_TestCsv.test_read_csv_within_decorator.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1191, "end_line": 1212, "span_ids": ["TestCsv.test_read_csv_within_decorator"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_read_csv_within_decorator(self):\n @dummy_decorator()\n def wrapped_read_csv(file, method):\n if method == \"pandas\":\n return pandas.read_csv(file)\n\n if method == \"modin\":\n return pd.read_csv(file)\n\n pandas_df = wrapped_read_csv(\n pytest.csvs_names[\"test_read_csv_regular\"], method=\"pandas\"\n )\n modin_df = wrapped_read_csv(\n pytest.csvs_names[\"test_read_csv_regular\"], method=\"modin\"\n )\n\n if StorageFormat.get() == \"Hdk\":\n # Aligning DateTime dtypes because of the bug related to the `parse_dates` parameter:\n # https://github.com/modin-project/modin/issues/3485\n modin_df, pandas_df = align_datetime_dtypes(modin_df, pandas_df)\n\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_file_handle_TestCsv.test_read_csv_file_handle.if_not_AsyncReadMode_get_.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_file_handle_TestCsv.test_read_csv_file_handle.if_not_AsyncReadMode_get_.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1214, "end_line": 1246, "span_ids": ["TestCsv.test_read_csv_file_handle"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"read_mode\",\n [\n \"r\",\n pytest.param(\n \"rb\",\n marks=pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"Cannot pickle file handles. See comments in PR #2625\",\n ),\n ),\n ],\n )\n @pytest.mark.parametrize(\"buffer_start_pos\", [0, 10])\n @pytest.mark.parametrize(\"set_async_read_mode\", [False, True], indirect=True)\n def test_read_csv_file_handle(\n self, read_mode, make_csv_file, buffer_start_pos, set_async_read_mode\n ):\n with ensure_clean() as unique_filename:\n make_csv_file(filename=unique_filename)\n\n with open(unique_filename, mode=read_mode) as buffer:\n buffer.seek(buffer_start_pos)\n pandas_df = pandas.read_csv(buffer)\n buffer.seek(buffer_start_pos)\n modin_df = pd.read_csv(buffer)\n if AsyncReadMode.get():\n # If read operations are asynchronous, then the dataframes\n # check should be inside `ensure_clean` context\n # because the file may be deleted before actual reading starts\n df_equals(modin_df, pandas_df)\n if not AsyncReadMode.get():\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_unnamed_index_TestCsv.test_read_csv_empty_frame.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_unnamed_index_TestCsv.test_read_csv_empty_frame.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1248, "end_line": 1267, "span_ids": ["TestCsv.test_unnamed_index", "TestCsv.test_read_csv_empty_frame"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_unnamed_index(self):\n def get_internal_df(df):\n partition = read_df._query_compiler._modin_frame._partitions[0][0]\n return partition.to_pandas()\n\n path = \"modin/pandas/test/data/issue_3119.csv\"\n read_df = pd.read_csv(path, index_col=0)\n assert get_internal_df(read_df).index.name is None\n read_df = pd.read_csv(path, index_col=[0, 1])\n for name1, name2 in zip(get_internal_df(read_df).index.names, [None, \"a\"]):\n assert name1 == name2\n\n def test_read_csv_empty_frame(self):\n eval_io(\n fn_name=\"read_csv\",\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n usecols=[\"col1\"],\n index_col=\"col1\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skiprows_corner_cases_TestCsv.test_read_csv_skiprows_corner_cases.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_skiprows_corner_cases_TestCsv.test_read_csv_skiprows_corner_cases.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1269, "end_line": 1300, "span_ids": ["TestCsv.test_read_csv_skiprows_corner_cases"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\n \"skiprows\",\n [\n [x for x in range(10)],\n [x + 5 for x in range(15)],\n [x for x in range(10) if x % 2 == 0],\n [x + 5 for x in range(15) if x % 2 == 0],\n lambda x: x % 2,\n lambda x: x > 20,\n lambda x: x < 20,\n lambda x: True,\n lambda x: x in [10, 20],\n pytest.param(\n lambda x: x << 10,\n marks=pytest.mark.skipif(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #2340\",\n ),\n ),\n ],\n )\n @pytest.mark.parametrize(\"header\", [\"infer\", None, 0, 1, 150])\n def test_read_csv_skiprows_corner_cases(self, skiprows, header):\n eval_io(\n fn_name=\"read_csv\",\n check_kwargs_callable=not callable(skiprows),\n # read_csv kwargs\n filepath_or_buffer=pytest.csvs_names[\"test_read_csv_regular\"],\n skiprows=skiprows,\n header=header,\n dtype=\"str\", # to avoid issues with heterogeneous data\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_to_csv_with_index_TestCsv.test_to_csv_with_index.eval_to_csv_file_tmp_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_to_csv_with_index_TestCsv.test_to_csv_with_index.eval_to_csv_file_tmp_path", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1302, "end_line": 1320, "span_ids": ["TestCsv.test_to_csv_with_index"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n def test_to_csv_with_index(self, tmp_path):\n cols = 100\n arows = 20000\n keyrange = 100\n values = np.vstack(\n [\n np.random.choice(keyrange, size=(arows)),\n np.random.normal(size=(cols, arows)),\n ]\n ).transpose()\n modin_df = pd.DataFrame(\n values,\n columns=[\"key\"] + [\"avalue\" + str(i) for i in range(1, 1 + cols)],\n ).set_index(\"key\")\n pandas_df = pandas.DataFrame(\n values,\n columns=[\"key\"] + [\"avalue\" + str(i) for i in range(1, 1 + cols)],\n ).set_index(\"key\")\n eval_to_csv_file(tmp_path, modin_df, pandas_df, \"csv\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_issue_5150_TestCsv.test_read_csv_issue_5150.if_not_AsyncReadMode_get_.df_equals_expected_pandas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestCsv.test_read_csv_issue_5150_TestCsv.test_read_csv_issue_5150.if_not_AsyncReadMode_get_.df_equals_expected_pandas", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1322, "end_line": 1338, "span_ids": ["TestCsv.test_read_csv_issue_5150"], "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": "@pytest.mark.usefixtures(\"TestReadCSVFixture\")\n@pytest.mark.skipif(\n IsExperimental.get() and StorageFormat.get() == \"Pyarrow\",\n reason=\"Segmentation fault; see PR #2347 ffor details\",\n)\nclass TestCsv:\n\n @pytest.mark.parametrize(\"set_async_read_mode\", [False, True], indirect=True)\n def test_read_csv_issue_5150(self, set_async_read_mode):\n with ensure_clean(\".csv\") as unique_filename:\n pandas_df = pandas.DataFrame(\n np.random.randint(0, 100, size=(2**6, 2**6))\n )\n pandas_df.to_csv(unique_filename, index=False)\n expected_pandas_df = pandas.read_csv(unique_filename, index_col=False)\n modin_df = pd.read_csv(unique_filename, index_col=False)\n actual_pandas_df = modin_df._to_pandas()\n if AsyncReadMode.get():\n # If read operations are asynchronous, then the dataframes\n # check should be inside `ensure_clean` context\n # because the file may be deleted before actual reading starts\n df_equals(expected_pandas_df, actual_pandas_df)\n if not AsyncReadMode.get():\n df_equals(expected_pandas_df, actual_pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestTable_TestTable.test_read_table_empty_frame.with_ensure_clean_as_un.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestTable_TestTable.test_read_table_empty_frame.with_ensure_clean_as_un.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1341, "end_line": 1388, "span_ids": ["TestTable.test_read_table_empty_frame", "TestTable.test_read_table_within_decorator", "TestTable.test_read_table", "TestTable"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTable:\n def test_read_table(self, make_csv_file):\n with ensure_clean() as unique_filename:\n make_csv_file(filename=unique_filename, delimiter=\"\\t\")\n eval_io(\n fn_name=\"read_table\",\n # read_table kwargs\n filepath_or_buffer=unique_filename,\n )\n\n @pytest.mark.parametrize(\"set_async_read_mode\", [False, True], indirect=True)\n def test_read_table_within_decorator(self, make_csv_file, set_async_read_mode):\n @dummy_decorator()\n def wrapped_read_table(file, method):\n if method == \"pandas\":\n return pandas.read_table(file)\n\n if method == \"modin\":\n return pd.read_table(file)\n\n with ensure_clean() as unique_filename:\n make_csv_file(filename=unique_filename, delimiter=\"\\t\")\n\n pandas_df = wrapped_read_table(unique_filename, method=\"pandas\")\n modin_df = wrapped_read_table(unique_filename, method=\"modin\")\n\n if StorageFormat.get() == \"Hdk\":\n modin_df, pandas_df = align_datetime_dtypes(modin_df, pandas_df)\n\n if AsyncReadMode.get():\n # If read operations are asynchronous, then the dataframes\n # check should be inside `ensure_clean` context\n # because the file may be deleted before actual reading starts\n df_equals(modin_df, pandas_df)\n if not AsyncReadMode.get():\n df_equals(modin_df, pandas_df)\n\n def test_read_table_empty_frame(self, make_csv_file):\n with ensure_clean() as unique_filename:\n make_csv_file(filename=unique_filename, delimiter=\"\\t\")\n\n eval_io(\n fn_name=\"read_table\",\n # read_table kwargs\n filepath_or_buffer=unique_filename,\n usecols=[\"col1\"],\n index_col=\"col1\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet_TestParquet.test_read_parquet.with_ensure_clean_parqu.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet_TestParquet.test_read_parquet.with_ensure_clean_parqu.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1391, "end_line": 1413, "span_ids": ["TestParquet.test_read_parquet", "TestParquet"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n @pytest.mark.parametrize(\"columns\", [None, [\"col1\"]])\n @pytest.mark.parametrize(\"row_group_size\", [None, 100, 1000, 10_000])\n @pytest.mark.parametrize(\"path_type\", [Path, str])\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet(\n self, engine, make_parquet_file, columns, row_group_size, path_type\n ):\n with ensure_clean(\".parquet\") as unique_filename:\n unique_filename = path_type(unique_filename)\n make_parquet_file(filename=unique_filename, row_group_size=row_group_size)\n\n eval_io(\n fn_name=\"read_parquet\",\n # read_parquet kwargs\n engine=engine,\n path=unique_filename,\n columns=columns,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_dtype_backend_TestParquet.test_read_parquet_dtype_backend.with_ensure_clean_parqu.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_dtype_backend_TestParquet.test_read_parquet_dtype_backend.with_ensure_clean_parqu.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1415, "end_line": 1437, "span_ids": ["TestParquet.test_read_parquet_dtype_backend"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_dtype_backend(self, engine, make_parquet_file, dtype_backend):\n with ensure_clean(\".parquet\") as unique_filename:\n make_parquet_file(filename=unique_filename, row_group_size=100)\n\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_parquet\",\n # read_parquet kwargs\n engine=engine,\n path=unique_filename,\n dtype_backend=dtype_backend,\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_list_of_files_5698_TestParquet.test_read_parquet_list_of_files_5698.with_ensure_clean_parqu.eval_io_fn_name_read_par": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_list_of_files_5698_TestParquet.test_read_parquet_list_of_files_5698.with_ensure_clean_parqu.eval_io_fn_name_read_par", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1439, "end_line": 1447, "span_ids": ["TestParquet.test_read_parquet_list_of_files_5698"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n def test_read_parquet_list_of_files_5698(self, engine, make_parquet_file):\n if engine == \"fastparquet\" and os.name == \"nt\":\n pytest.xfail(reason=\"https://github.com/pandas-dev/pandas/issues/51720\")\n with ensure_clean(\".parquet\") as f1, ensure_clean(\n \".parquet\"\n ) as f2, ensure_clean(\".parquet\") as f3:\n for f in [f1, f2, f3]:\n make_parquet_file(filename=f)\n eval_io(fn_name=\"read_parquet\", path=[f1, f2, f3], engine=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_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_indexing_by_column_TestParquet.test_read_parquet_indexing_by_column.for_col_in_parquet_df_col.parquet_df_col_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_indexing_by_column_TestParquet.test_read_parquet_indexing_by_column.for_col_in_parquet_df_col.parquet_df_col_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1449, "end_line": 1466, "span_ids": ["TestParquet.test_read_parquet_indexing_by_column"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_indexing_by_column(self, tmp_path, engine, make_parquet_file):\n # Test indexing into a column of Modin with various parquet file row lengths.\n # Specifically, tests for https://github.com/modin-project/modin/issues/3527\n # which fails when min_partition_size < nrows < min_partition_size * (num_partitions - 1)\n\n nrows = (\n MinPartitionSize.get() + 1\n ) # Use the minimal guaranteed failing value for nrows.\n unique_filename = get_unique_filename(extension=\"parquet\", data_dir=tmp_path)\n make_parquet_file(filename=unique_filename, nrows=nrows)\n\n parquet_df = pd.read_parquet(unique_filename, engine=engine)\n for col in parquet_df.columns:\n parquet_df[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_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_directory_TestParquet.test_read_parquet_directory.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_directory_TestParquet.test_read_parquet_directory.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1468, "end_line": 1506, "span_ids": ["TestParquet.test_read_parquet_directory"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.parametrize(\"columns\", [None, [\"col1\"]])\n @pytest.mark.parametrize(\"row_group_size\", [None, 100, 1000, 10_000])\n @pytest.mark.parametrize(\n \"rows_per_file\", [[1000] * 40, [0, 0, 40_000], [10_000, 10_000] + [100] * 200]\n )\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_directory(\n self, engine, make_parquet_dir, columns, row_group_size, rows_per_file\n ):\n num_cols = DATASET_SIZE_DICT.get(\n TestDatasetSize.get(), DATASET_SIZE_DICT[\"Small\"]\n )\n dfs_by_filename = {}\n start_row = 0\n for i, length in enumerate(rows_per_file):\n end_row = start_row + length\n dfs_by_filename[f\"{i}.parquet\"] = pandas.DataFrame(\n {f\"col{x + 1}\": np.arange(start_row, end_row) for x in range(num_cols)}\n )\n start_row = end_row\n path = make_parquet_dir(dfs_by_filename, row_group_size)\n\n # There are specific files that PyArrow will try to ignore by default\n # in a parquet directory. One example are files that start with '_'. Our\n # previous implementation tried to read all files in a parquet directory,\n # but we now make use of PyArrow to ensure the directory is valid.\n with open(os.path.join(path, \"_committed_file\"), \"w+\") as f:\n f.write(\"testingtesting\")\n\n eval_io(\n fn_name=\"read_parquet\",\n # read_parquet kwargs\n engine=engine,\n path=path,\n columns=columns,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_partitioned_directory_TestParquet.test_read_parquet_partitioned_directory.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_partitioned_directory_TestParquet.test_read_parquet_partitioned_directory.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1508, "end_line": 1525, "span_ids": ["TestParquet.test_read_parquet_partitioned_directory"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.parametrize(\"columns\", [None, [\"col1\"]])\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_partitioned_directory(\n self, tmp_path, make_parquet_file, columns, engine\n ):\n unique_filename = get_unique_filename(extension=None, data_dir=tmp_path)\n make_parquet_file(filename=unique_filename, partitioned_columns=[\"col1\"])\n\n eval_io(\n fn_name=\"read_parquet\",\n # read_parquet kwargs\n engine=engine,\n path=unique_filename,\n columns=columns,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_pandas_index_TestParquet.test_read_parquet_pandas_index.with_ensure_clean_parqu.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_pandas_index_TestParquet.test_read_parquet_pandas_index.with_ensure_clean_parqu.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1527, "end_line": 1589, "span_ids": ["TestParquet.test_read_parquet_pandas_index"], "tokens": 670}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_pandas_index(self, engine):\n if (\n version.parse(pa.__version__) >= version.parse(\"12.0.0\")\n and version.parse(pd.__version__) < version.parse(\"2.0.0\")\n and engine == \"pyarrow\"\n ):\n pytest.xfail(\"incompatible versions; see #6072\")\n # Ensure modin can read parquet files written by pandas with a non-RangeIndex object\n pandas_df = pandas.DataFrame(\n {\n \"idx\": np.random.randint(0, 100_000, size=2000),\n \"idx_categorical\": pandas.Categorical([\"y\", \"z\"] * 1000),\n # Can't do interval index right now because of this bug fix that is planned\n # to be apart of the pandas 1.5.0 release: https://github.com/pandas-dev/pandas/pull/46034\n # \"idx_interval\": pandas.interval_range(start=0, end=2000),\n \"idx_periodrange\": pandas.period_range(\n start=\"2017-01-01\", periods=2000\n ),\n \"A\": np.random.randint(0, 100_000, size=2000),\n \"B\": [\"a\", \"b\"] * 1000,\n \"C\": [\"c\"] * 2000,\n }\n )\n # Older versions of pyarrow do not support Arrow to Parquet\n # schema conversion for duration[ns]\n # https://issues.apache.org/jira/browse/ARROW-6780\n if version.parse(pa.__version__) >= version.parse(\"8.0.0\"):\n pandas_df[\"idx_timedelta\"] = pandas.timedelta_range(\n start=\"1 day\", periods=2000\n )\n\n # There is a non-deterministic bug in the fastparquet engine when we\n # try to set the index to the datetime column. Please see:\n # https://github.com/dask/fastparquet/issues/796\n if engine == \"pyarrow\":\n pandas_df[\"idx_datetime\"] = pandas.date_range(\n start=\"1/1/2018\", periods=2000\n )\n\n for col in pandas_df.columns:\n if col.startswith(\"idx\"):\n with ensure_clean(\".parquet\") as unique_filename:\n pandas_df.set_index(col).to_parquet(unique_filename)\n # read the same parquet using modin.pandas\n eval_io(\n \"read_parquet\",\n # read_parquet kwargs\n path=unique_filename,\n engine=engine,\n )\n\n with ensure_clean(\".parquet\") as unique_filename:\n pandas_df.set_index([\"idx\", \"A\"]).to_parquet(unique_filename)\n eval_io(\n \"read_parquet\",\n # read_parquet kwargs\n path=unique_filename,\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_pandas_index_partitioned_TestParquet.test_read_parquet_pandas_index_partitioned.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_pandas_index_partitioned_TestParquet.test_read_parquet_pandas_index_partitioned.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1591, "end_line": 1613, "span_ids": ["TestParquet.test_read_parquet_pandas_index_partitioned"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_pandas_index_partitioned(self, tmp_path, engine):\n # Ensure modin can read parquet files written by pandas with a non-RangeIndex object\n pandas_df = pandas.DataFrame(\n {\n \"idx\": np.random.randint(0, 100_000, size=2000),\n \"A\": np.random.randint(0, 10, size=2000),\n \"B\": [\"a\", \"b\"] * 1000,\n \"C\": [\"c\"] * 2000,\n }\n )\n unique_filename = get_unique_filename(extension=\"parquet\", data_dir=tmp_path)\n pandas_df.set_index(\"idx\").to_parquet(unique_filename, partition_cols=[\"A\"])\n # read the same parquet using modin.pandas\n eval_io(\n \"read_parquet\",\n # read_parquet kwargs\n path=unique_filename,\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_hdfs_TestParquet.test_read_parquet_s3.if_path_type_object_.else_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_hdfs_TestParquet.test_read_parquet_s3.if_path_type_object_.else_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1615, "end_line": 1656, "span_ids": ["TestParquet.test_read_parquet_s3", "TestParquet.test_read_parquet_hdfs"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_hdfs(self, engine):\n eval_io(\n fn_name=\"read_parquet\",\n # read_parquet kwargs\n path=\"modin/pandas/test/data/hdfs.parquet\",\n engine=engine,\n )\n\n @pytest.mark.parametrize(\n \"path_type\",\n [\"object\", \"directory\", \"url\"],\n )\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_s3(self, path_type, engine):\n dataset_url = \"s3://modin-datasets/testing/test_data.parquet\"\n if path_type == \"object\":\n import s3fs\n\n fs = s3fs.S3FileSystem(anon=True)\n with fs.open(dataset_url, \"rb\") as file_obj:\n eval_io(\"read_parquet\", path=file_obj, engine=engine)\n elif path_type == \"directory\":\n eval_io(\n \"read_parquet\",\n path=\"s3://modin-datasets/test_data_dir.parquet\",\n storage_options={\"anon\": True},\n engine=engine,\n )\n else:\n eval_io(\n \"read_parquet\",\n path=dataset_url,\n storage_options={\"anon\": True},\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_without_metadata_TestParquet.test_read_parquet_without_metadata.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_without_metadata_TestParquet.test_read_parquet_without_metadata.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1658, "end_line": 1687, "span_ids": ["TestParquet.test_read_parquet_without_metadata"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_without_metadata(self, tmp_path, engine):\n \"\"\"Test that Modin can read parquet files not written by pandas.\"\"\"\n from pyarrow import csv\n from pyarrow import parquet\n\n parquet_fname = get_unique_filename(extension=\"parquet\", data_dir=tmp_path)\n csv_fname = get_unique_filename(extension=\"parquet\", data_dir=tmp_path)\n pandas_df = pandas.DataFrame(\n {\n \"idx\": np.random.randint(0, 100_000, size=2000),\n \"A\": np.random.randint(0, 10, size=2000),\n \"B\": [\"a\", \"b\"] * 1000,\n \"C\": [\"c\"] * 2000,\n }\n )\n pandas_df.to_csv(csv_fname, index=False)\n # read into pyarrow table and write it to a parquet file\n t = csv.read_csv(csv_fname)\n parquet.write_table(t, parquet_fname)\n\n eval_io(\n \"read_parquet\",\n # read_parquet kwargs\n path=parquet_fname,\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_empty_parquet_file_TestParquet.test_to_parquet.parquet_eval_to_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_empty_parquet_file_TestParquet.test_to_parquet.parquet_eval_to_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1689, "end_line": 1709, "span_ids": ["TestParquet.test_to_parquet", "TestParquet.test_read_empty_parquet_file"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n def test_read_empty_parquet_file(self, tmp_path, engine):\n test_df = pandas.DataFrame()\n path = tmp_path / \"data\"\n path.mkdir()\n test_df.to_parquet(path / \"part-00000.parquet\", engine=engine)\n eval_io(fn_name=\"read_parquet\", path=path, engine=engine)\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_to_parquet(self, tmp_path, engine):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n parquet_eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_parquet\",\n extension=\"parquet\",\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_to_parquet_keep_index_TestParquet.test_to_parquet_keep_index.parquet_eval_to_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_to_parquet_keep_index_TestParquet.test_to_parquet_keep_index.parquet_eval_to_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1711, "end_line": 1725, "span_ids": ["TestParquet.test_to_parquet_keep_index"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n def test_to_parquet_keep_index(self, tmp_path, engine):\n data = {\"c0\": [0, 1] * 1000, \"c1\": [2, 3] * 1000}\n modin_df, pandas_df = create_test_dfs(data)\n modin_df.index.name = \"foo\"\n pandas_df.index.name = \"foo\"\n\n parquet_eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_parquet\",\n extension=\"parquet\",\n index=True,\n engine=engine,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_to_parquet_s3_TestParquet.test_to_parquet_s3.assert_not_os_path_isdir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_to_parquet_s3_TestParquet.test_to_parquet_s3.assert_not_os_path_isdir_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1727, "end_line": 1746, "span_ids": ["TestParquet.test_to_parquet_s3"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n def test_to_parquet_s3(self, s3_resource, engine, s3_storage_options):\n # use utils_test_data because it spans multiple partitions\n modin_path = \"s3://modin-test/modin-dir/modin_df.parquet\"\n mdf, pdf = create_test_dfs(utils_test_data[\"int_data\"])\n pdf.to_parquet(\n \"s3://modin-test/pandas-dir/pandas_df.parquet\",\n engine=engine,\n storage_options=s3_storage_options,\n )\n mdf.to_parquet(modin_path, engine=engine, storage_options=s3_storage_options)\n df_equals(\n pandas.read_parquet(\n \"s3://modin-test/pandas-dir/pandas_df.parquet\",\n storage_options=s3_storage_options,\n ),\n pd.read_parquet(modin_path, storage_options=s3_storage_options),\n )\n # check we're not creating local file:\n # https://github.com/modin-project/modin/issues/5888\n assert not os.path.isdir(modin_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_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_2462_TestParquet.test_read_parquet_2462.df_equals_test_df_read_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_2462_TestParquet.test_read_parquet_2462.df_equals_test_df_read_d", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1748, "end_line": 1758, "span_ids": ["TestParquet.test_read_parquet_2462"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_parquet_2462(self, tmp_path, engine):\n test_df = pandas.DataFrame({\"col1\": [[\"ad_1\", \"ad_2\"], [\"ad_3\"]]})\n path = tmp_path / \"data\"\n path.mkdir()\n test_df.to_parquet(path / \"part-00000.parquet\", engine=engine)\n read_df = pd.read_parquet(path, engine=engine)\n df_equals(test_df, read_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_5767_TestParquet.test_read_parquet_5767.df_equals_test_df_read_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_5767_TestParquet.test_read_parquet_5767.df_equals_test_df_read_d", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1760, "end_line": 1768, "span_ids": ["TestParquet.test_read_parquet_5767"], "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": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n def test_read_parquet_5767(self, tmp_path, engine):\n test_df = pandas.DataFrame({\"a\": [1, 2, 3, 4], \"b\": [1, 1, 2, 2]})\n path = tmp_path / \"data\"\n path.mkdir()\n file_name = \"modin_issue#0000.parquet\"\n test_df.to_parquet(path / file_name, engine=engine, partition_cols=[\"b\"])\n read_df = pd.read_parquet(path / file_name)\n # both Modin and pandas read column \"b\" as a category\n df_equals(test_df, read_df.astype(\"int64\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_5509_TestParquet.test_read_parquet_s3_with_column_partitioning.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestParquet.test_read_parquet_5509_TestParquet.test_read_parquet_s3_with_column_partitioning.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1770, "end_line": 1795, "span_ids": ["TestParquet.test_read_parquet_s3_with_column_partitioning", "TestParquet.test_read_parquet_5509"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"engine\", [\"pyarrow\", \"fastparquet\"])\nclass TestParquet:\n\n def test_read_parquet_5509(self, tmp_path, engine):\n test_df = pandas.DataFrame({\"col_a\": [1, 2, 3], \"col_b\": [\"a\", \"b\", \"c\"]})\n\n path = tmp_path / \"data\"\n path.mkdir()\n file_name = \"5509.parquet\"\n test_df.to_parquet(path / file_name)\n with warns_that_defaulting_to_pandas():\n eval_io(\n fn_name=\"read_parquet\",\n path=str(path / file_name),\n columns=[\"col_b\"],\n engine=engine,\n filters=[[(\"col_a\", \"==\", 1)]],\n )\n\n def test_read_parquet_s3_with_column_partitioning(self, engine):\n # This test case comes from\n # https://github.com/modin-project/modin/issues/4636\n dataset_url = \"s3://modin-datasets/modin-bugs/modin_bug_5159_parquet/df.parquet\"\n eval_io(\n fn_name=\"read_parquet\",\n path=dataset_url,\n engine=engine,\n storage_options={\"anon\": 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_modin-project__modin/modin/pandas/test/test_io.py_TestJson_TestJson.test_read_json_dtype_backend.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson_TestJson.test_read_json_dtype_backend.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1798, "end_line": 1823, "span_ids": ["TestJson.test_read_json_dtype_backend", "TestJson", "TestJson.test_read_json"], "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 TestJson:\n @pytest.mark.parametrize(\"lines\", [False, True])\n def test_read_json(self, make_json_file, lines):\n eval_io(\n fn_name=\"read_json\",\n # read_json kwargs\n path_or_buf=make_json_file(lines=lines),\n lines=lines,\n )\n\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n def test_read_json_dtype_backend(self, make_json_file, dtype_backend):\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_json\",\n # read_json kwargs\n path_or_buf=make_json_file(lines=True),\n lines=True,\n dtype_backend=dtype_backend,\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_s3_TestJson.test_read_json_different_columns.with_warns_that_defaultin.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_s3_TestJson.test_read_json_different_columns.with_warns_that_defaultin.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1825, "end_line": 1853, "span_ids": ["TestJson.test_read_json_different_columns", "TestJson.test_read_json_categories", "TestJson.test_read_json_s3"], "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 TestJson:\n\n @pytest.mark.parametrize(\n \"storage_options\",\n [{\"anon\": False}, {\"anon\": True}, {\"key\": \"123\", \"secret\": \"123\"}, None],\n )\n def test_read_json_s3(self, storage_options):\n eval_io(\n fn_name=\"read_json\",\n path_or_buf=\"s3://modin-datasets/testing/test_data.json\",\n lines=True,\n orient=\"records\",\n storage_options=storage_options,\n )\n\n def test_read_json_categories(self):\n eval_io(\n fn_name=\"read_json\",\n # read_json kwargs\n path_or_buf=\"modin/pandas/test/data/test_categories.json\",\n dtype={\"one\": \"int64\", \"two\": \"category\"},\n )\n\n def test_read_json_different_columns(self):\n with warns_that_defaulting_to_pandas():\n eval_io(\n fn_name=\"read_json\",\n # read_json kwargs\n path_or_buf=\"modin/pandas/test/data/test_different_columns_in_rows.json\",\n lines=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_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_string_bytes_TestJson.test_read_json_string_bytes.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_string_bytes_TestJson.test_read_json_string_bytes.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1855, "end_line": 1869, "span_ids": ["TestJson.test_read_json_string_bytes"], "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 TestJson:\n\n @pytest.mark.parametrize(\n \"data\",\n [json_short_string, json_short_bytes, json_long_string, json_long_bytes],\n )\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_json_string_bytes(self, data):\n with warns_that_defaulting_to_pandas():\n modin_df = pd.read_json(data)\n # For I/O objects we need to rewind to reuse the same object.\n if hasattr(data, \"seek\"):\n data.seek(0)\n df_equals(modin_df, pandas.read_json(data))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_to_json_TestJson.test_read_json_file_handle.with_open_make_json_file_.df_equals_df_pandas_df_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_to_json_TestJson.test_read_json_file_handle.with_open_make_json_file_.df_equals_df_pandas_df_m", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1871, "end_line": 1899, "span_ids": ["TestJson.test_read_json_file_handle", "TestJson.test_to_json"], "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 TestJson:\n\n def test_to_json(self, tmp_path):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_json\",\n extension=\"json\",\n )\n\n @pytest.mark.parametrize(\n \"read_mode\",\n [\n \"r\",\n pytest.param(\n \"rb\",\n marks=pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"Cannot pickle file handles. See comments in PR #2625\",\n ),\n ),\n ],\n )\n def test_read_json_file_handle(self, make_json_file, read_mode):\n with open(make_json_file(), mode=read_mode) as buf:\n df_pandas = pandas.read_json(buf)\n buf.seek(0)\n df_modin = pd.read_json(buf)\n df_equals(df_pandas, df_modin)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_metadata_TestJson.test_read_json_metadata.assert_parts_width_cached": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestJson.test_read_json_metadata_TestJson.test_read_json_metadata.assert_parts_width_cached", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1901, "end_line": 1918, "span_ids": ["TestJson.test_read_json_metadata"], "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 TestJson:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_json_metadata(self, make_json_file):\n # `lines=True` is for triggering Modin implementation,\n # `orient=\"records\"` should be set if `lines=True`\n df = pd.read_json(\n make_json_file(ncols=80, lines=True), lines=True, orient=\"records\"\n )\n parts_width_cached = df._query_compiler._modin_frame._column_widths_cache\n num_splits = len(df._query_compiler._modin_frame._partitions[0])\n parts_width_actual = [\n len(df._query_compiler._modin_frame._partitions[0][i].get().columns)\n for i in range(num_splits)\n ]\n\n assert parts_width_cached == parts_width_actual", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel_TestExcel.test_read_excel_dtype_backend.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel_TestExcel.test_read_excel_dtype_backend.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1921, "end_line": 1945, "span_ids": ["TestExcel.test_read_excel", "TestExcel", "TestExcel.test_read_excel_dtype_backend"], "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 TestExcel:\n @check_file_leaks\n def test_read_excel(self, make_excel_file):\n eval_io(\n fn_name=\"read_excel\",\n # read_excel kwargs\n io=make_excel_file(),\n )\n\n @check_file_leaks\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n def test_read_excel_dtype_backend(self, make_excel_file, dtype_backend):\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_excel\",\n # read_csv kwargs\n io=make_excel_file(),\n dtype_backend=dtype_backend,\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_engine_TestExcel.test_read_excel_engine.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_engine_TestExcel.test_read_excel_engine.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1947, "end_line": 1959, "span_ids": ["TestExcel.test_read_excel_engine"], "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": "class TestExcel:\n\n @check_file_leaks\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_excel_engine(self, make_excel_file):\n eval_io(\n fn_name=\"read_excel\",\n modin_warning=UserWarning,\n # read_excel kwargs\n io=make_excel_file(),\n engine=\"openpyxl\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_index_col_TestExcel.test_read_excel_index_col.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_index_col_TestExcel.test_read_excel_index_col.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1961, "end_line": 1973, "span_ids": ["TestExcel.test_read_excel_index_col"], "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": "class TestExcel:\n\n @check_file_leaks\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_excel_index_col(self, make_excel_file):\n eval_io(\n fn_name=\"read_excel\",\n modin_warning=UserWarning,\n # read_excel kwargs\n io=make_excel_file(),\n index_col=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_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_all_sheets_TestExcel.test_read_excel_all_sheets.for_key_in_pandas_df_keys.df_equals_modin_df_get_ke": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_all_sheets_TestExcel.test_read_excel_all_sheets.for_key_in_pandas_df_keys.df_equals_modin_df_get_ke", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1975, "end_line": 1991, "span_ids": ["TestExcel.test_read_excel_all_sheets"], "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 TestExcel:\n\n @check_file_leaks\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_excel_all_sheets(self, make_excel_file):\n unique_filename = make_excel_file()\n\n pandas_df = pandas.read_excel(unique_filename, sheet_name=None)\n modin_df = pd.read_excel(unique_filename, sheet_name=None)\n\n assert isinstance(pandas_df, (OrderedDict, dict))\n assert isinstance(modin_df, type(pandas_df))\n assert pandas_df.keys() == modin_df.keys()\n\n for key in pandas_df.keys():\n df_equals(modin_df.get(key), pandas_df.get(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_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_sheetname_title_TestExcel.test_read_excel_header_none.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_sheetname_title_TestExcel.test_read_excel_header_none.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 1993, "end_line": 2045, "span_ids": ["TestExcel.test_read_excel_sheetname_title", "TestExcel.test_read_excel_border_rows", "TestExcel.test_excel_empty_line", "TestExcel.test_read_excel_every_other_nan", "TestExcel.test_read_excel_empty_rows", "TestExcel.test_read_excel_header_none"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExcel:\n\n @pytest.mark.xfail(\n Engine.get() != \"Python\" and StorageFormat.get() != \"Hdk\",\n reason=\"pandas throws the exception. See pandas issue #39250 for more info\",\n )\n @check_file_leaks\n def test_read_excel_sheetname_title(self):\n eval_io(\n fn_name=\"read_excel\",\n # read_excel kwargs\n io=\"modin/pandas/test/data/excel_sheetname_title.xlsx\",\n )\n\n @check_file_leaks\n def test_excel_empty_line(self):\n path = \"modin/pandas/test/data/test_emptyline.xlsx\"\n modin_df = pd.read_excel(path)\n assert str(modin_df)\n\n @check_file_leaks\n def test_read_excel_empty_rows(self):\n # Test parsing empty rows in middle of excel dataframe as NaN values\n eval_io(\n fn_name=\"read_excel\",\n io=\"modin/pandas/test/data/test_empty_rows.xlsx\",\n )\n\n @check_file_leaks\n def test_read_excel_border_rows(self):\n # Test parsing border rows as NaN values in excel dataframe\n eval_io(\n fn_name=\"read_excel\",\n io=\"modin/pandas/test/data/test_border_rows.xlsx\",\n )\n\n @check_file_leaks\n def test_read_excel_every_other_nan(self):\n # Test for reading excel dataframe with every other row as a NaN value\n eval_io(\n fn_name=\"read_excel\",\n io=\"modin/pandas/test/data/every_other_row_nan.xlsx\",\n )\n\n @pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"The frame contains different dtypes in the same column and could not be converted to arrow\",\n )\n @check_file_leaks\n def test_read_excel_header_none(self):\n eval_io(\n fn_name=\"read_excel\",\n io=\"modin/pandas/test/data/every_other_row_nan.xlsx\",\n header=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_sheet_name_TestExcel.test_read_excel_sheet_name.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_sheet_name_TestExcel.test_read_excel_sheet_name.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2047, "end_line": 2069, "span_ids": ["TestExcel.test_read_excel_sheet_name"], "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 TestExcel:\n\n @pytest.mark.parametrize(\n \"sheet_name\",\n [\n \"Sheet1\",\n \"AnotherSpecialName\",\n \"SpecialName\",\n \"SecondSpecialName\",\n 0,\n 1,\n 2,\n 3,\n ],\n )\n @check_file_leaks\n def test_read_excel_sheet_name(self, sheet_name):\n eval_io(\n fn_name=\"read_excel\",\n # read_excel kwargs\n io=\"modin/pandas/test/data/modin_error_book.xlsx\",\n sheet_name=sheet_name,\n # https://github.com/modin-project/modin/issues/5965\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_ExcelFile_TestExcel.test_ExcelFile.try_.finally_.pandas_excel_file_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_ExcelFile_TestExcel.test_ExcelFile.try_.finally_.pandas_excel_file_close_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2071, "end_line": 2087, "span_ids": ["TestExcel.test_ExcelFile"], "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 TestExcel:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"TypeError: Expected list, got type - issue #3284\",\n )\n def test_ExcelFile(self, make_excel_file):\n unique_filename = make_excel_file()\n\n modin_excel_file = pd.ExcelFile(unique_filename)\n pandas_excel_file = pandas.ExcelFile(unique_filename)\n\n try:\n df_equals(modin_excel_file.parse(), pandas_excel_file.parse())\n assert modin_excel_file.io == unique_filename\n assert isinstance(modin_excel_file, pd.ExcelFile)\n finally:\n modin_excel_file.close()\n pandas_excel_file.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_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_to_excel_TestExcel.test_to_excel.assert_assert_files_eq_un": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_to_excel_TestExcel.test_to_excel.assert_assert_files_eq_un", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2089, "end_line": 2107, "span_ids": ["TestExcel.test_to_excel"], "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 TestExcel:\n\n @pytest.mark.xfail(strict=False, reason=\"Flaky test, defaults to pandas\")\n def test_to_excel(self, tmp_path):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n\n unique_filename_modin = get_unique_filename(extension=\"xlsx\", data_dir=tmp_path)\n unique_filename_pandas = get_unique_filename(\n extension=\"xlsx\", data_dir=tmp_path\n )\n\n modin_writer = pandas.ExcelWriter(unique_filename_modin)\n pandas_writer = pandas.ExcelWriter(unique_filename_pandas)\n\n modin_df.to_excel(modin_writer)\n pandas_df.to_excel(pandas_writer)\n\n modin_writer.save()\n pandas_writer.save()\n\n assert assert_files_eq(unique_filename_modin, unique_filename_pandas)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_empty_frame_TestExcel.test_read_excel_empty_frame.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestExcel.test_read_excel_empty_frame_TestExcel.test_read_excel_empty_frame.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2109, "end_line": 2122, "span_ids": ["TestExcel.test_read_excel_empty_frame"], "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 TestExcel:\n\n @check_file_leaks\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_excel_empty_frame(self, make_excel_file):\n eval_io(\n fn_name=\"read_excel\",\n modin_warning=UserWarning,\n # read_excel kwargs\n io=make_excel_file(),\n usecols=[0],\n index_col=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_modin-project__modin/modin/pandas/test/test_io.py_TestHdf_TestHdf.test_read_hdf.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf_TestHdf.test_read_hdf.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2125, "end_line": 2137, "span_ids": ["TestHdf", "TestHdf.test_read_hdf"], "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 TestHdf:\n @pytest.mark.parametrize(\"format\", [None, \"table\"])\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_hdf(self, make_hdf_file, format):\n eval_io(\n fn_name=\"read_hdf\",\n # read_hdf kwargs\n path_or_buf=make_hdf_file(format=format),\n key=\"df\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf.test_HDFStore_TestHdf.test_HDFStore.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf.test_HDFStore_TestHdf.test_HDFStore.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2139, "end_line": 2173, "span_ids": ["TestHdf.test_HDFStore"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestHdf:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_HDFStore(self, tmp_path):\n unique_filename_modin = get_unique_filename(extension=\"hdf\", data_dir=tmp_path)\n unique_filename_pandas = get_unique_filename(extension=\"hdf\", data_dir=tmp_path)\n\n modin_store = pd.HDFStore(unique_filename_modin)\n pandas_store = pandas.HDFStore(unique_filename_pandas)\n\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n\n modin_store[\"foo\"] = modin_df\n pandas_store[\"foo\"] = pandas_df\n\n modin_df = modin_store.get(\"foo\")\n pandas_df = pandas_store.get(\"foo\")\n df_equals(modin_df, pandas_df)\n\n modin_store.close()\n pandas_store.close()\n modin_df = pandas.read_hdf(unique_filename_modin, key=\"foo\", mode=\"r\")\n pandas_df = pandas.read_hdf(unique_filename_pandas, key=\"foo\", mode=\"r\")\n df_equals(modin_df, pandas_df)\n assert isinstance(modin_store, pd.HDFStore)\n\n with ensure_clean(\".hdf5\") as hdf_file:\n with pd.HDFStore(hdf_file, mode=\"w\") as store:\n store.append(\"data/df1\", pd.DataFrame(np.random.randn(5, 5)))\n store.append(\"data/df2\", pd.DataFrame(np.random.randn(4, 4)))\n\n modin_df = pd.read_hdf(hdf_file, key=\"data/df1\", mode=\"r\")\n pandas_df = pandas.read_hdf(hdf_file, key=\"data/df1\", mode=\"r\")\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf.test_HDFStore_in_read_hdf_TestHdf.test_HDFStore_in_read_hdf.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHdf.test_HDFStore_in_read_hdf_TestHdf.test_HDFStore_in_read_hdf.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2175, "end_line": 2188, "span_ids": ["TestHdf.test_HDFStore_in_read_hdf"], "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 TestHdf:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_HDFStore_in_read_hdf(self):\n with ensure_clean(\".hdf\") as filename:\n dfin = pd.DataFrame(np.random.rand(8, 8))\n dfin.to_hdf(filename, \"/key\")\n\n with pd.HDFStore(filename) as h:\n modin_df = pd.read_hdf(h, \"/key\")\n with pandas.HDFStore(filename) as h:\n pandas_df = pandas.read_hdf(h, \"/key\")\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql_TestSql.test_read_sql.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql_TestSql.test_read_sql.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2191, "end_line": 2252, "span_ids": ["TestSql", "TestSql.test_read_sql"], "tokens": 429}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSql:\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n @pytest.mark.parametrize(\"read_sql_engine\", [\"Pandas\", \"Connectorx\"])\n def test_read_sql(self, tmp_path, make_sql_connection, read_sql_engine):\n filename = get_unique_filename(\".db\")\n table = \"test_read_sql\"\n conn = make_sql_connection(tmp_path / filename, table)\n query = f\"select * from {table}\"\n\n eval_io(\n fn_name=\"read_sql\",\n # read_sql kwargs\n sql=query,\n con=conn,\n )\n\n eval_io(\n fn_name=\"read_sql\",\n # read_sql kwargs\n sql=query,\n con=conn,\n index_col=\"index\",\n )\n\n with warns_that_defaulting_to_pandas():\n pd.read_sql_query(query, conn)\n\n with warns_that_defaulting_to_pandas():\n pd.read_sql_table(table, conn)\n\n # Test SQLAlchemy engine\n sqlalchemy_engine = sa.create_engine(conn)\n eval_io(\n fn_name=\"read_sql\",\n # read_sql kwargs\n sql=query,\n con=sqlalchemy_engine,\n )\n\n # Test SQLAlchemy Connection\n sqlalchemy_connection = sqlalchemy_engine.connect()\n eval_io(\n fn_name=\"read_sql\",\n # read_sql kwargs\n sql=query,\n con=sqlalchemy_connection,\n )\n\n old_sql_engine = ReadSqlEngine.get()\n ReadSqlEngine.put(read_sql_engine)\n if ReadSqlEngine.get() == \"Connectorx\":\n modin_df = pd.read_sql(sql=query, con=conn)\n else:\n modin_df = pd.read_sql(\n sql=query, con=ModinDatabaseConnection(\"sqlalchemy\", conn)\n )\n ReadSqlEngine.put(old_sql_engine)\n pandas_df = pandas.read_sql(sql=query, con=sqlalchemy_connection)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_dtype_backend_TestSql.test_read_sql_dtype_backend.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_dtype_backend_TestSql.test_read_sql_dtype_backend.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2254, "end_line": 2279, "span_ids": ["TestSql.test_read_sql_dtype_backend"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSql:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n def test_read_sql_dtype_backend(self, tmp_path, make_sql_connection, dtype_backend):\n filename = get_unique_filename(extension=\"db\")\n\n table = \"test_read_sql_dtype_backend\"\n conn = make_sql_connection(tmp_path / filename, table)\n query = f\"select * from {table}\"\n\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_sql\",\n # read_sql kwargs\n sql=query,\n con=conn,\n dtype_backend=dtype_backend,\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_from_sql_server_TestSql.test_read_sql_from_sql_server.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_from_sql_server_TestSql.test_read_sql_from_sql_server.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2281, "end_line": 2304, "span_ids": ["TestSql.test_read_sql_from_sql_server"], "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 TestSql:\n\n @pytest.mark.skipif(\n not TestReadFromSqlServer.get(),\n reason=\"Skip the test when the test SQL server is not set up.\",\n )\n def test_read_sql_from_sql_server(self):\n table_name = \"test_1000x256\"\n query = f\"SELECT * FROM {table_name}\"\n sqlalchemy_connection_string = (\n \"mssql+pymssql://sa:Strong.Pwd-123@0.0.0.0:1433/master\"\n )\n pandas_df_to_read = pandas.DataFrame(\n np.arange(\n 1000 * 256,\n ).reshape(1000, 256)\n ).add_prefix(\"col\")\n pandas_df_to_read.to_sql(\n table_name, sqlalchemy_connection_string, if_exists=\"replace\"\n )\n modin_df = pd.read_sql(\n query,\n ModinDatabaseConnection(\"sqlalchemy\", sqlalchemy_connection_string),\n )\n pandas_df = pandas.read_sql(query, sqlalchemy_connection_string)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_from_postgres_TestSql.test_read_sql_from_postgres.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_read_sql_from_postgres_TestSql.test_read_sql_from_postgres.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2306, "end_line": 2325, "span_ids": ["TestSql.test_read_sql_from_postgres"], "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 TestSql:\n\n @pytest.mark.skipif(\n not TestReadFromPostgres.get(),\n reason=\"Skip the test when the postgres server is not set up.\",\n )\n def test_read_sql_from_postgres(self):\n table_name = \"test_1000x256\"\n query = f\"SELECT * FROM {table_name}\"\n connection = \"postgresql://sa:Strong.Pwd-123@localhost:2345/postgres\"\n pandas_df_to_read = pandas.DataFrame(\n np.arange(\n 1000 * 256,\n ).reshape(1000, 256)\n ).add_prefix(\"col\")\n pandas_df_to_read.to_sql(table_name, connection, if_exists=\"replace\")\n modin_df = pd.read_sql(\n query,\n ModinDatabaseConnection(\"psycopg2\", connection),\n )\n pandas_df = pandas.read_sql(query, connection)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_invalid_modin_database_connections_TestSql.test_read_sql_with_chunksize.for_modin_df_pandas_df_i.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_invalid_modin_database_connections_TestSql.test_read_sql_with_chunksize.for_modin_df_pandas_df_i.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2327, "end_line": 2344, "span_ids": ["TestSql.test_invalid_modin_database_connections", "TestSql.test_read_sql_with_chunksize"], "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 TestSql:\n\n def test_invalid_modin_database_connections(self):\n with pytest.raises(UnsupportedDatabaseException):\n ModinDatabaseConnection(\"unsupported_database\")\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_sql_with_chunksize(self, make_sql_connection):\n filename = get_unique_filename(extension=\"db\")\n table = \"test_read_sql_with_chunksize\"\n conn = make_sql_connection(filename, table)\n query = f\"select * from {table}\"\n\n pandas_gen = pandas.read_sql(query, conn, chunksize=10)\n modin_gen = pd.read_sql(query, conn, chunksize=10)\n for modin_df, pandas_df in zip(modin_gen, pandas_gen):\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_to_sql_TestSql.test_to_sql.assert_df_modin_sql_sort_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSql.test_to_sql_TestSql.test_to_sql.assert_df_modin_sql_sort_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2346, "end_line": 2374, "span_ids": ["TestSql.test_to_sql"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSql:\n\n @pytest.mark.parametrize(\"index\", [False, True])\n @pytest.mark.parametrize(\"conn_type\", [\"str\", \"sqlalchemy\", \"sqlalchemy+connect\"])\n def test_to_sql(self, tmp_path, make_sql_connection, index, conn_type):\n table_name = f\"test_to_sql_{str(index)}\"\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n\n # We do not pass the table name so the fixture won't generate a table\n conn = make_sql_connection(tmp_path / f\"{table_name}_modin.db\")\n if conn_type.startswith(\"sqlalchemy\"):\n conn = sa.create_engine(conn)\n if conn_type == \"sqlalchemy+connect\":\n conn = conn.connect()\n modin_df.to_sql(table_name, conn, index=index)\n df_modin_sql = pandas.read_sql(\n table_name, con=conn, index_col=\"index\" if index else None\n )\n\n # We do not pass the table name so the fixture won't generate a table\n conn = make_sql_connection(tmp_path / f\"{table_name}_pandas.db\")\n if conn_type.startswith(\"sqlalchemy\"):\n conn = sa.create_engine(conn)\n if conn_type == \"sqlalchemy+connect\":\n conn = conn.connect()\n pandas_df.to_sql(table_name, conn, index=index)\n df_pandas_sql = pandas.read_sql(\n table_name, con=conn, index_col=\"index\" if index else None\n )\n\n assert df_modin_sql.sort_index().equals(df_pandas_sql.sort_index())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHtml_TestFwf.test_fwf_file.assert_isinstance_df_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestHtml_TestFwf.test_fwf_file.assert_isinstance_df_pd_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2368, "end_line": 2397, "span_ids": ["TestFwf.test_fwf_file", "TestFwf", "TestHtml", "TestHtml.test_to_html", "TestHtml.test_read_html"], "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 TestHtml:\n def test_read_html(self, make_html_file):\n eval_io(fn_name=\"read_html\", io=make_html_file())\n\n def test_to_html(self, tmp_path):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n\n eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_html\",\n extension=\"html\",\n )\n\n\nclass TestFwf:\n def test_fwf_file(self, make_fwf_file):\n fwf_data = (\n \"id8141 360.242940 149.910199 11950.7\\n\"\n + \"id1594 444.953632 166.985655 11788.4\\n\"\n + \"id1849 364.136849 183.628767 11806.2\\n\"\n + \"id1230 413.836124 184.375703 11916.8\\n\"\n + \"id1948 502.953953 173.237159 12468.3\\n\"\n )\n unique_filename = make_fwf_file(fwf_data=fwf_data)\n\n colspecs = [(0, 6), (8, 20), (21, 33), (34, 43)]\n df = pd.read_fwf(unique_filename, colspecs=colspecs, header=None, index_col=0)\n assert isinstance(df, pd.DataFrame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_colspecs_widths_TestFwf.test_fwf_file_colspecs_widths.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_colspecs_widths_TestFwf.test_fwf_file_colspecs_widths.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2399, "end_line": 2436, "span_ids": ["TestFwf.test_fwf_file_colspecs_widths"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFwf:\n\n @pytest.mark.parametrize(\n \"kwargs\",\n [\n {\n \"colspecs\": [\n (0, 11),\n (11, 15),\n (19, 24),\n (27, 32),\n (35, 40),\n (43, 48),\n (51, 56),\n (59, 64),\n (67, 72),\n (75, 80),\n (83, 88),\n (91, 96),\n (99, 104),\n (107, 112),\n ],\n \"names\": [\"stationID\", \"year\", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n \"na_values\": [\"-9999\"],\n \"index_col\": [\"stationID\", \"year\"],\n },\n {\n \"widths\": [20, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8],\n \"names\": [\"id\", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n \"index_col\": [0],\n },\n ],\n )\n def test_fwf_file_colspecs_widths(self, make_fwf_file, kwargs):\n unique_filename = make_fwf_file()\n\n modin_df = pd.read_fwf(unique_filename, **kwargs)\n pandas_df = pd.read_fwf(unique_filename, **kwargs)\n\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_usecols_TestFwf.test_fwf_file_usecols.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_usecols_TestFwf.test_fwf_file_usecols.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2438, "end_line": 2453, "span_ids": ["TestFwf.test_fwf_file_usecols"], "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 TestFwf:\n\n @pytest.mark.parametrize(\"usecols\", [[\"a\"], [\"a\", \"b\", \"d\"], [0, 1, 3]])\n def test_fwf_file_usecols(self, make_fwf_file, usecols):\n fwf_data = (\n \"a b c d\\n\"\n + \"id8141 360.242940 149.910199 11950.7\\n\"\n + \"id1594 444.953632 166.985655 11788.4\\n\"\n + \"id1849 364.136849 183.628767 11806.2\\n\"\n + \"id1230 413.836124 184.375703 11916.8\\n\"\n + \"id1948 502.953953 173.237159 12468.3\\n\"\n )\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=make_fwf_file(fwf_data=fwf_data),\n usecols=usecols,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_dtype_backend_TestFwf.test_read_fwf_dtype_backend.with_ensure_clean_fwf_.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_dtype_backend_TestFwf.test_read_fwf_dtype_backend.with_ensure_clean_fwf_.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2455, "end_line": 2472, "span_ids": ["TestFwf.test_read_fwf_dtype_backend"], "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 TestFwf:\n\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n def test_read_fwf_dtype_backend(self, make_fwf_file, dtype_backend):\n with ensure_clean(\".fwf\") as unique_filename:\n make_fwf_file(filename=unique_filename)\n\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_fwf\",\n # read_csv kwargs\n filepath_or_buffer=unique_filename,\n dtype_backend=dtype_backend,\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_chunksize_TestFwf.test_fwf_file_chunksize.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_chunksize_TestFwf.test_fwf_file_chunksize.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2474, "end_line": 2500, "span_ids": ["TestFwf.test_fwf_file_chunksize"], "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 TestFwf:\n\n def test_fwf_file_chunksize(self, make_fwf_file):\n unique_filename = make_fwf_file()\n\n # Tests __next__ and correctness of reader as an iterator\n rdf_reader = pd.read_fwf(unique_filename, chunksize=5)\n pd_reader = pandas.read_fwf(unique_filename, chunksize=5)\n\n for modin_df, pd_df in zip(rdf_reader, pd_reader):\n df_equals(modin_df, pd_df)\n\n # Tests that get_chunk works correctly\n rdf_reader = pd.read_fwf(unique_filename, chunksize=1)\n pd_reader = pandas.read_fwf(unique_filename, chunksize=1)\n\n modin_df = rdf_reader.get_chunk(1)\n pd_df = pd_reader.get_chunk(1)\n\n df_equals(modin_df, pd_df)\n\n # Tests that read works correctly\n rdf_reader = pd.read_fwf(unique_filename, chunksize=1)\n pd_reader = pandas.read_fwf(unique_filename, chunksize=1)\n\n modin_df = rdf_reader.read()\n pd_df = pd_reader.read()\n\n df_equals(modin_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_skiprows_TestFwf.test_fwf_file_skiprows.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_skiprows_TestFwf.test_fwf_file_skiprows.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2502, "end_line": 2521, "span_ids": ["TestFwf.test_fwf_file_skiprows"], "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 TestFwf:\n\n @pytest.mark.parametrize(\"nrows\", [13, None])\n def test_fwf_file_skiprows(self, make_fwf_file, nrows):\n unique_filename = make_fwf_file()\n\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=unique_filename,\n skiprows=2,\n nrows=nrows,\n )\n\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=unique_filename,\n usecols=[0, 4, 7],\n skiprows=[2, 5],\n nrows=nrows,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_index_col_TestFwf.test_fwf_file_skipfooter.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_index_col_TestFwf.test_fwf_file_skipfooter.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2523, "end_line": 2545, "span_ids": ["TestFwf.test_fwf_file_index_col", "TestFwf.test_fwf_file_skipfooter"], "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 TestFwf:\n\n def test_fwf_file_index_col(self, make_fwf_file):\n fwf_data = (\n \"a b c d\\n\"\n + \"id8141 360.242940 149.910199 11950.7\\n\"\n + \"id1594 444.953632 166.985655 11788.4\\n\"\n + \"id1849 364.136849 183.628767 11806.2\\n\"\n + \"id1230 413.836124 184.375703 11916.8\\n\"\n + \"id1948 502.953953 173.237159 12468.3\\n\"\n )\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=make_fwf_file(fwf_data=fwf_data),\n index_col=\"c\",\n )\n\n def test_fwf_file_skipfooter(self, make_fwf_file):\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=make_fwf_file(),\n skipfooter=2,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_parse_dates_TestFwf.test_fwf_file_parse_dates.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_fwf_file_parse_dates_TestFwf.test_fwf_file_parse_dates.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2547, "end_line": 2571, "span_ids": ["TestFwf.test_fwf_file_parse_dates"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFwf:\n\n def test_fwf_file_parse_dates(self, make_fwf_file):\n dates = pandas.date_range(\"2000\", freq=\"h\", periods=10)\n fwf_data = \"col1 col2 col3 col4\"\n for i in range(10, 20):\n fwf_data = fwf_data + \"\\n{col1} {col2} {col3} {col4}\".format(\n col1=str(i),\n col2=str(dates[i - 10].date()),\n col3=str(i),\n col4=str(dates[i - 10].time()),\n )\n unique_filename = make_fwf_file(fwf_data=fwf_data)\n\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=unique_filename,\n parse_dates=[[\"col2\", \"col4\"]],\n )\n\n eval_io(\n fn_name=\"read_fwf\",\n # read_fwf kwargs\n filepath_or_buffer=unique_filename,\n parse_dates={\"time\": [\"col2\", \"col4\"]},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_file_handle_TestFwf.test_read_fwf_file_handle.with_open_make_fwf_file_.df_equals_df_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_file_handle_TestFwf.test_read_fwf_file_handle.with_open_make_fwf_file_.df_equals_df_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2573, "end_line": 2591, "span_ids": ["TestFwf.test_read_fwf_file_handle"], "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 TestFwf:\n\n @pytest.mark.parametrize(\n \"read_mode\",\n [\n \"r\",\n pytest.param(\n \"rb\",\n marks=pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"Cannot pickle file handles. See comments in PR #2625\",\n ),\n ),\n ],\n )\n def test_read_fwf_file_handle(self, make_fwf_file, read_mode):\n with open(make_fwf_file(), mode=read_mode) as buffer:\n df_pandas = pandas.read_fwf(buffer)\n buffer.seek(0)\n df_modin = pd.read_fwf(buffer)\n df_equals(df_modin, df_pandas)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_empty_frame_TestFwf.test_read_fwf_s3.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFwf.test_read_fwf_empty_frame_TestFwf.test_read_fwf_s3.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2593, "end_line": 2614, "span_ids": ["TestFwf.test_read_fwf_empty_frame", "TestFwf.test_read_fwf_s3"], "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 TestFwf:\n\n def test_read_fwf_empty_frame(self, make_fwf_file):\n kwargs = {\n \"usecols\": [0],\n \"index_col\": 0,\n }\n unique_filename = make_fwf_file()\n\n modin_df = pd.read_fwf(unique_filename, **kwargs)\n pandas_df = pandas.read_fwf(unique_filename, **kwargs)\n\n df_equals(modin_df, pandas_df)\n\n @pytest.mark.parametrize(\n \"storage_options\",\n [{\"anon\": False}, {\"anon\": True}, {\"key\": \"123\", \"secret\": \"123\"}, None],\n )\n def test_read_fwf_s3(self, storage_options):\n eval_io(\n fn_name=\"read_fwf\",\n filepath_or_buffer=\"s3://modin-datasets/testing/test_data.fwf\",\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestGbq_TestGbq.test_to_gbq.with_pytest_raises_.modin_df_to_gbq_modin_ta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestGbq_TestGbq.test_to_gbq.with_pytest_raises_.modin_df_to_gbq_modin_ta", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2617, "end_line": 2633, "span_ids": ["TestGbq.test_to_gbq", "TestGbq", "TestGbq.test_read_gbq"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGbq:\n @pytest.mark.skip(reason=\"Can not pass without GBQ access\")\n def test_read_gbq(self):\n # Test API, but do not supply credentials until credits can be secured.\n with pytest.raises(\n ValueError, match=\"Could not determine project ID and one was not supplied.\"\n ):\n pd.read_gbq(\"SELECT 1\")\n\n @pytest.mark.skip(reason=\"Can not pass without GBQ access\")\n def test_to_gbq(self):\n modin_df, _ = create_test_dfs(TEST_DATA)\n # Test API, but do not supply credentials until credits can be secured.\n with pytest.raises(\n ValueError, match=\"Could not determine project ID and one was not supplied.\"\n ):\n modin_df.to_gbq(\"modin.table\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestGbq.test_read_gbq_mock_TestGbq.test_read_gbq_mock.read_gbq_assert_called_on": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestGbq.test_read_gbq_mock_TestGbq.test_read_gbq_mock.read_gbq_assert_called_on", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2635, "end_line": 2644, "span_ids": ["TestGbq.test_read_gbq_mock"], "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 TestGbq:\n\n def test_read_gbq_mock(self):\n test_args = (\"fake_query\",)\n test_kwargs = inspect.signature(pd.read_gbq).parameters.copy()\n test_kwargs.update(project_id=\"test_id\", dialect=\"standart\")\n test_kwargs.pop(\"query\", None)\n with mock.patch(\n \"pandas.read_gbq\", return_value=pandas.DataFrame([])\n ) as read_gbq:\n pd.read_gbq(*test_args, **test_kwargs)\n read_gbq.assert_called_once_with(*test_args, **test_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_modin-project__modin/modin/pandas/test/test_io.py_TestStata_TestSas.test_read_sas.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestStata_TestSas.test_read_sas.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2647, "end_line": 2672, "span_ids": ["TestSas.test_read_sas", "TestStata.test_to_stata", "TestStata", "TestSas", "TestStata.test_read_stata"], "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 TestStata:\n def test_read_stata(self, make_stata_file):\n eval_io(\n fn_name=\"read_stata\",\n # read_stata kwargs\n filepath_or_buffer=make_stata_file(),\n )\n\n def test_to_stata(self, tmp_path):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_stata\",\n extension=\"stata\",\n )\n\n\nclass TestSas:\n def test_read_sas(self):\n eval_io(\n fn_name=\"read_sas\",\n # read_sas kwargs\n filepath_or_buffer=\"modin/pandas/test/data/airline.sas7bdat\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather_TestFeather.test_read_feather_dtype_backend.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather_TestFeather.test_read_feather_dtype_backend.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2675, "end_line": 2705, "span_ids": ["TestFeather", "TestFeather.test_read_feather", "TestFeather.test_read_feather_dtype_backend"], "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 TestFeather:\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_read_feather(self, make_feather_file):\n eval_io(\n fn_name=\"read_feather\",\n # read_feather kwargs\n path=make_feather_file(),\n )\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n @pytest.mark.parametrize(\n \"dtype_backend\", [lib.no_default, \"numpy_nullable\", \"pyarrow\"]\n )\n def test_read_feather_dtype_backend(self, make_feather_file, dtype_backend):\n def comparator(df1, df2):\n df_equals(df1, df2)\n df_equals(df1.dtypes, df2.dtypes)\n\n eval_io(\n fn_name=\"read_feather\",\n # read_feather kwargs\n path=make_feather_file(),\n dtype_backend=dtype_backend,\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_s3_TestFeather.test_read_feather_s3.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_s3_TestFeather.test_read_feather_s3.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2707, "end_line": 2720, "span_ids": ["TestFeather.test_read_feather_s3"], "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 TestFeather:\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n @pytest.mark.parametrize(\n \"storage_options\",\n [{\"anon\": False}, {\"anon\": True}, {\"key\": \"123\", \"secret\": \"123\"}, None],\n )\n def test_read_feather_s3(self, storage_options):\n eval_io(\n fn_name=\"read_feather\",\n path=\"s3://modin-datasets/testing/test_data.feather\",\n storage_options=storage_options,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_path_object_TestFeather.test_to_feather.eval_to_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_path_object_TestFeather.test_to_feather.eval_to_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2722, "end_line": 2740, "span_ids": ["TestFeather.test_to_feather", "TestFeather.test_read_feather_path_object"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFeather:\n\n def test_read_feather_path_object(self, make_feather_file):\n eval_io(\n fn_name=\"read_feather\",\n path=Path(make_feather_file()),\n )\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n )\n def test_to_feather(self, tmp_path):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_feather\",\n extension=\"feather\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_with_index_metadata_TestFeather.test_read_feather_with_index_metadata.eval_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestFeather.test_read_feather_with_index_metadata_TestFeather.test_read_feather_with_index_metadata.eval_io_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2742, "end_line": 2752, "span_ids": ["TestFeather.test_read_feather_with_index_metadata"], "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 TestFeather:\n\n def test_read_feather_with_index_metadata(self, tmp_path):\n # see: https://github.com/modin-project/modin/issues/6212\n df = pandas.DataFrame({\"a\": [1, 2, 3]}, index=[0, 1, 2])\n assert not isinstance(df.index, pandas.RangeIndex)\n\n path = get_unique_filename(extension=\".feather\", data_dir=tmp_path)\n df.to_feather(path)\n eval_io(\n fn_name=\"read_feather\",\n path=path,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestClipboard_TestClipboard.test_to_clipboard.assert_modin_as_clip_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestClipboard_TestClipboard.test_to_clipboard.assert_modin_as_clip_equa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2755, "end_line": 2772, "span_ids": ["TestClipboard.test_to_clipboard", "TestClipboard.test_read_clipboard", "TestClipboard"], "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 TestClipboard:\n @pytest.mark.skip(reason=\"No clipboard in CI\")\n def test_read_clipboard(self):\n setup_clipboard()\n\n eval_io(fn_name=\"read_clipboard\")\n\n @pytest.mark.skip(reason=\"No clipboard in CI\")\n def test_to_clipboard(self):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n\n modin_df.to_clipboard()\n modin_as_clip = pandas.read_clipboard()\n\n pandas_df.to_clipboard()\n pandas_as_clip = pandas.read_clipboard()\n\n assert modin_as_clip.equals(pandas_as_clip)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestPickle_TestPickle.test_to_pickle.eval_to_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestPickle_TestPickle.test_to_pickle.eval_to_file_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2775, "end_line": 2795, "span_ids": ["TestPickle", "TestPickle.test_to_pickle", "TestPickle.test_read_pickle"], "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 TestPickle:\n def test_read_pickle(self, make_pickle_file):\n eval_io(\n fn_name=\"read_pickle\",\n # read_pickle kwargs\n filepath_or_buffer=make_pickle_file(),\n )\n\n @pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"There is no point in writing to local files.\",\n )\n def test_to_pickle(self, tmp_path):\n modin_df, pandas_df = create_test_dfs(TEST_DATA)\n eval_to_file(\n tmp_path,\n modin_obj=modin_df,\n pandas_obj=pandas_df,\n fn=\"to_pickle\",\n extension=\"pkl\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestXml_TestXml.test_read_xml.eval_io_read_xml_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestXml_TestXml.test_read_xml.eval_io_read_xml_path_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2798, "end_line": 2814, "span_ids": ["TestXml", "TestXml.test_read_xml"], "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 TestXml:\n def test_read_xml(self):\n # example from pandas\n data = \"\"\"\n\n \n square\n 360\n 4.0\n \n \n circle\n 360\n \n \n\"\"\"\n eval_io(\"read_xml\", path_or_buffer=data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestOrc_TestOrc.test_read_orc.read_orc_assert_called_on": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestOrc_TestOrc.test_read_orc.read_orc_assert_called_on", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2817, "end_line": 2832, "span_ids": ["TestOrc", "TestOrc.test_read_orc"], "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 TestOrc:\n # It's not easy to add infrastructure for `orc` format.\n # In case of defaulting to pandas, it's enough\n # to check that the parameters are passed to pandas.\n def test_read_orc(self):\n test_args = (\"fake_path\",)\n test_kwargs = dict(\n columns=[\"A\"],\n dtype_backend=lib.no_default,\n fake_kwarg=\"some_pyarrow_parameter\",\n )\n with mock.patch(\n \"pandas.read_orc\", return_value=pandas.DataFrame([])\n ) as read_orc:\n pd.read_orc(*test_args, **test_kwargs)\n read_orc.assert_called_once_with(*test_args, **test_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_modin-project__modin/modin/pandas/test/test_io.py_TestSpss_TestSpss.test_read_spss.read_spss_assert_called_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_TestSpss_TestSpss.test_read_spss.read_spss_assert_called_o", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2835, "end_line": 2848, "span_ids": ["TestSpss", "TestSpss.test_read_spss"], "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 TestSpss:\n # It's not easy to add infrastructure for `spss` format.\n # In case of defaulting to pandas, it's enough\n # to check that the parameters are passed to pandas.\n def test_read_spss(self):\n test_args = (\"fake_path\",)\n test_kwargs = dict(\n usecols=[\"A\"], convert_categoricals=False, dtype_backend=lib.no_default\n )\n with mock.patch(\n \"pandas.read_spss\", return_value=pandas.DataFrame([])\n ) as read_spss:\n pd.read_spss(*test_args, **test_kwargs)\n read_spss.assert_called_once_with(*test_args, **test_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_modin-project__modin/modin/pandas/test/test_io.py_test_json_normalize_test_from_arrow.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_json_normalize_test_from_arrow.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2851, "end_line": 2868, "span_ids": ["test_json_normalize", "test_from_arrow"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_json_normalize():\n # example from pandas\n data = [\n {\"id\": 1, \"name\": {\"first\": \"Coleen\", \"last\": \"Volk\"}},\n {\"name\": {\"given\": \"Mark\", \"family\": \"Regner\"}},\n {\"id\": 2, \"name\": \"Faye Raker\"},\n ]\n eval_io(\"json_normalize\", data=data)\n\n\n@pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n)\ndef test_from_arrow():\n _, pandas_df = create_test_dfs(TEST_DATA)\n modin_df = from_arrow(pa.Table.from_pandas(pandas_df))\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_from_spmatrix_test_from_spmatrix.df_equals_modin_df_panda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_from_spmatrix_test_from_spmatrix.df_equals_modin_df_panda", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2871, "end_line": 2880, "span_ids": ["test_from_spmatrix"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n)\ndef test_from_spmatrix():\n data = sparse.eye(3)\n with pytest.warns(UserWarning, match=\"defaulting to pandas.*\"):\n modin_df = pd.DataFrame.sparse.from_spmatrix(data)\n pandas_df = pandas.DataFrame.sparse.from_spmatrix(data)\n df_equals(modin_df, pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_dense_test_to_dict_dataframe.assert_modin_df_to_dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_dense_test_to_dict_dataframe.assert_modin_df_to_dict_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2883, "end_line": 2895, "span_ids": ["test_to_dense", "test_to_dict_dataframe"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(\n condition=\"config.getoption('--simulate-cloud').lower() != 'off'\",\n reason=\"The reason of tests fail in `cloud` mode is unknown for now - issue #3264\",\n)\ndef test_to_dense():\n data = {\"col1\": pandas.arrays.SparseArray([0, 1, 0])}\n modin_df, pandas_df = create_test_dfs(data)\n df_equals(modin_df.sparse.to_dense(), pandas_df.sparse.to_dense())\n\n\ndef test_to_dict_dataframe():\n modin_df, _ = create_test_dfs(TEST_DATA)\n assert modin_df.to_dict() == to_pandas(modin_df).to_dict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_dict_series_test_to_dict_series.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_dict_series_test_to_dict_series.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2898, "end_line": 2914, "span_ids": ["test_to_dict_series"], "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": "@pytest.mark.parametrize(\n \"kwargs\",\n [\n pytest.param({}, id=\"no_kwargs\"),\n pytest.param({\"into\": dict}, id=\"into_dict\"),\n pytest.param({\"into\": OrderedDict}, id=\"into_ordered_dict\"),\n pytest.param({\"into\": defaultdict(list)}, id=\"into_defaultdict\"),\n ],\n)\ndef test_to_dict_series(kwargs):\n eval_general(\n *[df.iloc[:, 0] for df in create_test_dfs(utils_test_data[\"int_data\"])],\n lambda df: df.to_dict(**kwargs),\n # TODO(https://github.com/modin-project/modin/issues/6016): fix eval_general\n # and remove this raising_exceptions\n raising_exceptions=(Exception,),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_latex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_io.py_test_to_latex_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_io.py", "file_name": "test_io.py", "file_type": "text/x-python", "category": "test", "start_line": 2917, "end_line": 2928, "span_ids": ["test_to_latex", "test_to_period"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_to_latex():\n modin_df, _ = create_test_dfs(TEST_DATA)\n assert modin_df.to_latex() == to_pandas(modin_df).to_latex()\n\n\ndef test_to_period():\n index = pandas.DatetimeIndex(\n pandas.date_range(\"2000\", freq=\"h\", periods=len(TEST_DATA[\"col1\"]))\n )\n modin_df, pandas_df = create_test_dfs(TEST_DATA, index=index)\n df_equals(modin_df.to_period(), pandas_df.to_period())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_pandas_test_get_dummies.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_pandas_test_get_dummies.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_reshape.py", "file_name": "test_reshape.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 73, "span_ids": ["test_get_dummies", "docstring"], "tokens": 582}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport pytest\nimport numpy as np\nimport modin.pandas as pd\n\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom .utils import df_equals, test_data_values\n\n\ndef test_get_dummies():\n s = pd.Series(list(\"abca\"))\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(s)\n\n s1 = [\"a\", \"b\", np.nan]\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(s1)\n\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(s1, dummy_na=True)\n\n data = {\"A\": [\"a\", \"b\", \"a\"], \"B\": [\"b\", \"a\", \"c\"], \"C\": [1, 2, 3]}\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_result = pd.get_dummies(modin_df, prefix=[\"col1\", \"col2\"])\n pandas_result = pandas.get_dummies(pandas_df, prefix=[\"col1\", \"col2\"])\n df_equals(modin_result, pandas_result)\n assert modin_result._to_pandas().columns.equals(pandas_result.columns)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.get_dummies(pd.DataFrame(pd.Series(list(\"abcdeabac\"))))\n pandas_result = pandas.get_dummies(\n pandas.DataFrame(pandas.Series(list(\"abcdeabac\")))\n )\n df_equals(modin_result, pandas_result)\n assert modin_result._to_pandas().columns.equals(pandas_result.columns)\n assert modin_result.shape == pandas_result.shape\n\n with pytest.raises(NotImplementedError):\n pd.get_dummies(modin_df, prefix=[\"col1\", \"col2\"], sparse=True)\n\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(pd.Series(list(\"abcaa\")))\n\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(pd.Series(list(\"abcaa\")), drop_first=True)\n\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(pd.Series(list(\"abc\")), dtype=float)\n\n with warns_that_defaulting_to_pandas():\n pd.get_dummies(1)\n\n # test from #5184\n pandas_df = pandas.DataFrame({\"a\": [1, 2, 3], \"b\": [4, 5, 6], \"c\": [\"7\", \"8\", \"9\"]})\n modin_df = pd.DataFrame(pandas_df)\n pandas_result = pandas.get_dummies(pandas_df, columns=[\"a\", \"b\"])\n modin_result = pd.get_dummies(modin_df, columns=[\"a\", \"b\"])\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_reshape.py_test_melt_test_crosstab.None_2.assert_isinstance_df_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_melt_test_crosstab.None_2.assert_isinstance_df_pd_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_reshape.py", "file_name": "test_reshape.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 121, "span_ids": ["test_crosstab", "test_melt"], "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": "def test_melt():\n data = test_data_values[0]\n with pytest.warns(UserWarning):\n pd.melt(pd.DataFrame(data))\n\n\ndef test_crosstab():\n a = np.array(\n [\"foo\", \"foo\", \"foo\", \"foo\", \"bar\", \"bar\", \"bar\", \"bar\", \"foo\", \"foo\", \"foo\"],\n dtype=object,\n )\n b = np.array(\n [\"one\", \"one\", \"one\", \"two\", \"one\", \"one\", \"one\", \"two\", \"two\", \"two\", \"one\"],\n dtype=object,\n )\n c = np.array(\n [\n \"dull\",\n \"dull\",\n \"shiny\",\n \"dull\",\n \"dull\",\n \"shiny\",\n \"shiny\",\n \"dull\",\n \"shiny\",\n \"shiny\",\n \"shiny\",\n ],\n dtype=object,\n )\n\n with warns_that_defaulting_to_pandas():\n df = pd.crosstab(a, [b, c], rownames=[\"a\"], colnames=[\"b\", \"c\"])\n assert isinstance(df, pd.DataFrame)\n\n foo = pd.Categorical([\"a\", \"b\"], categories=[\"a\", \"b\", \"c\"])\n bar = pd.Categorical([\"d\", \"e\"], categories=[\"d\", \"e\", \"f\"])\n\n with warns_that_defaulting_to_pandas():\n df = pd.crosstab(foo, bar)\n assert isinstance(df, pd.DataFrame)\n\n with warns_that_defaulting_to_pandas():\n df = pd.crosstab(foo, bar, dropna=False)\n assert isinstance(df, pd.DataFrame)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_lreshape_test_lreshape.with_pytest_raises_ValueE.pd_lreshape_data_to_numpy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_lreshape_test_lreshape.with_pytest_raises_ValueE.pd_lreshape_data_to_numpy", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_reshape.py", "file_name": "test_reshape.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 140, "span_ids": ["test_lreshape"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_lreshape():\n data = pd.DataFrame(\n {\n \"hr1\": [514, 573],\n \"hr2\": [545, 526],\n \"team\": [\"Red Sox\", \"Yankees\"],\n \"year1\": [2007, 2008],\n \"year2\": [2008, 2008],\n }\n )\n\n with warns_that_defaulting_to_pandas():\n df = pd.lreshape(data, {\"year\": [\"year1\", \"year2\"], \"hr\": [\"hr1\", \"hr2\"]})\n assert isinstance(df, pd.DataFrame)\n\n with pytest.raises(ValueError):\n pd.lreshape(data.to_numpy(), {\"year\": [\"year1\", \"year2\"], \"hr\": [\"hr1\", \"hr2\"]})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_wide_to_long_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_reshape.py_test_wide_to_long_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_reshape.py", "file_name": "test_reshape.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 160, "span_ids": ["test_wide_to_long"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_wide_to_long():\n data = pd.DataFrame(\n {\n \"hr1\": [514, 573],\n \"hr2\": [545, 526],\n \"team\": [\"Red Sox\", \"Yankees\"],\n \"year1\": [2007, 2008],\n \"year2\": [2008, 2008],\n }\n )\n\n with warns_that_defaulting_to_pandas():\n df = pd.wide_to_long(data, [\"hr\", \"year\"], \"team\", \"index\")\n assert isinstance(df, pd.DataFrame)\n\n with pytest.raises(ValueError):\n pd.wide_to_long(data.to_numpy(), [\"hr\", \"year\"], \"team\", \"index\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_pytest_create_test_series.return.modin_series_pandas_seri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_pytest_create_test_series.return.modin_series_pandas_seri", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 46, "span_ids": ["create_test_series", "docstring"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport numpy as np\nimport pandas\nimport modin.pandas as pd\n\nfrom .utils import (\n df_equals,\n test_data_values,\n test_data_keys,\n eval_general,\n create_test_dfs,\n default_to_pandas_ignore_string,\n)\nfrom modin.config import NPartitions\n\nNPartitions.put(4)\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\n\ndef create_test_series(vals):\n if isinstance(vals, dict):\n modin_series = pd.Series(vals[next(iter(vals.keys()))])\n pandas_series = pandas.Series(vals[next(iter(vals.keys()))])\n else:\n modin_series = pd.Series(vals)\n pandas_series = pandas.Series(vals)\n return modin_series, pandas_series", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_rolling_test_dataframe_rolling.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_rolling_test_dataframe_rolling.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 90, "span_ids": ["test_dataframe_rolling"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"window\", [5, 100])\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"method, kwargs\",\n [\n (\"count\", {}),\n (\"sum\", {}),\n (\"mean\", {}),\n (\"var\", {\"ddof\": 0}),\n (\"std\", {\"ddof\": 0}),\n (\"min\", {}),\n (\"max\", {}),\n (\"skew\", {}),\n (\"kurt\", {}),\n (\"apply\", {\"func\": np.sum}),\n (\"rank\", {}),\n (\"sem\", {\"ddof\": 0}),\n (\"quantile\", {\"q\": 0.1}),\n (\"median\", {}),\n ],\n)\ndef test_dataframe_rolling(data, window, min_periods, axis, method, kwargs):\n # Testing of Rolling class\n modin_df, pandas_df = create_test_dfs(data)\n if window > len(pandas_df):\n window = len(pandas_df)\n eval_general(\n modin_df,\n pandas_df,\n lambda df: getattr(\n df.rolling(\n window=window,\n min_periods=min_periods,\n win_type=None,\n center=True,\n axis=axis,\n ),\n method,\n )(**kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_agg_test_dataframe_agg.if_axis_1_.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_agg_test_dataframe_agg.if_axis_1_.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 115, "span_ids": ["test_dataframe_agg"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"window\", [5, 100])\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\"axis\", [0, 1])\ndef test_dataframe_agg(data, window, min_periods, axis):\n modin_df, pandas_df = create_test_dfs(data)\n if window > len(pandas_df):\n window = len(pandas_df)\n modin_rolled = modin_df.rolling(\n window=window, min_periods=min_periods, win_type=None, center=True, axis=axis\n )\n pandas_rolled = pandas_df.rolling(\n window=window, min_periods=min_periods, win_type=None, center=True, axis=axis\n )\n df_equals(pandas_rolled.aggregate(np.sum), modin_rolled.aggregate(np.sum))\n # TODO(https://github.com/modin-project/modin/issues/4260): Once pandas\n # allows us to rolling aggregate a list of functions over axis 1, test\n # that, too.\n if axis != 1:\n df_equals(\n pandas_rolled.aggregate([np.sum, np.mean]),\n modin_rolled.aggregate([np.sum, np.mean]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_window_test_dataframe_window.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_window_test_dataframe_window.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 149, "span_ids": ["test_dataframe_window"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"window\", [5, 100])\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"method, kwargs\",\n [\n (\"sum\", {}),\n (\"mean\", {}),\n (\"var\", {\"ddof\": 0}),\n (\"std\", {\"ddof\": 0}),\n ],\n)\ndef test_dataframe_window(data, window, min_periods, axis, method, kwargs):\n # Testing of Window class\n modin_df, pandas_df = create_test_dfs(data)\n if window > len(pandas_df):\n window = len(pandas_df)\n eval_general(\n modin_df,\n pandas_df,\n lambda df: getattr(\n df.rolling(\n window=window,\n min_periods=min_periods,\n win_type=\"triang\",\n center=True,\n axis=axis,\n ),\n method,\n )(**kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_dt_index_test_dataframe_dt_index.if_isinstance_window_int.else_.df_equals_modin_rolled_qu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_dataframe_dt_index_test_dataframe_dt_index.if_isinstance_window_int.else_.df_equals_modin_rolled_qu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 152, "end_line": 200, "span_ids": ["test_dataframe_dt_index"], "tokens": 616}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"axis\", [0, \"columns\"])\n@pytest.mark.parametrize(\"on\", [None, \"DateCol\"])\n@pytest.mark.parametrize(\"closed\", [\"both\", \"right\"])\n@pytest.mark.parametrize(\"window\", [3, \"3s\"])\ndef test_dataframe_dt_index(axis, on, closed, window):\n index = pandas.date_range(\"31/12/2000\", periods=12, freq=\"T\")\n data = {\"A\": range(12), \"B\": range(12)}\n pandas_df = pandas.DataFrame(data, index=index)\n modin_df = pd.DataFrame(data, index=index)\n if on is not None and axis == 0 and isinstance(window, str):\n pandas_df[on] = pandas.date_range(\"22/06/1941\", periods=12, freq=\"T\")\n modin_df[on] = pd.date_range(\"22/06/1941\", periods=12, freq=\"T\")\n else:\n on = None\n if axis == \"columns\":\n pandas_df = pandas_df.T\n modin_df = modin_df.T\n pandas_rolled = pandas_df.rolling(window=window, on=on, axis=axis, closed=closed)\n modin_rolled = modin_df.rolling(window=window, on=on, axis=axis, closed=closed)\n if isinstance(window, int):\n # This functions are very slowly for data from test_rolling\n df_equals(\n modin_rolled.corr(modin_df, True), pandas_rolled.corr(pandas_df, True)\n )\n df_equals(\n modin_rolled.corr(modin_df, False), pandas_rolled.corr(pandas_df, False)\n )\n df_equals(modin_rolled.cov(modin_df, True), pandas_rolled.cov(pandas_df, True))\n df_equals(\n modin_rolled.cov(modin_df, False), pandas_rolled.cov(pandas_df, False)\n )\n if axis == 0:\n df_equals(\n modin_rolled.cov(modin_df[modin_df.columns[0]], True),\n pandas_rolled.cov(pandas_df[pandas_df.columns[0]], True),\n )\n df_equals(\n modin_rolled.corr(modin_df[modin_df.columns[0]], True),\n pandas_rolled.corr(pandas_df[pandas_df.columns[0]], True),\n )\n else:\n df_equals(modin_rolled.count(), pandas_rolled.count())\n df_equals(modin_rolled.skew(), pandas_rolled.skew())\n df_equals(\n modin_rolled.apply(np.sum, raw=True),\n pandas_rolled.apply(np.sum, raw=True),\n )\n df_equals(modin_rolled.aggregate(np.sum), pandas_rolled.aggregate(np.sum))\n df_equals(modin_rolled.quantile(0.1), pandas_rolled.quantile(0.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_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_rolling_test_series_rolling.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_rolling_test_series_rolling.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 203, "end_line": 244, "span_ids": ["test_series_rolling"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"window\", [5, 100])\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\n \"method, kwargs\",\n [\n (\"count\", {}),\n (\"sum\", {}),\n (\"mean\", {}),\n (\"var\", {\"ddof\": 0}),\n (\"std\", {\"ddof\": 0}),\n (\"min\", {}),\n (\"max\", {}),\n (\"skew\", {}),\n (\"kurt\", {}),\n (\"apply\", {\"func\": np.sum}),\n (\"rank\", {}),\n (\"sem\", {\"ddof\": 0}),\n (\"aggregate\", {\"func\": np.sum}),\n (\"agg\", {\"func\": [np.sum, np.mean]}),\n (\"quantile\", {\"q\": 0.1}),\n (\"median\", {}),\n ],\n)\ndef test_series_rolling(data, window, min_periods, method, kwargs):\n # Test of Rolling class\n modin_series, pandas_series = create_test_series(data)\n if window > len(pandas_series):\n window = len(pandas_series)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: getattr(\n series.rolling(\n window=window,\n min_periods=min_periods,\n win_type=None,\n center=True,\n ),\n method,\n )(**kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_corr_cov_test_series_corr_cov.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_corr_cov_test_series_corr_cov.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 247, "end_line": 266, "span_ids": ["test_series_corr_cov"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"window\", [5, 100])\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\ndef test_series_corr_cov(data, window, min_periods):\n modin_series, pandas_series = create_test_series(data)\n if window > len(pandas_series):\n window = len(pandas_series)\n modin_rolled = modin_series.rolling(\n window=window, min_periods=min_periods, win_type=None, center=True\n )\n pandas_rolled = pandas_series.rolling(\n window=window, min_periods=min_periods, win_type=None, center=True\n )\n df_equals(modin_rolled.corr(modin_series), pandas_rolled.corr(pandas_series))\n df_equals(\n modin_rolled.cov(modin_series, True), pandas_rolled.cov(pandas_series, True)\n )\n df_equals(\n modin_rolled.cov(modin_series, False), pandas_rolled.cov(pandas_series, 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_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_window_test_series_window.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_window_test_series_window.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 269, "end_line": 298, "span_ids": ["test_series_window"], "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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"window\", [5, 100])\n@pytest.mark.parametrize(\"min_periods\", [None, 5])\n@pytest.mark.parametrize(\n \"method, kwargs\",\n [\n (\"sum\", {}),\n (\"mean\", {}),\n (\"var\", {\"ddof\": 0}),\n (\"std\", {\"ddof\": 0}),\n ],\n)\ndef test_series_window(data, window, min_periods, method, kwargs):\n # Test of Window class\n modin_series, pandas_series = create_test_series(data)\n if window > len(pandas_series):\n window = len(pandas_series)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: getattr(\n series.rolling(\n window=window,\n min_periods=min_periods,\n win_type=\"triang\",\n center=True,\n ),\n method,\n )(**kwargs),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_dt_index_test_series_dt_index.df_equals_modin_rolled_qu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_series_dt_index_test_series_dt_index.df_equals_modin_rolled_qu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 301, "end_line": 315, "span_ids": ["test_series_dt_index"], "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": "@pytest.mark.parametrize(\"closed\", [\"both\", \"right\"])\ndef test_series_dt_index(closed):\n index = pandas.date_range(\"1/1/2000\", periods=12, freq=\"T\")\n pandas_series = pandas.Series(range(12), index=index)\n modin_series = pd.Series(range(12), index=index)\n\n pandas_rolled = pandas_series.rolling(\"3s\", closed=closed)\n modin_rolled = modin_series.rolling(\"3s\", closed=closed)\n df_equals(modin_rolled.count(), pandas_rolled.count())\n df_equals(modin_rolled.skew(), pandas_rolled.skew())\n df_equals(\n modin_rolled.apply(np.sum, raw=True), pandas_rolled.apply(np.sum, raw=True)\n )\n df_equals(modin_rolled.aggregate(np.sum), pandas_rolled.aggregate(np.sum))\n df_equals(modin_rolled.quantile(0.1), pandas_rolled.quantile(0.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_modin-project__modin/modin/pandas/test/test_rolling.py_test_api_indexer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_rolling.py_test_api_indexer_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_rolling.py", "file_name": "test_rolling.py", "file_type": "text/x-python", "category": "test", "start_line": 318, "end_line": 335, "span_ids": ["test_issue_3512", "test_api_indexer"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_api_indexer():\n modin_df, pandas_df = create_test_dfs(test_data_values[0])\n indexer = pd.api.indexers.FixedForwardWindowIndexer(window_size=3)\n pandas_rolled = pandas_df.rolling(window=indexer)\n modin_rolled = modin_df.rolling(window=indexer)\n df_equals(modin_rolled.sum(), pandas_rolled.sum())\n\n\ndef test_issue_3512():\n data = np.random.rand(129)\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n\n modin_ans = modin_df[0:33].rolling(window=21).mean()\n pandas_ans = pandas_df[0:33].rolling(window=21).mean()\n\n df_equals(modin_ans, pandas_ans)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_from___future___import_an_inter_df_math_helper.if_rop_.inter_df_math_helper_one_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_from___future___import_an_inter_df_math_helper.if_rop_.inter_df_math_helper_one_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 117, "span_ids": ["inter_df_math_helper", "get_rop", "imports:18", "docstring"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 annotations\n\nimport sys\nimport pytest\nimport unittest.mock as mock\nimport numpy as np\nimport json\nimport pandas\nfrom pandas._testing import assert_series_equal\nfrom pandas.errors import SpecificationError\nfrom pandas.core.indexing import IndexingError\nimport pandas._libs.lib as lib\nimport matplotlib\nimport modin.pandas as pd\nfrom numpy.testing import assert_array_equal\n\nfrom modin.utils import get_current_execution\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\n\nfrom modin.utils import to_pandas\nfrom .utils import (\n random_state,\n RAND_LOW,\n RAND_HIGH,\n df_equals,\n arg_keys,\n name_contains,\n test_data,\n test_data_values,\n test_data_keys,\n test_data_with_duplicates_values,\n test_data_with_duplicates_keys,\n test_string_data_values,\n test_string_data_keys,\n test_string_list_data_values,\n test_string_list_data_keys,\n string_sep_values,\n string_sep_keys,\n string_na_rep_values,\n string_na_rep_keys,\n numeric_dfs,\n no_numeric_dfs,\n agg_func_keys,\n agg_func_values,\n agg_func_except_keys,\n agg_func_except_values,\n numeric_agg_funcs,\n quantiles_keys,\n quantiles_values,\n axis_keys,\n axis_values,\n bool_arg_keys,\n bool_arg_values,\n int_arg_keys,\n int_arg_values,\n encoding_types,\n categories_equals,\n eval_general,\n test_data_small_values,\n test_data_small_keys,\n test_data_categorical_values,\n test_data_categorical_keys,\n generate_multiindex,\n test_data_diff_dtype,\n df_equals_with_non_stable_indices,\n test_data_large_categorical_series_keys,\n test_data_large_categorical_series_values,\n default_to_pandas_ignore_string,\n CustomIntegerForAddition,\n NonCommutativeMultiplyInteger,\n assert_dtypes_equal,\n)\nfrom modin.config import NPartitions, StorageFormat\n\n# Our configuration in pytest.ini requires that we explicitly catch all\n# instances of defaulting to pandas, but some test modules, like this one,\n# have too many such instances.\n# TODO(https://github.com/modin-project/modin/issues/3655): catch all instances\n# of defaulting to pandas.\npytestmark = pytest.mark.filterwarnings(default_to_pandas_ignore_string)\n\nNPartitions.put(4)\n\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use(\"Agg\")\n\n# Initialize the environment\npd.DataFrame()\n\n\ndef get_rop(op):\n if op.startswith(\"__\") and op.endswith(\"__\"):\n return \"__r\" + op[2:]\n else:\n return None\n\n\ndef inter_df_math_helper(modin_series, pandas_series, op, comparator_kwargs=None):\n inter_df_math_helper_one_side(modin_series, pandas_series, op, comparator_kwargs)\n rop = get_rop(op)\n if rop:\n inter_df_math_helper_one_side(\n modin_series, pandas_series, rop, comparator_kwargs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_inter_df_math_helper_one_side_inter_df_math_helper_one_side.None_6.except_TypeError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_inter_df_math_helper_one_side_inter_df_math_helper_one_side.None_6.except_TypeError_.pass", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 213, "span_ids": ["inter_df_math_helper_one_side"], "tokens": 743}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def inter_df_math_helper_one_side(\n modin_series, pandas_series, op, comparator_kwargs=None\n):\n if comparator_kwargs is None:\n comparator_kwargs = {}\n\n try:\n pandas_attr = getattr(pandas_series, op)\n except Exception as err:\n with pytest.raises(type(err)):\n _ = getattr(modin_series, op)\n return\n modin_attr = getattr(modin_series, op)\n\n try:\n pandas_result = pandas_attr(4)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_attr(4)) # repr to force materialization\n else:\n modin_result = modin_attr(4)\n df_equals(modin_result, pandas_result, **comparator_kwargs)\n\n try:\n pandas_result = pandas_attr(4.0)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_attr(4.0)) # repr to force materialization\n else:\n modin_result = modin_attr(4.0)\n df_equals(modin_result, pandas_result, **comparator_kwargs)\n\n # These operations don't support non-scalar `other` or have a strange behavior in\n # the testing environment\n if op in [\n \"__divmod__\",\n \"divmod\",\n \"rdivmod\",\n \"floordiv\",\n \"__floordiv__\",\n \"rfloordiv\",\n \"__rfloordiv__\",\n \"mod\",\n \"__mod__\",\n \"rmod\",\n \"__rmod__\",\n ]:\n return\n\n try:\n pandas_result = pandas_attr(pandas_series)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_attr(modin_series)) # repr to force materialization\n else:\n modin_result = modin_attr(modin_series)\n df_equals(modin_result, pandas_result, **comparator_kwargs)\n\n list_test = random_state.randint(RAND_LOW, RAND_HIGH, size=(modin_series.shape[0]))\n try:\n pandas_result = pandas_attr(list_test)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_attr(list_test)) # repr to force materialization\n else:\n modin_result = modin_attr(list_test)\n df_equals(modin_result, pandas_result, **comparator_kwargs)\n\n series_test_modin = pd.Series(list_test, index=modin_series.index)\n series_test_pandas = pandas.Series(list_test, index=pandas_series.index)\n try:\n pandas_result = pandas_attr(series_test_pandas)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_attr(series_test_modin)) # repr to force materialization\n else:\n modin_result = modin_attr(series_test_modin)\n df_equals(modin_result, pandas_result, **comparator_kwargs)\n\n # Level test\n new_idx = pandas.MultiIndex.from_tuples(\n [(i // 4, i // 2, i) for i in modin_series.index]\n )\n modin_df_multi_level = modin_series.copy()\n modin_df_multi_level.index = new_idx\n\n try:\n # Defaults to pandas\n with warns_that_defaulting_to_pandas():\n # Operation against self for sanity check\n getattr(modin_df_multi_level, op)(modin_df_multi_level, level=1)\n except TypeError:\n # Some operations don't support multilevel `level` parameter\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_modin-project__modin/modin/pandas/test/test_series.py_create_test_series_create_test_series.return.modin_series_pandas_seri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_create_test_series_create_test_series.return.modin_series_pandas_seri", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 226, "span_ids": ["create_test_series"], "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 create_test_series(vals, sort=False, **kwargs):\n if isinstance(vals, dict):\n modin_series = pd.Series(vals[next(iter(vals.keys()))], **kwargs)\n pandas_series = pandas.Series(vals[next(iter(vals.keys()))], **kwargs)\n else:\n modin_series = pd.Series(vals, **kwargs)\n pandas_series = pandas.Series(vals, **kwargs)\n if sort:\n modin_series = modin_series.sort_values().reset_index(drop=True)\n pandas_series = pandas_series.sort_values().reset_index(drop=True)\n return modin_series, pandas_series", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_to_frame_test___bool__.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_to_frame_test___bool__.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 307, "span_ids": ["test___bool__", "test_to_frame", "test___abs__", "test___array__", "test___and__", "test___add__", "test_to_list", "test_accessing_index_element_as_property", "test_callable_key_in_getitem", "test_T"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_to_frame(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.to_frame(name=\"miao\"), pandas_series.to_frame(name=\"miao\"))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_to_list(data):\n modin_series, pandas_series = create_test_series(data)\n pd_res = pandas_series.to_list()\n md_res = modin_series.to_list()\n assert type(pd_res) == type(md_res)\n assert np.array_equal(pd_res, md_res, equal_nan=True)\n\n\ndef test_accessing_index_element_as_property():\n s = pd.Series([10, 20, 30], index=[\"a\", \"b\", \"c\"])\n assert s.b == 20\n with pytest.raises(Exception):\n _ = s.d\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_callable_key_in_getitem(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series[lambda s: s.index % 2 == 0],\n pandas_series[lambda s: s.index % 2 == 0],\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_T(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.T, pandas_series.T)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___abs__(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.__abs__(), pandas_series.__abs__())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___add__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__add__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___and__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(\n modin_series,\n pandas_series,\n \"__and__\",\n # https://github.com/modin-project/modin/issues/5966\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___array__(data):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.__array__()\n assert_array_equal(modin_result, pandas_series.__array__())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___bool__(data):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.__bool__()\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.__bool__()\n else:\n modin_result = modin_series.__bool__()\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test___contains___test___contains__.if_empty_data_not_in_re.assert_result_key_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___contains___test___contains__.if_empty_data_not_in_re.assert_result_key_in_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 310, "end_line": 323, "span_ids": ["test___contains__"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___contains__(request, data):\n modin_series, pandas_series = create_test_series(data)\n\n result = False\n key = \"Not Exist\"\n assert result == modin_series.__contains__(key)\n assert result == (key in modin_series)\n\n if \"empty_data\" not in request.node.name:\n result = True\n key = pandas_series.keys()[0]\n assert result == modin_series.__contains__(key)\n assert result == (key in modin_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___copy___test___deepcopy__.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___copy___test___deepcopy__.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 326, "end_line": 339, "span_ids": ["test___copy__", "test___deepcopy__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___copy__(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.copy(), modin_series)\n df_equals(modin_series.copy(), pandas_series.copy())\n df_equals(modin_series.copy(), pandas_series)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___deepcopy__(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.__deepcopy__(), modin_series)\n df_equals(modin_series.__deepcopy__(), pandas_series.__deepcopy__())\n df_equals(modin_series.__deepcopy__(), pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___delitem___test___delitem__.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___delitem___test___delitem__.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 342, "end_line": 355, "span_ids": ["test___delitem__"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___delitem__(data):\n modin_series, pandas_series = create_test_series(data)\n del modin_series[modin_series.index[0]]\n del pandas_series[pandas_series.index[0]]\n df_equals(modin_series, pandas_series)\n\n del modin_series[modin_series.index[-1]]\n del pandas_series[pandas_series.index[-1]]\n df_equals(modin_series, pandas_series)\n\n del modin_series[modin_series.index[0]]\n del pandas_series[pandas_series.index[0]]\n df_equals(modin_series, pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_divmod_test___ge__.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_divmod_test___ge__.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 358, "end_line": 385, "span_ids": ["test___floordiv__", "test___ge__", "test_rdivmod", "test_divmod", "test___eq__"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_divmod(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"divmod\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rdivmod(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rdivmod\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___eq__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__eq__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___floordiv__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__floordiv__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___ge__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__ge__\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___getitem___test___getitem__.df_equals_pd_Series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___getitem___test___getitem__.df_equals_pd_Series_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 388, "end_line": 405, "span_ids": ["test___getitem__"], "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.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___getitem__(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series[0], pandas_series[0])\n df_equals(\n modin_series[modin_series.index[-1]], pandas_series[pandas_series.index[-1]]\n )\n modin_series = pd.Series(list(range(1000)))\n pandas_series = pandas.Series(list(range(1000)))\n df_equals(modin_series[:30], pandas_series[:30])\n df_equals(modin_series[modin_series > 500], pandas_series[pandas_series > 500])\n df_equals(modin_series[::2], pandas_series[::2])\n # Test getting an invalid string key\n eval_general(modin_series, pandas_series, lambda s: s[\"a\"])\n eval_general(modin_series, pandas_series, lambda s: s[[\"a\"]])\n\n # Test empty series\n df_equals(pd.Series([])[:30], pandas.Series([])[: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_modin-project__modin/modin/pandas/test/test_series.py_test___getitem__1383_test___getitem_edge_cases.df_equals_modin_series_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___getitem__1383_test___getitem_edge_cases.df_equals_modin_series_st", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 408, "end_line": 422, "span_ids": ["test___getitem__1383", "test___getitem_edge_cases"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___getitem__1383():\n # see #1383 for more details\n data = [\"\", \"a\", \"b\", \"c\", \"a\"]\n modin_series = pd.Series(data)\n pandas_series = pandas.Series(data)\n df_equals(modin_series[3:7], pandas_series[3:7])\n\n\n@pytest.mark.parametrize(\"start\", [-7, -5, -3, 0, None, 3, 5, 7])\n@pytest.mark.parametrize(\"stop\", [-7, -5, -3, 0, None, 3, 5, 7])\ndef test___getitem_edge_cases(start, stop):\n data = [\"\", \"a\", \"b\", \"c\", \"a\"]\n modin_series = pd.Series(data)\n pandas_series = pandas.Series(data)\n df_equals(modin_series[start:stop], pandas_series[start:stop])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___gt___test___neg__.try_.else_.df_equals_modin_series___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___gt___test___neg__.try_.else_.df_equals_modin_series___", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 425, "end_line": 517, "span_ids": ["test___gt__", "test___invert__", "test___mul__", "test___le__", "test___long__", "test___neg__", "test___int__", "test___mod__", "test___float__", "test___ne__", "test___iter__", "test___len__", "test___lt__"], "tokens": 763}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___gt__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__gt__\")\n\n\n@pytest.mark.parametrize(\"count_elements\", [0, 1, 10])\ndef test___int__(count_elements):\n eval_general(*create_test_series([1.5] * count_elements), int)\n\n\n@pytest.mark.parametrize(\"count_elements\", [0, 1, 10])\ndef test___float__(count_elements):\n eval_general(*create_test_series([1] * count_elements), float)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___invert__(data):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.__invert__()\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_series.__invert__())\n else:\n df_equals(modin_series.__invert__(), pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___iter__(data):\n modin_series, pandas_series = create_test_series(data)\n for m, p in zip(modin_series.__iter__(), pandas_series.__iter__()):\n np.testing.assert_equal(m, p)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___le__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__le__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___len__(data):\n modin_series, pandas_series = create_test_series(data)\n assert len(modin_series) == len(pandas_series)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___long__(data):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series[0].__long__()\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series[0].__long__()\n else:\n assert modin_series[0].__long__() == pandas_result\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___lt__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__lt__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___mod__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__mod__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___mul__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__mul__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___ne__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__ne__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___neg__(request, data):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.__neg__()\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_series.__neg__())\n else:\n df_equals(modin_series.__neg__(), pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test___or___test___pow__.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___or___test___pow__.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 520, "end_line": 535, "span_ids": ["test___or__", "test___pow__"], "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.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___or__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(\n modin_series,\n pandas_series,\n \"__or__\",\n # https://github.com/modin-project/modin/issues/5966\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___pow__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__pow__\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___repr___test___repr__.assert_repr_modin_series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___repr___test___repr__.assert_repr_modin_series_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 538, "end_line": 559, "span_ids": ["test___repr__"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"name\", [\"Dates\", None])\n@pytest.mark.parametrize(\n \"dt_index\", [True, False], ids=[\"dt_index_true\", \"dt_index_false\"]\n)\n@pytest.mark.parametrize(\n \"data\",\n [*test_data_values, \"empty\"],\n ids=[*test_data_keys, \"empty\"],\n)\ndef test___repr__(name, dt_index, data):\n if data == \"empty\":\n modin_series, pandas_series = pd.Series(), pandas.Series()\n else:\n modin_series, pandas_series = create_test_series(data)\n pandas_series.name = modin_series.name = name\n if dt_index:\n index = pandas.date_range(\n \"1/1/2000\", periods=len(pandas_series.index), freq=\"T\"\n )\n pandas_series.index = modin_series.index = index\n\n assert repr(modin_series) == repr(pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___repr__4186_test___setitem__.for_key_in_modin_series_k.df_equals_modin_series_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___repr__4186_test___setitem__.for_key_in_modin_series_k.df_equals_modin_series_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 562, "end_line": 581, "span_ids": ["test___setitem__", "test___round__", "test___repr__4186"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test___repr__4186():\n modin_series, pandas_series = create_test_series(\n [\"a\", \"b\", \"c\", \"a\"], dtype=\"category\"\n )\n assert repr(modin_series) == repr(pandas_series)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___round__(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(round(modin_series), round(pandas_series))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___setitem__(data):\n modin_series, pandas_series = create_test_series(data)\n for key in modin_series.keys():\n modin_series[key] = 0\n pandas_series[key] = 0\n df_equals(modin_series, pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___setitem___non_hashable_test___setitem___non_hashable.df_equals_md_sr_pd_sr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___setitem___non_hashable_test___setitem___non_hashable.df_equals_md_sr_pd_sr_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 584, "end_line": 614, "span_ids": ["test___setitem___non_hashable"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"key\",\n [\n pytest.param(lambda idx: slice(1, 3), id=\"location_based_slice\"),\n pytest.param(lambda idx: slice(idx[1], idx[-1]), id=\"index_based_slice\"),\n pytest.param(lambda idx: [idx[0], idx[2], idx[-1]], id=\"list_of_labels\"),\n pytest.param(\n lambda idx: [True if i % 2 else False for i in range(len(idx))],\n id=\"boolean_mask\",\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"index\",\n [\n pytest.param(\n lambda idx_len: [chr(x) for x in range(ord(\"a\"), ord(\"a\") + idx_len)],\n id=\"str_index\",\n ),\n pytest.param(lambda idx_len: list(range(1, idx_len + 1)), id=\"int_index\"),\n ],\n)\ndef test___setitem___non_hashable(key, index):\n data = np.arange(5)\n index = index(len(data))\n key = key(index)\n md_sr, pd_sr = create_test_series(data, index=index)\n\n md_sr[key] = 10\n pd_sr[key] = 10\n df_equals(md_sr, pd_sr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___sizeof___test_add_custom_class.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test___sizeof___test_add_custom_class.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 617, "end_line": 706, "span_ids": ["test_add_suffix", "test_add_does_not_change_original_series_name", "test___xor__", "test_add", "test_add_custom_class", "test_abs", "test___str__", "test___truediv__", "test___sub__", "test_add_prefix", "test___sizeof__"], "tokens": 732}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\ndef test___sizeof__(data):\n modin_series, pandas_series = create_test_series(data)\n with warns_that_defaulting_to_pandas():\n modin_series.__sizeof__()\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___str__(data):\n modin_series, pandas_series = create_test_series(data)\n assert str(modin_series) == str(pandas_series)\n\n\n@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/272\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___sub__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__sub__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___truediv__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"__truediv__\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test___xor__(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(\n modin_series,\n pandas_series,\n \"__xor__\",\n # https://github.com/modin-project/modin/issues/5966\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_abs(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.abs(), pandas_series.abs())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_add(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"add\")\n\n\ndef test_add_does_not_change_original_series_name():\n # See https://github.com/modin-project/modin/issues/5232\n s1 = pd.Series(1, name=1)\n s2 = pd.Series(2, name=2)\n original_s1 = s1.copy(deep=True)\n original_s2 = s2.copy(deep=True)\n _ = s1 + s2\n df_equals(s1, original_s1)\n df_equals(s2, original_s2)\n\n\n@pytest.mark.parametrize(\"axis\", [None, 0, 1])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_add_prefix(data, axis):\n eval_general(\n *create_test_series(data),\n lambda df: df.add_prefix(\"PREFIX_ADD_\", axis=axis),\n )\n\n\n@pytest.mark.parametrize(\"axis\", [None, 0, 1])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_add_suffix(data, axis):\n eval_general(\n *create_test_series(data),\n lambda df: df.add_suffix(\"SUFFIX_ADD_\", axis=axis),\n )\n\n\ndef test_add_custom_class():\n # see https://github.com/modin-project/modin/issues/5236\n # Test that we can add any object that is addable to pandas object data\n # via \"+\".\n eval_general(\n *create_test_series(test_data[\"int_data\"]),\n lambda df: df + CustomIntegerForAddition(4),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_agg_test_agg_numeric.if_name_contains_request_.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_agg_test_agg_numeric.if_name_contains_request_.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 709, "end_line": 740, "span_ids": ["test_agg_except", "test_agg_numeric", "test_agg"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_agg(data, func):\n eval_general(\n *create_test_series(data),\n lambda df: df.agg(func),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_agg_except(data, func):\n # SpecificationError is arisen because we treat a Series as a DataFrame.\n # See details in pandas issue 36036.\n with pytest.raises(SpecificationError):\n eval_general(\n *create_test_series(data),\n lambda df: df.agg(func),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_agg_numeric(request, data, func):\n if name_contains(request.node.name, numeric_agg_funcs) and name_contains(\n request.node.name, numeric_dfs\n ):\n axis = 0\n eval_general(\n *create_test_series(data),\n lambda df: df.agg(func, axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_agg_numeric_except_test_agg_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_agg_numeric_except_test_agg_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 743, "end_line": 756, "span_ids": ["test_agg_numeric_except"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_agg_numeric_except(request, data, func):\n if name_contains(request.node.name, numeric_agg_funcs) and name_contains(\n request.node.name, numeric_dfs\n ):\n axis = 0\n # SpecificationError is arisen because we treat a Series as a DataFrame.\n # See details in pandas issue 36036.\n with pytest.raises(SpecificationError):\n eval_general(\n *create_test_series(data),\n lambda df: df.agg(func, axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_test_aggregate_numeric.if_name_contains_request_.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_test_aggregate_numeric.if_name_contains_request_.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 759, "end_line": 792, "span_ids": ["test_aggregate", "test_aggregate_numeric", "test_aggregate_except"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_aggregate(data, func):\n axis = 0\n eval_general(\n *create_test_series(data),\n lambda df: df.aggregate(func, axis),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_aggregate_except(data, func):\n axis = 0\n # SpecificationError is arisen because we treat a Series as a DataFrame.\n # See details in pandas issues 36036.\n with pytest.raises(SpecificationError):\n eval_general(\n *create_test_series(data),\n lambda df: df.aggregate(func, axis),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_aggregate_numeric(request, data, func):\n if name_contains(request.node.name, numeric_agg_funcs) and name_contains(\n request.node.name, numeric_dfs\n ):\n axis = 0\n eval_general(\n *create_test_series(data),\n lambda df: df.agg(func, axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_numeric_except_test_aggregate_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_numeric_except_test_aggregate_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 795, "end_line": 808, "span_ids": ["test_aggregate_numeric_except"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_aggregate_numeric_except(request, data, func):\n if name_contains(request.node.name, numeric_agg_funcs) and name_contains(\n request.node.name, numeric_dfs\n ):\n axis = 0\n # SpecificationError is arisen because we treat a Series as a DataFrame.\n # See details in pandas issues 36036.\n with pytest.raises(SpecificationError):\n eval_general(\n *create_test_series(data),\n lambda df: df.agg(func, axis),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_error_checking_test_aggregate_error_checking.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_aggregate_error_checking_test_aggregate_error_checking.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 811, "end_line": 833, "span_ids": ["test_aggregate_error_checking"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_aggregate_error_checking(data):\n modin_series, pandas_series = create_test_series(data)\n\n assert pandas_series.aggregate(\"ndim\") == 1\n assert modin_series.aggregate(\"ndim\") == 1\n\n def user_warning_checker(series, fn):\n if isinstance(series, pd.Series):\n with warns_that_defaulting_to_pandas():\n return fn(series)\n return fn(series)\n\n eval_general(\n modin_series,\n pandas_series,\n lambda series: user_warning_checker(\n series, fn=lambda series: series.aggregate(\"cumproduct\")\n ),\n )\n eval_general(\n modin_series, pandas_series, lambda series: series.aggregate(\"NOT_EXISTS\")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_align_test_any.eval_general_create_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_align_test_any.eval_general_create_test", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 836, "end_line": 856, "span_ids": ["test_all", "test_any", "test_align"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_align(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.align(modin_series)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_all(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.all(skipna=skipna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_any(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.any(skipna=skipna))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_append_test_append.for_verify_integrity_in_v.None_1.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_append_test_append.for_verify_integrity_in_v.None_1.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 859, "end_line": 924, "span_ids": ["test_append"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_append(data):\n modin_series, pandas_series = create_test_series(data)\n\n data_to_append = {\"append_a\": 2, \"append_b\": 1000}\n\n ignore_idx_values = [True, False]\n\n for ignore in ignore_idx_values:\n try:\n pandas_result = pandas_series.append(data_to_append, ignore_index=ignore)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.append(data_to_append, ignore_index=ignore)\n else:\n modin_result = modin_series.append(data_to_append, ignore_index=ignore)\n df_equals(modin_result, pandas_result)\n\n try:\n pandas_result = pandas_series.append(pandas_series.iloc[-1])\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.append(modin_series.iloc[-1])\n else:\n modin_result = modin_series.append(modin_series.iloc[-1])\n df_equals(modin_result, pandas_result)\n\n try:\n pandas_result = pandas_series.append([pandas_series.iloc[-1]])\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.append([modin_series.iloc[-1]])\n else:\n modin_result = modin_series.append([modin_series.iloc[-1]])\n df_equals(modin_result, pandas_result)\n\n verify_integrity_values = [True, False]\n\n for verify_integrity in verify_integrity_values:\n try:\n pandas_result = pandas_series.append(\n [pandas_series, pandas_series], verify_integrity=verify_integrity\n )\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.append(\n [modin_series, modin_series], verify_integrity=verify_integrity\n )\n else:\n modin_result = modin_series.append(\n [modin_series, modin_series], verify_integrity=verify_integrity\n )\n df_equals(modin_result, pandas_result)\n\n try:\n pandas_result = pandas_series.append(\n pandas_series, verify_integrity=verify_integrity\n )\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.append(modin_series, verify_integrity=verify_integrity)\n else:\n modin_result = modin_series.append(\n modin_series, verify_integrity=verify_integrity\n )\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_apply_test_apply_except.with_pytest_raises_Specif.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_test_apply_except.with_pytest_raises_Specif.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 927, "end_line": 945, "span_ids": ["test_apply", "test_apply_except"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_apply(data, func):\n eval_general(\n *create_test_series(data),\n lambda df: df.apply(func),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_apply_except(data, func):\n # SpecificationError is arisen because we treat a Series as a DataFrame.\n # See details in pandas issues 36036.\n with pytest.raises(SpecificationError):\n eval_general(\n *create_test_series(data),\n lambda df: df.apply(func),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_external_lib_test_apply_external_lib.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_external_lib_test_apply_external_lib.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 948, "end_line": 965, "span_ids": ["test_apply_external_lib"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_apply_external_lib():\n json_string = \"\"\"\n {\n \"researcher\": {\n \"name\": \"Ford Prefect\",\n \"species\": \"Betelgeusian\",\n \"relatives\": [\n {\n \"name\": \"Zaphod Beeblebrox\",\n \"species\": \"Betelgeusian\"\n }\n ]\n }\n }\n \"\"\"\n modin_result = pd.DataFrame.from_dict({\"a\": [json_string]}).a.apply(json.loads)\n pandas_result = pandas.DataFrame.from_dict({\"a\": [json_string]}).a.apply(json.loads)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_apply_numeric_test_apply_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_numeric_test_apply_numeric_except.if_name_contains_request_.with_pytest_raises_Specif.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 968, "end_line": 988, "span_ids": ["test_apply_numeric", "test_apply_numeric_except"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_apply_numeric(request, data, func):\n if name_contains(request.node.name, numeric_dfs):\n eval_general(\n *create_test_series(data),\n lambda df: df.apply(func),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_apply_numeric_except(request, data, func):\n if name_contains(request.node.name, numeric_dfs):\n # SpecificationError is arisen because we treat a Series as a DataFrame.\n # See details in pandas issues 36036.\n with pytest.raises(SpecificationError):\n eval_general(\n *create_test_series(data),\n lambda df: df.apply(func),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_text_func_test_apply_text_func.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_apply_text_func_test_apply_text_func.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 991, "end_line": 1010, "span_ids": ["test_apply_text_func"], "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": "@pytest.mark.parametrize(\"axis\", [None, 0, 1])\n@pytest.mark.parametrize(\"level\", [None, -1, 0, 1])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", [\"count\", \"all\", \"kurt\", \"array\", \"searchsorted\"])\ndef test_apply_text_func(level, data, func, axis):\n func_kwargs = {}\n if level:\n func_kwargs.update({\"level\": level})\n if axis:\n func_kwargs.update({\"axis\": axis})\n rows_number = len(next(iter(data.values()))) # length of the first data column\n level_0 = np.random.choice([0, 1, 2], rows_number)\n level_1 = np.random.choice([3, 4, 5], rows_number)\n index = pd.MultiIndex.from_arrays([level_0, level_1])\n\n modin_series, pandas_series = create_test_series(data)\n modin_series.index = index\n pandas_series.index = index\n\n eval_general(modin_series, pandas_series, lambda df: df.apply(func), **func_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_modin-project__modin/modin/pandas/test/test_series.py_test_argmax_test_asfreq.with_warns_that_defaultin.series_asfreq_freq_30S_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_argmax_test_asfreq.with_warns_that_defaultin.series_asfreq_freq_30S_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1013, "end_line": 1041, "span_ids": ["test_argmax", "test_asfreq", "test_argsort", "test_argmin"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"skipna\", [True, False])\ndef test_argmax(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.argmax(skipna=skipna), pandas_series.argmax(skipna=skipna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"skipna\", [True, False])\ndef test_argmin(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.argmin(skipna=skipna), pandas_series.argmin(skipna=skipna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_argsort(data):\n modin_series, pandas_series = create_test_series(data)\n with warns_that_defaulting_to_pandas():\n modin_result = modin_series.argsort()\n df_equals(modin_result, pandas_series.argsort())\n\n\ndef test_asfreq():\n index = pd.date_range(\"1/1/2000\", periods=4, freq=\"T\")\n series = pd.Series([0.0, None, 2.0, 3.0], index=index)\n with warns_that_defaulting_to_pandas():\n # We are only testing that this defaults to pandas, so we will just check for\n # the warning\n series.asfreq(freq=\"30S\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_asof_test_asof.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_asof_test_asof.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1044, "end_line": 1075, "span_ids": ["test_asof"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"where\",\n [\n 20,\n 30,\n [10, 40],\n [20, 30],\n [20],\n 25,\n [25, 45],\n [25, 30],\n pandas.Index([20, 30]),\n pandas.Index([10]),\n ],\n)\ndef test_asof(where):\n # With NaN:\n values = [1, 2, np.nan, 4]\n index = [10, 20, 30, 40]\n modin_series, pandas_series = (\n pd.Series(values, index=index),\n pandas.Series(values, index=index),\n )\n df_equals(modin_series.asof(where), pandas_series.asof(where))\n\n # No NaN:\n values = [1, 2, 7, 4]\n modin_series, pandas_series = (\n pd.Series(values, index=index),\n pandas.Series(values, index=index),\n )\n df_equals(modin_series.asof(where), pandas_series.asof(where))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_asof_large_test_asof_large.df_equals_modin_series_as": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_asof_large_test_asof_large.df_equals_modin_series_as", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1078, "end_line": 1089, "span_ids": ["test_asof_large"], "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": "@pytest.mark.parametrize(\n \"where\",\n [20, 30, [10.5, 40.5], [10], pandas.Index([20, 30]), pandas.Index([10.5])],\n)\ndef test_asof_large(where):\n values = test_data[\"float_nan_data\"][\"col1\"]\n index = list(range(len(values)))\n modin_series, pandas_series = (\n pd.Series(values, index=index),\n pandas.Series(values, index=index),\n )\n df_equals(modin_series.asof(where), pandas_series.asof(where))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_test_astype._dict_to_astype_for_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_test_astype._dict_to_astype_for_a_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1092, "end_line": 1142, "span_ids": ["test_astype"], "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": "@pytest.mark.parametrize(\n \"data\",\n [\n test_data[\"int_data\"],\n pytest.param(\n test_data[\"float_nan_data\"],\n marks=pytest.mark.xfail(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK does not raise IntCastingNaNError\",\n ),\n ),\n ],\n ids=test_data_keys,\n)\ndef test_astype(data):\n modin_series, pandas_series = create_test_series(data)\n series_name = \"test_series\"\n modin_series.name = pandas_series.name = series_name\n try:\n pandas_result = pandas_series.astype(str)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_series.astype(str)) # repr to force materialization\n else:\n df_equals(modin_series.astype(str), pandas_result)\n\n try:\n pandas_result = pandas_series.astype(np.int64)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_series.astype(np.int64)) # repr to force materialization\n else:\n df_equals(modin_series.astype(np.int64), pandas_result)\n\n try:\n pandas_result = pandas_series.astype(np.float64)\n except Exception as err:\n with pytest.raises(type(err)):\n repr(modin_series.astype(np.float64)) # repr to force materialization\n else:\n df_equals(modin_series.astype(np.float64), pandas_result)\n\n df_equals(\n modin_series.astype({series_name: str}),\n pandas_series.astype({series_name: str}),\n )\n\n eval_general(modin_series, pandas_series, lambda df: df.astype({\"wrong_name\": str}))\n\n # TODO(https://github.com/modin-project/modin/issues/4317): Test passing a\n # dict to astype() for a series with no 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_modin-project__modin/modin/pandas/test/test_series.py_test_astype_categorical_test_astype_categorical.assert_modin_result_dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_categorical_test_astype_categorical.assert_modin_result_dtype", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1145, "end_line": 1154, "span_ids": ["test_astype_categorical"], "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": "@pytest.mark.parametrize(\n \"data\", [[\"A\", \"A\", \"B\", \"B\", \"A\"], [1, 1, 2, 1, 2, 2, 3, 1, 2, 1, 2]]\n)\ndef test_astype_categorical(data):\n modin_df, pandas_df = create_test_series(data)\n\n modin_result = modin_df.astype(\"category\")\n pandas_result = pandas_df.astype(\"category\")\n df_equals(modin_result, pandas_result)\n assert modin_result.dtype == pandas_result.dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_categorical_issue5722_test_astype_categorical_issue5722.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_astype_categorical_issue5722_test_astype_categorical_issue5722.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1157, "end_line": 1183, "span_ids": ["test_astype_categorical_issue5722"], "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": "@pytest.mark.parametrize(\"data\", [[\"a\", \"a\", \"b\", \"c\", \"c\", \"d\", \"b\", \"d\"]])\n@pytest.mark.parametrize(\n \"set_min_partition_size\",\n [2, 4],\n ids=[\"four_partitions\", \"two_partitions\"],\n indirect=True,\n)\ndef test_astype_categorical_issue5722(data, set_min_partition_size):\n modin_series, pandas_series = create_test_series(data)\n\n modin_result = modin_series.astype(\"category\")\n pandas_result = pandas_series.astype(\"category\")\n df_equals(modin_result, pandas_result)\n assert modin_result.dtype == pandas_result.dtype\n\n pandas_result1, pandas_result2 = pandas_result.iloc[:4], pandas_result.iloc[4:]\n modin_result1, modin_result2 = modin_result.iloc[:4], modin_result.iloc[4:]\n\n # check categories\n assert pandas_result1.cat.categories.equals(pandas_result2.cat.categories)\n assert modin_result1.cat.categories.equals(modin_result2.cat.categories)\n assert pandas_result1.cat.categories.equals(modin_result1.cat.categories)\n assert pandas_result2.cat.categories.equals(modin_result2.cat.categories)\n\n # check codes\n assert_array_equal(pandas_result1.cat.codes.values, modin_result1.cat.codes.values)\n assert_array_equal(pandas_result2.cat.codes.values, modin_result2.cat.codes.values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_at_test_at_time.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_at_test_at_time.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1186, "end_line": 1202, "span_ids": ["test_at", "test_at_time"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_at(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series.at[modin_series.index[0]], pandas_series.at[pandas_series.index[0]]\n )\n df_equals(\n modin_series.at[modin_series.index[-1]], pandas_series[pandas_series.index[-1]]\n )\n\n\ndef test_at_time():\n i = pd.date_range(\"2008-01-01\", periods=1000, freq=\"12H\")\n modin_series = pd.Series(list(range(1000)), index=i)\n pandas_series = pandas.Series(list(range(1000)), index=i)\n df_equals(modin_series.at_time(\"12:00\"), pandas_series.at_time(\"12:00\"))\n df_equals(modin_series.at_time(\"3:00\"), pandas_series.at_time(\"3:00\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_autocorr_test_between.with_pytest_raises_NotImp.modin_series_between_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_autocorr_test_between.with_pytest_raises_NotImp.modin_series_between_None", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1205, "end_line": 1239, "span_ids": ["test_axes", "test_array", "test_autocorr", "test_between", "test_attrs"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"lag\", [1, 2, 3])\ndef test_autocorr(data, lag):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.autocorr(lag=lag)\n pandas_result = pandas_series.autocorr(lag=lag)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_axes(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.axes[0].equals(pandas_series.axes[0])\n assert len(modin_series.axes) == len(pandas_series.axes)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_attrs(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda df: df.attrs)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_array(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda df: df.array)\n\n\n@pytest.mark.xfail(reason=\"Using pandas Series.\")\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_between(data):\n modin_series = create_test_series(data)\n\n with pytest.raises(NotImplementedError):\n modin_series.between(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_modin-project__modin/modin/pandas/test/test_series.py_test_between_time_test_between_time.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_between_time_test_between_time.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1242, "end_line": 1257, "span_ids": ["test_between_time"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_between_time():\n i = pd.date_range(\"2008-01-01\", periods=1000, freq=\"12H\")\n modin_series = pd.Series(list(range(1000)), index=i)\n pandas_series = pandas.Series(list(range(1000)), index=i)\n df_equals(\n modin_series.between_time(\"12:00\", \"17:00\"),\n pandas_series.between_time(\"12:00\", \"17:00\"),\n )\n df_equals(\n modin_series.between_time(\"3:00\", \"8:00\"),\n pandas_series.between_time(\"3:00\", \"8:00\"),\n )\n df_equals(\n modin_series.between_time(\"3:00\", \"8:00\", inclusive=\"right\"),\n pandas_series.between_time(\"3:00\", \"8:00\", inclusive=\"right\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_add_series_to_timedeltaindex_test_bool.None_1.modin_series___bool___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_add_series_to_timedeltaindex_test_bool.None_1.modin_series___bool___", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1260, "end_line": 1287, "span_ids": ["test_bool", "test_bfill", "test_add_series_to_timedeltaindex"], "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": "def test_add_series_to_timedeltaindex():\n # Make a pandas.core.indexes.timedeltas.TimedeltaIndex\n deltas = pd.to_timedelta([1], unit=\"h\")\n test_series = create_test_series(np.datetime64(\"2000-12-12\"))\n eval_general(*test_series, lambda s: s + deltas)\n eval_general(*test_series, lambda s: s - deltas)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_bfill(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.bfill(), pandas_series.bfill())\n # inplace\n modin_series_cp = modin_series.copy()\n pandas_series_cp = pandas_series.copy()\n modin_series_cp.bfill(inplace=True)\n pandas_series_cp.bfill(inplace=True)\n df_equals(modin_series_cp, pandas_series_cp)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_bool(data):\n modin_series, _ = create_test_series(data)\n\n with pytest.raises(ValueError):\n modin_series.bool()\n with pytest.raises(ValueError):\n modin_series.__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_modin-project__modin/modin/pandas/test/test_series.py_test_clip_scalar_test_clip_scalar.if_name_contains_request_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_clip_scalar_test_clip_scalar.if_name_contains_request_.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1290, "end_line": 1309, "span_ids": ["test_clip_scalar"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"bound_type\", [\"list\", \"series\"], ids=[\"list\", \"series\"])\ndef test_clip_scalar(request, data, bound_type):\n modin_series, pandas_series = create_test_series(\n data,\n )\n\n if name_contains(request.node.name, numeric_dfs):\n # set bounds\n lower, upper = np.sort(random_state.random_integers(RAND_LOW, RAND_HIGH, 2))\n\n # test only upper scalar bound\n modin_result = modin_series.clip(None, upper)\n pandas_result = pandas_series.clip(None, upper)\n df_equals(modin_result, pandas_result)\n\n # test lower and upper scalar bound\n modin_result = modin_series.clip(lower, upper)\n pandas_result = pandas_series.clip(lower, upper)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_clip_sequence_test_clip_sequence.if_name_contains_request_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_clip_sequence_test_clip_sequence.if_name_contains_request_.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1312, "end_line": 1340, "span_ids": ["test_clip_sequence"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"bound_type\", [\"list\", \"series\"], ids=[\"list\", \"series\"])\ndef test_clip_sequence(request, data, bound_type):\n modin_series, pandas_series = create_test_series(\n data,\n )\n\n if name_contains(request.node.name, numeric_dfs):\n lower = random_state.random_integers(RAND_LOW, RAND_HIGH, len(pandas_series))\n upper = random_state.random_integers(RAND_LOW, RAND_HIGH, len(pandas_series))\n\n if bound_type == \"series\":\n modin_lower = pd.Series(lower)\n pandas_lower = pandas.Series(lower)\n modin_upper = pd.Series(upper)\n pandas_upper = pandas.Series(upper)\n else:\n modin_lower = pandas_lower = lower\n modin_upper = pandas_upper = upper\n\n # test lower and upper list bound\n modin_result = modin_series.clip(modin_lower, modin_upper, axis=0)\n pandas_result = pandas_series.clip(pandas_lower, pandas_upper)\n df_equals(modin_result, pandas_result)\n\n # test only upper list bound\n modin_result = modin_series.clip(np.nan, modin_upper, axis=0)\n pandas_result = pandas_series.clip(np.nan, pandas_upper)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_combine_test_combine.modin_series_combine_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_combine_test_combine.modin_series_combine_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1343, "end_line": 1351, "span_ids": ["test_combine"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/271\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_combine(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n modin_series2 = modin_series % (max(modin_series) // 2)\n modin_series.combine(modin_series2, lambda s1, s2: s1 if s1 < s2 else s2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_combine_first_test_combine_first.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_combine_first_test_combine_first.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1354, "end_line": 1365, "span_ids": ["test_combine_first"], "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 StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/271\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_combine_first(data):\n modin_series, pandas_series = create_test_series(data)\n modin_series2 = modin_series % (max(modin_series) // 2)\n pandas_series2 = pandas_series % (max(pandas_series) // 2)\n modin_result = modin_series.combine_first(modin_series2)\n pandas_result = pandas_series.combine_first(pandas_series2)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_compress_test_constructor.df_equals_pd_Series_modin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_compress_test_constructor.df_equals_pd_Series_modin", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1368, "end_line": 1384, "span_ids": ["test_constructor", "test_compress"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_compress(data):\n modin_series, pandas_series = create_test_series(data) # noqa: F841\n try:\n pandas_series.compress(pandas_series > 30)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.compress(modin_series > 30)\n else:\n modin_series.compress(modin_series > 30)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_constructor(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series, pandas_series)\n df_equals(pd.Series(modin_series), pandas.Series(pandas_series))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_constructor_columns_and_index_test_constructor_columns_and_index.with_pytest_raises_NotImp.pd_Series_modin_series_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_constructor_columns_and_index_test_constructor_columns_and_index.with_pytest_raises_NotImp.pd_Series_modin_series_i", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1387, "end_line": 1401, "span_ids": ["test_constructor_columns_and_index"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_constructor_columns_and_index():\n modin_series = pd.Series([1, 1, 10], index=[1, 2, 3], name=\"health\")\n pandas_series = pandas.Series([1, 1, 10], index=[1, 2, 3], name=\"health\")\n df_equals(modin_series, pandas_series)\n df_equals(pd.Series(modin_series), pandas.Series(pandas_series))\n df_equals(\n pd.Series(modin_series, name=\"max_speed\"),\n pandas.Series(pandas_series, name=\"max_speed\"),\n )\n df_equals(\n pd.Series(modin_series, index=[1, 2]),\n pandas.Series(pandas_series, index=[1, 2]),\n )\n with pytest.raises(NotImplementedError):\n pd.Series(modin_series, index=[1, 2, 99999])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_copy_test_cov.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_copy_test_cov.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1404, "end_line": 1435, "span_ids": ["test_copy", "test_count", "test_corr", "test_cov"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_copy(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series, modin_series.copy())\n df_equals(modin_series.copy(), pandas_series)\n df_equals(modin_series.copy(), pandas_series.copy())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_corr(data):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.corr(modin_series)\n pandas_result = pandas_series.corr(pandas_series)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\n \"data\",\n test_data_values + test_data_large_categorical_series_values,\n ids=test_data_keys + test_data_large_categorical_series_keys,\n)\ndef test_count(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.count(), pandas_series.count())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_cov(data):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.cov(modin_series)\n pandas_result = pandas_series.cov(pandas_series)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cummax_test_cummax.try_.else_.df_equals_modin_series_cu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cummax_test_cummax.try_.else_.df_equals_modin_series_cu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1438, "end_line": 1450, "span_ids": ["test_cummax"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_cummax(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.cummax(skipna=skipna)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.cummax(skipna=skipna)\n else:\n df_equals(modin_series.cummax(skipna=skipna), pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cummin_test_cummin.try_.else_.df_equals_modin_series_cu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cummin_test_cummin.try_.else_.df_equals_modin_series_cu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1453, "end_line": 1465, "span_ids": ["test_cummin"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_cummin(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.cummin(skipna=skipna)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.cummin(skipna=skipna)\n else:\n df_equals(modin_series.cummin(skipna=skipna), pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cumprod_test_cumprod.try_.else_.df_equals_modin_series_cu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cumprod_test_cumprod.try_.else_.df_equals_modin_series_cu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1468, "end_line": 1480, "span_ids": ["test_cumprod"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_cumprod(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.cumprod(skipna=skipna)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.cumprod(skipna=skipna)\n else:\n df_equals(modin_series.cumprod(skipna=skipna), pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cumsum_test_cumsum.try_.else_.df_equals_modin_series_cu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cumsum_test_cumsum.try_.else_.df_equals_modin_series_cu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1483, "end_line": 1495, "span_ids": ["test_cumsum"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_cumsum(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.cumsum(skipna=skipna)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.cumsum(skipna=skipna)\n else:\n df_equals(modin_series.cumsum(skipna=skipna), pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_describe_test_describe.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_describe_test_describe.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1498, "end_line": 1551, "span_ids": ["test_describe"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_describe(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.describe(), pandas_series.describe())\n percentiles = [0.10, 0.11, 0.44, 0.78, 0.99]\n df_equals(\n modin_series.describe(percentiles=percentiles),\n pandas_series.describe(percentiles=percentiles),\n )\n\n try:\n pandas_result = pandas_series.describe(exclude=[np.float64])\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.describe(exclude=[np.float64])\n else:\n modin_result = modin_series.describe(exclude=[np.float64])\n df_equals(modin_result, pandas_result)\n\n try:\n pandas_result = pandas_series.describe(exclude=np.float64)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.describe(exclude=np.float64)\n else:\n modin_result = modin_series.describe(exclude=np.float64)\n df_equals(modin_result, pandas_result)\n\n try:\n pandas_result = pandas_series.describe(\n include=[np.timedelta64, np.datetime64, np.object_, np.bool_]\n )\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.describe(\n include=[np.timedelta64, np.datetime64, np.object_, np.bool_]\n )\n else:\n modin_result = modin_series.describe(\n include=[np.timedelta64, np.datetime64, np.object_, np.bool_]\n )\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_series.describe(include=str(modin_series.dtypes))\n pandas_result = pandas_series.describe(include=str(pandas_series.dtypes))\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_series.describe(include=[np.number])\n pandas_result = pandas_series.describe(include=[np.number])\n df_equals(modin_result, pandas_result)\n\n df_equals(\n modin_series.describe(include=\"all\"), pandas_series.describe(include=\"all\")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_diff_test_divide.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_diff_test_divide.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1554, "end_line": 1589, "span_ids": ["test_div", "test_diff", "test_divide"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"periods\", int_arg_values, ids=arg_keys(\"periods\", int_arg_keys)\n)\ndef test_diff(data, periods):\n modin_series, pandas_series = create_test_series(data)\n\n try:\n pandas_result = pandas_series.diff(periods=periods)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.diff(periods=periods)\n else:\n modin_result = modin_series.diff(periods=periods)\n df_equals(modin_result, pandas_result)\n\n try:\n pandas_result = pandas_series.T.diff(periods=periods)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.T.diff(periods=periods)\n else:\n modin_result = modin_series.T.diff(periods=periods)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_div(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"div\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_divide(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"divide\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dot_test_dot.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dot_test_dot.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1592, "end_line": 1639, "span_ids": ["test_dot"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dot(data):\n modin_series, pandas_series = create_test_series(data)\n ind_len = len(modin_series)\n\n # Test 1D array input\n arr = np.arange(ind_len)\n modin_result = modin_series.dot(arr)\n pandas_result = pandas_series.dot(arr)\n df_equals(modin_result, pandas_result)\n\n # Test 2D array input\n arr = np.arange(ind_len * 2).reshape(ind_len, 2)\n modin_result = modin_series.dot(arr)\n pandas_result = pandas_series.dot(arr)\n assert_array_equal(modin_result, pandas_result)\n\n # Test bad dimensions\n with pytest.raises(ValueError):\n modin_series.dot(np.arange(ind_len + 10))\n\n # Test dataframe input\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_result = modin_series.dot(modin_df)\n pandas_result = pandas_series.dot(pandas_df)\n df_equals(modin_result, pandas_result)\n\n # Test series input\n modin_series_2 = pd.Series(np.arange(ind_len), index=modin_series.index)\n pandas_series_2 = pandas.Series(np.arange(ind_len), index=pandas_series.index)\n modin_result = modin_series.dot(modin_series_2)\n pandas_result = pandas_series.dot(pandas_series_2)\n df_equals(modin_result, pandas_result)\n\n # Test when input series index doesn't line up with columns\n with pytest.raises(ValueError):\n modin_series.dot(\n pd.Series(\n np.arange(ind_len), index=[\"a\" for _ in range(len(modin_series.index))]\n )\n )\n\n # Test case when left series has size (1 x 1)\n # and right dataframe has size (1 x n)\n modin_result = pd.Series([1]).dot(pd.DataFrame(modin_series).T)\n pandas_result = pandas.Series([1]).dot(pandas.DataFrame(pandas_series).T)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_matmul_test_matmul.None_1.modin_series_pd_Series_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_matmul_test_matmul.None_1.modin_series_pd_Series_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1642, "end_line": 1681, "span_ids": ["test_matmul"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_matmul(data):\n modin_series, pandas_series = create_test_series(data) # noqa: F841\n ind_len = len(modin_series)\n\n # Test 1D array input\n arr = np.arange(ind_len)\n modin_result = modin_series @ arr\n pandas_result = pandas_series @ arr\n df_equals(modin_result, pandas_result)\n\n # Test 2D array input\n arr = np.arange(ind_len * 2).reshape(ind_len, 2)\n modin_result = modin_series @ arr\n pandas_result = pandas_series @ arr\n assert_array_equal(modin_result, pandas_result)\n\n # Test bad dimensions\n with pytest.raises(ValueError):\n modin_series @ np.arange(ind_len + 10)\n\n # Test dataframe input\n modin_df = pd.DataFrame(data)\n pandas_df = pandas.DataFrame(data)\n modin_result = modin_series @ modin_df\n pandas_result = pandas_series @ pandas_df\n df_equals(modin_result, pandas_result)\n\n # Test series input\n modin_series_2 = pd.Series(np.arange(ind_len), index=modin_series.index)\n pandas_series_2 = pandas.Series(np.arange(ind_len), index=pandas_series.index)\n modin_result = modin_series @ modin_series_2\n pandas_result = pandas_series @ pandas_series_2\n df_equals(modin_result, pandas_result)\n\n # Test when input series index doesn't line up with columns\n with pytest.raises(ValueError):\n modin_series @ pd.Series(\n np.arange(ind_len), index=[\"a\" for _ in range(len(modin_series.index))]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_drop_test_drop_duplicates.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_drop_test_drop_duplicates.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1684, "end_line": 1705, "span_ids": ["test_drop", "test_drop_duplicates"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(reason=\"Using pandas Series.\")\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_drop(data):\n modin_series = create_test_series(data)\n\n with pytest.raises(NotImplementedError):\n modin_series.drop(None, None, None, None)\n\n\n@pytest.mark.parametrize(\n \"data\", test_data_with_duplicates_values, ids=test_data_with_duplicates_keys\n)\n@pytest.mark.parametrize(\n \"keep\", [\"last\", \"first\", False], ids=[\"last\", \"first\", \"False\"]\n)\n@pytest.mark.parametrize(\"inplace\", [True, False], ids=[\"True\", \"False\"])\ndef test_drop_duplicates(data, keep, inplace):\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series.drop_duplicates(keep=keep, inplace=inplace),\n pandas_series.drop_duplicates(keep=keep, inplace=inplace),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dropna_test_dtype.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dropna_test_dtype.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1708, "end_line": 1740, "span_ids": ["test_dropna", "test_dropna_inplace", "test_dtype_empty", "test_dtype"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"how\", [\"any\", \"all\"], ids=[\"any\", \"all\"])\ndef test_dropna(data, how):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.dropna(how=how)\n pandas_result = pandas_series.dropna(how=how)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dropna_inplace(data):\n modin_series, pandas_series = create_test_series(data)\n pandas_result = pandas_series.dropna()\n modin_series.dropna(inplace=True)\n df_equals(modin_series, pandas_result)\n\n modin_series, pandas_series = create_test_series(data)\n pandas_series.dropna(how=\"any\", inplace=True)\n modin_series.dropna(how=\"any\", inplace=True)\n df_equals(modin_series, pandas_series)\n\n\ndef test_dtype_empty():\n modin_series, pandas_series = pd.Series(), pandas.Series()\n assert modin_series.dtype == pandas_series.dtype\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_dtype(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.dtype, modin_series.dtypes)\n df_equals(modin_series.dtype, pandas_series.dtype)\n df_equals(modin_series.dtype, pandas_series.dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__Bug_https_github_com__test_dt.None_32": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__Bug_https_github_com__test_dt.None_32", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1743, "end_line": 1811, "span_ids": ["test_dt", "test_dtype"], "tokens": 849}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Bug https://github.com/modin-project/modin/issues/4436 in\n# Series.dt.to_pydatetime is only reproducible when the date range out of which\n# the frame is created has timezone None, so that its dtype is datetime64[ns]\n# as opposed to, e.g. datetime64[ns, Europe/Berlin]. To reproduce that bug, we\n# use timezones None and Europe/Berlin.\n@pytest.mark.parametrize(\n \"timezone\",\n [\n pytest.param(None),\n pytest.param(\n \"Europe/Berlin\",\n marks=pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK is unable to store TZ in the table schema\",\n ),\n ),\n ],\n)\ndef test_dt(timezone):\n data = pd.date_range(\"2016-12-31\", periods=128, freq=\"D\", tz=timezone)\n modin_series = pd.Series(data)\n pandas_series = pandas.Series(data)\n\n df_equals(modin_series.dt.date, pandas_series.dt.date)\n df_equals(modin_series.dt.time, pandas_series.dt.time)\n df_equals(modin_series.dt.timetz, pandas_series.dt.timetz)\n df_equals(modin_series.dt.year, pandas_series.dt.year)\n df_equals(modin_series.dt.month, pandas_series.dt.month)\n df_equals(modin_series.dt.day, pandas_series.dt.day)\n df_equals(modin_series.dt.hour, pandas_series.dt.hour)\n df_equals(modin_series.dt.minute, pandas_series.dt.minute)\n df_equals(modin_series.dt.second, pandas_series.dt.second)\n df_equals(modin_series.dt.microsecond, pandas_series.dt.microsecond)\n df_equals(modin_series.dt.nanosecond, pandas_series.dt.nanosecond)\n df_equals(modin_series.dt.dayofweek, pandas_series.dt.dayofweek)\n df_equals(modin_series.dt.day_of_week, pandas_series.dt.day_of_week)\n df_equals(modin_series.dt.weekday, pandas_series.dt.weekday)\n df_equals(modin_series.dt.dayofyear, pandas_series.dt.dayofyear)\n df_equals(modin_series.dt.day_of_year, pandas_series.dt.day_of_year)\n df_equals(modin_series.dt.unit, pandas_series.dt.unit)\n df_equals(modin_series.dt.as_unit(\"s\"), pandas_series.dt.as_unit(\"s\"))\n df_equals(modin_series.dt.isocalendar(), pandas_series.dt.isocalendar())\n df_equals(modin_series.dt.quarter, pandas_series.dt.quarter)\n df_equals(modin_series.dt.is_month_start, pandas_series.dt.is_month_start)\n df_equals(modin_series.dt.is_month_end, pandas_series.dt.is_month_end)\n df_equals(modin_series.dt.is_quarter_start, pandas_series.dt.is_quarter_start)\n df_equals(modin_series.dt.is_quarter_end, pandas_series.dt.is_quarter_end)\n df_equals(modin_series.dt.is_year_start, pandas_series.dt.is_year_start)\n df_equals(modin_series.dt.is_year_end, pandas_series.dt.is_year_end)\n df_equals(modin_series.dt.is_leap_year, pandas_series.dt.is_leap_year)\n df_equals(modin_series.dt.daysinmonth, pandas_series.dt.daysinmonth)\n df_equals(modin_series.dt.days_in_month, pandas_series.dt.days_in_month)\n assert modin_series.dt.tz == pandas_series.dt.tz\n assert modin_series.dt.freq == pandas_series.dt.freq\n df_equals(modin_series.dt.to_period(\"W\"), pandas_series.dt.to_period(\"W\"))\n assert_array_equal(\n modin_series.dt.to_pydatetime(), pandas_series.dt.to_pydatetime()\n )\n df_equals(\n modin_series.dt.tz_localize(None),\n pandas_series.dt.tz_localize(None),\n )\n if timezone:\n df_equals(\n modin_series.dt.tz_convert(tz=\"Europe/Berlin\"),\n pandas_series.dt.tz_convert(tz=\"Europe/Berlin\"),\n )\n\n df_equals(modin_series.dt.normalize(), pandas_series.dt.normalize())\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_modin-project__modin/modin/pandas/test/test_series.py_test_dt.None_33_test_dt.None_49": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dt.None_33_test_dt.None_49", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1812, "end_line": 1842, "span_ids": ["test_dt"], "tokens": 487}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"timezone\",\n [\n pytest.param(None),\n pytest.param(\n \"Europe/Berlin\",\n marks=pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK is unable to store TZ in the table schema\",\n ),\n ),\n ],\n)\ndef test_dt(timezone):\n # ... other code\n df_equals(\n modin_series.dt.strftime(\"%B %d, %Y, %r\"),\n pandas_series.dt.strftime(\"%B %d, %Y, %r\"),\n )\n df_equals(modin_series.dt.round(\"H\"), pandas_series.dt.round(\"H\"))\n df_equals(modin_series.dt.floor(\"H\"), pandas_series.dt.floor(\"H\"))\n df_equals(modin_series.dt.ceil(\"H\"), pandas_series.dt.ceil(\"H\"))\n df_equals(modin_series.dt.month_name(), pandas_series.dt.month_name())\n df_equals(modin_series.dt.day_name(), pandas_series.dt.day_name())\n\n modin_series = pd.Series(pd.to_timedelta(np.arange(128), unit=\"d\"))\n pandas_series = pandas.Series(pandas.to_timedelta(np.arange(128), unit=\"d\"))\n\n assert_array_equal(\n modin_series.dt.to_pytimedelta(), pandas_series.dt.to_pytimedelta()\n )\n df_equals(modin_series.dt.total_seconds(), pandas_series.dt.total_seconds())\n df_equals(modin_series.dt.days, pandas_series.dt.days)\n df_equals(modin_series.dt.seconds, pandas_series.dt.seconds)\n df_equals(modin_series.dt.microseconds, pandas_series.dt.microseconds)\n df_equals(modin_series.dt.nanoseconds, pandas_series.dt.nanoseconds)\n df_equals(modin_series.dt.components, pandas_series.dt.components)\n\n data_per = pd.date_range(\"1/1/2012\", periods=128, freq=\"M\")\n pandas_series = pandas.Series(data_per, index=data_per).dt.to_period()\n modin_series = pd.Series(data_per, index=data_per).dt.to_period()\n\n df_equals(modin_series.dt.qyear, pandas_series.dt.qyear)\n df_equals(modin_series.dt.start_time, pandas_series.dt.start_time)\n df_equals(modin_series.dt.end_time, pandas_series.dt.end_time)\n df_equals(modin_series.dt.to_timestamp(), pandas_series.dt.to_timestamp())\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_modin-project__modin/modin/pandas/test/test_series.py_test_dt.dt_with_empty_partition_test_dt.if_timezone_is_None_.df_equals_modin_series_dt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_dt.dt_with_empty_partition_test_dt.if_timezone_is_None_.df_equals_modin_series_dt", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1844, "end_line": 1868, "span_ids": ["test_dt"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"timezone\",\n [\n pytest.param(None),\n pytest.param(\n \"Europe/Berlin\",\n marks=pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK is unable to store TZ in the table schema\",\n ),\n ),\n ],\n)\ndef test_dt(timezone):\n # ... other code\n\n def dt_with_empty_partition(lib):\n # For context, see https://github.com/modin-project/modin/issues/5112\n df_a = lib.DataFrame({\"A\": [lib.to_datetime(\"26/10/2020\")]})\n df_b = lib.DataFrame({\"B\": [lib.to_datetime(\"27/10/2020\")]})\n df = lib.concat([df_a, df_b], axis=1)\n eval_result = df.eval(\"B - A\", engine=\"python\")\n # BaseOnPython ahd HDK had a single partition after the concat, and it\n # maintains that partition after eval. In other execution modes,\n # eval() should re-split the result into two column partitions,\n # one of which is empty.\n if (\n isinstance(df, pd.DataFrame)\n and get_current_execution() != \"BaseOnPython\"\n and StorageFormat.get() != \"Hdk\"\n ):\n assert eval_result._query_compiler._modin_frame._partitions.shape == (1, 2)\n return eval_result.dt.days\n\n eval_general(pd, pandas, dt_with_empty_partition)\n\n if timezone is None:\n data = pd.period_range(\"2016-12-31\", periods=128, freq=\"D\")\n modin_series = pd.Series(data)\n pandas_series = pandas.Series(data)\n df_equals(modin_series.dt.asfreq(\"T\"), pandas_series.dt.asfreq(\"T\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_duplicated_test_eq.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_duplicated_test_eq.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1871, "end_line": 1897, "span_ids": ["test_empty", "test_duplicated", "test_empty_series", "test_eq"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data\", test_data_with_duplicates_values, ids=test_data_with_duplicates_keys\n)\n@pytest.mark.parametrize(\n \"keep\", [\"last\", \"first\", False], ids=[\"last\", \"first\", \"False\"]\n)\ndef test_duplicated(data, keep):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.duplicated(keep=keep)\n df_equals(modin_result, pandas_series.duplicated(keep=keep))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_empty(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.empty == pandas_series.empty\n\n\ndef test_empty_series():\n modin_series = pd.Series()\n assert modin_series.empty\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_eq(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"eq\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_equals_test_equals.None_1.df_equals_modin_df3_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_equals_test_equals.None_1.df_equals_modin_df3_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1900, "end_line": 1919, "span_ids": ["test_equals"], "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_equals():\n series_data = [2.9, 3, 3, 3]\n modin_df1 = pd.Series(series_data)\n modin_df2 = pd.Series(series_data)\n\n assert modin_df1.equals(modin_df2)\n assert modin_df1.equals(pd.Series(modin_df1))\n df_equals(modin_df1, modin_df2)\n df_equals(modin_df1, pd.Series(modin_df1))\n\n series_data = [2, 3, 5, 1]\n modin_df3 = pd.Series(series_data, index=list(\"abcd\"))\n\n assert not modin_df1.equals(modin_df3)\n\n with pytest.raises(AssertionError):\n df_equals(modin_df3, modin_df1)\n\n with pytest.raises(AssertionError):\n df_equals(modin_df3, modin_df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ewm_test_ffill.df_equals_modin_series_cp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ewm_test_ffill.df_equals_modin_series_cp", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1922, "end_line": 1951, "span_ids": ["test_ffill", "test_factorize", "test_ewm", "test_expanding"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ewm(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.ewm(halflife=6)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_expanding(data):\n modin_series, pandas_series = create_test_series(data) # noqa: F841\n df_equals(modin_series.expanding().sum(), pandas_series.expanding().sum())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_factorize(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.factorize()\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ffill(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.ffill(), pandas_series.ffill())\n # inplace\n modin_series_cp = modin_series.copy()\n pandas_series_cp = pandas_series.copy()\n modin_series_cp.ffill(inplace=True)\n pandas_series_cp.ffill(inplace=True)\n df_equals(modin_series_cp, pandas_series_cp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_fillna_test_fillna.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_fillna_test_fillna.None_4", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1954, "end_line": 1994, "span_ids": ["test_fillna"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"reindex\", [None, 2, -2])\n@pytest.mark.parametrize(\"limit\", [None, 1, 2, 0.5, -1, -2, 1.5])\ndef test_fillna(data, reindex, limit):\n modin_series, pandas_series = create_test_series(data)\n index = pandas_series.index\n pandas_replace_series = index.to_series().sample(frac=1)\n modin_replace_series = pd.Series(pandas_replace_series)\n replace_dict = pandas_replace_series.to_dict()\n\n if reindex is not None:\n if reindex > 0:\n pandas_series = pandas_series[:reindex].reindex(index)\n else:\n pandas_series = pandas_series[reindex:].reindex(index)\n # Because of bug #3178 modin Series has to be created from pandas\n # Series instead of performing the same slice and reindex operations.\n modin_series = pd.Series(pandas_series)\n\n if isinstance(limit, float):\n limit = int(len(modin_series) * limit)\n if limit is not None and limit < 0:\n limit = len(modin_series) + limit\n\n df_equals(modin_series.fillna(0, limit=limit), pandas_series.fillna(0, limit=limit))\n df_equals(\n modin_series.fillna(method=\"bfill\", limit=limit),\n pandas_series.fillna(method=\"bfill\", limit=limit),\n )\n df_equals(\n modin_series.fillna(method=\"ffill\", limit=limit),\n pandas_series.fillna(method=\"ffill\", limit=limit),\n )\n df_equals(\n modin_series.fillna(modin_replace_series, limit=limit),\n pandas_series.fillna(pandas_replace_series, limit=limit),\n )\n df_equals(\n modin_series.fillna(replace_dict, limit=limit),\n pandas_series.fillna(replace_dict, limit=limit),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_filter_test_iat.df_equals_modin_series_ia": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_filter_test_iat.df_equals_modin_series_ia", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 1997, "end_line": 2076, "span_ids": ["test_first", "test_iat", "test_filter", "test_get", "test_gt", "test_hasnans", "test_hist", "test_head", "test_ge", "test_floordiv", "test_first_valid_index"], "tokens": 690}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.xfail(reason=\"Using pandas Series.\")\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_filter(data):\n modin_series = create_test_series(data)\n\n with pytest.raises(NotImplementedError):\n modin_series.filter(None, None, None)\n\n\ndef test_first():\n i = pd.date_range(\"2010-04-09\", periods=400, freq=\"2D\")\n modin_series = pd.Series(list(range(400)), index=i)\n pandas_series = pandas.Series(list(range(400)), index=i)\n df_equals(modin_series.first(\"3D\"), pandas_series.first(\"3D\"))\n df_equals(modin_series.first(\"20D\"), pandas_series.first(\"20D\"))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_first_valid_index(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.first_valid_index(), pandas_series.first_valid_index())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_floordiv(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"floordiv\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ge(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"ge\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_get(data):\n modin_series, pandas_series = create_test_series(data)\n for key in modin_series.keys():\n df_equals(modin_series.get(key), pandas_series.get(key))\n df_equals(\n modin_series.get(\"NO_EXIST\", \"DEFAULT\"),\n pandas_series.get(\"NO_EXIST\", \"DEFAULT\"),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_gt(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"gt\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_hasnans(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.hasnans == pandas_series.hasnans\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=arg_keys(\"n\", int_arg_keys))\ndef test_head(data, n):\n modin_series, pandas_series = create_test_series(data)\n\n df_equals(modin_series.head(n), pandas_series.head(n))\n df_equals(\n modin_series.head(len(modin_series)), pandas_series.head(len(pandas_series))\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_hist(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.hist(None)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_iat(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.iat[0], pandas_series.iat[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_modin-project__modin/modin/pandas/test/test_series.py_test_idxmax_test_idxmax.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_idxmax_test_idxmax.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2079, "end_line": 2091, "span_ids": ["test_idxmax"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_idxmax(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n pandas_result = pandas_series.idxmax(skipna=skipna)\n modin_result = modin_series.idxmax(skipna=skipna)\n df_equals(modin_result, pandas_result)\n\n pandas_result = pandas_series.T.idxmax(skipna=skipna)\n modin_result = modin_series.T.idxmax(skipna=skipna)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_idxmin_test_idxmin.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_idxmin_test_idxmin.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2094, "end_line": 2106, "span_ids": ["test_idxmin"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_idxmin(data, skipna):\n modin_series, pandas_series = create_test_series(data)\n pandas_result = pandas_series.idxmin(skipna=skipna)\n modin_result = modin_series.idxmin(skipna=skipna)\n df_equals(modin_result, pandas_result)\n\n pandas_result = pandas_series.T.idxmin(skipna=skipna)\n modin_result = modin_series.T.idxmin(skipna=skipna)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_iloc_test_iloc.if_not_name_contains_requ.else_.with_pytest_raises_IndexE.modin_series_iloc_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_iloc_test_iloc.if_not_name_contains_requ.else_.with_pytest_raises_IndexE.modin_series_iloc_0_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2109, "end_line": 2130, "span_ids": ["test_iloc"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_iloc(request, data):\n modin_series, pandas_series = create_test_series(data)\n\n if not name_contains(request.node.name, [\"empty_data\"]):\n # Scalar\n np.testing.assert_equal(modin_series.iloc[0], pandas_series.iloc[0])\n\n # Series\n df_equals(modin_series.iloc[1:], pandas_series.iloc[1:])\n df_equals(modin_series.iloc[1:2], pandas_series.iloc[1:2])\n df_equals(modin_series.iloc[[1, 2]], pandas_series.iloc[[1, 2]])\n\n # Write Item\n modin_series.iloc[[1, 2]] = 42\n pandas_series.iloc[[1, 2]] = 42\n df_equals(modin_series, pandas_series)\n with pytest.raises(IndexingError):\n modin_series.iloc[1:, 1]\n else:\n with pytest.raises(IndexError):\n modin_series.iloc[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_modin-project__modin/modin/pandas/test/test_series.py_test_index_test_isin.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_index_test_isin.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2133, "end_line": 2176, "span_ids": ["test_is_monotonic_increasing", "test_is_unique", "test_interpolate", "test_index", "test_isin", "test_is_monotonic_decreasing"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_index(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.index, pandas_series.index)\n with pytest.raises(ValueError):\n modin_series.index = list(modin_series.index) + [999]\n\n modin_series.index = modin_series.index.map(str)\n pandas_series.index = pandas_series.index.map(str)\n df_equals(modin_series.index, pandas_series.index)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_interpolate(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.interpolate()\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_is_monotonic_decreasing(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.is_monotonic_decreasing == pandas_series.is_monotonic_decreasing\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_is_monotonic_increasing(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.is_monotonic_increasing == pandas_series.is_monotonic_increasing\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_is_unique(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.is_unique == pandas_series.is_unique\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_isin(data):\n modin_series, pandas_series = create_test_series(data)\n val = [1, 2, 3, 4]\n pandas_result = pandas_series.isin(val)\n modin_result = modin_series.isin(val)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_isin_with_series_test_isin_with_series.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_isin_with_series_test_isin_with_series.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2179, "end_line": 2196, "span_ids": ["test_isin_with_series"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_isin_with_series():\n modin_series1, pandas_series1 = create_test_series([1, 2, 3])\n modin_series2, pandas_series2 = create_test_series([1, 2, 3, 4, 5])\n\n eval_general(\n (modin_series1, modin_series2),\n (pandas_series1, pandas_series2),\n lambda srs: srs[0].isin(srs[1]),\n )\n\n # Verify that Series actualy behaves like Series and ignores unmatched indices on '.isin'\n modin_series1, pandas_series1 = create_test_series([1, 2, 3], index=[10, 11, 12])\n\n eval_general(\n (modin_series1, modin_series2),\n (pandas_series1, pandas_series2),\n lambda srs: srs[0].isin(srs[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_modin-project__modin/modin/pandas/test/test_series.py_test_isnull_test_items.for_modin_item_pandas_it.assert_pandas_index_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_isnull_test_items.for_modin_item_pandas_it.assert_pandas_index_mo", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2199, "end_line": 2215, "span_ids": ["test_items", "test_isnull"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_isnull(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.isnull(), pandas_series.isnull())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_items(data):\n modin_series, pandas_series = create_test_series(data)\n\n modin_items = modin_series.items()\n pandas_items = pandas_series.items()\n for modin_item, pandas_item in zip(modin_items, pandas_items):\n modin_index, modin_scalar = modin_item\n pandas_index, pandas_scalar = pandas_item\n df_equals(modin_scalar, pandas_scalar)\n assert pandas_index == modin_index", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_keys_test_kurtosis_numeric_only.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_keys_test_kurtosis_numeric_only.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2218, "end_line": 2245, "span_ids": ["test_kurtosis", "test_kurtosis_alias", "test_keys", "test_kurtosis_numeric_only"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_keys(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.keys(), pandas_series.keys())\n\n\ndef test_kurtosis_alias():\n # It's optimization. If failed, Series.kurt should be tested explicitly\n # in tests: `test_kurt_kurtosis`, `test_kurt_kurtosis_level`.\n assert pd.Series.kurt == pd.Series.kurtosis\n\n\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"skipna\", bool_arg_values, ids=bool_arg_keys)\ndef test_kurtosis(axis, skipna):\n eval_general(\n *create_test_series(test_data[\"float_nan_data\"]),\n lambda df: df.kurtosis(axis=axis, skipna=skipna),\n )\n\n\n@pytest.mark.parametrize(\"axis\", [\"rows\", \"columns\"])\n@pytest.mark.parametrize(\"numeric_only\", [True, False, None])\ndef test_kurtosis_numeric_only(axis, numeric_only):\n eval_general(\n *create_test_series(test_data_diff_dtype),\n lambda df: df.kurtosis(axis=axis, numeric_only=numeric_only),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_last_test_last.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_last_test_last.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2248, "end_line": 2254, "span_ids": ["test_last"], "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_last():\n modin_index = pd.date_range(\"2010-04-09\", periods=400, freq=\"2D\")\n pandas_index = pandas.date_range(\"2010-04-09\", periods=400, freq=\"2D\")\n modin_series = pd.Series(list(range(400)), index=modin_index)\n pandas_series = pandas.Series(list(range(400)), index=pandas_index)\n df_equals(modin_series.last(\"3D\"), pandas_series.last(\"3D\"))\n df_equals(modin_series.last(\"20D\"), pandas_series.last(\"20D\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_index_order_test_le.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_index_order_test_le.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2257, "end_line": 2285, "span_ids": ["test_index_order", "test_le", "test_last_valid_index"], "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": "@pytest.mark.parametrize(\"func\", [\"all\", \"any\", \"count\"])\ndef test_index_order(func):\n # see #1708 and #1869 for details\n s_modin, s_pandas = create_test_series(test_data[\"float_nan_data\"])\n rows_number = len(s_modin.index)\n level_0 = np.random.choice([x for x in range(10)], rows_number)\n level_1 = np.random.choice([x for x in range(10)], rows_number)\n index = pandas.MultiIndex.from_arrays([level_0, level_1])\n\n s_modin.index = index\n s_pandas.index = index\n\n # The result of the operation is not a Series, `.index` is missed\n df_equals(\n getattr(s_modin, func)(),\n getattr(s_pandas, func)(),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_last_valid_index(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.last_valid_index() == (pandas_series.last_valid_index())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_le(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"le\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_loc_test_loc.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_loc_test_loc.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2288, "end_line": 2311, "span_ids": ["test_loc"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_loc(data):\n modin_series, pandas_series = create_test_series(data)\n for v in modin_series.index:\n df_equals(modin_series.loc[v], pandas_series.loc[v])\n df_equals(modin_series.loc[v:], pandas_series.loc[v:])\n\n indices = [True if i % 3 == 0 else False for i in range(len(modin_series.index))]\n modin_result = modin_series.loc[indices]\n pandas_result = pandas_series.loc[indices]\n df_equals(modin_result, pandas_result)\n\n # From issue #1988\n index = pd.MultiIndex.from_product([np.arange(10), np.arange(10)], names=[\"f\", \"s\"])\n data = np.arange(100)\n modin_series = pd.Series(data, index=index).sort_index()\n pandas_series = pandas.Series(data, index=index).sort_index()\n modin_result = modin_series.loc[\n (slice(None), 1),\n ] # fmt: skip\n pandas_result = pandas_series.loc[\n (slice(None), 1),\n ] # fmt: skip\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py__This_tests_the_bug_from_test_iloc_assigning_scalar_none_to_string_series.df_equals_modin_series_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__This_tests_the_bug_from_test_iloc_assigning_scalar_none_to_string_series.df_equals_modin_series_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2314, "end_line": 2329, "span_ids": ["test_loc_setting_categorical_series", "test_loc", "test_iloc_assigning_scalar_none_to_string_series"], "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": "# This tests the bug from https://github.com/modin-project/modin/issues/3736\ndef test_loc_setting_categorical_series():\n modin_series = pd.Series([\"a\", \"b\", \"c\"], dtype=\"category\")\n pandas_series = pandas.Series([\"a\", \"b\", \"c\"], dtype=\"category\")\n modin_series.loc[1:3] = \"a\"\n pandas_series.loc[1:3] = \"a\"\n df_equals(modin_series, pandas_series)\n\n\n# This tests the bug from https://github.com/modin-project/modin/issues/3736\ndef test_iloc_assigning_scalar_none_to_string_series():\n data = [\"A\"]\n modin_series, pandas_series = create_test_series(data, dtype=\"string\")\n modin_series.iloc[0] = None\n pandas_series.iloc[0] = None\n df_equals(modin_series, pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_set_ordered_categorical_column_test_lt.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_set_ordered_categorical_column_test_lt.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2332, "end_line": 2348, "span_ids": ["test_lt", "test_set_ordered_categorical_column"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_set_ordered_categorical_column():\n data = {\"a\": [1, 2, 3], \"b\": [4, 5, 6]}\n mdf = pd.DataFrame(data)\n pdf = pandas.DataFrame(data)\n mdf[\"a\"] = pd.Categorical(mdf[\"a\"], ordered=True)\n pdf[\"a\"] = pandas.Categorical(pdf[\"a\"], ordered=True)\n df_equals(mdf, pdf)\n\n modin_categories = mdf[\"a\"].dtype\n pandas_categories = pdf[\"a\"].dtype\n assert modin_categories == pandas_categories\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_lt(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"lt\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_map_test_map.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_map_test_map.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2351, "end_line": 2376, "span_ids": ["test_map"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"na_values\", [\"ignore\", None], ids=[\"na_ignore\", \"na_none\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_map(data, na_values):\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series.map(str, na_action=na_values),\n pandas_series.map(str, na_action=na_values),\n )\n mapper = {i: str(i) for i in range(100)}\n df_equals(\n modin_series.map(mapper, na_action=na_values),\n pandas_series.map(mapper, na_action=na_values),\n # https://github.com/modin-project/modin/issues/5967\n check_dtypes=False,\n )\n\n # Return list objects\n modin_series_lists = modin_series.map(lambda s: [s, s, s])\n pandas_series_lists = pandas_series.map(lambda s: [s, s, s])\n df_equals(modin_series_lists, pandas_series_lists)\n\n # Index into list objects\n df_equals(\n modin_series_lists.map(lambda lst: lst[0]),\n pandas_series_lists.map(lambda lst: lst[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_modin-project__modin/modin/pandas/test/test_series.py_test_mask_test_median.eval_general_create_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_mask_test_median.eval_general_create_test", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2379, "end_line": 2410, "span_ids": ["test_median", "test_mask", "test_max", "test_mean"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_mask():\n modin_series = pd.Series(np.arange(10))\n m = modin_series % 3 == 0\n with warns_that_defaulting_to_pandas():\n try:\n modin_series.mask(~m, -modin_series)\n except ValueError:\n pass\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_max(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.max(skipna=skipna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_mean(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.mean(skipna=skipna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_median(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.median(skipna=skipna))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_median_skew_std_sum_var_prod_sem_1953_test_median_skew_std_sum_var_prod_sem_1953.eval_general_modin_s_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_median_skew_std_sum_var_prod_sem_1953_test_median_skew_std_sum_var_prod_sem_1953.eval_general_modin_s_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2413, "end_line": 2425, "span_ids": ["test_median_skew_std_sum_var_prod_sem_1953"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"method\", [\"median\", \"skew\", \"std\", \"sum\", \"var\", \"prod\", \"sem\"]\n)\ndef test_median_skew_std_sum_var_prod_sem_1953(method):\n # See #1953 for details\n data = [3, 3, 3, 3, 3, 3, 3, 3, 3]\n arrays = [\n [\"1\", \"1\", \"1\", \"2\", \"2\", \"2\", \"3\", \"3\", \"3\"],\n [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"],\n ]\n modin_s = pd.Series(data, index=arrays)\n pandas_s = pandas.Series(data, index=arrays)\n eval_general(modin_s, pandas_s, lambda s: getattr(s, method)())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_memory_usage_test_notnull.df_equals_modin_series_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_memory_usage_test_notnull.df_equals_modin_series_no", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2428, "end_line": 2508, "span_ids": ["test_ne", "test_mul", "test_notnull", "test_multiply", "test_mode", "test_nlargest", "test_memory_usage", "test_mod", "test_name", "test_ndim", "test_min", "test_nbytes"], "tokens": 671}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"index\", [True, False], ids=[\"True\", \"False\"])\ndef test_memory_usage(data, index):\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series.memory_usage(index=index), pandas_series.memory_usage(index=index)\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_min(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.min(skipna=skipna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_mod(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"mod\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_mode(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.mode(), pandas_series.mode())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_mul(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"mul\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_multiply(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"multiply\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_name(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.name == pandas_series.name\n modin_series.name = pandas_series.name = \"New_name\"\n assert modin_series.name == pandas_series.name\n assert modin_series._query_compiler.columns == [\"New_name\"]\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_nbytes(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.nbytes == pandas_series.nbytes\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ndim(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n assert modin_series.ndim == 1\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_ne(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"ne\")\n\n\n@pytest.mark.xfail(reason=\"Using pandas Series.\")\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_nlargest(data):\n modin_series = create_test_series(data)\n\n with pytest.raises(NotImplementedError):\n modin_series.nlargest(None)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_notnull(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.notnull(), pandas_series.notnull())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_nsmallest_test_nsmallest.df_equals_modin_series_ns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_nsmallest_test_nsmallest.df_equals_modin_series_ns", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2511, "end_line": 2526, "span_ids": ["test_nsmallest"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_nsmallest(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series.nsmallest(n=5, keep=\"first\"),\n pandas_series.nsmallest(n=5, keep=\"first\"),\n )\n df_equals(\n modin_series.nsmallest(n=10, keep=\"first\"),\n pandas_series.nsmallest(n=10, keep=\"first\"),\n )\n df_equals(\n modin_series.nsmallest(n=10, keep=\"last\"),\n pandas_series.nsmallest(n=10, keep=\"last\"),\n )\n df_equals(modin_series.nsmallest(keep=\"all\"), pandas_series.nsmallest(keep=\"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_modin-project__modin/modin/pandas/test/test_series.py_test_nunique_test_pct_change.with_warns_that_defaultin.modin_series_pct_change_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_nunique_test_pct_change.with_warns_that_defaultin.modin_series_pct_change_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2529, "end_line": 2540, "span_ids": ["test_pct_change", "test_nunique"], "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.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"dropna\", [True, False], ids=[\"True\", \"False\"])\ndef test_nunique(data, dropna):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.nunique(dropna=dropna), pandas_series.nunique(dropna=dropna))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_pct_change(data):\n modin_series, pandas_series = create_test_series(data)\n with warns_that_defaulting_to_pandas():\n modin_series.pct_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_modin-project__modin/modin/pandas/test/test_series.py_test_pipe_test_pipe.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_pipe_test_pipe.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2543, "end_line": 2567, "span_ids": ["test_pipe"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_pipe(data):\n modin_series, pandas_series = create_test_series(data)\n n = len(modin_series.index)\n a, b, c = 2 % n, 0, 3 % n\n\n def h(x):\n return x.dropna()\n\n def g(x, arg1=0):\n for _ in range(arg1):\n x = (pd if isinstance(x, pd.Series) else pandas).concat((x, x))\n return x\n\n def f(x, arg2=0, arg3=0):\n return x.drop(x.index[[arg2, arg3]])\n\n df_equals(\n f(g(h(modin_series), arg1=a), arg2=b, arg3=c),\n (modin_series.pipe(h).pipe(g, arg1=a).pipe(f, arg2=b, arg3=c)),\n )\n df_equals(\n (modin_series.pipe(h).pipe(g, arg1=a).pipe(f, arg2=b, arg3=c)),\n (pandas_series.pipe(h).pipe(g, arg1=a).pipe(f, arg2=b, arg3=c)),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_plot_test_plot.if_name_contains_request_.for_left_right_in_zipped.if_isinstance_left_get_yd.else_.assert_np_array_equal_lef": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_plot_test_plot.if_name_contains_request_.for_left_right_in_zipped.if_isinstance_left_get_yd.else_.assert_np_array_equal_lef", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2570, "end_line": 2589, "span_ids": ["test_plot"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_plot(request, data):\n modin_series, pandas_series = create_test_series(data)\n\n if name_contains(request.node.name, numeric_dfs):\n # We have to test this way because equality in plots means same object.\n zipped_plot_lines = zip(modin_series.plot().lines, pandas_series.plot().lines)\n for left, right in zipped_plot_lines:\n if isinstance(left.get_xdata(), np.ma.core.MaskedArray) and isinstance(\n right.get_xdata(), np.ma.core.MaskedArray\n ):\n assert all((left.get_xdata() == right.get_xdata()).data)\n else:\n assert np.array_equal(left.get_xdata(), right.get_xdata())\n if isinstance(left.get_ydata(), np.ma.core.MaskedArray) and isinstance(\n right.get_ydata(), np.ma.core.MaskedArray\n ):\n assert all((left.get_ydata() == right.get_ydata()).data)\n else:\n assert np.array_equal(left.get_xdata(), right.get_xdata())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_pop_test_radd.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_pop_test_radd.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2592, "end_line": 2646, "span_ids": ["test_radd", "test_prod", "test_product_alias", "test_prod_specific", "test_quantile", "test_pop", "test_pow"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\ndef test_pop(data):\n modin_series, pandas_series = create_test_series(data)\n\n for key in modin_series.keys():\n df_equals(modin_series.pop(key), pandas_series.pop(key))\n df_equals(modin_series, pandas_series)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_pow(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"pow\")\n\n\ndef test_product_alias():\n assert pd.Series.prod == pd.Series.product\n\n\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_prod(axis, skipna):\n eval_general(\n *create_test_series(test_data[\"float_nan_data\"]),\n lambda s: s.prod(axis=axis, skipna=skipna),\n )\n\n\n@pytest.mark.parametrize(\n \"numeric_only\", bool_arg_values, ids=arg_keys(\"numeric_only\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"min_count\", int_arg_values, ids=arg_keys(\"min_count\", int_arg_keys)\n)\ndef test_prod_specific(min_count, numeric_only):\n eval_general(\n *create_test_series(test_data_diff_dtype),\n lambda df: df.prod(min_count=min_count, numeric_only=numeric_only),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"q\", quantiles_values, ids=quantiles_keys)\ndef test_quantile(request, data, q):\n modin_series, pandas_series = create_test_series(data)\n if not name_contains(request.node.name, no_numeric_dfs):\n df_equals(modin_series.quantile(q), pandas_series.quantile(q))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_radd(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"radd\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_rank_test_ravel.np_testing_assert_equal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_rank_test_ravel.np_testing_assert_equal_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2649, "end_line": 2671, "span_ids": ["test_ravel", "test_rank"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"na_option\", [\"keep\", \"top\", \"bottom\"], ids=[\"keep\", \"top\", \"bottom\"]\n)\ndef test_rank(data, na_option):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.rank(na_option=na_option)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.rank(na_option=na_option)\n else:\n modin_result = modin_series.rank(na_option=na_option)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"order\", [None, \"C\", \"F\", \"A\", \"K\"])\ndef test_ravel(data, order):\n modin_series, pandas_series = create_test_series(data)\n np.testing.assert_equal(\n modin_series.ravel(order=order), pandas_series.ravel(order=order)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ravel_category_test_ravel_category.categories_equals_modin_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ravel_category_test_ravel_category.categories_equals_modin_s", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2674, "end_line": 2686, "span_ids": ["test_ravel_category"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data\",\n [\n pandas.Categorical(np.arange(1000), ordered=True),\n pandas.Categorical(np.arange(1000), ordered=False),\n pandas.Categorical(np.arange(1000), categories=np.arange(500), ordered=True),\n pandas.Categorical(np.arange(1000), categories=np.arange(500), ordered=False),\n ],\n)\n@pytest.mark.parametrize(\"order\", [None, \"C\", \"F\", \"A\", \"K\"])\ndef test_ravel_category(data, order):\n modin_series, pandas_series = create_test_series(data)\n categories_equals(modin_series.ravel(order=order), pandas_series.ravel(order=order))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ravel_simple_category_test_rdiv.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_ravel_simple_category_test_rdiv.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2689, "end_line": 2707, "span_ids": ["test_ravel_simple_category", "test_rdiv"], "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": "@pytest.mark.parametrize(\n \"data\",\n [\n pandas.Categorical(np.arange(10), ordered=True),\n pandas.Categorical(np.arange(10), ordered=False),\n pandas.Categorical(np.arange(10), categories=np.arange(5), ordered=True),\n pandas.Categorical(np.arange(10), categories=np.arange(5), ordered=False),\n ],\n)\n@pytest.mark.parametrize(\"order\", [None, \"C\", \"F\", \"A\", \"K\"])\ndef test_ravel_simple_category(data, order):\n modin_series, pandas_series = create_test_series(data)\n categories_equals(modin_series.ravel(order=order), pandas_series.ravel(order=order))\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rdiv(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rdiv\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reindex_test_reindex.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reindex_test_reindex.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2710, "end_line": 2750, "span_ids": ["test_reindex"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_data_values, ids=test_data_keys)\ndef test_reindex(data):\n modin_series, pandas_series = create_test_series(data)\n pandas_result = pandas_series.reindex(\n list(pandas_series.index) + [\"_A_NEW_ROW\"], fill_value=0\n )\n modin_result = modin_series.reindex(\n list(modin_series.index) + [\"_A_NEW_ROW\"], fill_value=0\n )\n df_equals(pandas_result, modin_result)\n\n frame_data = {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col4\": [12, 13, 14, 15],\n \"col5\": [0, 0, 0, 0],\n }\n pandas_df = pandas.DataFrame(frame_data)\n modin_df = pd.DataFrame(frame_data)\n\n for col in pandas_df.columns:\n modin_series = modin_df[col]\n pandas_series = pandas_df[col]\n df_equals(\n modin_series.reindex([0, 3, 2, 1]), pandas_series.reindex([0, 3, 2, 1])\n )\n df_equals(modin_series.reindex([0, 6, 2]), pandas_series.reindex([0, 6, 2]))\n df_equals(\n modin_series.reindex(index=[0, 1, 5]),\n pandas_series.reindex(index=[0, 1, 5]),\n )\n\n # MultiIndex\n modin_series, pandas_series = create_test_series(data)\n modin_series.index, pandas_series.index = [\n generate_multiindex(len(pandas_series))\n ] * 2\n pandas_result = pandas_series.reindex(list(reversed(pandas_series.index)))\n modin_result = modin_series.reindex(list(reversed(modin_series.index)))\n df_equals(pandas_result, modin_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_modin-project__modin/modin/pandas/test/test_series.py_test_reindex_like_test_reindex_like.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reindex_like_test_reindex_like.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2753, "end_line": 2772, "span_ids": ["test_reindex_like"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reindex_like():\n o_data = [\n [24.3, 75.7, \"high\"],\n [31, 87.8, \"high\"],\n [22, 71.6, \"medium\"],\n [35, 95, \"medium\"],\n ]\n o_columns = [\"temp_celsius\", \"temp_fahrenheit\", \"windspeed\"]\n o_index = pd.date_range(start=\"2014-02-12\", end=\"2014-02-15\", freq=\"D\")\n new_data = [[28, \"low\"], [30, \"low\"], [35.1, \"medium\"]]\n new_columns = [\"temp_celsius\", \"windspeed\"]\n new_index = pd.DatetimeIndex([\"2014-02-12\", \"2014-02-13\", \"2014-02-15\"])\n modin_df1 = pd.DataFrame(o_data, columns=o_columns, index=o_index)\n modin_df2 = pd.DataFrame(new_data, columns=new_columns, index=new_index)\n modin_result = modin_df2[\"windspeed\"].reindex_like(modin_df1[\"windspeed\"])\n\n pandas_df1 = pandas.DataFrame(o_data, columns=o_columns, index=o_index)\n pandas_df2 = pandas.DataFrame(new_data, columns=new_columns, index=new_index)\n pandas_result = pandas_df2[\"windspeed\"].reindex_like(pandas_df1[\"windspeed\"])\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_rename_test_rename.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_rename_test_rename.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2775, "end_line": 2789, "span_ids": ["test_rename"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rename(data):\n modin_series, pandas_series = create_test_series(data)\n new_name = \"NEW_NAME\"\n df_equals(modin_series.rename(new_name), pandas_series.rename(new_name))\n\n modin_series_cp = modin_series.copy()\n pandas_series_cp = pandas_series.copy()\n modin_series_cp.rename(new_name, inplace=True)\n pandas_series_cp.rename(new_name, inplace=True)\n df_equals(modin_series_cp, pandas_series_cp)\n\n modin_result = modin_series.rename(\"{}__\".format)\n pandas_result = pandas_series.rename(\"{}__\".format)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_reorder_levels_test_reorder_levels.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reorder_levels_test_reorder_levels.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2792, "end_line": 2820, "span_ids": ["test_reorder_levels"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reorder_levels():\n data = np.random.randint(1, 100, 12)\n modin_series = pd.Series(\n data,\n index=pd.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n pandas_series = pandas.Series(\n data,\n index=pandas.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n modin_result = modin_series.reorder_levels([\"Letter\", \"Color\", \"Number\"])\n pandas_result = pandas_series.reorder_levels([\"Letter\", \"Color\", \"Number\"])\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_repeat_test_repeat_lists.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_repeat_test_repeat_lists.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2823, "end_line": 2850, "span_ids": ["test_repeat_lists", "test_repeat"], "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.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"repeats\", [0, 2, 3, 4], ids=[\"repeats_{}\".format(i) for i in [0, 2, 3, 4]]\n)\ndef test_repeat(data, repeats):\n eval_general(pd.Series(data), pandas.Series(data), lambda df: df.repeat(repeats))\n\n\n@pytest.mark.parametrize(\"data\", [np.arange(256)])\n@pytest.mark.parametrize(\n \"repeats\",\n [\n [0],\n [2],\n [3],\n [4],\n np.arange(256),\n [0] * 64 + [2] * 64 + [3] * 32 + [4] * 32 + [5] * 64,\n [2] * 257,\n [2] * 128,\n ],\n)\ndef test_repeat_lists(data, repeats):\n eval_general(\n pd.Series(data),\n pandas.Series(data),\n lambda df: df.repeat(repeats),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_replace_test_replace.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_replace_test_replace.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2853, "end_line": 2862, "span_ids": ["test_replace"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_replace():\n modin_series = pd.Series([0, 1, 2, 3, 4])\n pandas_series = pandas.Series([0, 1, 2, 3, 4])\n modin_result = modin_series.replace(0, 5)\n pandas_result = pandas_series.replace(0, 5)\n df_equals(modin_result, pandas_result)\n\n modin_result = modin_series.replace([1, 2], method=\"bfill\")\n pandas_result = pandas_series.replace([1, 2], method=\"bfill\")\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_resample_test_resample.None_22": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_resample_test_resample.None_22", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2865, "end_line": 2948, "span_ids": ["test_resample"], "tokens": 853}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"closed\", [\"left\", \"right\"])\n@pytest.mark.parametrize(\"label\", [\"right\", \"left\"])\n@pytest.mark.parametrize(\"level\", [None, 1])\ndef test_resample(closed, label, level):\n rule = \"5T\"\n freq = \"H\"\n\n index = pandas.date_range(\"1/1/2000\", periods=12, freq=freq)\n pandas_series = pandas.Series(range(12), index=index)\n modin_series = pd.Series(range(12), index=index)\n\n if level is not None:\n index = pandas.MultiIndex.from_product(\n [[\"a\", \"b\", \"c\"], pandas.date_range(\"31/12/2000\", periods=4, freq=freq)]\n )\n pandas_series.index = index\n modin_series.index = index\n pandas_resampler = pandas_series.resample(\n rule, closed=closed, label=label, level=level\n )\n modin_resampler = modin_series.resample(\n rule, closed=closed, label=label, level=level\n )\n\n df_equals(modin_resampler.count(), pandas_resampler.count())\n df_equals(modin_resampler.var(0), pandas_resampler.var(0))\n df_equals(modin_resampler.sum(), pandas_resampler.sum())\n df_equals(modin_resampler.std(), pandas_resampler.std())\n df_equals(modin_resampler.sem(), pandas_resampler.sem())\n df_equals(modin_resampler.size(), pandas_resampler.size())\n df_equals(modin_resampler.prod(), pandas_resampler.prod())\n df_equals(modin_resampler.ohlc(), pandas_resampler.ohlc())\n df_equals(modin_resampler.min(), pandas_resampler.min())\n df_equals(modin_resampler.median(), pandas_resampler.median())\n df_equals(modin_resampler.mean(), pandas_resampler.mean())\n df_equals(modin_resampler.max(), pandas_resampler.max())\n df_equals(modin_resampler.last(), pandas_resampler.last())\n df_equals(modin_resampler.first(), pandas_resampler.first())\n df_equals(modin_resampler.nunique(), pandas_resampler.nunique())\n df_equals(\n modin_resampler.pipe(lambda x: x.max() - x.min()),\n pandas_resampler.pipe(lambda x: x.max() - x.min()),\n )\n df_equals(\n modin_resampler.transform(lambda x: (x - x.mean()) / x.std()),\n pandas_resampler.transform(lambda x: (x - x.mean()) / x.std()),\n )\n df_equals(\n modin_resampler.aggregate(\"max\"),\n pandas_resampler.aggregate(\"max\"),\n )\n df_equals(\n modin_resampler.apply(\"sum\"),\n pandas_resampler.apply(\"sum\"),\n )\n df_equals(\n modin_resampler.get_group(name=list(modin_resampler.groups)[0]),\n pandas_resampler.get_group(name=list(pandas_resampler.groups)[0]),\n )\n assert pandas_resampler.indices == modin_resampler.indices\n assert pandas_resampler.groups == modin_resampler.groups\n df_equals(modin_resampler.quantile(), pandas_resampler.quantile())\n # Upsampling from level= or on= selection is not supported\n if level is None:\n df_equals(\n modin_resampler.interpolate(),\n pandas_resampler.interpolate(),\n )\n df_equals(modin_resampler.asfreq(), pandas_resampler.asfreq())\n df_equals(\n modin_resampler.fillna(method=\"nearest\"),\n pandas_resampler.fillna(method=\"nearest\"),\n )\n df_equals(modin_resampler.nearest(), pandas_resampler.nearest())\n df_equals(modin_resampler.bfill(), pandas_resampler.bfill())\n df_equals(modin_resampler.ffill(), pandas_resampler.ffill())\n df_equals(\n modin_resampler.apply([\"sum\", \"mean\", \"max\"]),\n pandas_resampler.apply([\"sum\", \"mean\", \"max\"]),\n )\n df_equals(\n modin_resampler.aggregate([\"sum\", \"mean\", \"max\"]),\n pandas_resampler.aggregate([\"sum\", \"mean\", \"max\"]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reset_index_test_reset_index.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reset_index_test_reset_index.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2951, "end_line": 2963, "span_ids": ["test_reset_index"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"drop\", [True, False], ids=[\"True\", \"False\"])\n@pytest.mark.parametrize(\"name\", [lib.no_default, \"Custom name\"])\n@pytest.mark.parametrize(\"inplace\", [True, False])\ndef test_reset_index(data, drop, name, inplace):\n eval_general(\n *create_test_series(data),\n lambda df, *args, **kwargs: df.reset_index(*args, **kwargs),\n drop=drop,\n name=name,\n inplace=inplace,\n __inplace__=inplace,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reshape_test_rtruediv.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_reshape_test_rtruediv.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 2966, "end_line": 3014, "span_ids": ["test_rmod", "test_rmul", "test_rpow", "test_rfloordiv", "test_round", "test_reshape", "test_rtruediv", "test_rsub"], "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": "@pytest.mark.xfail(reason=\"Using pandas Series.\")\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_reshape(data):\n modin_series = create_test_series(data)\n\n with pytest.raises(NotImplementedError):\n modin_series.reshape(None)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rfloordiv(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rfloordiv\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rmod(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rmod\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rmul(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rmul\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_round(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.round(), pandas_series.round())\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rpow(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rpow\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rsub(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rsub\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_rtruediv(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"rtruediv\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sample_test_sample.with_pytest_raises_ValueE.modin_series_sample_n_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sample_test_sample.with_pytest_raises_ValueE.modin_series_sample_n_3_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3017, "end_line": 3044, "span_ids": ["test_sample"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_sample(data):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.sample(frac=0.5, random_state=21019)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.sample(frac=0.5, random_state=21019)\n else:\n modin_result = modin_series.sample(frac=0.5, random_state=21019)\n df_equals(pandas_result, modin_result)\n\n try:\n pandas_result = pandas_series.sample(n=12, random_state=21019)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.sample(n=12, random_state=21019)\n else:\n modin_result = modin_series.sample(n=12, random_state=21019)\n df_equals(pandas_result, modin_result)\n\n with warns_that_defaulting_to_pandas():\n df_equals(\n modin_series.sample(n=0, random_state=21019),\n pandas_series.sample(n=0, random_state=21019),\n )\n with pytest.raises(ValueError):\n modin_series.sample(n=-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_modin-project__modin/modin/pandas/test/test_series.py_test_searchsorted_test_searchsorted.for_case_in_test_cases_.assert_case": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_searchsorted_test_searchsorted.for_case_in_test_cases_.assert_case", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3047, "end_line": 3109, "span_ids": ["test_searchsorted"], "tokens": 539}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"single_value_data\", [True, False])\n@pytest.mark.parametrize(\"use_multiindex\", [True, False])\n@pytest.mark.parametrize(\"sorter\", [True, None])\n@pytest.mark.parametrize(\"values_number\", [1, 2, 5])\n@pytest.mark.parametrize(\"side\", [\"left\", \"right\"])\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_searchsorted(\n data, side, values_number, sorter, use_multiindex, single_value_data\n):\n data = data if not single_value_data else data[next(iter(data.keys()))][0]\n if not sorter:\n modin_series, pandas_series = create_test_series(vals=data, sort=True)\n else:\n modin_series, pandas_series = create_test_series(vals=data)\n sorter = np.argsort(list(modin_series))\n\n if use_multiindex:\n rows_number = len(modin_series.index)\n level_0_series = random_state.choice([0, 1], rows_number)\n level_1_series = random_state.choice([2, 3], rows_number)\n index_series = pd.MultiIndex.from_arrays(\n [level_0_series, level_1_series], names=[\"first\", \"second\"]\n )\n modin_series.index = index_series\n pandas_series.index = index_series\n\n min_sample = modin_series.min(skipna=True)\n max_sample = modin_series.max(skipna=True)\n\n if single_value_data:\n values = [data]\n else:\n values = []\n values.append(pandas_series.sample(n=values_number, random_state=random_state))\n values.append(\n random_state.uniform(low=min_sample, high=max_sample, size=values_number)\n )\n values.append(\n random_state.uniform(\n low=max_sample, high=2 * max_sample, size=values_number\n )\n )\n values.append(\n random_state.uniform(\n low=min_sample - max_sample, high=min_sample, size=values_number\n )\n )\n pure_float = random_state.uniform(float(min_sample), float(max_sample))\n pure_int = int(pure_float)\n values.append(pure_float)\n values.append(pure_int)\n\n test_cases = [\n modin_series.searchsorted(value=value, side=side, sorter=sorter)\n == pandas_series.searchsorted(value=value, side=side, sorter=sorter)\n for value in values\n ]\n test_cases = [\n case.all() if not isinstance(case, bool) else case for case in test_cases\n ]\n\n for case in test_cases:\n assert case", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sem_float_nan_only_test_skew.eval_general_create_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sem_float_nan_only_test_skew.eval_general_create_test", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3112, "end_line": 3154, "span_ids": ["test_size", "test_shape", "test_skew", "test_sem_int_only", "test_set_axis", "test_sem_float_nan_only"], "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": "@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\ndef test_sem_float_nan_only(skipna, ddof):\n eval_general(\n *create_test_series(test_data[\"float_nan_data\"]),\n lambda df: df.sem(skipna=skipna, ddof=ddof),\n )\n\n\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\ndef test_sem_int_only(ddof):\n eval_general(\n *create_test_series(test_data[\"int_data\"]),\n lambda df: df.sem(ddof=ddof),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_set_axis(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n modin_series.set_axis(labels=[\"{}_{}\".format(i, i + 1) for i in modin_series.index])\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_shape(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.shape == pandas_series.shape\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_size(data):\n modin_series, pandas_series = create_test_series(data)\n assert modin_series.size == pandas_series.size\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\ndef test_skew(data, skipna):\n eval_general(*create_test_series(data), lambda df: df.skew(skipna=skipna))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_shift_test_shift.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_shift_test_shift.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3157, "end_line": 3181, "span_ids": ["test_shift"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"index\", [\"default\", \"ndarray\", \"has_duplicates\"])\n@pytest.mark.parametrize(\"periods\", [0, 1, -1, 10, -10, 1000000000, -1000000000])\n@pytest.mark.parametrize(\"name\", [None, \"foo\"])\ndef test_shift(data, index, periods, name):\n modin_series, pandas_series = create_test_series(data, name=name)\n if index == \"ndarray\":\n data_column_length = len(data[next(iter(data))])\n modin_series.index = pandas_series.index = np.arange(2, data_column_length + 2)\n elif index == \"has_duplicates\":\n modin_series.index = pandas_series.index = list(modin_series.index[:-3]) + [\n 0,\n 1,\n 2,\n ]\n\n df_equals(\n modin_series.shift(periods=periods),\n pandas_series.shift(periods=periods),\n )\n df_equals(\n modin_series.shift(periods=periods, fill_value=777),\n pandas_series.shift(periods=periods, fill_value=777),\n )\n eval_general(modin_series, pandas_series, lambda df: df.shift(axis=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_modin-project__modin/modin/pandas/test/test_series.py_test_sort_index_test_sort_index.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sort_index_test_sort_index.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3184, "end_line": 3214, "span_ids": ["test_sort_index"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"ascending\", bool_arg_values, ids=arg_keys(\"ascending\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"sort_remaining\", bool_arg_values, ids=arg_keys(\"sort_remaining\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"na_position\", [\"first\", \"last\"], ids=[\"first\", \"last\"])\ndef test_sort_index(data, ascending, sort_remaining, na_position):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda df: df.sort_index(\n ascending=ascending,\n sort_remaining=sort_remaining,\n na_position=na_position,\n ),\n )\n\n eval_general(\n modin_series.copy(),\n pandas_series.copy(),\n lambda df: df.sort_index(\n ascending=ascending,\n sort_remaining=sort_remaining,\n na_position=na_position,\n inplace=True,\n ),\n __inplace__=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_modin-project__modin/modin/pandas/test/test_series.py_test_sort_values_test_sort_values.None_1.else_.np_testing_assert_equal_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sort_values_test_sort_values.None_1.else_.np_testing_assert_equal_m", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3217, "end_line": 3251, "span_ids": ["test_sort_values"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"ascending\", [True, False], ids=[\"True\", \"False\"])\n@pytest.mark.parametrize(\"na_position\", [\"first\", \"last\"], ids=[\"first\", \"last\"])\ndef test_sort_values(data, ascending, na_position):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.sort_values(\n ascending=ascending, na_position=na_position\n )\n pandas_result = pandas_series.sort_values(\n ascending=ascending, na_position=na_position\n )\n # Note: For `ascending=False` only\n # For some reason, the indexing of Series and DataFrame differ in the underlying\n # algorithm. The order of values is the same, but the index values are shuffled.\n # Since we use `DataFrame.sort_values` even for Series, the index can be different\n # between `pandas.Series.sort_values`. For this reason, we check that the values are\n # identical instead of the index as well.\n if ascending:\n df_equals_with_non_stable_indices(modin_result, pandas_result)\n else:\n np.testing.assert_equal(modin_result.values, pandas_result.values)\n\n modin_series_cp = modin_series.copy()\n pandas_series_cp = pandas_series.copy()\n modin_series_cp.sort_values(\n ascending=ascending, na_position=na_position, inplace=True\n )\n pandas_series_cp.sort_values(\n ascending=ascending, na_position=na_position, inplace=True\n )\n # See above about `ascending=False`\n if ascending:\n df_equals_with_non_stable_indices(modin_result, pandas_result)\n else:\n np.testing.assert_equal(modin_series_cp.values, pandas_series_cp.values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_squeeze_test_std.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_squeeze_test_std.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3254, "end_line": 3277, "span_ids": ["test_squeeze", "test_std"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_squeeze(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.squeeze(None), pandas_series.squeeze(None))\n df_equals(modin_series.squeeze(0), pandas_series.squeeze(0))\n with pytest.raises(ValueError):\n modin_series.squeeze(1)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\ndef test_std(request, data, skipna, ddof):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.std(skipna=skipna, ddof=ddof)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.std(skipna=skipna, ddof=ddof)\n else:\n modin_result = modin_series.std(skipna=skipna, ddof=ddof)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_sub_test_subtract.inter_df_math_helper_modi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sub_test_subtract.inter_df_math_helper_modi", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3280, "end_line": 3297, "span_ids": ["test_subtract", "test_sub"], "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": "@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/272\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_sub(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"sub\")\n\n\n@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/intel-ai/hdk/issues/272\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_subtract(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"subtract\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sum_test_sum.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_sum_test_sum.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3300, "end_line": 3323, "span_ids": ["test_sum"], "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": "@pytest.mark.parametrize(\n \"data\",\n test_data_values + test_data_small_values,\n ids=test_data_keys + test_data_small_keys,\n)\n@pytest.mark.parametrize(\"axis\", axis_values, ids=axis_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"numeric_only\", bool_arg_values, ids=arg_keys(\"numeric_only\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\n \"min_count\", int_arg_values, ids=arg_keys(\"min_count\", int_arg_keys)\n)\ndef test_sum(data, axis, skipna, numeric_only, min_count):\n eval_general(\n *create_test_series(data),\n lambda df, *args, **kwargs: df.sum(*args, **kwargs),\n axis=axis,\n skipna=skipna,\n numeric_only=numeric_only,\n min_count=min_count,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_swapaxes_test_swapaxes.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_swapaxes_test_swapaxes.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3326, "end_line": 3338, "span_ids": ["test_swapaxes"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"axis1\", [0, 1, \"columns\", \"index\"])\n@pytest.mark.parametrize(\"axis2\", [0, 1, \"columns\", \"index\"])\ndef test_swapaxes(data, axis1, axis2):\n modin_series, pandas_series = create_test_series(data)\n try:\n pandas_result = pandas_series.swapaxes(axis1, axis2)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.swapaxes(axis1, axis2)\n else:\n modin_result = modin_series.swapaxes(axis1, axis2)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_swaplevel_test_swaplevel.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_swaplevel_test_swaplevel.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3341, "end_line": 3371, "span_ids": ["test_swaplevel"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_swaplevel():\n data = np.random.randint(1, 100, 12)\n modin_s = pd.Series(\n data,\n index=pd.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n pandas_s = pandas.Series(\n data,\n index=pandas.MultiIndex.from_tuples(\n [\n (num, letter, color)\n for num in range(1, 3)\n for letter in [\"a\", \"b\", \"c\"]\n for color in [\"Red\", \"Green\"]\n ],\n names=[\"Number\", \"Letter\", \"Color\"],\n ),\n )\n df_equals(\n modin_s.swaplevel(\"Number\", \"Color\"), pandas_s.swaplevel(\"Number\", \"Color\")\n )\n df_equals(modin_s.swaplevel(), pandas_s.swaplevel())\n df_equals(modin_s.swaplevel(1, 0), pandas_s.swaplevel(1, 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_modin-project__modin/modin/pandas/test/test_series.py_test_tail_test_take.try_.except_Exception_as_err_.with_pytest_raises_type_e.modin_s_take_2_axis_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tail_test_take.try_.except_Exception_as_err_.with_pytest_raises_type_e.modin_s_take_2_axis_1_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3374, "end_line": 3393, "span_ids": ["test_tail", "test_take"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=arg_keys(\"n\", int_arg_keys))\ndef test_tail(data, n):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.tail(n), pandas_series.tail(n))\n df_equals(\n modin_series.tail(len(modin_series)), pandas_series.tail(len(pandas_series))\n )\n\n\ndef test_take():\n modin_s = pd.Series([\"falcon\", \"parrot\", \"lion\", \"cat\"], index=[0, 2, 3, 1])\n pandas_s = pandas.Series([\"falcon\", \"parrot\", \"lion\", \"cat\"], index=[0, 2, 3, 1])\n a = modin_s.take([0, 3])\n df_equals(a, pandas_s.take([0, 3]))\n try:\n pandas_s.take([2], axis=1)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_s.take([2], axis=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_modin-project__modin/modin/pandas/test/test_series.py_test_explode_test_explode.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_explode_test_explode.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3396, "end_line": 3406, "span_ids": ["test_explode"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"ignore_index\", bool_arg_values, ids=arg_keys(\"ignore_index\", bool_arg_keys)\n)\ndef test_explode(ignore_index):\n # Some items in this test data are lists that explode() should expand.\n data = [[1, 2, 3], \"foo\", [], [3, 4]]\n modin_series, pandas_series = create_test_series(data)\n df_equals(\n modin_series.explode(ignore_index=ignore_index),\n pandas_series.explode(ignore_index=ignore_index),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_to_period_test_transpose.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_to_period_test_transpose.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3409, "end_line": 3507, "span_ids": ["test_transform_except", "test_tolist", "test_to_numpy", "test_to_timestamp", "test_transform", "test_to_xarray", "test_to_string", "test_to_xarray_mock", "test_transpose", "test_series_values", "test_to_period", "test_series_empty_values"], "tokens": 768}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_to_period():\n idx = pd.date_range(\"1/1/2012\", periods=5, freq=\"M\")\n series = pd.Series(np.random.randint(0, 100, size=(len(idx))), index=idx)\n with warns_that_defaulting_to_pandas():\n series.to_period()\n\n\n@pytest.mark.parametrize(\n \"data\",\n test_data_values + test_data_large_categorical_series_values,\n ids=test_data_keys + test_data_large_categorical_series_keys,\n)\ndef test_to_numpy(data):\n modin_series, pandas_series = create_test_series(data)\n assert_array_equal(modin_series.to_numpy(), pandas_series.to_numpy())\n\n\n@pytest.mark.parametrize(\n \"data\",\n test_data_values + test_data_large_categorical_series_values,\n ids=test_data_keys + test_data_large_categorical_series_keys,\n)\ndef test_series_values(data):\n modin_series, pandas_series = create_test_series(data)\n assert_array_equal(modin_series.values, pandas_series.values)\n\n\ndef test_series_empty_values():\n modin_series, pandas_series = pd.Series(), pandas.Series()\n assert_array_equal(modin_series.values, pandas_series.values)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_to_string(request, data):\n eval_general(\n *create_test_series(data),\n lambda df: df.to_string(),\n )\n\n\ndef test_to_timestamp():\n idx = pd.date_range(\"1/1/2012\", periods=5, freq=\"M\")\n series = pd.Series(np.random.randint(0, 100, size=(len(idx))), index=idx)\n with warns_that_defaulting_to_pandas():\n series.to_period().to_timestamp()\n\n\n@pytest.mark.skipif(\n condition=sys.version_info < (3, 9),\n reason=\"xarray doesn't support pandas>=2.0 for python 3.8\",\n)\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_to_xarray(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.to_xarray()\n\n\ndef test_to_xarray_mock():\n modin_series = pd.Series([])\n\n with mock.patch(\"pandas.Series.to_xarray\") as to_xarray:\n modin_series.to_xarray()\n to_xarray.assert_called_once()\n assert len(to_xarray.call_args[0]) == 1\n df_equals(modin_series, to_xarray.call_args[0][0])\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_tolist(data):\n modin_series, _ = create_test_series(data) # noqa: F841\n with warns_that_defaulting_to_pandas():\n modin_series.tolist()\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_values, ids=agg_func_keys)\ndef test_transform(data, func):\n eval_general(\n *create_test_series(data),\n lambda df: df.transform(func),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\"func\", agg_func_except_values, ids=agg_func_except_keys)\ndef test_transform_except(data, func):\n eval_general(\n *create_test_series(data),\n lambda df: df.transform(func),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_transpose(data):\n modin_series, pandas_series = create_test_series(data)\n df_equals(modin_series.transpose(), modin_series)\n df_equals(modin_series.transpose(), pandas_series.transpose())\n df_equals(modin_series.transpose(), pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_truediv_test_truncate.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_truediv_test_truncate.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3510, "end_line": 3536, "span_ids": ["test_truediv", "test_truncate"], "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(\"data\", test_data_values, ids=test_data_keys)\ndef test_truediv(data):\n modin_series, pandas_series = create_test_series(data)\n inter_df_math_helper(modin_series, pandas_series, \"truediv\")\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_truncate(data):\n modin_series, pandas_series = create_test_series(data)\n\n before = 1\n after = len(modin_series - 3)\n df_equals(\n modin_series.truncate(before, after), pandas_series.truncate(before, after)\n )\n\n before = 1\n after = 3\n df_equals(\n modin_series.truncate(before, after), pandas_series.truncate(before, after)\n )\n\n before = None\n after = None\n df_equals(\n modin_series.truncate(before, after), pandas_series.truncate(before, after)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tz_convert_test_tz_convert.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tz_convert_test_tz_convert.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3539, "end_line": 3560, "span_ids": ["test_tz_convert"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_tz_convert():\n modin_idx = pd.date_range(\n \"1/1/2012\", periods=400, freq=\"2D\", tz=\"America/Los_Angeles\"\n )\n pandas_idx = pandas.date_range(\n \"1/1/2012\", periods=400, freq=\"2D\", tz=\"America/Los_Angeles\"\n )\n data = np.random.randint(0, 100, size=len(modin_idx))\n modin_series = pd.Series(data, index=modin_idx)\n pandas_series = pandas.Series(data, index=pandas_idx)\n modin_result = modin_series.tz_convert(\"UTC\", axis=0)\n pandas_result = pandas_series.tz_convert(\"UTC\", axis=0)\n df_equals(modin_result, pandas_result)\n\n modin_multi = pd.MultiIndex.from_arrays([modin_idx, range(len(modin_idx))])\n pandas_multi = pandas.MultiIndex.from_arrays([pandas_idx, range(len(modin_idx))])\n modin_series = pd.Series(data, index=modin_multi)\n pandas_series = pandas.Series(data, index=pandas_multi)\n df_equals(\n modin_series.tz_convert(\"UTC\", axis=0, level=0),\n pandas_series.tz_convert(\"UTC\", axis=0, level=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_modin-project__modin/modin/pandas/test/test_series.py_test_tz_localize_test_tz_localize.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_tz_localize_test_tz_localize.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3563, "end_line": 3575, "span_ids": ["test_tz_localize"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_tz_localize():\n idx = pd.date_range(\"1/1/2012\", periods=400, freq=\"2D\")\n data = np.random.randint(0, 100, size=len(idx))\n modin_series = pd.Series(data, index=idx)\n pandas_series = pandas.Series(data, index=idx)\n df_equals(\n modin_series.tz_localize(\"America/Los_Angeles\"),\n pandas_series.tz_localize(\"America/Los_Angeles\"),\n )\n df_equals(\n modin_series.tz_localize(\"UTC\"),\n pandas_series.tz_localize(\"UTC\"),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unique_test_unique.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unique_test_unique.None_6", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3578, "end_line": 3619, "span_ids": ["test_unique"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_unique(data):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.unique()\n pandas_result = pandas_series.unique()\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.Series([2, 1, 3, 3], name=\"A\").unique()\n pandas_result = pandas.Series([2, 1, 3, 3], name=\"A\").unique()\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.Series([pd.Timestamp(\"2016-01-01\") for _ in range(3)]).unique()\n pandas_result = pandas.Series(\n [pd.Timestamp(\"2016-01-01\") for _ in range(3)]\n ).unique()\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.Series(\n [pd.Timestamp(\"2016-01-01\", tz=\"US/Eastern\") for _ in range(3)]\n ).unique()\n pandas_result = pandas.Series(\n [pd.Timestamp(\"2016-01-01\", tz=\"US/Eastern\") for _ in range(3)]\n ).unique()\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pandas.Series(pd.Categorical(list(\"baabc\"))).unique()\n pandas_result = pd.Series(pd.Categorical(list(\"baabc\"))).unique()\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape\n\n modin_result = pd.Series(\n pd.Categorical(list(\"baabc\"), categories=list(\"abc\"), ordered=True)\n ).unique()\n pandas_result = pandas.Series(\n pd.Categorical(list(\"baabc\"), categories=list(\"abc\"), ordered=True)\n ).unique()\n assert_array_equal(modin_result, pandas_result)\n assert modin_result.shape == pandas_result.shape", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unstack_test_unstack.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unstack_test_unstack.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3622, "end_line": 3635, "span_ids": ["test_unstack"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_unstack(data):\n modin_series, pandas_series = create_test_series(data)\n index = generate_multiindex(len(pandas_series), nlevels=4, is_tree_like=True)\n\n modin_series = pd.Series(data[next(iter(data.keys()))], index=index)\n pandas_series = pandas.Series(data[next(iter(data.keys()))], index=index)\n\n df_equals(modin_series.unstack(), pandas_series.unstack())\n df_equals(modin_series.unstack(level=0), pandas_series.unstack(level=0))\n df_equals(modin_series.unstack(level=[0, 1]), pandas_series.unstack(level=[0, 1]))\n df_equals(\n modin_series.unstack(level=[0, 1, 2]), pandas_series.unstack(level=[0, 1, 2])\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unstack_error_no_multiindex_test_update.df_equals_modin_series_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_unstack_error_no_multiindex_test_update.df_equals_modin_series_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3638, "end_line": 3652, "span_ids": ["test_unstack_error_no_multiindex", "test_update"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_unstack_error_no_multiindex():\n modin_series = pd.Series([0, 1, 2])\n with pytest.raises(ValueError, match=\"index must be a MultiIndex to unstack\"):\n modin_series.unstack()\n\n\n@pytest.mark.parametrize(\n \"data, other_data\",\n [([1, 2, 3], [4, 5, 6]), ([1, 2, 3], [4, 5, 6, 7, 8]), ([1, 2, 3], [4, np.nan, 6])],\n)\ndef test_update(data, other_data):\n modin_series, pandas_series = pd.Series(data), pandas.Series(data)\n modin_series.update(pd.Series(other_data))\n pandas_series.update(pandas.Series(other_data))\n df_equals(modin_series, pandas_series)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_value_counts_test_value_counts.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_value_counts_test_value_counts.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3655, "end_line": 3715, "span_ids": ["test_value_counts"], "tokens": 487}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"sort\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"normalize\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"bins\", [3, None])\n@pytest.mark.parametrize(\n \"dropna\",\n [\n pytest.param(None),\n pytest.param(False),\n pytest.param(\n True,\n marks=pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"https://github.com/modin-project/modin/issues/2896\",\n ),\n ),\n ],\n)\n@pytest.mark.parametrize(\"ascending\", bool_arg_values, ids=bool_arg_keys)\ndef test_value_counts(sort, normalize, bins, dropna, ascending):\n def sort_sensitive_comparator(df1, df2):\n # We sort indices for Modin and pandas result because of issue #1650\n return (\n df_equals_with_non_stable_indices(df1, df2)\n if sort\n else df_equals(df1.sort_index(), df2.sort_index())\n )\n\n eval_general(\n *create_test_series(test_data_values[0]),\n lambda df: df.value_counts(\n sort=sort,\n bins=bins,\n normalize=normalize,\n dropna=dropna,\n ascending=ascending,\n ),\n comparator=sort_sensitive_comparator,\n # Modin's `sort_values` does not validate `ascending` type and so\n # does not raise an exception when it isn't a bool, when pandas do so,\n # visit modin-issue#3388 for more info.\n check_exception_type=None if sort and ascending is None else True,\n )\n\n # from issue #2365\n arr = np.random.rand(2**6)\n arr[::10] = np.nan\n eval_general(\n *create_test_series(arr),\n lambda df: df.value_counts(\n sort=sort,\n bins=bins,\n normalize=normalize,\n dropna=dropna,\n ascending=ascending,\n ),\n comparator=sort_sensitive_comparator,\n # Modin's `sort_values` does not validate `ascending` type and so\n # does not raise an exception when it isn't a bool, when pandas do so,\n # visit modin-issue#3388 for more info.\n check_exception_type=None if sort and ascending is None else 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_modin-project__modin/modin/pandas/test/test_series.py_test_value_counts_categorical_test_value_counts_categorical.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_value_counts_categorical_test_value_counts_categorical.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3718, "end_line": 3741, "span_ids": ["test_value_counts_categorical"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_value_counts_categorical():\n # from issue #3571\n data = np.array([\"a\"] * 50000 + [\"b\"] * 10000 + [\"c\"] * 1000)\n random_state = np.random.RandomState(seed=42)\n random_state.shuffle(data)\n\n if StorageFormat.get() == \"Hdk\":\n # The order of HDK categories is different from Pandas\n # and, thus, index comparison fails.\n def comparator(df1, df2):\n # Perform our own non-strict version of dtypes equality check\n assert_dtypes_equal(df1, df2)\n assert_series_equal(\n df1._to_pandas(), df2, check_index=False, check_dtype=False\n )\n\n else:\n comparator = df_equals\n\n eval_general(\n *create_test_series(data, dtype=\"category\"),\n lambda df: df.value_counts(),\n comparator=comparator,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_values_test_values_ea.df_equals_modin_values_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_values_test_values_ea.df_equals_modin_values_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3744, "end_line": 3768, "span_ids": ["test_values", "test_values_ea", "test_values_non_numeric"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_values(data):\n modin_series, pandas_series = create_test_series(data)\n\n np.testing.assert_equal(modin_series.values, pandas_series.values)\n\n\ndef test_values_non_numeric():\n data = [\"str{0}\".format(i) for i in range(0, 10**3)]\n modin_series, pandas_series = create_test_series(data)\n\n modin_series = modin_series.astype(\"category\")\n pandas_series = pandas_series.astype(\"category\")\n\n df_equals(modin_series.values, pandas_series.values)\n\n\ndef test_values_ea():\n data = pandas.arrays.SparseArray(np.arange(10, dtype=\"int64\"))\n modin_series, pandas_series = create_test_series(data)\n modin_values = modin_series.values\n pandas_values = pandas_series.values\n\n assert modin_values.dtype == pandas_values.dtype\n df_equals(modin_values, pandas_values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_var_test_var.try_.else_.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_var_test_var.try_.else_.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3771, "end_line": 3786, "span_ids": ["test_var"], "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": "@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\n@pytest.mark.parametrize(\n \"skipna\", bool_arg_values, ids=arg_keys(\"skipna\", bool_arg_keys)\n)\n@pytest.mark.parametrize(\"ddof\", int_arg_values, ids=arg_keys(\"ddof\", int_arg_keys))\ndef test_var(data, skipna, ddof):\n modin_series, pandas_series = create_test_series(data)\n\n try:\n pandas_result = pandas_series.var(skipna=skipna, ddof=ddof)\n except Exception as err:\n with pytest.raises(type(err)):\n modin_series.var(skipna=skipna, ddof=ddof)\n else:\n modin_result = modin_series.var(skipna=skipna, ddof=ddof)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_view_test_view.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_view_test_view.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3789, "end_line": 3806, "span_ids": ["test_view"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_view():\n modin_series = pd.Series([-2, -1, 0, 1, 2], dtype=\"int8\")\n pandas_series = pandas.Series([-2, -1, 0, 1, 2], dtype=\"int8\")\n modin_result = modin_series.view(dtype=\"uint8\")\n pandas_result = pandas_series.view(dtype=\"uint8\")\n df_equals(modin_result, pandas_result)\n\n modin_series = pd.Series([-20, -10, 0, 10, 20], dtype=\"int32\")\n pandas_series = pandas.Series([-20, -10, 0, 10, 20], dtype=\"int32\")\n modin_result = modin_series.view(dtype=\"float32\")\n pandas_result = pandas_series.view(dtype=\"float32\")\n df_equals(modin_result, pandas_result)\n\n modin_series = pd.Series([-200, -100, 0, 100, 200], dtype=\"int64\")\n pandas_series = pandas.Series([-200, -100, 0, 100, 200], dtype=\"int64\")\n modin_result = modin_series.view(dtype=\"float64\")\n pandas_result = pandas_series.view(dtype=\"float64\")\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_where_test_where.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_where_test_where.None_3", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3809, "end_line": 3828, "span_ids": ["test_where"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_where():\n frame_data = random_state.randn(100)\n pandas_series = pandas.Series(frame_data)\n modin_series = pd.Series(frame_data)\n pandas_cond_series = pandas_series % 5 < 2\n modin_cond_series = modin_series % 5 < 2\n\n pandas_result = pandas_series.where(pandas_cond_series, -pandas_series)\n modin_result = modin_series.where(modin_cond_series, -modin_series)\n assert all((to_pandas(modin_result) == pandas_result))\n\n other_data = random_state.randn(100)\n modin_other, pandas_other = pd.Series(other_data), pandas.Series(other_data)\n pandas_result = pandas_series.where(pandas_cond_series, pandas_other, axis=0)\n modin_result = modin_series.where(modin_cond_series, modin_other, axis=0)\n assert all(to_pandas(modin_result) == pandas_result)\n\n pandas_result = pandas_series.where(pandas_series < 2, True)\n modin_result = modin_series.where(modin_series < 2, True)\n assert all(to_pandas(modin_result) == pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_str___getitem___test_str___getitem__.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str___getitem___test_str___getitem__.df_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3831, "end_line": 3846, "span_ids": ["test_str___getitem__"], "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.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\n \"key\",\n [0, slice(0, len(test_string_data_values) / 2)],\n ids=[\"single_key\", \"slice_key\"],\n)\ndef test_str___getitem__(data, key):\n modin_series, pandas_series = create_test_series(data)\n modin_result = modin_series.str[key]\n pandas_result = pandas_series.str[key]\n df_equals(\n modin_result,\n pandas_result,\n # https://github.com/modin-project/modin/issues/5968\n check_dtypes=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_modin-project__modin/modin/pandas/test/test_series.py__Test_str_operations_test_str_cat.eval_general_create_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py__Test_str_operations_test_str_cat.eval_general_create_test", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3849, "end_line": 3857, "span_ids": ["test_str_cat", "test_str___getitem__"], "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": "# Test str operations\n@pytest.mark.parametrize(\n \"others\",\n [[\"abC|DeF,Hik\", \"gSaf,qWer|Gre\", \"asd3,4sad|\", np.NaN], None],\n ids=[\"list\", \"None\"],\n)\ndef test_str_cat(others):\n data = [\"abC|DeF,Hik\", \"gSaf,qWer|Gre\", \"asd3,4sad|\", np.NaN]\n eval_general(*create_test_series(data), lambda s: s.str.cat(others=others))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_split_test_str_split.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_split_test_str_split.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3860, "end_line": 3868, "span_ids": ["test_str_split"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"expand\", bool_arg_values, ids=bool_arg_keys)\ndef test_str_split(data, pat, n, expand):\n eval_general(\n *create_test_series(data),\n lambda series: series.str.split(pat, n=n, expand=expand),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rsplit_test_str_rsplit.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rsplit_test_str_rsplit.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3871, "end_line": 3879, "span_ids": ["test_str_rsplit"], "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": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"expand\", bool_arg_values, ids=bool_arg_keys)\ndef test_str_rsplit(data, pat, n, expand):\n eval_general(\n *create_test_series(data),\n lambda series: series.str.rsplit(pat, n=n, expand=expand),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_get_test_str_join.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_get_test_str_join.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3882, "end_line": 3895, "span_ids": ["test_str_join", "test_str_get"], "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": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"i\", int_arg_values, ids=int_arg_keys)\ndef test_str_get(data, i):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.get(i))\n\n\n@pytest.mark.parametrize(\n \"data\", test_string_list_data_values, ids=test_string_list_data_keys\n)\n@pytest.mark.parametrize(\"sep\", string_sep_values, ids=string_sep_keys)\ndef test_str_join(data, sep):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.join(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_modin-project__modin/modin/pandas/test/test_series.py_test_str_get_dummies_test_str_get_dummies.if_sep_.with_warns_that_defaultin.modin_series_str_get_dumm": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_get_dummies_test_str_get_dummies.if_sep_.with_warns_that_defaultin.modin_series_str_get_dumm", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3898, "end_line": 3909, "span_ids": ["test_str_get_dummies"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data\", test_string_list_data_values, ids=test_string_list_data_keys\n)\n@pytest.mark.parametrize(\"sep\", string_sep_values, ids=string_sep_keys)\ndef test_str_get_dummies(data, sep):\n modin_series, pandas_series = create_test_series(data)\n\n if sep:\n with warns_that_defaulting_to_pandas():\n # We are only testing that this defaults to pandas, so we will just check for\n # the warning\n modin_series.str.get_dummies(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_modin-project__modin/modin/pandas/test/test_series.py_test_str_contains_test_str_contains.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_contains_test_str_contains.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3912, "end_line": 3934, "span_ids": ["test_str_contains"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"case\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"na\", string_na_rep_values, ids=string_na_rep_keys)\ndef test_str_contains(data, pat, case, na):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.contains(pat, case=case, na=na, regex=False),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n # Test regex\n pat = \",|b\"\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.contains(pat, case=case, na=na, regex=True),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_replace_test_str_replace.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_replace_test_str_replace.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3937, "end_line": 3957, "span_ids": ["test_str_replace"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"repl\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"n\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"case\", bool_arg_values, ids=bool_arg_keys)\ndef test_str_replace(data, pat, repl, n, case):\n eval_general(\n *create_test_series(data),\n lambda series: series.str.replace(pat, repl, n=n, case=case, regex=False),\n # https://github.com/modin-project/modin/issues/5970\n comparator_kwargs={\"check_dtypes\": pat is not None},\n )\n # Test regex\n eval_general(\n *create_test_series(data),\n lambda series: series.str.replace(\n pat=\",|b\", repl=repl, n=n, case=case, regex=True\n ),\n # https://github.com/modin-project/modin/issues/5970\n comparator_kwargs={\"check_dtypes\": pat is not None},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_repeat_test_str_removesuffix.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_repeat_test_str_removesuffix.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3960, "end_line": 3986, "span_ids": ["test_str_repeat", "test_str_removesuffix", "test_str_removeprefix"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"repeats\", int_arg_values, ids=int_arg_keys)\ndef test_str_repeat(data, repeats):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.repeat(repeats))\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_removeprefix(data):\n modin_series, pandas_series = create_test_series(data)\n prefix = \"test_prefix\"\n eval_general(\n modin_series,\n pandas_series,\n lambda series: (prefix + series).str.removeprefix(prefix),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_removesuffix(data):\n modin_series, pandas_series = create_test_series(data)\n suffix = \"test_suffix\"\n eval_general(\n modin_series,\n pandas_series,\n lambda series: (series + suffix).str.removesuffix(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_modin-project__modin/modin/pandas/test/test_series.py_test_str_pad_test_str_pad.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_pad_test_str_pad.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 3989, "end_line": 4001, "span_ids": ["test_str_pad"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"width\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\n \"side\", [\"left\", \"right\", \"both\"], ids=[\"left\", \"right\", \"both\"]\n)\n@pytest.mark.parametrize(\"fillchar\", string_sep_values, ids=string_sep_keys)\ndef test_str_pad(data, width, side, fillchar):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.pad(width, side=side, fillchar=fillchar),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_center_test_str_center.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_center_test_str_center.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4004, "end_line": 4013, "span_ids": ["test_str_center"], "tokens": 103}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"width\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"fillchar\", string_sep_values, ids=string_sep_keys)\ndef test_str_center(data, width, fillchar):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.center(width, fillchar=fillchar),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_ljust_test_str_ljust.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_ljust_test_str_ljust.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4016, "end_line": 4025, "span_ids": ["test_str_ljust"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"width\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"fillchar\", string_sep_values, ids=string_sep_keys)\ndef test_str_ljust(data, width, fillchar):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.ljust(width, fillchar=fillchar),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rjust_test_str_rjust.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rjust_test_str_rjust.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4028, "end_line": 4037, "span_ids": ["test_str_rjust"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"width\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"fillchar\", string_sep_values, ids=string_sep_keys)\ndef test_str_rjust(data, width, fillchar):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.rjust(width, fillchar=fillchar),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_zfill_test_str_wrap.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_zfill_test_str_wrap.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4040, "end_line": 4051, "span_ids": ["test_str_wrap", "test_str_zfill"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"width\", int_arg_values, ids=int_arg_keys)\ndef test_str_zfill(data, width):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.zfill(width))\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"width\", int_arg_values, ids=int_arg_keys)\ndef test_str_wrap(data, width):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.wrap(width))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_slice_test_str_slice.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_slice_test_str_slice.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4054, "end_line": 4064, "span_ids": ["test_str_slice"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"start\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"stop\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"step\", int_arg_values, ids=int_arg_keys)\ndef test_str_slice(data, start, stop, step):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.slice(start=start, stop=stop, step=step),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_slice_replace_test_str_count.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_slice_replace_test_str_count.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4067, "end_line": 4084, "span_ids": ["test_str_slice_replace", "test_str_count"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"start\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"stop\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"repl\", string_sep_values, ids=string_sep_keys)\ndef test_str_slice_replace(data, start, stop, repl):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.slice_replace(start=start, stop=stop, repl=repl),\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\ndef test_str_count(data, pat):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.count(pat))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_startswith_test_str_startswith.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_startswith_test_str_startswith.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4087, "end_line": 4098, "span_ids": ["test_str_startswith"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"na\", string_na_rep_values, ids=string_na_rep_keys)\ndef test_str_startswith(data, pat, na):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.startswith(pat, na=na),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_endswith_test_str_endswith.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_endswith_test_str_endswith.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4101, "end_line": 4112, "span_ids": ["test_str_endswith"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"na\", string_na_rep_values, ids=string_na_rep_keys)\ndef test_str_endswith(data, pat, na):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.endswith(pat, na=na),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_findall_test_str_fullmatch.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_findall_test_str_fullmatch.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4115, "end_line": 4126, "span_ids": ["test_str_findall", "test_str_fullmatch"], "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.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\ndef test_str_findall(data, pat):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.findall(pat))\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\ndef test_str_fullmatch(data, pat):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.fullmatch(pat))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_match_test_str_match.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_match_test_str_match.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4129, "end_line": 4139, "span_ids": ["test_str_match"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"case\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"na\", string_na_rep_values, ids=string_na_rep_keys)\ndef test_str_match(data, pat, case, na):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.match(pat, case=case, na=na),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_extract_test_str_extract.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_extract_test_str_extract.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4142, "end_line": 4152, "span_ids": ["test_str_extract"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"expand\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"pat\", [r\"([ab])\", r\"([ab])(\\d)\"])\ndef test_str_extract(data, expand, pat):\n modin_series, pandas_series = create_test_series(data)\n\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.extract(pat, expand=expand),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_extractall_test_str_lstrip.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_extractall_test_str_lstrip.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4155, "end_line": 4195, "span_ids": ["test_str_extractall", "test_str_len", "test_str_rstrip", "test_str_strip", "test_str_lstrip"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_extractall(data):\n modin_series, pandas_series = create_test_series(data)\n\n with warns_that_defaulting_to_pandas():\n # We are only testing that this defaults to pandas, so we will just check for\n # the warning\n modin_series.str.extractall(r\"([ab])(\\d)\")\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_len(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.len())\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"to_strip\", string_sep_values, ids=string_sep_keys)\ndef test_str_strip(data, to_strip):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series, pandas_series, lambda series: series.str.strip(to_strip=to_strip)\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"to_strip\", string_sep_values, ids=string_sep_keys)\ndef test_str_rstrip(data, to_strip):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series, pandas_series, lambda series: series.str.rstrip(to_strip=to_strip)\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"to_strip\", string_sep_values, ids=string_sep_keys)\ndef test_str_lstrip(data, to_strip):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series, pandas_series, lambda series: series.str.lstrip(to_strip=to_strip)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_partition_test_str_partition.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_partition_test_str_partition.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4198, "end_line": 4209, "span_ids": ["test_str_partition"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"sep\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"expand\", bool_arg_values, ids=bool_arg_keys)\ndef test_str_partition(data, sep, expand):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.partition(sep, expand=expand),\n # https://github.com/modin-project/modin/issues/5971\n comparator_kwargs={\"check_dtypes\": sep is not None},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rpartition_test_str_rpartition.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rpartition_test_str_rpartition.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4212, "end_line": 4223, "span_ids": ["test_str_rpartition"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"sep\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"expand\", bool_arg_values, ids=bool_arg_keys)\ndef test_str_rpartition(data, sep, expand):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.rpartition(sep, expand=expand),\n # https://github.com/modin-project/modin/issues/5971\n comparator_kwargs={\"check_dtypes\": sep is not None},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_lower_test_str_title.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_lower_test_str_title.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4226, "end_line": 4241, "span_ids": ["test_str_upper", "test_str_lower", "test_str_title"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_lower(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.lower())\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_upper(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.upper())\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_title(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.title())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_find_test_str_find.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_find_test_str_find.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4244, "end_line": 4256, "span_ids": ["test_str_find"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"sub\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"start\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"end\", int_arg_values, ids=int_arg_keys)\ndef test_str_find(data, sub, start, end):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.find(sub, start=start, end=end),\n # https://github.com/modin-project/modin/issues/5972\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_rfind_test_str_rfind.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rfind_test_str_rfind.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4259, "end_line": 4271, "span_ids": ["test_str_rfind"], "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": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"sub\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"start\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"end\", int_arg_values, ids=int_arg_keys)\ndef test_str_rfind(data, sub, start, end):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.rfind(sub, start=start, end=end),\n # https://github.com/modin-project/modin/issues/5972\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_index_test_str_index.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_index_test_str_index.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4274, "end_line": 4286, "span_ids": ["test_str_index"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"sub\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"start\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"end\", int_arg_values, ids=int_arg_keys)\ndef test_str_index(data, sub, start, end):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.index(sub, start=start, end=end),\n # https://github.com/modin-project/modin/issues/5972\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_rindex_test_str_rindex.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_rindex_test_str_rindex.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4289, "end_line": 4301, "span_ids": ["test_str_rindex"], "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": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"sub\", string_sep_values, ids=string_sep_keys)\n@pytest.mark.parametrize(\"start\", int_arg_values, ids=int_arg_keys)\n@pytest.mark.parametrize(\"end\", int_arg_values, ids=int_arg_keys)\ndef test_str_rindex(data, sub, start, end):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.rindex(sub, start=start, end=end),\n # https://github.com/modin-project/modin/issues/5972\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_capitalize_test_str_normalize.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_capitalize_test_str_normalize.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4304, "end_line": 4322, "span_ids": ["test_str_swapcase", "test_str_capitalize", "test_str_normalize"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_capitalize(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.capitalize())\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_swapcase(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.swapcase())\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\n \"form\", [\"NFC\", \"NFKC\", \"NFD\", \"NFKD\"], ids=[\"NFC\", \"NFKC\", \"NFD\", \"NFKD\"]\n)\ndef test_str_normalize(data, form):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.normalize(form))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_translate_test_str_translate.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_translate_test_str_translate.None_2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4325, "end_line": 4358, "span_ids": ["test_str_translate"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\n@pytest.mark.parametrize(\"pat\", string_sep_values, ids=string_sep_keys)\ndef test_str_translate(data, pat):\n modin_series, pandas_series = create_test_series(data)\n\n # Test none table\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.translate(None),\n # https://github.com/modin-project/modin/issues/5970\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n # Translation dictionary\n table = {pat: \"DDD\"}\n eval_general(\n modin_series, pandas_series, lambda series: series.str.translate(table)\n )\n\n # Translation table with maketrans (python3 only)\n if pat is not None:\n table = str.maketrans(pat, \"d\" * len(pat))\n eval_general(\n modin_series, pandas_series, lambda series: series.str.translate(table)\n )\n\n # Test delete chars\n deletechars = \"|\"\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.translate(table, deletechars),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_isalnum_test_str_isnumeric.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_isalnum_test_str_isnumeric.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4361, "end_line": 4454, "span_ids": ["test_str_isupper", "test_str_isnumeric", "test_str_isspace", "test_str_isdigit", "test_str_islower", "test_str_isalnum", "test_str_isalpha", "test_str_istitle"], "tokens": 697}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isalnum(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isalnum(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isalpha(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isalpha(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isdigit(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isdigit(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isspace(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isspace(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_islower(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.islower(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isupper(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isupper(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_istitle(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.istitle(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isnumeric(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isnumeric(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": 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_modin-project__modin/modin/pandas/test/test_series.py_test_str_isdecimal_test_str_decode.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_str_isdecimal_test_str_decode.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4457, "end_line": 4513, "span_ids": ["test_str_isdecimal", "test_str_decode", "str_encode_decode_test_data", "test_casefold", "test_str_encode"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_str_isdecimal(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.str.isdecimal(),\n # https://github.com/modin-project/modin/issues/5969\n comparator_kwargs={\"check_dtypes\": False},\n )\n\n\n@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_casefold(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(modin_series, pandas_series, lambda series: series.str.casefold())\n\n\n@pytest.fixture\ndef str_encode_decode_test_data() -> list[str]:\n return [\n \"abC|DeF,Hik\",\n \"234,3245.67\",\n \"gSaf,qWer|Gre\",\n \"asd3,4sad|\",\n np.NaN,\n None,\n # add a string that we can't encode in ascii, and whose utf-8 encoding\n # we cannot decode in ascii\n \"\u0d15\",\n ]\n\n\n@pytest.mark.parametrize(\"encoding\", encoding_types)\n@pytest.mark.parametrize(\"errors\", [\"strict\", \"ignore\", \"replace\"])\ndef test_str_encode(encoding, errors, str_encode_decode_test_data):\n eval_general(\n *create_test_series(str_encode_decode_test_data),\n lambda s: s.str.encode(encoding, errors=errors),\n )\n\n\n@pytest.mark.parametrize(\n \"encoding\",\n encoding_types,\n)\n@pytest.mark.parametrize(\"errors\", [\"strict\", \"ignore\", \"replace\"])\ndef test_str_decode(encoding, errors, str_encode_decode_test_data):\n eval_general(\n *create_test_series(\n [\n s.encode(\"utf-8\") if isinstance(s, str) else s\n for s in str_encode_decode_test_data\n ]\n ),\n lambda s: s.str.decode(encoding, errors=errors),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_non_commutative_add_string_to_series_test_non_commutative_multiply_pandas.assert_not_integer_pan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_non_commutative_add_string_to_series_test_non_commutative_multiply_pandas.assert_not_integer_pan", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4516, "end_line": 4531, "span_ids": ["test_non_commutative_multiply_pandas", "test_non_commutative_add_string_to_series"], "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": "@pytest.mark.parametrize(\"data\", test_string_data_values, ids=test_string_data_keys)\ndef test_non_commutative_add_string_to_series(data):\n # This test checks that add and radd do different things when addition is\n # not commutative, e.g. for adding a string to a string. For context see\n # https://github.com/modin-project/modin/issues/4908\n eval_general(*create_test_series(data), lambda s: \"string\" + s)\n eval_general(*create_test_series(data), lambda s: s + \"string\")\n\n\ndef test_non_commutative_multiply_pandas():\n # The non commutative integer class implementation is tricky. Check that\n # multiplying such an integer with a pandas series is really not\n # commutative.\n pandas_series = pandas.Series(1, dtype=int)\n integer = NonCommutativeMultiplyInteger(2)\n assert not (integer * pandas_series).equals(pandas_series * integer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_non_commutative_multiply_test_non_commutative_multiply.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_non_commutative_multiply_test_non_commutative_multiply.None_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4534, "end_line": 4541, "span_ids": ["test_non_commutative_multiply"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_non_commutative_multiply():\n # This test checks that mul and rmul do different things when\n # multiplication is not commutative, e.g. for adding a string to a string.\n # For context see https://github.com/modin-project/modin/issues/5238\n modin_series, pandas_series = create_test_series(1, dtype=int)\n integer = NonCommutativeMultiplyInteger(2)\n eval_general(modin_series, pandas_series, lambda s: integer * s)\n eval_general(modin_series, pandas_series, lambda s: s * integer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_hasattr_sparse_test_hasattr_sparse.eval_general_modin_df_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_hasattr_sparse_test_hasattr_sparse.eval_general_modin_df_pa", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4544, "end_line": 4555, "span_ids": ["test_hasattr_sparse"], "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": "@pytest.mark.parametrize(\n \"is_sparse_data\", [True, False], ids=[\"is_sparse\", \"is_not_sparse\"]\n)\ndef test_hasattr_sparse(is_sparse_data):\n modin_df, pandas_df = (\n create_test_series(\n pandas.arrays.SparseArray(test_data[\"float_nan_data\"].values())\n )\n if is_sparse_data\n else create_test_series(test_data[\"float_nan_data\"])\n )\n eval_general(modin_df, pandas_df, lambda df: hasattr(df, \"sparse\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_categories_test_cat_categories.eval_general_modin_series": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_categories_test_cat_categories.eval_general_modin_series", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4558, "end_line": 4571, "span_ids": ["test_cat_categories"], "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": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_categories(data):\n modin_series, pandas_series = create_test_series(data.copy())\n df_equals(modin_series.cat.categories, pandas_series.cat.categories)\n\n def set_categories(ser):\n ser.cat.categories = list(\"qwert\")\n return ser\n\n # pandas 2.0.0: Removed setting Categorical.categories directly (GH47834)\n # Just check the exception\n eval_general(modin_series, pandas_series, set_categories)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_ordered_test_cat_codes.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_ordered_test_cat_codes.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4574, "end_line": 4593, "span_ids": ["test_cat_codes", "test_cat_ordered"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_ordered(data):\n modin_series, pandas_series = create_test_series(data.copy())\n assert modin_series.cat.ordered == pandas_series.cat.ordered\n\n\n@pytest.mark.skipif(\n StorageFormat.get() == \"Hdk\",\n reason=\"HDK uses internal codes, that are different from Pandas\",\n)\n@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_codes(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.codes\n modin_result = modin_series.cat.codes\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cat_codes_issue5650_test_cat_codes_issue5650.eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_codes_issue5650_test_cat_codes_issue5650.eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4596, "end_line": 4614, "span_ids": ["test_cat_codes_issue5650"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"set_min_partition_size\",\n [1, 2],\n ids=[\"four_partitions\", \"two_partitions\"],\n indirect=True,\n)\ndef test_cat_codes_issue5650(set_min_partition_size):\n data = {\"name\": [\"abc\", \"def\", \"ghi\", \"jkl\"]}\n pandas_df = pandas.DataFrame(data)\n pandas_df = pandas_df.astype(\"category\")\n modin_df = pd.DataFrame(data)\n modin_df = modin_df.astype(\"category\")\n eval_general(\n modin_df,\n pandas_df,\n lambda df: df[\"name\"].cat.codes,\n # https://github.com/modin-project/modin/issues/5973\n comparator_kwargs={\"check_dtypes\": StorageFormat.get() != \"Hdk\"},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_rename_categories_test_cat_reorder_categories.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_rename_categories_test_cat_reorder_categories.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4617, "end_line": 4637, "span_ids": ["test_cat_rename_categories", "test_cat_reorder_categories"], "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": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_rename_categories(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.rename_categories(list(\"qwert\"))\n modin_result = modin_series.cat.rename_categories(list(\"qwert\"))\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\n@pytest.mark.parametrize(\"ordered\", bool_arg_values, ids=bool_arg_keys)\ndef test_cat_reorder_categories(data, ordered):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.reorder_categories(list(\"tades\"), ordered=ordered)\n modin_result = modin_series.cat.reorder_categories(list(\"tades\"), ordered=ordered)\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cat_add_categories_test_cat_remove_categories.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_add_categories_test_cat_remove_categories.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4640, "end_line": 4659, "span_ids": ["test_cat_remove_categories", "test_cat_add_categories"], "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": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_add_categories(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.add_categories(list(\"qw\"))\n modin_result = modin_series.cat.add_categories(list(\"qw\"))\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_remove_categories(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.remove_categories(list(\"at\"))\n modin_result = modin_series.cat.remove_categories(list(\"at\"))\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cat_remove_unused_categories_test_cat_remove_unused_categories.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_remove_unused_categories_test_cat_remove_unused_categories.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4662, "end_line": 4672, "span_ids": ["test_cat_remove_unused_categories"], "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": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_remove_unused_categories(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_series[1] = np.nan\n pandas_result = pandas_series.cat.remove_unused_categories()\n modin_series[1] = np.nan\n modin_result = modin_series.cat.remove_unused_categories()\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cat_set_categories_test_cat_set_categories.df_equals_modin_result_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_set_categories_test_cat_set_categories.df_equals_modin_result_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4675, "end_line": 4689, "span_ids": ["test_cat_set_categories"], "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": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\n@pytest.mark.parametrize(\"ordered\", bool_arg_values, ids=bool_arg_keys)\n@pytest.mark.parametrize(\"rename\", [True, False])\ndef test_cat_set_categories(data, ordered, rename):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.set_categories(\n list(\"qwert\"), ordered=ordered, rename=rename\n )\n modin_result = modin_series.cat.set_categories(\n list(\"qwert\"), ordered=ordered, rename=rename\n )\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_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_modin-project__modin/modin/pandas/test/test_series.py_test_cat_as_ordered_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/test_series.py_test_cat_as_ordered_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/test_series.py", "file_name": "test_series.py", "file_type": "text/x-python", "category": "test", "start_line": 4692, "end_line": 4739, "span_ids": ["test_peculiar_callback", "test_cat_as_ordered", "test_cat_as_unordered", "test_apply_return_df"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_as_ordered(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.as_ordered()\n modin_result = modin_series.cat.as_ordered()\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_result)\n\n\n@pytest.mark.parametrize(\n \"data\", test_data_categorical_values, ids=test_data_categorical_keys\n)\ndef test_cat_as_unordered(data):\n modin_series, pandas_series = create_test_series(data.copy())\n pandas_result = pandas_series.cat.as_unordered()\n modin_result = modin_series.cat.as_unordered()\n df_equals(modin_series, pandas_series)\n df_equals(modin_result, pandas_result)\n\n\ndef test_peculiar_callback():\n def func(val):\n if not isinstance(val, tuple):\n raise BaseException(\"Urgh...\")\n return val\n\n pandas_df = pandas.DataFrame({\"col\": [(0, 1)]})\n pandas_series = pandas_df[\"col\"].apply(func)\n\n modin_df = pd.DataFrame({\"col\": [(0, 1)]})\n modin_series = modin_df[\"col\"].apply(func)\n\n df_equals(modin_series, pandas_series)\n\n\n@pytest.mark.parametrize(\"data\", test_data_values, ids=test_data_keys)\ndef test_apply_return_df(data):\n modin_series, pandas_series = create_test_series(data)\n eval_general(\n modin_series,\n pandas_series,\n lambda series: series.apply(\n lambda x: pandas.Series([x + i for i in range(100)])\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_modin-project__modin/modin/pandas/test/utils.py_re__The_test_data_that_we_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_re__The_test_data_that_we_w", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 72, "span_ids": ["docstring"], "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": "import re\nfrom pathlib import Path\nfrom typing import Union\nimport pytest\nimport numpy as np\nimport math\nimport pandas\nimport itertools\nfrom pandas.testing import (\n assert_series_equal,\n assert_frame_equal,\n assert_index_equal,\n assert_extension_array_equal,\n)\nfrom pandas.core.dtypes.common import (\n is_list_like,\n is_numeric_dtype,\n is_object_dtype,\n is_string_dtype,\n is_bool_dtype,\n is_categorical_dtype,\n is_datetime64_any_dtype,\n is_timedelta64_dtype,\n is_period_dtype,\n)\n\nfrom modin.config import MinPartitionSize, NPartitions\nimport modin.pandas as pd\nfrom modin.utils import to_pandas, try_cast_to_pandas\nfrom modin.config import TestDatasetSize, TrackFileLeaks\nfrom io import BytesIO\nimport os\nfrom string import ascii_letters\nimport csv\nimport psutil\nimport functools\n\n# Flag activated on command line with \"--extra-test-parameters\" option.\n# Used in some tests to perform additional parameter combinations.\nextra_test_parameters = False\n\nrandom_state = np.random.RandomState(seed=42)\n\nDATASET_SIZE_DICT = {\n \"Small\": (2**2, 2**3),\n \"Normal\": (2**6, 2**8),\n \"Big\": (2**7, 2**12),\n}\n\n# Size of test dataframes\nNCOLS, NROWS = DATASET_SIZE_DICT.get(TestDatasetSize.get(), DATASET_SIZE_DICT[\"Normal\"])\nNGROUPS = 10\n\n# Range for values for test data\nRAND_LOW = 0\nRAND_HIGH = 100\n\n# Input data and functions for the tests\n# The test data that we will test our code against", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_test_data__that_purpose_at_time_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_test_data__that_purpose_at_time_p", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 135, "span_ids": ["docstring:19", "docstring"], "tokens": 699}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "test_data = {\n # \"empty_data\": {},\n # \"columns_only\": {\"col1\": [], \"col2\": [], \"col3\": [], \"col4\": [], \"col5\": []},\n \"int_data\": {\n \"col{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): random_state.randint(\n RAND_LOW, RAND_HIGH, size=(NROWS)\n )\n for i in range(NCOLS)\n },\n \"float_nan_data\": {\n \"col{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): [\n x\n if (j % 4 == 0 and i > NCOLS // 2) or (j != i and i <= NCOLS // 2)\n else np.NaN\n for j, x in enumerate(\n random_state.uniform(RAND_LOW, RAND_HIGH, size=(NROWS))\n )\n ]\n for i in range(NCOLS)\n },\n # \"int_float_object_data\": {\n # \"col3\": [1, 2, 3, 4],\n # \"col4\": [4, 5, 6, 7],\n # \"col1\": [8.0, 9.4, 10.1, 11.3],\n # \"col2\": [\"a\", \"b\", \"c\", \"d\"],\n # },\n # \"datetime_timedelta_data\": {\n # \"col3\": [\n # np.datetime64(\"2010\"),\n # np.datetime64(\"2011\"),\n # np.datetime64(\"2011-06-15T00:00\"),\n # np.datetime64(\"2009-01-01\"),\n # ],\n # \"col4\": [\n # np.datetime64(\"2010\"),\n # np.datetime64(\"2011\"),\n # np.datetime64(\"2011-06-15T00:00\"),\n # np.datetime64(\"2009-01-01\"),\n # ],\n # \"col1\": [\n # np.timedelta64(1, \"M\"),\n # np.timedelta64(2, \"D\"),\n # np.timedelta64(3, \"Y\"),\n # np.timedelta64(20, \"D\"),\n # ],\n # \"col2\": [\n # np.timedelta64(1, \"M\"),\n # np.timedelta64(2, \"D\"),\n # np.timedelta64(3, \"Y\"),\n # np.timedelta64(20, \"D\"),\n # ],\n # },\n # \"all_data\": {\n # \"col3\": 1.0,\n # \"col4\": np.datetime64(\"2011-06-15T00:00\"),\n # \"col5\": np.array([3] * 4, dtype=\"int32\"),\n # \"col1\": \"foo\",\n # \"col2\": True,\n # },\n}\n# The parse_dates param can take several different types and combinations of\n# types. Use the following values to test date parsing on a CSV created for\n# that purpose at `time_parsing_csv_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_modin-project__modin/modin/pandas/test/utils.py_parse_dates_values_by_id_test_data_with_duplicates": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_parse_dates_values_by_id_test_data_with_duplicates", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 136, "end_line": 208, "span_ids": ["docstring:19", "impl:35"], "tokens": 724}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "parse_dates_values_by_id = {\n \"bool\": False,\n \"list_of_single_int\": [0],\n \"list_of_single_string\": [\"timestamp\"],\n \"list_of_list_of_strings\": [[\"year\", \"month\", \"date\"]],\n \"list_of_string_and_list_of_strings\": [\"timestamp\", [\"year\", \"month\", \"date\"]],\n \"list_of_list_of_ints\": [[1, 2, 3]],\n \"list_of_list_of_strings_and_ints\": [[\"year\", 2, \"date\"]],\n \"empty_list\": [],\n \"dict\": {\"year_and_month\": [1, 2], \"day\": [\"date\"]},\n \"nonexistent_string_column\": [\"z\"],\n \"nonexistent_int_column\": [99],\n}\n\n# See details in #1403\ntest_data[\"int_data\"][\"index\"] = test_data[\"int_data\"].pop(\n \"col{}\".format(int(NCOLS / 2))\n)\n\nfor col in test_data[\"float_nan_data\"]:\n for row in range(NROWS // 2):\n if row % 16 == 0:\n test_data[\"float_nan_data\"][col][row] = np.NaN\n\ntest_data_values = list(test_data.values())\ntest_data_keys = list(test_data.keys())\n\ntest_bool_data = {\n \"col{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): random_state.choice(\n [True, False], size=(NROWS)\n )\n for i in range(NCOLS)\n}\n\ntest_groupby_data = {f\"col{i}\": np.arange(NCOLS) % NGROUPS for i in range(NROWS)}\n\ntest_data_resample = {\n \"data\": {\"A\": range(12), \"B\": range(12)},\n \"index\": pandas.date_range(\"31/12/2000\", periods=12, freq=\"H\"),\n}\n\ntest_data_with_duplicates = {\n \"no_duplicates\": {\n \"col{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): range(NROWS)\n for i in range(NCOLS)\n },\n \"all_duplicates\": {\n \"col{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): [\n float(i) for _ in range(NROWS)\n ]\n for i in range(NCOLS)\n },\n \"some_duplicates\": {\n \"col{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): [\n i if j % 7 == 0 else x for j, x in enumerate(range(NROWS))\n ]\n for i in range(NCOLS)\n },\n \"has_name_column\": {\n \"name\": [\"one\", \"two\", \"two\", \"three\"],\n \"col1\": [1, 2, 2, 3],\n \"col3\": [10, 20, 20, 3],\n \"col7\": [100, 201, 200, 300],\n },\n \"str_columns\": {\n \"col_str{}\".format(int((i - NCOLS / 2) % NCOLS + 1)): [\n \"s\" + str(x % 5) for x in range(NROWS)\n ]\n for i in range(NCOLS)\n },\n}\n\ntest_data_with_duplicates[\"float_nan\"] = test_data[\"float_nan_data\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_test_data_small_test_func_values.list_test_func_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_test_data_small_test_func_values.list_test_func_values_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 210, "end_line": 303, "span_ids": ["impl:72", "impl:35"], "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": "test_data_small = {\n \"small\": {\n \"col0\": [1, 2, 3, 4],\n \"col1\": [8.0, 9.4, 10.1, 11.3],\n \"col2\": [4, 5, 6, 7],\n }\n}\n\ntest_data_diff_dtype = {\n \"int_col\": [-5, 2, 7, 16],\n \"float_col\": [np.NaN, -9.4, 10.1, np.NaN],\n \"str_col\": [\"a\", np.NaN, \"c\", \"d\"],\n \"bool_col\": [False, True, True, False],\n}\n\ntest_data_small_values = list(test_data_small.values())\ntest_data_small_keys = list(test_data_small.keys())\n\ntest_data_with_duplicates_values = list(test_data_with_duplicates.values())\ntest_data_with_duplicates_keys = list(test_data_with_duplicates.keys())\n\ntest_data_categorical = {\n \"ordered\": pandas.Categorical(list(\"testdata\"), ordered=True),\n \"unordered\": pandas.Categorical(list(\"testdata\"), ordered=False),\n}\n\ntest_data_categorical_values = list(test_data_categorical.values())\ntest_data_categorical_keys = list(test_data_categorical.keys())\n\n# Fully fill all of the partitions used in tests.\ntest_data_large_categorical_dataframe = {\n i: pandas.Categorical(np.arange(NPartitions.get() * MinPartitionSize.get()))\n for i in range(NPartitions.get() * MinPartitionSize.get())\n}\ntest_data_large_categorical_series_values = [\n pandas.Categorical(np.arange(NPartitions.get() * MinPartitionSize.get()))\n]\ntest_data_large_categorical_series_keys = [\"categorical_series\"]\n\nnumeric_dfs = [\n \"empty_data\",\n \"columns_only\",\n \"int_data\",\n \"float_nan_data\",\n \"with_index_column\",\n]\n\nno_numeric_dfs = [\"datetime_timedelta_data\"]\n\n# String test data\ntest_string_data = {\n \"separator data\": [\n \"abC|DeF,Hik\",\n \"234,3245.67\",\n \"gSaf,qWer|Gre\",\n \"asd3,4sad|\",\n np.NaN,\n ]\n}\n\ntest_string_data_values = list(test_string_data.values())\ntest_string_data_keys = list(test_string_data.keys())\n\n# List of strings test data\ntest_string_list_data = {\"simple string\": [[\"a\"], [\"CdE\"], [\"jDf\"], [\"werB\"]]}\n\ntest_string_list_data_values = list(test_string_list_data.values())\ntest_string_list_data_keys = list(test_string_list_data.keys())\n\nstring_seperators = {\"empty sep\": \"\", \"comma sep\": \",\", \"None sep\": None}\n\nstring_sep_values = list(string_seperators.values())\nstring_sep_keys = list(string_seperators.keys())\n\nstring_na_rep = {\"None na_rep\": None, \"- na_rep\": \"-\", \"nan na_rep\": np.NaN}\n\nstring_na_rep_values = list(string_na_rep.values())\nstring_na_rep_keys = list(string_na_rep.keys())\n\njoin_type = {\"left\": \"left\", \"right\": \"right\", \"inner\": \"inner\", \"outer\": \"outer\"}\n\njoin_type_keys = list(join_type.keys())\njoin_type_values = list(join_type.values())\n\n# Test functions for applymap\ntest_func = {\n \"plus one\": lambda x: x + 1,\n \"convert to string\": str,\n \"square\": lambda x: x * x,\n \"identity\": lambda x: x,\n \"return false\": lambda x: False,\n}\ntest_func_keys = list(test_func.keys())\ntest_func_values = list(test_func.values())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_numeric_test_funcs_None_33": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_numeric_test_funcs_None_33", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 305, "end_line": 385, "span_ids": ["impl:112", "impl:72"], "tokens": 758}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "numeric_test_funcs = [\"plus one\", \"square\"]\n\n# Test functions for query\nquery_func = {\n \"col1 < col2\": \"col1 < col2\",\n \"col3 > col4\": \"col3 > col4\",\n \"col1 == col2\": \"col1 == col2\",\n \"(col2 > col1) and (col1 < col3)\": \"(col2 > col1) and (col1 < col3)\",\n}\nquery_func_keys = list(query_func.keys())\nquery_func_values = list(query_func.values())\n\n# Test agg functions for apply, agg, and aggregate\nagg_func = {\n \"sum\": \"sum\",\n \"df sum\": lambda df: df.sum(),\n \"str\": str,\n \"sum mean\": [\"sum\", \"mean\"],\n \"sum df sum\": [\"sum\", lambda df: df.sum()],\n # The case verifies that returning a scalar that is based on a frame's data doesn't cause a problem\n \"sum of certain elements\": lambda axis: (\n axis.iloc[0] + axis.iloc[-1] if isinstance(axis, pandas.Series) else axis + axis\n ),\n \"should raise TypeError\": 1,\n}\nagg_func_keys = list(agg_func.keys())\nagg_func_values = list(agg_func.values())\n\n# For this sort of parameters pandas throws an exception.\n# See details in pandas issue 36036.\nagg_func_except = {\n \"sum sum\": [\"sum\", \"sum\"],\n}\nagg_func_except_keys = list(agg_func_except.keys())\nagg_func_except_values = list(agg_func_except.values())\n\nnumeric_agg_funcs = [\"sum mean\", \"sum sum\", \"sum df sum\"]\n\nudf_func = {\n \"return self\": lambda x, *args, **kwargs: type(x)(x.values),\n \"change index\": lambda x, *args, **kwargs: pandas.Series(\n x.values, index=np.arange(-1, len(x.index) - 1)\n ),\n \"return none\": lambda x, *args, **kwargs: None,\n \"return empty\": lambda x, *args, **kwargs: pandas.Series(),\n \"access self\": lambda x, other, *args, **kwargs: pandas.Series(\n x.values, index=other.index\n ),\n}\nudf_func_keys = list(udf_func.keys())\nudf_func_values = list(udf_func.values())\n\n# Test q values for quantiles\nquantiles = {\n \"0.25\": 0.25,\n \"0.5\": 0.5,\n \"0.75\": 0.75,\n \"0.66\": 0.66,\n \"0.01\": 0.01,\n \"list\": [0.25, 0.5, 0.75, 0.66, 0.01],\n}\nquantiles_keys = list(quantiles.keys())\nquantiles_values = list(quantiles.values())\n\n# Test indices for get, set_index, __contains__, insert\nindices = {\n \"col1\": \"col1\",\n \"col2\": \"col2\",\n \"A\": \"A\",\n \"B\": \"B\",\n \"does not exist\": \"does not exist\",\n}\nindices_keys = list(indices.keys())\nindices_values = list(indices.values())\n\n# Test functions for groupby apply\ngroupby_apply_func = {\"sum\": lambda df: df.sum(), \"negate\": lambda df: -df}\ngroupby_apply_func_keys = list(groupby_apply_func.keys())\ngroupby_apply_func_values = list(groupby_apply_func.values())\n\n# Test functions for groupby agg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_groupby_agg_func_COMP_TO_EXT._gzip_gz_bz2_bz": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_groupby_agg_func_COMP_TO_EXT._gzip_gz_bz2_bz", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 386, "end_line": 490, "span_ids": ["impl:112", "impl:148", "impl:186"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "groupby_agg_func = {\"min\": \"min\", \"max\": \"max\"}\ngroupby_agg_func_keys = list(groupby_agg_func.keys())\ngroupby_agg_func_values = list(groupby_agg_func.values())\n\n# Test functions for groupby transform\ngroupby_transform_func = {\n \"add 4\": lambda df: df + 4,\n \"negatie and minus 10\": lambda df: -df - 10,\n}\ngroupby_transform_func_keys = list(groupby_transform_func.keys())\ngroupby_transform_func_values = list(groupby_transform_func.values())\n\n# Test functions for groupby pipe\ngroupby_pipe_func = {\"sum\": lambda df: df.sum()}\ngroupby_pipe_func_keys = list(groupby_pipe_func.keys())\ngroupby_pipe_func_values = list(groupby_pipe_func.values())\n\n# END Test input data and functions\n\n# Parametrizations of common kwargs\naxis = {\n \"over_rows_int\": 0,\n \"over_rows_str\": \"rows\",\n \"over_columns_int\": 1,\n \"over_columns_str\": \"columns\",\n}\naxis_keys = list(axis.keys())\naxis_values = list(axis.values())\n\nbool_arg = {\"True\": True, \"False\": False, \"None\": None}\nbool_arg_keys = list(bool_arg.keys())\nbool_arg_values = list(bool_arg.values())\n\nint_arg = {\"-5\": -5, \"-1\": -1, \"0\": 0, \"1\": 1, \"5\": 5}\nint_arg_keys = list(int_arg.keys())\nint_arg_values = list(int_arg.values())\n\n# END parametrizations of common kwargs\n\njson_short_string = \"\"\"[{\"project\": \"modin\"}]\"\"\"\njson_long_string = \"\"\"{\n \"quiz\": {\n \"sport\": {\n \"q1\": {\n \"question\": \"Which one is correct team name in NBA?\",\n \"options\": [\n \"New York Bulls\",\n \"Los Angeles Kings\",\n \"Golden State Warriros\",\n \"Huston Rocket\"\n ],\n \"answer\": \"Huston Rocket\"\n }\n },\n \"maths\": {\n \"q1\": {\n \"question\": \"5 + 7 = ?\",\n \"options\": [\n \"10\",\n \"11\",\n \"12\",\n \"13\"\n ],\n \"answer\": \"12\"\n },\n \"q2\": {\n \"question\": \"12 - 8 = ?\",\n \"options\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\n \"answer\": \"4\"\n }\n }\n }\n }\"\"\"\njson_long_bytes = BytesIO(json_long_string.encode(encoding=\"UTF-8\"))\njson_short_bytes = BytesIO(json_short_string.encode(encoding=\"UTF-8\"))\n\n\n# Text encoding types\nencoding_types = [\n \"ascii\",\n \"utf_32\",\n \"utf_32_be\",\n \"utf_32_le\",\n \"utf_16\",\n \"utf_16_be\",\n \"utf_16_le\",\n \"utf_7\",\n \"utf_8\",\n \"utf_8_sig\",\n]\n\n# raising of this exceptions can be caused by unexpected behavior\n# of I/O operation test, but can passed by eval_io function since\n# the type of this exceptions are the same\nio_ops_bad_exc = [TypeError, FileNotFoundError]\n\ndefault_to_pandas_ignore_string = \"default:.*defaulting to pandas.*:UserWarning\"\n\n# Files compression to extension mapping\nCOMP_TO_EXT = {\"gzip\": \"gz\", \"bz2\": \"bz2\", \"xz\": \"xz\", \"zip\": \"zip\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_time_parsing_csv_path_NonCommutativeMultiplyInteger.__rmul__.return.self_value_other_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_time_parsing_csv_path_NonCommutativeMultiplyInteger.__rmul__.return.self_value_other_1", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 493, "end_line": 536, "span_ids": ["NonCommutativeMultiplyInteger.__rmul__", "CustomIntegerForAddition", "CustomIntegerForAddition.__init__", "NonCommutativeMultiplyInteger", "NonCommutativeMultiplyInteger.__init__", "CustomIntegerForAddition.__add__", "CustomIntegerForAddition.__radd__", "impl:186", "NonCommutativeMultiplyInteger.__mul__"], "tokens": 385}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "time_parsing_csv_path = \"modin/pandas/test/data/test_time_parsing.csv\"\n\n\nclass CustomIntegerForAddition:\n def __init__(self, value: int):\n self.value = value\n\n def __add__(self, other):\n return self.value + other\n\n def __radd__(self, other):\n return other + self.value\n\n\nclass NonCommutativeMultiplyInteger:\n \"\"\"int-like class with non-commutative multiply operation.\n\n We need to test that rmul and mul do different things even when\n multiplication is not commutative, but almost all multiplication is\n commutative. This class' fake multiplication overloads are not commutative\n when you multiply an instance of this class with pandas.series, which\n does not know how to __mul__ with this class. e.g.\n\n NonCommutativeMultiplyInteger(2) * pd.Series(1, dtype=int) == pd.Series(2, dtype=int)\n pd.Series(1, dtype=int) * NonCommutativeMultiplyInteger(2) == pd.Series(3, dtype=int)\n \"\"\"\n\n def __init__(self, value: int):\n if not isinstance(value, int):\n raise TypeError(\n f\"must initialize with integer, but got {value} of type {type(value)}\"\n )\n self.value = value\n\n def __mul__(self, other):\n # Note that we need to check other is an int, otherwise when we (left) mul\n # this with a series, we'll just multiply self.value by the series, whereas\n # we want to make the series do an rmul instead.\n if not isinstance(other, int):\n return NotImplemented\n return self.value * other\n\n def __rmul__(self, other):\n return self.value * other + 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_modin-project__modin/modin/pandas/test/utils.py_categories_equals_df_categories_equals.for_i_in_range_len_df1_ca.assert_extension_array_eq": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_categories_equals_df_categories_equals.for_i_in_range_len_df1_ca.assert_extension_array_eq", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 539, "end_line": 565, "span_ids": ["df_categories_equals", "categories_equals"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def categories_equals(left, right):\n assert (left.ordered and right.ordered) or (not left.ordered and not right.ordered)\n assert_extension_array_equal(left, right)\n\n\ndef df_categories_equals(df1, df2):\n if not hasattr(df1, \"select_dtypes\"):\n if isinstance(df1, pandas.CategoricalDtype):\n categories_equals(df1, df2)\n elif isinstance(getattr(df1, \"dtype\"), pandas.CategoricalDtype) and isinstance(\n getattr(df2, \"dtype\"), pandas.CategoricalDtype\n ):\n categories_equals(df1.dtype, df2.dtype)\n return True\n\n df1_categorical = df1.select_dtypes(include=\"category\")\n df2_categorical = df2.select_dtypes(include=\"category\")\n assert df1_categorical.columns.equals(df2_categorical.columns)\n # Use an index instead of a column name to iterate through columns. There\n # may be duplicate colum names. e.g. if two columns are named col1,\n # selecting df1_categorical[\"col1\"] gives a dataframe of width 2 instead of a series.\n for i in range(len(df1_categorical.columns)):\n assert_extension_array_equal(\n df1_categorical.iloc[:, i].values,\n df2_categorical.iloc[:, i].values,\n check_dtype=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_modin-project__modin/modin/pandas/test/utils.py_assert_empty_frame_equal_assert_empty_frame_equal.if_df1_empty_and_not_df2.elif_df1_empty_and_df2_em.assert_False_f_Empty_fra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_empty_frame_equal_assert_empty_frame_equal.if_df1_empty_and_not_df2.elif_df1_empty_and_df2_em.assert_False_f_Empty_fra", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 568, "end_line": 586, "span_ids": ["assert_empty_frame_equal"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_empty_frame_equal(df1, df2):\n \"\"\"\n Test if df1 and df2 are empty.\n\n Parameters\n ----------\n df1 : pandas.DataFrame or pandas.Series\n df2 : pandas.DataFrame or pandas.Series\n\n Raises\n ------\n AssertionError\n If check fails.\n \"\"\"\n\n if (df1.empty and not df2.empty) or (df2.empty and not df1.empty):\n assert False, \"One of the passed frames is empty, when other isn't\"\n elif df1.empty and df2.empty and type(df1) != type(df2):\n assert False, f\"Empty frames have different types: {type(df1)} != {type(df2)}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_all_act_same__maybe_cast_to_pandas_dtype.return.dtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_all_act_same__maybe_cast_to_pandas_dtype.return.dtype", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 589, "end_line": 619, "span_ids": ["_maybe_cast_to_pandas_dtype", "assert_all_act_same"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_all_act_same(condition, *objs):\n \"\"\"\n Assert that all of the objs give the same boolean result for the passed condition (either all True or all False).\n\n Parameters\n ----------\n condition : callable(obj) -> bool\n Condition to run on the passed objects.\n *objs :\n Objects to pass to the condition.\n\n Returns\n -------\n bool\n Result of the condition.\n \"\"\"\n results = [condition(obj) for obj in objs]\n if len(results) < 2:\n return results[0] if len(results) else None\n\n assert all(results[0] == res for res in results[1:])\n return results[0]\n\n\ndef _maybe_cast_to_pandas_dtype(dtype):\n \"\"\"Cast passed `dtype` to according pandas dtype if needed for the sake of equality comparison.\"\"\"\n # If we're running in a cloud mode then all the numpy types are substituted with a proxy net-reference,\n # Such dtypes won't pass equality check with pandas dtypes thus manually converting them to a pure numpy\n if \"netref\" in str(type(dtype)):\n return np.dtype(dtype.name)\n return dtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_dtypes_equal_assert_dtypes_equal.for_col_in_dtypes1_keys_.for_comparator_in_dtype_c.if_assert_all_act_same_co.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_assert_dtypes_equal_assert_dtypes_equal.for_col_in_dtypes1_keys_.for_comparator_in_dtype_c.if_assert_all_act_same_co.break", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 622, "end_line": 672, "span_ids": ["assert_dtypes_equal"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_dtypes_equal(df1, df2):\n \"\"\"\n Assert that the two passed DataFrame/Series objects have equal dtypes.\n\n The function doesn't require that the dtypes are identical, it has the following reliefs:\n 1. The dtypes are not required to be in the same order\n (e.g. {\"col1\": int, \"col2\": float} == {\"col2\": float, \"col1\": int})\n 2. The dtypes are only required to be in the same class\n (e.g. both numerical, both categorical, etc...)\n\n Parameters\n ----------\n df1 : DataFrame or Series\n df2 : DataFrame or Series\n \"\"\"\n if not isinstance(\n df1, (pandas.Series, pd.Series, pandas.DataFrame, pd.DataFrame)\n ) or not isinstance(\n df2, (pandas.Series, pd.Series, pandas.DataFrame, pd.DataFrame)\n ):\n return\n\n if isinstance(df1.dtypes, (pandas.Series, pd.Series)):\n dtypes1 = df1.dtypes\n dtypes2 = df2.dtypes\n else:\n # Case when `dtypes` is a scalar\n dtypes1 = pandas.Series({\"col\": df1.dtypes})\n dtypes2 = pandas.Series({\"col\": df2.dtypes})\n\n # Don't require for dtypes to be in the same order\n assert len(dtypes1.index.difference(dtypes2.index)) == 0\n assert len(dtypes1) == len(dtypes2)\n\n dtype_comparators = (\n is_numeric_dtype,\n lambda obj: is_object_dtype(obj) or is_string_dtype(obj),\n is_bool_dtype,\n is_categorical_dtype,\n is_datetime64_any_dtype,\n is_timedelta64_dtype,\n is_period_dtype,\n )\n\n for col in dtypes1.keys():\n type1, type2 = map(_maybe_cast_to_pandas_dtype, (dtypes1[col], dtypes2[col]))\n for comparator in dtype_comparators:\n if assert_all_act_same(comparator, type1, type2):\n # We met a dtype that both types satisfy, so we can stop iterating\n # over comparators and compare next dtypes\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_modin-project__modin/modin/pandas/test/utils.py_df_equals_df_equals.if_isinstance_df1_pandas.assert_empty_frame_equal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_equals_df_equals.if_isinstance_df1_pandas.assert_empty_frame_equal_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 675, "end_line": 728, "span_ids": ["df_equals"], "tokens": 503}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def df_equals(df1, df2, check_dtypes=True):\n \"\"\"Tests if df1 and df2 are equal.\n\n Args:\n df1: (pandas or modin DataFrame or series) dataframe to test if equal.\n df2: (pandas or modin DataFrame or series) dataframe to test if equal.\n\n Returns:\n True if df1 is equal to df2.\n \"\"\"\n # Gets AttributError if modin's groupby object is not import like this\n from modin.pandas.groupby import DataFrameGroupBy\n\n groupby_types = (pandas.core.groupby.DataFrameGroupBy, DataFrameGroupBy)\n\n # The typing behavior of how pandas treats its index is not consistent when the\n # length of the DataFrame or Series is 0, so we just verify that the contents are\n # the same.\n if (\n hasattr(df1, \"index\")\n and hasattr(df2, \"index\")\n and len(df1) == 0\n and len(df2) == 0\n ):\n if type(df1).__name__ == type(df2).__name__:\n if hasattr(df1, \"name\") and hasattr(df2, \"name\") and df1.name == df2.name:\n return\n if (\n hasattr(df1, \"columns\")\n and hasattr(df2, \"columns\")\n and df1.columns.equals(df2.columns)\n ):\n return\n assert False\n\n if isinstance(df1, (list, tuple)) and all(\n isinstance(d, (pd.DataFrame, pd.Series, pandas.DataFrame, pandas.Series))\n for d in df1\n ):\n assert isinstance(df2, type(df1)), \"Different type of collection\"\n assert len(df1) == len(df2), \"Different length result\"\n return (df_equals(d1, d2) for d1, d2 in zip(df1, df2))\n\n if check_dtypes:\n assert_dtypes_equal(df1, df2)\n\n # Convert to pandas\n if isinstance(df1, (pd.DataFrame, pd.Series)):\n df1 = to_pandas(df1)\n if isinstance(df2, (pd.DataFrame, pd.Series)):\n df2 = to_pandas(df2)\n\n if isinstance(df1, pandas.DataFrame) and isinstance(df2, pandas.DataFrame):\n assert_empty_frame_equal(df1, df2)\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_modin-project__modin/modin/pandas/test/utils.py_df_equals.None_6_df_equals.None_6.else_.if_df1_df2_.np_testing_assert_almost_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_equals.None_6_df_equals.None_6.else_.if_df1_df2_.np_testing_assert_almost_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 730, "end_line": 771, "span_ids": ["df_equals"], "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": "def df_equals(df1, df2, check_dtypes=True):\n # ... other code\n\n if isinstance(df1, pandas.DataFrame) and isinstance(df2, pandas.DataFrame):\n assert_frame_equal(\n df1,\n df2,\n check_dtype=False,\n check_datetimelike_compat=True,\n check_index_type=False,\n check_column_type=False,\n check_categorical=False,\n )\n df_categories_equals(df1, df2)\n elif isinstance(df1, pandas.Index) and isinstance(df2, pandas.Index):\n assert_index_equal(df1, df2)\n elif isinstance(df1, pandas.Series) and isinstance(df2, pandas.Series):\n assert_series_equal(df1, df2, check_dtype=False, check_series_type=False)\n elif (\n hasattr(df1, \"dtype\")\n and hasattr(df2, \"dtype\")\n and isinstance(df1.dtype, pandas.core.dtypes.dtypes.ExtensionDtype)\n and isinstance(df2.dtype, pandas.core.dtypes.dtypes.ExtensionDtype)\n ):\n assert_extension_array_equal(df1, df2)\n elif isinstance(df1, groupby_types) and isinstance(df2, groupby_types):\n for g1, g2 in zip(df1, df2):\n assert g1[0] == g2[0]\n df_equals(g1[1], g2[1])\n elif (\n isinstance(df1, pandas.Series)\n and isinstance(df2, pandas.Series)\n and df1.empty\n and df2.empty\n ):\n assert all(df1.index == df2.index)\n assert df1.dtypes == df2.dtypes\n elif isinstance(df1, pandas.core.arrays.numpy_.PandasArray):\n assert isinstance(df2, pandas.core.arrays.numpy_.PandasArray)\n assert df1 == df2\n elif isinstance(df1, np.recarray) and isinstance(df2, np.recarray):\n np.testing.assert_array_equal(df1, df2)\n else:\n if df1 != df2:\n np.testing.assert_almost_equal(df1, df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_modin_df_almost_equals_pandas_modin_df_almost_equals_pandas.assert_diff_max_max_dif": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_modin_df_almost_equals_pandas_modin_df_almost_equals_pandas.assert_diff_max_max_dif", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 774, "end_line": 799, "span_ids": ["modin_df_almost_equals_pandas"], "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 modin_df_almost_equals_pandas(modin_df, pandas_df, max_diff=0.0001):\n df_categories_equals(modin_df._to_pandas(), pandas_df)\n\n modin_df = to_pandas(modin_df)\n\n if hasattr(modin_df, \"select_dtypes\"):\n modin_df = modin_df.select_dtypes(exclude=[\"category\"])\n if hasattr(pandas_df, \"select_dtypes\"):\n pandas_df = pandas_df.select_dtypes(exclude=[\"category\"])\n\n if modin_df.equals(pandas_df):\n return\n\n isna = modin_df.isna().all()\n if isinstance(isna, bool):\n if isna:\n assert pandas_df.isna().all()\n return\n elif isna.all():\n assert pandas_df.isna().all().all()\n return\n\n diff = (modin_df - pandas_df).abs()\n diff /= pandas_df\n diff_max = diff.max() if isinstance(diff, pandas.Series) else diff.max().max()\n assert diff_max < max_diff, f\"{diff_max} >= {max_diff}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_try_modin_df_almost_equals_compare_try_modin_df_almost_equals_compare.if_all_map_is_numeric_dty.else_.df_equals_df1_df2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_try_modin_df_almost_equals_compare_try_modin_df_almost_equals_compare.if_all_map_is_numeric_dty.else_.df_equals_df1_df2_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 802, "end_line": 811, "span_ids": ["try_modin_df_almost_equals_compare"], "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 try_modin_df_almost_equals_compare(df1, df2):\n \"\"\"Compare two dataframes as nearly equal if possible, otherwise compare as completely equal.\"\"\"\n # `modin_df_almost_equals_pandas` is numeric-only comparator\n dtypes1, dtypes2 = [\n dtype if is_list_like(dtype := df.dtypes) else [dtype] for df in (df1, df2)\n ]\n if all(map(is_numeric_dtype, dtypes1)) and all(map(is_numeric_dtype, dtypes2)):\n modin_df_almost_equals_pandas(df1, df2)\n else:\n df_equals(df1, df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_is_empty_name_contains.return.any_val_in_test_name_for_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_is_empty_name_contains.return.any_val_in_test_name_for_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 814, "end_line": 850, "span_ids": ["name_contains", "df_is_empty", "arg_keys"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def df_is_empty(df):\n \"\"\"Tests if df is empty.\n\n Args:\n df: (pandas or modin DataFrame) dataframe to test if empty.\n\n Returns:\n True if df is empty.\n \"\"\"\n assert df.size == 0 and df.empty\n assert df.shape[0] == 0 or df.shape[1] == 0\n\n\ndef arg_keys(arg_name, keys):\n \"\"\"Appends arg_name to the front of all values in keys.\n\n Args:\n arg_name: (string) String containing argument name.\n keys: (list of strings) Possible inputs of argument.\n\n Returns:\n List of strings with arg_name append to front of keys.\n \"\"\"\n return [\"{0}_{1}\".format(arg_name, key) for key in keys]\n\n\ndef name_contains(test_name, vals):\n \"\"\"Determines if any string in vals is a substring of test_name.\n\n Args:\n test_name: (string) String to determine if contains substrings.\n vals: (list of strings) List of substrings to test for.\n\n Returns:\n True if a substring in vals is in test_name, else False.\n \"\"\"\n return any(val in test_name for val in vals)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_check_df_columns_have_nans_check_df_columns_have_nans.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_check_df_columns_have_nans_check_df_columns_have_nans.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 853, "end_line": 873, "span_ids": ["check_df_columns_have_nans"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_df_columns_have_nans(df, cols):\n \"\"\"Checks if there are NaN values in specified columns of a dataframe.\n\n :param df: Dataframe to check.\n :param cols: One column name or list of column names.\n :return:\n True if specified columns of dataframe contains NaNs.\n \"\"\"\n return (\n pandas.api.types.is_list_like(cols)\n and (\n any(isinstance(x, str) and x in df.columns and df[x].hasnans for x in cols)\n or any(\n isinstance(x, pd.Series) and x._parent is df and x.hasnans for x in cols\n )\n )\n ) or (\n not pandas.api.types.is_list_like(cols)\n and cols in df.columns\n and df[cols].hasnans\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_general_eval_general.execute_callable.try_.else_.return._md_result_pd_result_if": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_general_eval_general.execute_callable.try_.else_.return._md_result_pd_result_if", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 876, "end_line": 916, "span_ids": ["eval_general"], "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 eval_general(\n modin_df,\n pandas_df,\n operation,\n comparator=df_equals,\n __inplace__=False,\n check_exception_type=True,\n raising_exceptions=None,\n check_kwargs_callable=True,\n md_extra_kwargs=None,\n comparator_kwargs=None,\n **kwargs,\n):\n if raising_exceptions:\n assert (\n check_exception_type\n ), \"if raising_exceptions is not None or False, check_exception_type should be True\"\n md_kwargs, pd_kwargs = {}, {}\n\n def execute_callable(fn, inplace=False, md_kwargs={}, pd_kwargs={}):\n try:\n pd_result = fn(pandas_df, **pd_kwargs)\n except Exception as pd_e:\n if check_exception_type is None:\n return None\n with pytest.raises(Exception) as md_e:\n # repr to force materialization\n repr(fn(modin_df, **md_kwargs))\n if check_exception_type:\n assert isinstance(\n md_e.value, type(pd_e)\n ), \"Got Modin Exception type {}, but pandas Exception type {} was expected\".format(\n type(md_e.value), type(pd_e)\n )\n if raising_exceptions:\n assert not isinstance(\n md_e.value, tuple(raising_exceptions)\n ), f\"not acceptable exception type: {md_e.value}\"\n else:\n md_result = fn(modin_df, **md_kwargs)\n return (md_result, pd_result) if not inplace else (modin_df, pandas_df)\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_modin-project__modin/modin/pandas/test/utils.py_eval_general.for_key_value_in_kwargs__eval_general.if_values_is_not_None_.comparator_values_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_general.for_key_value_in_kwargs__eval_general.if_values_is_not_None_.comparator_values_co", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 918, "end_line": 940, "span_ids": ["eval_general"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_general(\n modin_df,\n pandas_df,\n operation,\n comparator=df_equals,\n __inplace__=False,\n check_exception_type=True,\n raising_exceptions=None,\n check_kwargs_callable=True,\n md_extra_kwargs=None,\n comparator_kwargs=None,\n **kwargs,\n):\n # ... other code\n\n for key, value in kwargs.items():\n if check_kwargs_callable and callable(value):\n values = execute_callable(value)\n # that means, that callable raised an exception\n if values is None:\n return\n else:\n md_value, pd_value = values\n else:\n md_value, pd_value = value, value\n\n md_kwargs[key] = md_value\n pd_kwargs[key] = pd_value\n\n if md_extra_kwargs:\n assert isinstance(md_extra_kwargs, dict)\n md_kwargs.update(md_extra_kwargs)\n\n values = execute_callable(\n operation, md_kwargs=md_kwargs, pd_kwargs=pd_kwargs, inplace=__inplace__\n )\n if values is not None:\n comparator(*values, **(comparator_kwargs or {}))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_io_eval_io.if_modin_warning_.else_.call_eval_general_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_io_eval_io.if_modin_warning_.else_.call_eval_general_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 943, "end_line": 1008, "span_ids": ["eval_io"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_io(\n fn_name,\n comparator=df_equals,\n cast_to_str=False,\n check_exception_type=True,\n raising_exceptions=io_ops_bad_exc,\n check_kwargs_callable=True,\n modin_warning=None,\n modin_warning_str_match=None,\n md_extra_kwargs=None,\n *args,\n **kwargs,\n):\n \"\"\"Evaluate I/O operation outputs equality check.\n\n Parameters\n ----------\n fn_name: str\n I/O operation name (\"read_csv\" for example).\n comparator: obj\n Function to perform comparison.\n cast_to_str: bool\n There could be some missmatches in dtypes, so we're\n casting the whole frame to `str` before comparison.\n See issue #1931 for details.\n check_exception_type: bool\n Check or not exception types in the case of operation fail\n (compare exceptions types raised by Pandas and Modin).\n raising_exceptions: Exception or list of Exceptions\n Exceptions that should be raised even if they are raised\n both by Pandas and Modin (check evaluated only if\n `check_exception_type` passed as `True`).\n modin_warning: obj\n Warning that should be raised by Modin.\n modin_warning_str_match: str\n If `modin_warning` is set, checks that the raised warning matches this string.\n md_extra_kwargs: dict\n Modin operation specific kwargs.\n \"\"\"\n\n def applyier(module, *args, **kwargs):\n result = getattr(module, fn_name)(*args, **kwargs)\n if cast_to_str:\n result = result.astype(str)\n return result\n\n def call_eval_general():\n eval_general(\n pd,\n pandas,\n applyier,\n comparator=comparator,\n check_exception_type=check_exception_type,\n raising_exceptions=raising_exceptions,\n check_kwargs_callable=check_kwargs_callable,\n md_extra_kwargs=md_extra_kwargs,\n *args,\n **kwargs,\n )\n\n warn_match = modin_warning_str_match if modin_warning is not None else None\n if modin_warning:\n with pytest.warns(modin_warning, match=warn_match):\n call_eval_general()\n else:\n call_eval_general()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_io_from_str_create_test_dfs.return.map_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_eval_io_from_str_create_test_dfs.return.map_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1011, "end_line": 1044, "span_ids": ["eval_io_from_str", "create_test_dfs"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def eval_io_from_str(csv_str: str, unique_filename: str, **kwargs):\n \"\"\"Evaluate I/O operation outputs equality check by using `csv_str`\n data passed as python str (csv test file will be created from `csv_str`).\n\n Parameters\n ----------\n csv_str: str\n Test data for storing to csv file.\n unique_filename: str\n csv file name.\n \"\"\"\n try:\n with open(unique_filename, \"w\") as f:\n f.write(csv_str)\n\n eval_io(\n filepath_or_buffer=unique_filename,\n fn_name=\"read_csv\",\n **kwargs,\n )\n\n finally:\n if os.path.exists(unique_filename):\n try:\n os.remove(unique_filename)\n except PermissionError:\n pass\n\n\ndef create_test_dfs(*args, **kwargs):\n post_fn = kwargs.pop(\"post_fn\", lambda df: df)\n return map(\n post_fn, [pd.DataFrame(*args, **kwargs), pandas.DataFrame(*args, **kwargs)]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_dfs_generate_multiindex_dfs.return.df1_df2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_dfs_generate_multiindex_dfs.return.df1_df2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1047, "end_line": 1080, "span_ids": ["generate_multiindex_dfs", "generate_dfs"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_dfs():\n df = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col4\": [12, 13, 14, 15],\n \"col5\": [0, 0, 0, 0],\n }\n )\n\n df2 = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col6\": [12, 13, 14, 15],\n \"col7\": [0, 0, 0, 0],\n }\n )\n return df, df2\n\n\ndef generate_multiindex_dfs(axis=1):\n def generate_multiindex(index):\n return pandas.MultiIndex.from_tuples(\n [(\"a\", x) for x in index.values], names=[\"name1\", \"name2\"]\n )\n\n df1, df2 = generate_dfs()\n df1.axes[axis], df2.axes[axis] = map(\n generate_multiindex, [df1.axes[axis], df2.axes[axis]]\n )\n return df1, df2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_multiindex_generate_multiindex.if_is_tree_like_.else_.return.pd_MultiIndex_from_tuples": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_multiindex_generate_multiindex.if_is_tree_like_.else_.return.pd_MultiIndex_from_tuples", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1083, "end_line": 1120, "span_ids": ["generate_multiindex"], "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": "def generate_multiindex(elements_number, nlevels=2, is_tree_like=False):\n def generate_level(length, nlevel):\n src = [\"bar\", \"baz\", \"foo\", \"qux\"]\n return [src[i % len(src)] + f\"-{nlevel}-{i}\" for i in range(length)]\n\n if is_tree_like:\n for penalty_level in [0, 1]:\n lvl_len_f, lvl_len_d = math.modf(\n round(elements_number ** (1 / (nlevels - penalty_level)), 12)\n )\n if lvl_len_d >= 2 and lvl_len_f == 0:\n break\n\n if lvl_len_d < 2 or lvl_len_f != 0:\n raise RuntimeError(\n f\"Can't generate Tree-like MultiIndex with lenght: {elements_number} and number of levels: {nlevels}\"\n )\n\n lvl_len = int(lvl_len_d)\n result = pd.MultiIndex.from_product(\n [generate_level(lvl_len, i) for i in range(nlevels - penalty_level)],\n names=[f\"level-{i}\" for i in range(nlevels - penalty_level)],\n )\n if penalty_level:\n result = pd.MultiIndex.from_tuples(\n [(\"base_level\", *ml_tuple) for ml_tuple in result],\n names=[f\"level-{i}\" for i in range(nlevels)],\n )\n return result.sort_values()\n else:\n base_level = [\"first\"] * (elements_number // 2 + elements_number % 2) + [\n \"second\"\n ] * (elements_number // 2)\n primary_levels = [generate_level(elements_number, i) for i in range(1, nlevels)]\n arrays = [base_level] + primary_levels\n return pd.MultiIndex.from_tuples(\n list(zip(*arrays)), names=[f\"level-{i}\" for i in range(nlevels)]\n ).sort_values()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_none_dfs_generate_none_dfs.return.df_df2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_generate_none_dfs_generate_none_dfs.return.df_df2", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1123, "end_line": 1143, "span_ids": ["generate_none_dfs"], "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 generate_none_dfs():\n df = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, None, 7],\n \"col3\": [8, 9, 10, 11],\n \"col4\": [12, 13, 14, 15],\n \"col5\": [None, None, None, None],\n }\n )\n\n df2 = pandas.DataFrame(\n {\n \"col1\": [0, 1, 2, 3],\n \"col2\": [4, 5, 6, 7],\n \"col3\": [8, 9, 10, 11],\n \"col6\": [12, 13, 14, 15],\n \"col7\": [0, 0, 0, 0],\n }\n )\n return df, df2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_get_unique_filename_get_unique_filename.if_debug_mode_.else_.return.os_path_join_data_dir_uu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_get_unique_filename_get_unique_filename.if_debug_mode_.else_.return.os_path_join_data_dir_uu", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1146, "end_line": 1207, "span_ids": ["get_unique_filename"], "tokens": 482}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_unique_filename(\n test_name: str = \"test\",\n kwargs: dict = {},\n extension: str = \"csv\",\n data_dir: Union[str, Path] = \"\",\n suffix: str = \"\",\n debug_mode=False,\n):\n \"\"\"Returns unique file name with specified parameters.\n\n Parameters\n ----------\n test_name: str\n name of the test for which the unique file name is needed.\n kwargs: list of ints\n Unique combiantion of test parameters for creation of unique name.\n extension: str, default: \"csv\"\n Extension of unique file.\n data_dir: Union[str, Path]\n Data directory where test files will be created.\n suffix: str\n String to append to the resulted name.\n debug_mode: bool, default: False\n Get unique filename containing kwargs values.\n Otherwise kwargs values will be replaced with hash equivalent.\n\n Returns\n -------\n Unique file name.\n \"\"\"\n suffix_part = f\"_{suffix}\" if suffix else \"\"\n extension_part = f\".{extension}\" if extension else \"\"\n if debug_mode:\n # shortcut if kwargs parameter are not provided\n if len(kwargs) == 0 and extension == \"csv\" and suffix == \"\":\n return os.path.join(data_dir, (test_name + suffix_part + f\".{extension}\"))\n\n assert \".\" not in extension, \"please provide pure extension name without '.'\"\n prohibited_chars = ['\"', \"\\n\"]\n non_prohibited_char = \"np_char\"\n char_counter = 0\n kwargs_name = dict(kwargs)\n for key, value in kwargs_name.items():\n for char in prohibited_chars:\n if isinstance(value, str) and char in value or callable(value):\n kwargs_name[key] = non_prohibited_char + str(char_counter)\n char_counter += 1\n parameters_values = \"_\".join(\n [\n str(value)\n if not isinstance(value, (list, tuple))\n else \"_\".join([str(x) for x in value])\n for value in kwargs_name.values()\n ]\n )\n return os.path.join(\n data_dir, test_name + parameters_values + suffix_part + extension_part\n )\n else:\n import uuid\n\n return os.path.join(data_dir, uuid.uuid1().hex + suffix_part + extension_part)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_get_random_string_insert_lines_to_csv.with_open_csv_name_w_.writer_writerows_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_get_random_string_insert_lines_to_csv.with_open_csv_name_w_.writer_writerows_lines_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1210, "end_line": 1275, "span_ids": ["get_random_string", "insert_lines_to_csv"], "tokens": 493}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_random_string():\n random_string = \"\".join(\n random_state.choice([x for x in ascii_letters], size=10).tolist()\n )\n return random_string\n\n\ndef insert_lines_to_csv(\n csv_name: str,\n lines_positions: list,\n lines_type: str = \"blank\",\n encoding: str = None,\n **csv_reader_writer_params,\n):\n \"\"\"Insert lines to \".csv\" file.\n\n Parameters\n ----------\n csv_name: str\n \".csv\" file that should be modified.\n lines_positions: list of ints\n Lines postions that sghould be modified (serial number\n of line - begins from 0, ends in - 1).\n lines_type: str\n Lines types that should be inserted to \".csv\" file. Possible types:\n \"blank\" - empty line without any delimiters/separators,\n \"bad\" - lines with len(lines_data) > cols_number\n encoding: str\n Encoding type that should be used during file reading and writing.\n \"\"\"\n if lines_type == \"blank\":\n lines_data = []\n elif lines_type == \"bad\":\n cols_number = len(pandas.read_csv(csv_name, nrows=1).columns)\n lines_data = [x for x in range(cols_number + 1)]\n else:\n raise ValueError(\n f\"acceptable values for parameter are ['blank', 'bad'], actually passed {lines_type}\"\n )\n lines = []\n with open(csv_name, \"r\", encoding=encoding, newline=\"\") as read_file:\n try:\n dialect = csv.Sniffer().sniff(read_file.read())\n read_file.seek(0)\n except Exception:\n dialect = None\n\n reader = csv.reader(\n read_file,\n dialect=dialect if dialect is not None else \"excel\",\n **csv_reader_writer_params,\n )\n counter = 0\n for row in reader:\n if counter in lines_positions:\n lines.append(lines_data)\n else:\n lines.append(row)\n counter += 1\n with open(csv_name, \"w\", encoding=encoding, newline=\"\") as write_file:\n writer = csv.writer(\n write_file,\n dialect=dialect if dialect is not None else \"excel\",\n **csv_reader_writer_params,\n )\n writer.writerows(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_modin-project__modin/modin/pandas/test/utils.py__get_open_files_check_file_leaks.return.check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py__get_open_files_check_file_leaks.return.check", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1278, "end_line": 1320, "span_ids": ["check_file_leaks", "_get_open_files"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_open_files():\n \"\"\"\n psutil open_files() can return a lot of extra information that we can allow to\n be different, like file position; for simplicity we care about path and fd only.\n \"\"\"\n return sorted((info.path, info.fd) for info in psutil.Process().open_files())\n\n\ndef check_file_leaks(func):\n \"\"\"\n A decorator that ensures that no *newly* opened file handles are left\n after decorated function is finished.\n \"\"\"\n if not TrackFileLeaks.get():\n return func\n\n @functools.wraps(func)\n def check(*a, **kw):\n fstart = _get_open_files()\n try:\n return func(*a, **kw)\n finally:\n leaks = []\n for item in _get_open_files():\n try:\n fstart.remove(item)\n except ValueError:\n # Ignore files in /proc/, as they have nothing to do with\n # modin reading any data (and this is what we care about).\n if item[0].startswith(\"/proc/\"):\n continue\n # Ignore files in /tmp/ray/session_*/logs (ray session logs)\n # because Ray intends to keep these logs open even after\n # work has been done.\n if re.search(r\"/tmp/ray/session_.*/logs\", item[0]):\n continue\n leaks.append(item)\n\n assert (\n not leaks\n ), f\"Unexpected open handles left for: {', '.join(item[0] for item in leaks)}\"\n\n return check", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_dummy_decorator_generate_dataframe.return.pandas_DataFrame_data_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_dummy_decorator_generate_dataframe.return.pandas_DataFrame_data_in", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1323, "end_line": 1353, "span_ids": ["generate_dataframe", "dummy_decorator"], "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 dummy_decorator():\n \"\"\"A problematic decorator that does not use `functools.wraps`. This introduces unwanted local variables for\n inspect.currentframe. This decorator is used in test_io to test `read_csv` and `read_table`\n \"\"\"\n\n def wrapper(method):\n def wrapped_function(self, *args, **kwargs):\n result = method(self, *args, **kwargs)\n return result\n\n return wrapped_function\n\n return wrapper\n\n\ndef generate_dataframe(row_size=NROWS, additional_col_values=None, idx_name=None):\n dates = pandas.date_range(\"2000\", freq=\"h\", periods=row_size)\n data = {\n \"col1\": np.arange(row_size) * 10,\n \"col2\": [str(x.date()) for x in dates],\n \"col3\": np.arange(row_size) * 10,\n \"col4\": [str(x.time()) for x in dates],\n \"col5\": [get_random_string() for _ in range(row_size)],\n \"col6\": random_state.uniform(low=0.0, high=10000.0, size=row_size),\n }\n index = None if idx_name is None else pd.RangeIndex(0, row_size, name=idx_name)\n\n if additional_col_values is not None:\n assert isinstance(additional_col_values, (list, tuple))\n data.update({\"col7\": random_state.choice(additional_col_values, size=row_size)})\n return pandas.DataFrame(data, index=index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py__make_csv_file__make_csv_file.return._csv_file_maker": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py__make_csv_file__make_csv_file.return._csv_file_maker", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1356, "end_line": 1452, "span_ids": ["_make_csv_file"], "tokens": 668}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _make_csv_file(filenames):\n def _csv_file_maker(\n filename,\n row_size=NROWS,\n force=True,\n delimiter=\",\",\n encoding=None,\n compression=\"infer\",\n additional_col_values=None,\n remove_randomness=False,\n add_blank_lines=False,\n add_bad_lines=False,\n add_nan_lines=False,\n thousands_separator=None,\n decimal_separator=None,\n comment_col_char=None,\n quoting=csv.QUOTE_MINIMAL,\n quotechar='\"',\n doublequote=True,\n escapechar=None,\n lineterminator=None,\n ):\n if os.path.exists(filename) and not force:\n pass\n else:\n df = generate_dataframe(row_size, additional_col_values)\n if remove_randomness:\n df = df[[\"col1\", \"col2\", \"col3\", \"col4\"]]\n if add_nan_lines:\n for i in range(0, row_size, row_size // (row_size // 10)):\n df.loc[i] = pandas.Series()\n if comment_col_char:\n char = comment_col_char if isinstance(comment_col_char, str) else \"#\"\n df.insert(\n loc=0,\n column=\"col_with_comments\",\n value=[char if (x + 2) == 0 else x for x in range(row_size)],\n )\n\n if thousands_separator:\n for col_id in [\"col1\", \"col3\"]:\n df[col_id] = df[col_id].apply(\n lambda x: f\"{x:,d}\".replace(\",\", thousands_separator)\n )\n df[\"col6\"] = df[\"col6\"].apply(\n lambda x: f\"{x:,f}\".replace(\",\", thousands_separator)\n )\n filename = (\n f\"{filename}.{COMP_TO_EXT[compression]}\"\n if compression != \"infer\"\n else filename\n )\n df.to_csv(\n filename,\n sep=delimiter,\n encoding=encoding,\n compression=compression,\n index=False,\n decimal=decimal_separator if decimal_separator else \".\",\n lineterminator=lineterminator,\n quoting=quoting,\n quotechar=quotechar,\n doublequote=doublequote,\n escapechar=escapechar,\n )\n csv_reader_writer_params = {\n \"delimiter\": delimiter,\n \"doublequote\": doublequote,\n \"escapechar\": escapechar,\n \"lineterminator\": lineterminator if lineterminator else os.linesep,\n \"quotechar\": quotechar,\n \"quoting\": quoting,\n }\n if add_blank_lines:\n insert_lines_to_csv(\n csv_name=filename,\n lines_positions=[\n x for x in range(5, row_size, row_size // (row_size // 10))\n ],\n lines_type=\"blank\",\n encoding=encoding,\n **csv_reader_writer_params,\n )\n if add_bad_lines:\n insert_lines_to_csv(\n csv_name=filename,\n lines_positions=[\n x for x in range(6, row_size, row_size // (row_size // 10))\n ],\n lines_type=\"bad\",\n encoding=encoding,\n **csv_reader_writer_params,\n )\n filenames.append(filename)\n return df\n\n return _csv_file_maker", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_teardown_test_file_sort_index_for_equal_values.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_teardown_test_file_sort_index_for_equal_values.return.res", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1455, "end_line": 1485, "span_ids": ["sort_index_for_equal_values", "teardown_test_file", "teardown_test_files"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def teardown_test_file(test_path):\n if os.path.exists(test_path):\n # PermissionError can occure because of issue #2533\n try:\n os.remove(test_path)\n except PermissionError:\n pass\n\n\ndef teardown_test_files(test_paths: list):\n for path in test_paths:\n teardown_test_file(path)\n\n\ndef sort_index_for_equal_values(df, ascending=True):\n \"\"\"Sort `df` indices of equal rows.\"\"\"\n if df.index.dtype == np.float64:\n # HACK: workaround for pandas bug:\n # https://github.com/pandas-dev/pandas/issues/34455\n df.index = df.index.astype(\"str\")\n res = df.groupby(by=df if df.ndim == 1 else df.columns, sort=False).apply(\n lambda df: df.sort_index(ascending=ascending)\n )\n if res.index.nlevels > df.index.nlevels:\n # Sometimes GroupBy adds an extra level with 'by' to the result index.\n # GroupBy is very inconsistent about when it's doing this, so that's\n # why this clumsy if-statement is used.\n res.index = res.index.droplevel(0)\n # GroupBy overwrites original index names with 'by', so the following line restores original names\n res.index.names = df.index.names\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_modin-project__modin/modin/pandas/test/utils.py_df_equals_with_non_stable_indices_rotate_decimal_digits_or_symbols.if_value_dtype_object_.else_.return.tens_ones_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_df_equals_with_non_stable_indices_rotate_decimal_digits_or_symbols.if_value_dtype_object_.else_.return.tens_ones_10", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1488, "end_line": 1503, "span_ids": ["rotate_decimal_digits_or_symbols", "df_equals_with_non_stable_indices"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def df_equals_with_non_stable_indices(df1, df2):\n \"\"\"Assert equality of two frames regardless of the index order for equal values.\"\"\"\n df1, df2 = map(try_cast_to_pandas, (df1, df2))\n np.testing.assert_array_equal(df1.values, df2.values)\n sorted1, sorted2 = map(sort_index_for_equal_values, (df1, df2))\n df_equals(sorted1, sorted2)\n\n\ndef rotate_decimal_digits_or_symbols(value):\n if value.dtype == object:\n # When dtype is object, we assume that it is actually strings from MultiIndex level names\n return [x[-1] + x[:-1] for x in value]\n else:\n tens = value // 10\n ones = value % 10\n return tens + ones * 10", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_make_default_file_make_default_file.extension.file_type_to_extension_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_make_default_file_make_default_file.extension.file_type_to_extension_ge", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1506, "end_line": 1534, "span_ids": ["make_default_file"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_default_file(file_type: str):\n \"\"\"Helper function for pytest fixtures.\"\"\"\n filenames = []\n\n def _create_file(filenames, filename, force, nrows, ncols, func: str, func_kw=None):\n \"\"\"\n Helper function that creates a dataframe before writing it to a file.\n\n Eliminates the duplicate code that is needed before of output functions calls.\n\n Notes\n -----\n Importantly, names of created files are added to `filenames` variable for\n their further automatic deletion. Without this step, files created by\n `pytest` fixtures will not be deleted.\n \"\"\"\n if force or not os.path.exists(filename):\n df = pandas.DataFrame(\n {f\"col{x + 1}\": np.arange(nrows) for x in range(ncols)}\n )\n getattr(df, func)(filename, **func_kw if func_kw else {})\n filenames.append(filename)\n\n file_type_to_extension = {\n \"excel\": \"xlsx\",\n \"fwf\": \"txt\",\n \"pickle\": \"pkl\",\n }\n extension = file_type_to_extension.get(file_type, file_type)\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_modin-project__modin/modin/pandas/test/utils.py_make_default_file._make_default_file_make_default_file.return._make_default_file_filen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_make_default_file._make_default_file_make_default_file.return._make_default_file_filen", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1536, "end_line": 1562, "span_ids": ["make_default_file"], "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": "def make_default_file(file_type: str):\n # ... other code\n\n def _make_default_file(filename=None, nrows=NROWS, ncols=2, force=True, **kwargs):\n if filename is None:\n filename = get_unique_filename(extension=extension)\n\n if file_type == \"json\":\n lines = kwargs.get(\"lines\")\n func_kw = {\"lines\": lines, \"orient\": \"records\"} if lines else {}\n _create_file(filenames, filename, force, nrows, ncols, \"to_json\", func_kw)\n elif file_type in (\"html\", \"excel\", \"feather\", \"stata\", \"pickle\"):\n _create_file(filenames, filename, force, nrows, ncols, f\"to_{file_type}\")\n elif file_type == \"hdf\":\n func_kw = {\"key\": \"df\", \"format\": kwargs.get(\"format\")}\n _create_file(filenames, filename, force, nrows, ncols, \"to_hdf\", func_kw)\n elif file_type == \"fwf\":\n if force or not os.path.exists(filename):\n fwf_data = kwargs.get(\"fwf_data\")\n if fwf_data is None:\n with open(\"modin/pandas/test/data/test_data.fwf\", \"r\") as fwf_file:\n fwf_data = fwf_file.read()\n with open(filename, \"w\") as f:\n f.write(fwf_data)\n filenames.append(filename)\n else:\n raise ValueError(f\"Unsupported file type: {file_type}\")\n return filename\n\n return _make_default_file, filenames", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_value_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/test/utils.py_value_equals_", "embedding": null, "metadata": {"file_path": "modin/pandas/test/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1565, "end_line": 1578, "span_ids": ["dict_equals", "value_equals"], "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 value_equals(obj1, obj2):\n \"\"\"Check wherher two scalar or list-like values are equal and raise an ``AssertionError`` if they aren't.\"\"\"\n if is_list_like(obj1):\n np.testing.assert_array_equal(obj1, obj2)\n else:\n assert (obj1 == obj2) or (np.isnan(obj1) and np.isnan(obj2))\n\n\ndef dict_equals(dict1, dict2):\n \"\"\"Check whether two dictionaries are equal and raise an ``AssertionError`` if they aren't.\"\"\"\n for key1, key2 in itertools.zip_longest(sorted(dict1), sorted(dict2)):\n value_equals(key1, key2)\n value_equals(dict1[key1], dict2[key2])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_typing_import_Iterat_SET_DATAFRAME_ATTRIBUTE_WARNING._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_typing_import_Iterat_SET_DATAFRAME_ATTRIBUTE_WARNING._", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 46, "span_ids": ["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": "from typing import Iterator, Tuple, Optional\n\nfrom pandas.util._decorators import doc\nfrom pandas._typing import (\n AggFuncType,\n AggFuncTypeBase,\n AggFuncTypeDict,\n IndexLabel,\n)\nimport pandas\nimport numpy as np\n\nfrom modin.utils import hashable\n\n_doc_binary_operation = \"\"\"\nReturn {operation} of {left} and `{right}` (binary operator `{bin_op}`).\n\nParameters\n----------\n{right} : {right_type}\n The second operand to perform computation.\n\nReturns\n-------\n{returns}\n\"\"\"\n\nSET_DATAFRAME_ATTRIBUTE_WARNING = (\n \"Modin doesn't allow columns to be created via a new attribute name - see \"\n + \"https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access\"\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_non_pandas_from_non_pandas.return.new_qc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_non_pandas_from_non_pandas.return.new_qc", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 76, "span_ids": ["from_non_pandas"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def from_non_pandas(df, index, columns, dtype):\n \"\"\"\n Convert a non-pandas DataFrame into Modin DataFrame.\n\n Parameters\n ----------\n df : object\n Non-pandas DataFrame.\n index : object\n Index for non-pandas DataFrame.\n columns : object\n Columns for non-pandas DataFrame.\n dtype : type\n Data type to force.\n\n Returns\n -------\n modin.pandas.DataFrame\n Converted DataFrame.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\n new_qc = FactoryDispatcher.from_non_pandas(df, index, columns, dtype)\n if new_qc is not None:\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=new_qc)\n return new_qc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_pandas_from_arrow.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_pandas_from_arrow.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 116, "span_ids": ["from_arrow", "from_pandas"], "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": "def from_pandas(df):\n \"\"\"\n Convert a pandas DataFrame to a Modin DataFrame.\n\n Parameters\n ----------\n df : pandas.DataFrame\n The pandas DataFrame to convert.\n\n Returns\n -------\n modin.pandas.DataFrame\n A new Modin DataFrame object.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=FactoryDispatcher.from_pandas(df))\n\n\ndef from_arrow(at):\n \"\"\"\n Convert an Arrow Table to a Modin DataFrame.\n\n Parameters\n ----------\n at : Arrow Table\n The Arrow Table to convert from.\n\n Returns\n -------\n DataFrame\n A new Modin DataFrame object.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=FactoryDispatcher.from_arrow(at))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_dataframe_from_dataframe.return.DataFrame_query_compiler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_dataframe_from_dataframe.return.DataFrame_query_compiler_", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 138, "span_ids": ["from_dataframe"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def from_dataframe(df):\n \"\"\"\n Convert a DataFrame implementing the dataframe exchange protocol to a Modin DataFrame.\n\n See more about the protocol in https://data-apis.org/dataframe-protocol/latest/index.html.\n\n Parameters\n ----------\n df : DataFrame\n The DataFrame object supporting the dataframe exchange protocol.\n\n Returns\n -------\n DataFrame\n A new Modin DataFrame object.\n \"\"\"\n from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n from .dataframe import DataFrame\n\n return DataFrame(query_compiler=FactoryDispatcher.from_dataframe(df))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_cast_function_modin2pandas_cast_function_modin2pandas.return.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_cast_function_modin2pandas_cast_function_modin2pandas.return.func", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 161, "span_ids": ["cast_function_modin2pandas"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def cast_function_modin2pandas(func):\n \"\"\"\n Replace Modin functions with pandas functions if `func` is callable.\n\n Parameters\n ----------\n func : object\n\n Returns\n -------\n object\n \"\"\"\n if callable(func):\n if func.__module__ == \"modin.pandas.series\":\n func = getattr(pandas.Series, func.__name__)\n elif func.__module__ in (\"modin.pandas.dataframe\", \"modin.pandas.base\"):\n # FIXME: when the method is defined in `modin.pandas.base` file, then the\n # type cannot be determined, in general there may be an error, but at the\n # moment it is better.\n func = getattr(pandas.DataFrame, func.__name__)\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_modin-project__modin/modin/pandas/utils.py_is_scalar_is_scalar.return.not_isinstance_obj_BaseP": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_is_scalar_is_scalar.return.not_isinstance_obj_BaseP", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 187, "span_ids": ["is_scalar"], "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": "def is_scalar(obj):\n \"\"\"\n Return True if given object is scalar.\n\n This method works the same as is_scalar method from pandas but\n it is optimized for Modin frames. For BasePandasDataset objects\n pandas version of is_scalar tries to access missing attribute\n causing index scan. This triggers execution for lazy frames and\n we avoid it by handling BasePandasDataset objects separately.\n\n Parameters\n ----------\n obj : object\n Object to check.\n\n Returns\n -------\n bool\n True if given object is scalar and False otherwise.\n \"\"\"\n from pandas.api.types import is_scalar as pandas_is_scalar\n from .base import BasePandasDataset\n\n return not isinstance(obj, BasePandasDataset) and pandas_is_scalar(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_modin-project__modin/modin/pandas/utils.py_is_full_grab_slice_is_full_grab_slice.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_is_full_grab_slice_is_full_grab_slice.return._", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 216, "span_ids": ["is_full_grab_slice"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_full_grab_slice(slc, sequence_len=None):\n \"\"\"\n Check that the passed slice grabs the whole sequence.\n\n Parameters\n ----------\n slc : slice\n Slice object to check.\n sequence_len : int, optional\n Length of the sequence to index with the passed `slc`.\n If not specified the function won't be able to check whether\n ``slc.stop`` is equal or greater than the sequence length to\n consider `slc` to be a full-grab, and so, only slices with\n ``.stop is None`` are considered to be a full-grab.\n\n Returns\n -------\n bool\n \"\"\"\n assert isinstance(slc, slice), \"slice object required\"\n return (\n slc.start in (None, 0)\n and slc.step in (None, 1)\n and (\n slc.stop is None or (sequence_len is not None and slc.stop >= sequence_len)\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_modin-project__modin/modin/pandas/utils.py_from_modin_frame_to_mi_from_modin_frame_to_mi.return._original_pandas_MultiInd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_from_modin_frame_to_mi_from_modin_frame_to_mi.return._original_pandas_MultiInd", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 247, "span_ids": ["from_modin_frame_to_mi"], "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 from_modin_frame_to_mi(df, sortorder=None, names=None):\n \"\"\"\n Make a pandas.MultiIndex from a DataFrame.\n\n Parameters\n ----------\n df : DataFrame\n DataFrame to be converted to pandas.MultiIndex.\n sortorder : int, default: None\n Level of sortedness (must be lexicographically sorted by that\n level).\n names : list-like, optional\n If no names are provided, use the column names, or tuple of column\n names if the columns is a MultiIndex. If a sequence, overwrite\n names with the given sequence.\n\n Returns\n -------\n pandas.MultiIndex\n The pandas.MultiIndex representation of the given DataFrame.\n \"\"\"\n from .dataframe import DataFrame\n\n if isinstance(df, DataFrame):\n from modin.error_message import ErrorMessage\n\n ErrorMessage.default_to_pandas(\"`MultiIndex.from_frame`\")\n df = df._to_pandas()\n return _original_pandas_MultiIndex_from_frame(df, sortorder, 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_modin-project__modin/modin/pandas/utils.py_is_label_is_label.return.hashable_label_and_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_is_label_is_label.return.hashable_label_and_", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 250, "end_line": 271, "span_ids": ["is_label"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_label(obj, label, axis=0):\n \"\"\"\n Check whether or not 'obj' contain column or index level with name 'label'.\n\n Parameters\n ----------\n obj : modin.pandas.DataFrame, modin.pandas.Series or modin.core.storage_formats.base.BaseQueryCompiler\n Object to check.\n label : object\n Label name to check.\n axis : {0, 1}, default: 0\n Axis to search for `label` along.\n\n Returns\n -------\n bool\n True if check is successful, False otherwise.\n \"\"\"\n qc = getattr(obj, \"_query_compiler\", obj)\n return hashable(label) and (\n label in qc.get_axis(axis ^ 1) or label in qc.get_index_names(axis)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_check_both_not_none_check_both_not_none.return.not_option1_is_None_or_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_check_both_not_none_check_both_not_none.return.not_option1_is_None_or_o", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 290, "span_ids": ["check_both_not_none"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_both_not_none(option1, option2):\n \"\"\"\n Check that both `option1` and `option2` are not None.\n\n Parameters\n ----------\n option1 : Any\n First object to check if not None.\n option2 : Any\n Second object to check if not None.\n\n Returns\n -------\n bool\n True if both option1 and option2 are not None, False otherwise.\n \"\"\"\n return not (option1 is None or option2 is None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_broadcast_item_broadcast_item.try_.except_ValueError_.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_broadcast_item_broadcast_item.try_.except_ValueError_.raise_ValueError_", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 293, "end_line": 372, "span_ids": ["broadcast_item"], "tokens": 636}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def broadcast_item(\n obj,\n row_lookup,\n col_lookup,\n item,\n need_columns_reindex=True,\n):\n \"\"\"\n Use NumPy to broadcast or reshape item with reindexing.\n\n Parameters\n ----------\n obj : DataFrame or Series\n The object containing the necessary information about the axes.\n row_lookup : slice or scalar\n The global row index to locate inside of `item`.\n col_lookup : range, array, list, slice or scalar\n The global col index to locate inside of `item`.\n item : DataFrame, Series, or query_compiler\n Value that should be broadcast to a new shape of `to_shape`.\n need_columns_reindex : bool, default: True\n In the case of assigning columns to a dataframe (broadcasting is\n part of the flow), reindexing is not needed.\n\n Returns\n -------\n np.ndarray\n `item` after it was broadcasted to `to_shape`.\n\n Raises\n ------\n ValueError\n 1) If `row_lookup` or `col_lookup` contains values missing in\n DataFrame/Series index or columns correspondingly.\n 2) If `item` cannot be broadcast from its own shape to `to_shape`.\n\n Notes\n -----\n NumPy is memory efficient, there shouldn't be performance issue.\n \"\"\"\n # It is valid to pass a DataFrame or Series to __setitem__ that is larger than\n # the target the user is trying to overwrite.\n from .dataframe import DataFrame\n from .series import Series\n\n new_row_len = (\n len(obj.index[row_lookup]) if isinstance(row_lookup, slice) else len(row_lookup)\n )\n new_col_len = (\n len(obj.columns[col_lookup])\n if isinstance(col_lookup, slice)\n else len(col_lookup)\n )\n to_shape = new_row_len, new_col_len\n\n if isinstance(item, (pandas.Series, pandas.DataFrame, Series, DataFrame)):\n # convert indices in lookups to names, as pandas reindex expects them to be so\n axes_to_reindex = {}\n index_values = obj.index[row_lookup]\n if not index_values.equals(item.index):\n axes_to_reindex[\"index\"] = index_values\n if need_columns_reindex and isinstance(item, (pandas.DataFrame, DataFrame)):\n column_values = obj.columns[col_lookup]\n if not column_values.equals(item.columns):\n axes_to_reindex[\"columns\"] = column_values\n # New value for columns/index make that reindex add NaN values\n if axes_to_reindex:\n item = item.reindex(**axes_to_reindex)\n try:\n item = np.array(item)\n if np.prod(to_shape) == np.prod(item.shape):\n return item.reshape(to_shape)\n else:\n return np.broadcast_to(item, to_shape)\n except ValueError:\n from_shape = np.array(item).shape\n raise ValueError(\n f\"could not broadcast input array from shape {from_shape} into shape \"\n + f\"{to_shape}\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py__walk_aggregation_func__walk_aggregation_func.if_isinstance_value_lis.else_.yield_key_value_None_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py__walk_aggregation_func__walk_aggregation_func.if_isinstance_value_lis.else_.yield_key_value_None_c", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 375, "end_line": 422, "span_ids": ["_walk_aggregation_func"], "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": "def _walk_aggregation_func(\n key: IndexLabel, value: AggFuncType, depth: int = 0\n) -> Iterator[Tuple[IndexLabel, AggFuncTypeBase, Optional[str], bool]]:\n \"\"\"\n Walk over a function from a dictionary-specified aggregation.\n\n Note: this function is not supposed to be called directly and\n is used by ``walk_aggregation_dict``.\n\n Parameters\n ----------\n key : IndexLabel\n A key in a dictionary-specified aggregation for the passed `value`.\n This means an index label to apply the `value` functions against.\n value : AggFuncType\n An aggregation function matching the `key`.\n depth : int, default: 0\n Specifies a nesting level for the `value` where ``depth=0`` is when\n you call the function on a raw dictionary value.\n\n Yields\n ------\n (col: IndexLabel, func: AggFuncTypeBase, func_name: Optional[str], col_renaming_required: bool)\n Yield an aggregation function with its metadata:\n - `col`: column name to apply the function.\n - `func`: aggregation function to apply to the column.\n - `func_name`: custom function name that was specified in the dict.\n - `col_renaming_required`: whether it's required to rename the\n `col` into ``(col, func_name)``.\n \"\"\"\n col_renaming_required = bool(depth)\n\n if isinstance(value, (list, tuple)):\n if depth == 0:\n for val in value:\n yield from _walk_aggregation_func(key, val, depth + 1)\n elif depth == 1:\n if len(value) != 2:\n raise ValueError(\n f\"Incorrect rename format. Renamer must consist of exactly two elements, got: {len(value)}.\"\n )\n func_name, func = value\n yield key, func, func_name, col_renaming_required\n else:\n # pandas doesn't support this as well\n raise NotImplementedError(\"Nested renaming is not supported.\")\n else:\n yield key, value, None, col_renaming_required", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_walk_aggregation_dict_walk_aggregation_dict.for_key_value_in_agg_dic.yield_from__walk_aggregat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py_walk_aggregation_dict_walk_aggregation_dict.for_key_value_in_agg_dic.yield_from__walk_aggregat", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 446, "span_ids": ["walk_aggregation_dict"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def walk_aggregation_dict(\n agg_dict: AggFuncTypeDict,\n) -> Iterator[Tuple[IndexLabel, AggFuncTypeBase, Optional[str], bool]]:\n \"\"\"\n Walk over an aggregation dictionary.\n\n Parameters\n ----------\n agg_dict : AggFuncTypeDict\n\n Yields\n ------\n (col: IndexLabel, func: AggFuncTypeBase, func_name: Optional[str], col_renaming_required: bool)\n Yield an aggregation function with its metadata:\n - `col`: column name to apply the function.\n - `func`: aggregation function to apply to the column.\n - `func_name`: custom function name that was specified in the dict.\n - `col_renaming_required`: whether it's required to rename the\n `col` into ``(col, func_name)``.\n \"\"\"\n for key, value in agg_dict.items():\n yield from _walk_aggregation_func(key, value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py__doc_binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/utils.py__doc_binary_op_", "embedding": null, "metadata": {"file_path": "modin/pandas/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 495, "span_ids": ["_doc_binary_op", "impl:5"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _doc_binary_op(operation, bin_op, left=\"Series\", right=\"right\", returns=\"Series\"):\n \"\"\"\n Return callable documenting `Series` or `DataFrame` binary operator.\n\n Parameters\n ----------\n operation : str\n Operation name.\n bin_op : str\n Binary operation name.\n left : str, default: 'Series'\n The left object to document.\n right : str, default: 'right'\n The right operand name.\n returns : str, default: 'Series'\n Type of returns.\n\n Returns\n -------\n callable\n \"\"\"\n if left == \"Series\":\n right_type = \"Series or scalar value\"\n elif left == \"DataFrame\":\n right_type = \"DataFrame, Series or scalar value\"\n elif left == \"BasePandasDataset\":\n right_type = \"BasePandasDataset or scalar value\"\n else:\n raise NotImplementedError(\n f\"Only 'BasePandasDataset', `DataFrame` and 'Series' `left` are allowed, actually passed: {left}\"\n )\n doc_op = doc(\n _doc_binary_operation,\n operation=operation,\n right=right,\n right_type=right_type,\n bin_op=bin_op,\n returns=returns,\n left=left,\n )\n\n return doc_op\n\n\n_original_pandas_MultiIndex_from_frame = pandas.MultiIndex.from_frame\npandas.MultiIndex.from_frame = from_modin_frame_to_mi", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_from_typing_import_Option_Window.std.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_from_typing_import_Option_Window.std.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 81, "span_ids": ["Window.var", "Window.std", "Window.sum", "Window.mean", "docstring", "Window.__init__", "Window"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional\nimport pandas.core.window.rolling\nfrom pandas.core.dtypes.common import is_list_like\n\nfrom modin.logging import ClassLogger\nfrom modin.utils import _inherit_docstrings\nfrom modin.pandas.utils import cast_function_modin2pandas\n\n\n@_inherit_docstrings(pandas.core.window.rolling.Window)\nclass Window(ClassLogger):\n def __init__(\n self,\n dataframe,\n window=None,\n min_periods=None,\n center=False,\n win_type=None,\n on=None,\n axis=0,\n closed=None,\n step=None,\n method=\"single\",\n ):\n self._dataframe = dataframe\n self._query_compiler = dataframe._query_compiler\n self.window_args = [\n window,\n min_periods,\n center,\n win_type,\n on,\n axis,\n closed,\n step,\n method,\n ]\n self.axis = axis\n\n def mean(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.window_mean(\n self.axis, self.window_args, *args, **kwargs\n )\n )\n\n def sum(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.window_sum(\n self.axis, self.window_args, *args, **kwargs\n )\n )\n\n def var(self, ddof=1, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.window_var(\n self.axis, self.window_args, ddof, *args, **kwargs\n )\n )\n\n def std(self, ddof=1, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.window_std(\n self.axis, self.window_args, ddof, *args, **kwargs\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_modin-project__modin/modin/pandas/window.py_Rolling_Rolling.max.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling_Rolling.max.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 180, "span_ids": ["Rolling.min", "Rolling.count", "Rolling.sum", "Rolling.median", "Rolling", "Rolling.__init__", "Rolling.sem", "Rolling.var", "Rolling.max", "Rolling.mean", "Rolling.std"], "tokens": 618}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.core.window.rolling.Rolling,\n excluded=[pandas.core.window.rolling.Rolling.__init__],\n)\nclass Rolling(ClassLogger):\n def __init__(\n self,\n dataframe,\n window=None,\n min_periods=None,\n center=False,\n win_type=None,\n on=None,\n axis=0,\n closed=None,\n step=None,\n method=\"single\",\n ):\n if step is not None:\n raise NotImplementedError(\"step parameter is not implemented yet.\")\n self._dataframe = dataframe\n self._query_compiler = dataframe._query_compiler\n self.rolling_args = [\n window,\n min_periods,\n center,\n win_type,\n on,\n axis,\n closed,\n step,\n method,\n ]\n self.axis = axis\n\n def count(self):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_count(\n self.axis, self.rolling_args\n )\n )\n\n def sem(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_sem(\n self.axis, self.rolling_args, *args, **kwargs\n )\n )\n\n def sum(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_sum(\n self.axis, self.rolling_args, *args, **kwargs\n )\n )\n\n def mean(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_mean(\n self.axis, self.rolling_args, *args, **kwargs\n )\n )\n\n def median(self, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_median(\n self.axis, self.rolling_args, **kwargs\n )\n )\n\n def var(self, ddof=1, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_var(\n self.axis, self.rolling_args, ddof, *args, **kwargs\n )\n )\n\n def std(self, ddof=1, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_std(\n self.axis, self.rolling_args, ddof, *args, **kwargs\n )\n )\n\n def min(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_min(\n self.axis, self.rolling_args, *args, **kwargs\n )\n )\n\n def max(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_max(\n self.axis, self.rolling_args, *args, **kwargs\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_modin-project__modin/modin/pandas/window.py_Rolling.corr_Rolling.corr.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.corr_Rolling.corr.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 195, "span_ids": ["Rolling.corr"], "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": "@_inherit_docstrings(\n pandas.core.window.rolling.Rolling,\n excluded=[pandas.core.window.rolling.Rolling.__init__],\n)\nclass Rolling(ClassLogger):\n\n def corr(self, other=None, pairwise=None, *args, **kwargs):\n from .dataframe import DataFrame\n from .series import Series\n\n if isinstance(other, DataFrame):\n other = other._query_compiler.to_pandas()\n elif isinstance(other, Series):\n other = other._query_compiler.to_pandas().squeeze()\n\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_corr(\n self.axis, self.rolling_args, other, pairwise, *args, **kwargs\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_modin-project__modin/modin/pandas/window.py_Rolling.cov_Rolling.cov.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.cov_Rolling.cov.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 197, "end_line": 210, "span_ids": ["Rolling.cov"], "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": "@_inherit_docstrings(\n pandas.core.window.rolling.Rolling,\n excluded=[pandas.core.window.rolling.Rolling.__init__],\n)\nclass Rolling(ClassLogger):\n\n def cov(self, other=None, pairwise=None, ddof: Optional[int] = 1, **kwargs):\n from .dataframe import DataFrame\n from .series import Series\n\n if isinstance(other, DataFrame):\n other = other._query_compiler.to_pandas()\n elif isinstance(other, Series):\n other = other._query_compiler.to_pandas().squeeze()\n\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_cov(\n self.axis, self.rolling_args, other, pairwise, ddof, **kwargs\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_modin-project__modin/modin/pandas/window.py_Rolling.skew_Rolling.apply.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.skew_Rolling.apply.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 247, "span_ids": ["Rolling.skew", "Rolling.kurt", "Rolling.apply"], "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": "@_inherit_docstrings(\n pandas.core.window.rolling.Rolling,\n excluded=[pandas.core.window.rolling.Rolling.__init__],\n)\nclass Rolling(ClassLogger):\n\n def skew(self, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_skew(\n self.axis, self.rolling_args, **kwargs\n )\n )\n\n def kurt(self, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_kurt(\n self.axis, self.rolling_args, **kwargs\n )\n )\n\n def apply(\n self,\n func,\n raw=False,\n engine=\"cython\",\n engine_kwargs=None,\n args=None,\n kwargs=None,\n ):\n func = cast_function_modin2pandas(func)\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_apply(\n self.axis,\n self.rolling_args,\n func,\n raw,\n engine,\n engine_kwargs,\n args,\n kwargs,\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_modin-project__modin/modin/pandas/window.py_Rolling.aggregate_Rolling.aggregate.if_isinstance_self__dataf.else_.return.dataframe_squeeze_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.aggregate_Rolling.aggregate.if_isinstance_self__dataf.else_.return.dataframe_squeeze_", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 249, "end_line": 272, "span_ids": ["Rolling.aggregate"], "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": "@_inherit_docstrings(\n pandas.core.window.rolling.Rolling,\n excluded=[pandas.core.window.rolling.Rolling.__init__],\n)\nclass Rolling(ClassLogger):\n\n def aggregate(\n self,\n func,\n *args,\n **kwargs,\n ):\n from .dataframe import DataFrame\n\n dataframe = DataFrame(\n query_compiler=self._query_compiler.rolling_aggregate(\n self.axis,\n self.rolling_args,\n func,\n *args,\n **kwargs,\n )\n )\n if isinstance(self._dataframe, DataFrame):\n return dataframe\n elif is_list_like(func):\n dataframe.columns = dataframe.columns.droplevel()\n return dataframe\n else:\n return dataframe.squeeze()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.agg_Rolling.rank.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Rolling.agg_Rolling.rank.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 296, "span_ids": ["Rolling:2", "Rolling.rank", "Rolling.quantile"], "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": "@_inherit_docstrings(\n pandas.core.window.rolling.Rolling,\n excluded=[pandas.core.window.rolling.Rolling.__init__],\n)\nclass Rolling(ClassLogger):\n\n agg = aggregate\n\n def quantile(self, quantile, interpolation=\"linear\", **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_quantile(\n self.axis, self.rolling_args, quantile, interpolation, **kwargs\n )\n )\n\n def rank(\n self, method=\"average\", ascending=True, pct=False, numeric_only=False, **kwargs\n ):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.rolling_rank(\n self.axis,\n self.rolling_args,\n method,\n ascending,\n pct,\n numeric_only,\n **kwargs,\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_modin-project__modin/modin/pandas/window.py_Expanding_Expanding.count.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding_Expanding.count.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 385, "span_ids": ["Expanding.mean", "Expanding.sum", "Expanding.min", "Expanding.__init__", "Expanding.count", "Expanding.var", "Expanding.median", "Expanding.aggregate", "Expanding", "Expanding.std", "Expanding.max"], "tokens": 626}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_inherit_docstrings(\n pandas.core.window.expanding.Expanding,\n excluded=[pandas.core.window.expanding.Expanding.__init__],\n)\nclass Expanding(ClassLogger):\n def __init__(self, dataframe, min_periods=1, axis=0, method=\"single\"):\n self._dataframe = dataframe\n self._query_compiler = dataframe._query_compiler\n self.expanding_args = [min_periods, axis, method]\n self.axis = axis\n\n def aggregate(self, func, *args, **kwargs):\n from .dataframe import DataFrame\n\n dataframe = DataFrame(\n query_compiler=self._query_compiler.expanding_aggregate(\n self.axis, self.expanding_args, func, *args, **kwargs\n )\n )\n if isinstance(self._dataframe, DataFrame):\n return dataframe\n elif is_list_like(func):\n dataframe.columns = dataframe.columns.droplevel()\n return dataframe\n else:\n return dataframe.squeeze()\n\n def sum(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_sum(\n self.axis, self.expanding_args, *args, **kwargs\n )\n )\n\n def min(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_min(\n self.axis, self.expanding_args, *args, **kwargs\n )\n )\n\n def max(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_max(\n self.axis, self.expanding_args, *args, **kwargs\n )\n )\n\n def mean(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_mean(\n self.axis, self.expanding_args, *args, **kwargs\n )\n )\n\n def median(self, numeric_only=False, engine=None, engine_kwargs=None, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_median(\n self.axis,\n self.expanding_args,\n numeric_only=numeric_only,\n engine=engine,\n engine_kwargs=engine_kwargs,\n **kwargs,\n )\n )\n\n def var(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_var(\n self.axis, self.expanding_args, *args, **kwargs\n )\n )\n\n def std(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_std(\n self.axis, self.expanding_args, *args, **kwargs\n )\n )\n\n def count(self, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_count(\n self.axis, self.expanding_args, *args, **kwargs\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_modin-project__modin/modin/pandas/window.py_Expanding.cov_Expanding.cov.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding.cov_Expanding.cov.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 387, "end_line": 407, "span_ids": ["Expanding.cov"], "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": "@_inherit_docstrings(\n pandas.core.window.expanding.Expanding,\n excluded=[pandas.core.window.expanding.Expanding.__init__],\n)\nclass Expanding(ClassLogger):\n\n def cov(self, other=None, pairwise=None, ddof=1, numeric_only=False, **kwargs):\n from .dataframe import DataFrame\n from .series import Series\n\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_cov(\n self.axis,\n self.expanding_args,\n squeeze_self=isinstance(self._dataframe, Series),\n squeeze_other=isinstance(other, Series),\n other=(\n other._query_compiler\n if isinstance(other, (Series, DataFrame))\n else other\n ),\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\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_modin-project__modin/modin/pandas/window.py_Expanding.corr_Expanding.corr.return.self__dataframe___constru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding.corr_Expanding.corr.return.self__dataframe___constru", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 429, "span_ids": ["Expanding.corr"], "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": "@_inherit_docstrings(\n pandas.core.window.expanding.Expanding,\n excluded=[pandas.core.window.expanding.Expanding.__init__],\n)\nclass Expanding(ClassLogger):\n\n def corr(self, other=None, pairwise=None, ddof=1, numeric_only=False, **kwargs):\n from .dataframe import DataFrame\n from .series import Series\n\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_corr(\n self.axis,\n self.expanding_args,\n squeeze_self=isinstance(self._dataframe, Series),\n squeeze_other=isinstance(other, Series),\n other=(\n other._query_compiler\n if isinstance(other, (Series, DataFrame))\n else other\n ),\n pairwise=pairwise,\n ddof=ddof,\n numeric_only=numeric_only,\n **kwargs,\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_modin-project__modin/modin/pandas/window.py_Expanding.sem_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/pandas/window.py_Expanding.sem_", "embedding": null, "metadata": {"file_path": "modin/pandas/window.py", "file_name": "window.py", "file_type": "text/x-python", "category": "implementation", "start_line": 431, "end_line": 478, "span_ids": ["Expanding.quantile", "Expanding.rank", "Expanding.skew", "Expanding.kurt", "Expanding.sem"], "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": "@_inherit_docstrings(\n pandas.core.window.expanding.Expanding,\n excluded=[pandas.core.window.expanding.Expanding.__init__],\n)\nclass Expanding(ClassLogger):\n\n def sem(self, ddof=1, numeric_only=False, *args, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_sem(\n self.axis,\n self.expanding_args,\n ddof=ddof,\n numeric_only=numeric_only,\n *args,\n **kwargs,\n )\n )\n\n def skew(self, numeric_only=False, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_skew(\n self.axis, self.expanding_args, numeric_only=numeric_only, **kwargs\n )\n )\n\n def kurt(self, **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_kurt(\n self.axis, self.expanding_args, **kwargs\n )\n )\n\n def quantile(self, quantile, interpolation=\"linear\", **kwargs):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_quantile(\n self.axis, self.expanding_args, quantile, interpolation, **kwargs\n )\n )\n\n def rank(\n self, method=\"average\", ascending=True, pct=False, numeric_only=False, **kwargs\n ):\n return self._dataframe.__constructor__(\n query_compiler=self._query_compiler.expanding_rank(\n self.axis,\n self.expanding_args,\n method,\n ascending,\n pct,\n numeric_only,\n **kwargs,\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_modin-project__modin/modin/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/interchange/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/test/interchange/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/interchange/dataframe_protocol/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/interchange/dataframe_protocol/base/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/base/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/interchange/dataframe_protocol/base/test_sanity.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/test_sanity.py_pytest_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/base/test_sanity.py", "file_name": "test_sanity.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 51, "span_ids": ["test_basic_io", "test_sanity", "docstring"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport modin.pandas as pd\n\nfrom modin.pandas.test.utils import default_to_pandas_ignore_string\n\n\ndef test_sanity():\n \"\"\"Test that the DataFrame protocol module is valid and could be imported correctly.\"\"\"\n from modin.core.dataframe.base.interchange.dataframe_protocol.dataframe import ( # noqa\n ProtocolDataframe,\n )\n\n\n@pytest.mark.filterwarnings(default_to_pandas_ignore_string)\ndef test_basic_io(get_unique_base_execution):\n \"\"\"Test that the protocol IO functions actually reach their implementation with no errors.\"\"\"\n\n class TestPassed(BaseException):\n pass\n\n def dummy_io_method(*args, **kwargs):\n \"\"\"Dummy method emulating that the code path reached the exchange protocol implementation.\"\"\"\n raise TestPassed\n\n query_compiler_cls = get_unique_base_execution\n query_compiler_cls.from_dataframe = dummy_io_method\n query_compiler_cls.to_dataframe = dummy_io_method\n\n from modin.pandas.utils import from_dataframe\n\n with pytest.raises(TestPassed):\n from_dataframe(None)\n\n with pytest.raises(TestPassed):\n pd.DataFrame([[1]]).__dataframe__()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/test_utils.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/base/test_utils.py_pytest_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/base/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 54, "span_ids": ["test_dtype_to_arrow_c", "docstring"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport pandas\nimport numpy as np\n\nfrom modin.core.dataframe.base.interchange.dataframe_protocol.utils import (\n pandas_dtype_to_arrow_c,\n)\n\n\n# TODO: use ArrowSchema to get reference C-string.\n# At the time, there is no way to access ArrowSchema holding a type format string from python.\n# The only way to 'touch' it is to export the structure to a C-pointer:\n# https://github.com/apache/arrow/blob/5680d209fd870f99134e2d7299b47acd90fabb8e/python/pyarrow/types.pxi#L230-L239\n@pytest.mark.parametrize(\n \"pandas_dtype, c_string\",\n [\n (np.dtype(\"bool\"), \"b\"),\n (np.dtype(\"int8\"), \"c\"),\n (np.dtype(\"uint8\"), \"C\"),\n (np.dtype(\"int16\"), \"s\"),\n (np.dtype(\"uint16\"), \"S\"),\n (np.dtype(\"int32\"), \"i\"),\n (np.dtype(\"uint32\"), \"I\"),\n (np.dtype(\"int64\"), \"l\"),\n (np.dtype(\"uint64\"), \"L\"),\n (np.dtype(\"float16\"), \"e\"),\n (np.dtype(\"float32\"), \"f\"),\n (np.dtype(\"float64\"), \"g\"),\n (pandas.Series([\"a\"]).dtype, \"u\"),\n (\n pandas.Series([0]).astype(\"datetime64[ns]\").dtype,\n \"tsn:\",\n ),\n ],\n)\ndef test_dtype_to_arrow_c(pandas_dtype, c_string): # noqa PR01\n \"\"\"Test ``pandas_dtype_to_arrow_c`` utility function.\"\"\"\n assert pandas_dtype_to_arrow_c(pandas_dtype) == c_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_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_pytest_get_data_of_all_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_pytest_get_data_of_all_types", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 30, "span_ids": ["docstring"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport pyarrow as pa\nimport pandas\nimport numpy as np\n\nimport modin.pandas as pd\nfrom modin.core.dataframe.pandas.interchange.dataframe_protocol.from_dataframe import (\n primitive_column_to_ndarray,\n buffer_to_ndarray,\n set_nulls,\n)\nfrom modin.pandas.utils import from_arrow, from_dataframe\nfrom modin.pandas.test.utils import df_equals\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\nfrom .utils import get_data_of_all_types, split_df_into_chunks, export_frame", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_simple_export_test_simple_export.df_equals_md_df_exported": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_simple_export_test_simple_export.df_equals_md_df_exported", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 50, "span_ids": ["test_simple_export"], "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": "@pytest.mark.parametrize(\"data_has_nulls\", [True, False])\n@pytest.mark.parametrize(\"from_hdk\", [True, False])\n@pytest.mark.parametrize(\"n_chunks\", [None, 3, 5, 12])\ndef test_simple_export(data_has_nulls, from_hdk, n_chunks):\n if from_hdk:\n # HDK can't import 'uint64' as well as booleans\n # issue for bool: https://github.com/modin-project/modin/issues/4299\n exclude_dtypes = [\"bool\", \"uint64\"]\n else:\n exclude_dtypes = []\n\n data = get_data_of_all_types(\n has_nulls=data_has_nulls, exclude_dtypes=exclude_dtypes\n )\n md_df = pd.DataFrame(data)\n\n exported_df = export_frame(md_df, from_hdk, n_chunks=n_chunks)\n df_equals(md_df, exported_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_aligned_at_chunks_test_export_aligned_at_chunks.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_aligned_at_chunks_test_export_aligned_at_chunks.None_3", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 80, "span_ids": ["test_export_aligned_at_chunks"], "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": "@pytest.mark.parametrize(\"n_chunks\", [2, 4, 7])\n@pytest.mark.parametrize(\"data_has_nulls\", [True, False])\ndef test_export_aligned_at_chunks(n_chunks, data_has_nulls):\n \"\"\"Test export from DataFrame exchange protocol when internal PyArrow table is equaly chunked.\"\"\"\n # Modin DataFrame constructor can't process PyArrow's category when using `from_arrow`, so exclude it\n data = get_data_of_all_types(has_nulls=data_has_nulls, exclude_dtypes=[\"category\"])\n pd_df = pandas.DataFrame(data)\n pd_chunks = split_df_into_chunks(pd_df, n_chunks)\n\n chunked_at = pa.concat_tables([pa.Table.from_pandas(pd_df) for pd_df in pd_chunks])\n md_df = from_arrow(chunked_at)\n assert (\n len(md_df._query_compiler._modin_frame._partitions[0][0].get().column(0).chunks)\n == md_df.__dataframe__().num_chunks()\n == n_chunks\n )\n\n exported_df = export_frame(md_df)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=n_chunks)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=n_chunks * 2)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=n_chunks * 3)\n df_equals(md_df, exported_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_unaligned_at_chunks_test_export_unaligned_at_chunks.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_unaligned_at_chunks_test_export_unaligned_at_chunks.None_3", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 139, "span_ids": ["test_export_unaligned_at_chunks"], "tokens": 578}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data_has_nulls\", [True, False])\ndef test_export_unaligned_at_chunks(data_has_nulls):\n \"\"\"\n Test export from DataFrame exchange protocol when internal PyArrow table's chunks are unaligned.\n\n Arrow table allows for its columns to be chunked independently. Unaligned chunking means that\n each column has its individual chunking and so some preprocessing is required in order\n to emulate equaly chunked columns in the protocol.\n \"\"\"\n # Modin DataFrame constructor can't process PyArrow's category when using `from_arrow`, so exclude it\n data = get_data_of_all_types(has_nulls=data_has_nulls, exclude_dtypes=[\"category\"])\n pd_df = pandas.DataFrame(data)\n # divide columns in 3 groups: unchunked, 2-chunked, 7-chunked\n chunk_groups = [1, 2, 7]\n chunk_col_ilocs = [\n slice(\n i * len(pd_df.columns) // len(chunk_groups),\n (i + 1) * len(pd_df.columns) // len(chunk_groups),\n )\n for i in range(len(chunk_groups))\n ]\n\n pd_chunk_groups = [\n split_df_into_chunks(pd_df.iloc[:, cols], n_chunks)\n for n_chunks, cols in zip(chunk_groups, chunk_col_ilocs)\n ]\n at_chunk_groups = [\n pa.concat_tables([pa.Table.from_pandas(pd_df) for pd_df in chunk_group])\n for chunk_group in pd_chunk_groups\n ]\n\n chunked_at = at_chunk_groups[0]\n # TODO: appending columns one by one looks inefficient, is there a better way?\n for _at in at_chunk_groups[1:]:\n for field in _at.schema:\n chunked_at = chunked_at.append_column(field, _at[field.name])\n md_df = from_arrow(chunked_at)\n\n # verify that test generated the correct chunking\n internal_at = md_df._query_compiler._modin_frame._partitions[0][0].get()\n for n_chunks_group, cols in zip(chunk_groups, chunk_col_ilocs):\n for col in internal_at.select(range(cols.start, cols.stop)).columns:\n assert len(col.chunks) == n_chunks_group\n\n n_chunks = md_df.__dataframe__().num_chunks()\n\n exported_df = export_frame(md_df)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=n_chunks)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=n_chunks * 2)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=n_chunks * 3)\n df_equals(md_df, exported_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_indivisible_chunking_test_export_indivisible_chunking.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_indivisible_chunking_test_export_indivisible_chunking.None_3", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 142, "end_line": 173, "span_ids": ["test_export_indivisible_chunking"], "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": "@pytest.mark.parametrize(\"data_has_nulls\", [True, False])\ndef test_export_indivisible_chunking(data_has_nulls):\n \"\"\"\n Test ``.get_chunks(n_chunks)`` when internal PyArrow table's is 'indivisibly chunked'.\n\n The setup for the test is a PyArrow table having one of the chunk consisting of a single row,\n meaning that the chunk can't be subdivide.\n \"\"\"\n data = get_data_of_all_types(has_nulls=data_has_nulls, exclude_dtypes=[\"category\"])\n pd_df = pandas.DataFrame(data)\n pd_chunks = (pd_df.iloc[:1], pd_df.iloc[1:])\n\n chunked_at = pa.concat_tables([pa.Table.from_pandas(pd_df) for pd_df in pd_chunks])\n md_df = from_arrow(chunked_at)\n assert (\n len(md_df._query_compiler._modin_frame._partitions[0][0].get().column(0).chunks)\n == md_df.__dataframe__().num_chunks()\n == 2\n )\n # Meaning that we can't subdivide first chunk\n np.testing.assert_array_equal(\n md_df.__dataframe__()._chunk_slices, [0, 1, len(pd_df)]\n )\n\n exported_df = export_frame(md_df, n_chunks=2)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=4)\n df_equals(md_df, exported_df)\n\n exported_df = export_frame(md_df, n_chunks=40)\n df_equals(md_df, exported_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_when_delayed_computations_test_export_when_delayed_computations.df_equals_exported_df_pd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_export_when_delayed_computations_test_export_when_delayed_computations.df_equals_exported_df_pd", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 176, "end_line": 197, "span_ids": ["test_export_when_delayed_computations"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_export_when_delayed_computations():\n \"\"\"\n Test that export works properly when HdkOnNative has delayed computations.\n\n If there are delayed functions and export is required, it has to trigger the execution\n first prior materializing protocol's buffers, so the buffers contain actual result\n of the computations.\n \"\"\"\n # HDK can't import 'uint64' as well as booleans, so exclude them\n # issue for bool: https://github.com/modin-project/modin/issues/4299\n data = get_data_of_all_types(has_nulls=True, exclude_dtypes=[\"uint64\", \"bool\"])\n md_df = pd.DataFrame(data)\n pd_df = pandas.DataFrame(data)\n\n md_res = md_df.fillna({\"float32_null\": 32.0, \"float64_null\": 64.0})\n pd_res = pd_df.fillna({\"float32_null\": 32.0, \"float64_null\": 64.0})\n assert (\n not md_res._query_compiler._modin_frame._has_arrow_table()\n ), \"There are no delayed computations for the frame\"\n\n exported_df = export_frame(md_res)\n df_equals(exported_df, pd_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_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_simple_import_test_simple_import.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_simple_import_test_simple_import.None_1", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 200, "end_line": 227, "span_ids": ["test_simple_import"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"data_has_nulls\", [True, False])\ndef test_simple_import(data_has_nulls):\n \"\"\"Test that ``modin.pandas.utils.from_dataframe`` works properly.\"\"\"\n data = get_data_of_all_types(data_has_nulls)\n\n modin_df_producer = pd.DataFrame(data)\n internal_modin_df_producer = modin_df_producer.__dataframe__()\n # Our configuration in pytest.ini requires that we explicitly catch all\n # instances of defaulting to pandas, this one raises a warning on `.from_dataframe`\n with warns_that_defaulting_to_pandas():\n modin_df_consumer = from_dataframe(modin_df_producer)\n internal_modin_df_consumer = from_dataframe(internal_modin_df_producer)\n\n # TODO: the following assertions verify that `from_dataframe` doesn't return\n # the same object untouched due to optimization branching, it actually should\n # do so but the logic is not implemented yet, so the assertions are passing\n # for now. It's required to replace the producer's type with a different one\n # to consumer when we have some other implementation of the protocol as the\n # assertions may start failing shortly.\n assert modin_df_producer is not modin_df_consumer\n assert internal_modin_df_producer is not internal_modin_df_consumer\n assert (\n modin_df_producer._query_compiler._modin_frame\n is not modin_df_consumer._query_compiler._modin_frame\n )\n\n df_equals(modin_df_producer, modin_df_consumer)\n df_equals(modin_df_producer, internal_modin_df_consumer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_zero_copy_export_for_primitives_test_zero_copy_export_for_primitives.with_pytest_raises_Runtim.primitive_column_to_ndarr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_zero_copy_export_for_primitives_test_zero_copy_export_for_primitives.with_pytest_raises_Runtim.primitive_column_to_ndarr", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 256, "span_ids": ["test_zero_copy_export_for_primitives"], "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": "@pytest.mark.parametrize(\"data_has_nulls\", [True, False])\ndef test_zero_copy_export_for_primitives(data_has_nulls):\n \"\"\"Test that basic data types can be zero-copy exported from HdkOnNative dataframe.\"\"\"\n data = get_data_of_all_types(\n has_nulls=data_has_nulls, include_dtypes=[\"int\", \"uint\", \"float\"]\n )\n at = pa.Table.from_pydict(data)\n\n md_df = from_arrow(at)\n protocol_df = md_df.__dataframe__(allow_copy=False)\n\n for i, col in enumerate(protocol_df.get_columns()):\n col_arr, _ = primitive_column_to_ndarray(col)\n\n exported_ptr = col_arr.__array_interface__[\"data\"][0]\n producer_ptr = at.column(i).chunks[0].buffers()[-1].address\n # Verify that the pointers of produce and exported objects point to the same data\n assert producer_ptr == exported_ptr\n\n # Can't export `md_df` zero-copy no more as it has delayed 'fillna' operation\n md_df = md_df.fillna({\"float32\": 32.0})\n non_zero_copy_protocol_df = md_df.__dataframe__(allow_copy=False)\n\n with pytest.raises(RuntimeError):\n primitive_column_to_ndarray(\n non_zero_copy_protocol_df.get_column_by_name(\"float32\")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_bitmask_chunking_test_bitmask_chunking.df_equals_md_df_exported": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_bitmask_chunking_test_bitmask_chunking.df_equals_md_df_exported", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 268, "span_ids": ["test_bitmask_chunking"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_bitmask_chunking():\n \"\"\"Test that making a virtual chunk in a middle of a byte of a bitmask doesn't cause problems.\"\"\"\n at = pa.Table.from_pydict({\"col\": [True, False, True, True, False] * 5})\n assert at[\"col\"].type.bit_width == 1\n\n md_df = from_arrow(at)\n # Column length is 25, n_chunks is 2, meaning that the split will occur in the middle\n # of the second byte\n exported_df = export_frame(md_df, n_chunks=2)\n df_equals(md_df, exported_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_buffer_of_chunked_at_test_buffer_of_chunked_at.None_1.with_pytest_raises_Runtim.col_get_buffers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_buffer_of_chunked_at_test_buffer_of_chunked_at.None_1.with_pytest_raises_Runtim.col_get_buffers_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 271, "end_line": 312, "span_ids": ["test_buffer_of_chunked_at"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"data_has_nulls\", [True, False])\n@pytest.mark.parametrize(\"n_chunks\", [2, 9])\ndef test_buffer_of_chunked_at(data_has_nulls, n_chunks):\n \"\"\"Test that getting buffers of physically chunked column works properly.\"\"\"\n data = get_data_of_all_types(\n # For the simplicity of the test include only primitive types, so the test can use\n # only one function to export a column instead of if-elsing to find a type-according one\n has_nulls=data_has_nulls,\n include_dtypes=[\"bool\", \"int\", \"uint\", \"float\"],\n )\n\n pd_df = pandas.DataFrame(data)\n pd_chunks = split_df_into_chunks(pd_df, n_chunks)\n\n chunked_at = pa.concat_tables([pa.Table.from_pandas(pd_df) for pd_df in pd_chunks])\n md_df = from_arrow(chunked_at)\n\n protocol_df = md_df.__dataframe__()\n for i, col in enumerate(protocol_df.get_columns()):\n assert col.num_chunks() > 1\n assert len(col._pyarrow_table.column(0).chunks) > 1\n\n buffers = col.get_buffers()\n data_buff, data_dtype = buffers[\"data\"]\n result = buffer_to_ndarray(data_buff, data_dtype, col.offset, col.size())\n result = set_nulls(result, col, buffers[\"validity\"])\n\n # Our configuration in pytest.ini requires that we explicitly catch all\n # instances of defaulting to pandas, this one raises a warning on `.to_numpy()`\n with warns_that_defaulting_to_pandas():\n reference = md_df.iloc[:, i].to_numpy()\n\n np.testing.assert_array_equal(reference, result)\n\n protocol_df = md_df.__dataframe__(allow_copy=False)\n for i, col in enumerate(protocol_df.get_columns()):\n assert col.num_chunks() > 1\n assert len(col._pyarrow_table.column(0).chunks) > 1\n\n # Catch exception on attempt of doing a copy due to chunks combining\n with pytest.raises(RuntimeError):\n col.get_buffers()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_concat_chunks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/test_protocol.py_test_concat_chunks_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 315, "end_line": 327, "span_ids": ["test_concat_chunks"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_concat_chunks():\n \"\"\"Regression test for https://github.com/modin-project/modin/issues/4366\"\"\"\n modin_df = pd.DataFrame(\n {\"a\": pd.Categorical(list(\"testdataforexchangedataframeprotocol\"))}\n )\n n_chunks = 2\n chunks = split_df_into_chunks(modin_df, n_chunks)\n new_modin_df = pd.concat(chunks)\n assert new_modin_df[\"a\"].dtype.name == \"category\"\n protocol_df = new_modin_df.__dataframe__()\n df_col = protocol_df.get_column_by_name(\"a\")\n assert df_col.num_chunks() == n_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_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_pandas_split_df_into_chunks.return.chunks": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_pandas_split_df_into_chunks.return.chunks", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 50, "span_ids": ["split_df_into_chunks", "docstring"], "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 pandas\nimport numpy as np\nfrom typing import Dict\n\nfrom modin.core.dataframe.pandas.interchange.dataframe_protocol.from_dataframe import (\n from_dataframe_to_pandas,\n protocol_df_chunk_to_pandas,\n)\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.test.utils import (\n ForceHdkImport,\n)\n\n\ndef split_df_into_chunks(df, n_chunks):\n \"\"\"\n Split passed DataFrame into `n_chunks` along row axis.\n\n Parameters\n ----------\n df : DataFrame\n DataFrame to split into chunks.\n n_chunks : int\n Number of chunks to split `df` into.\n\n Returns\n -------\n list of DataFrames\n \"\"\"\n chunks = []\n for i in range(n_chunks):\n start = i * len(df) // n_chunks\n end = (i + 1) * len(df) // n_chunks\n chunks.append(df.iloc[start:end])\n\n return 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_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_export_frame_export_frame.return.exported_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_export_frame_export_frame.return.exported_df", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 79, "span_ids": ["export_frame"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def export_frame(md_df, from_hdk=False, **kwargs):\n \"\"\"\n Construct ``pandas.DataFrame`` from ``modin.pandas.DataFrame`` using DataFrame exchange protocol.\n\n Parameters\n ----------\n md_df : modin.pandas.DataFrame\n DataFrame to convert to pandas.\n from_hdk : bool, default: False\n Whether to forcibly use data exported from HDK. If `True`, import DataFrame's\n data into HDK and then export it back, so the origin for underlying `md_df`\n data is HDK.\n **kwargs : dict\n Additional parameters to pass to the ``from_dataframe_to_pandas`` function.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n if not from_hdk:\n return from_dataframe_to_pandas_assert_chunking(md_df, **kwargs)\n\n with ForceHdkImport(md_df) as instance:\n md_df_exported = instance.export_frames()[0]\n exported_df = from_dataframe_to_pandas_assert_chunking(md_df_exported, **kwargs)\n\n return exported_df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_from_dataframe_to_pandas_assert_chunking_from_dataframe_to_pandas_assert_chunking.return.pd_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_from_dataframe_to_pandas_assert_chunking_from_dataframe_to_pandas_assert_chunking.return.pd_df", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 82, "end_line": 118, "span_ids": ["from_dataframe_to_pandas_assert_chunking"], "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 from_dataframe_to_pandas_assert_chunking(df, n_chunks=None, **kwargs):\n \"\"\"\n Build a ``pandas.DataFrame`` from a `__dataframe__` object splitting it into `n_chunks`.\n\n The function asserts that the `df` was split exactly into `n_chunks` before converting them to pandas.\n\n Parameters\n ----------\n df : DataFrame\n Object supporting the exchange protocol, i.e. `__dataframe__` method.\n n_chunks : int, optional\n Number of chunks to split `df`.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n if n_chunks is None:\n return from_dataframe_to_pandas(df, n_chunks=n_chunks, **kwargs)\n\n protocol_df = df.__dataframe__()\n chunks = list(protocol_df.get_chunks(n_chunks))\n assert len(chunks) == n_chunks\n\n pd_chunks = [None] * len(chunks)\n for i in range(len(chunks)):\n pd_chunks[i] = protocol_df_chunk_to_pandas(chunks[i], **kwargs)\n\n pd_df = pandas.concat(pd_chunks, axis=0, ignore_index=True)\n\n index_obj = protocol_df.metadata.get(\n \"modin.index\", protocol_df.metadata.get(\"pandas.index\", None)\n )\n if index_obj is not None:\n pd_df.index = index_obj\n\n return pd_df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_get_data_of_all_types_get_data_of_all_types._datetime": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_get_data_of_all_types_get_data_of_all_types._datetime", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 186, "span_ids": ["get_data_of_all_types"], "tokens": 688}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_data_of_all_types(\n has_nulls=False, exclude_dtypes=None, include_dtypes=None\n) -> Dict[str, np.ndarray]:\n \"\"\"\n Generate a dictionary containing every datatype that is supported by HDK implementation of the exchange protocol.\n\n Parameters\n ----------\n has_nulls : bool, default: False\n Whether to include columns containing null values.\n exclude_dtypes : list, optional\n List of type prefixes to exclude in the dictionary. For example,\n passing ``[\"int\", \"float\"]`` excludes all of the signed integer (``int16``,\n ``int32``, ``int64``) and float (``float32``, ``float64``) types.\n include_dtypes : list, optional\n List of type prefixes to include in the dictionary. For example,\n passing ``[\"int\", \"float\"]`` will include ONLY signed integer (``int16``,\n ``int32``, ``int64``) and float (``float32``, ``float64``) types.\n\n Returns\n -------\n dict\n Dictionary to pass to a DataFrame constructor. The keys are string column names\n that are equal to the type name of the according column. Columns containing null\n types have a ``\"_null\"`` suffix in their names.\n \"\"\"\n bool_data = {}\n int_data = {}\n uint_data = {}\n float_data = {}\n datetime_data = {}\n string_data = {}\n category_data = {}\n\n # bool\n bool_data[\"bool\"] = np.array([True, False, True, True] * 10, dtype=bool)\n\n # int\n for width in (8, 16, 32, 64):\n dtype = getattr(np, f\"int{width}\")\n max_val, min_val = np.iinfo(dtype).max, np.iinfo(dtype).min\n int_data[f\"int{width}\"] = np.array(\n [max_val, max_val - 1, min_val + 1, min_val + 2] * 10, dtype=dtype\n )\n\n # uint\n for width in (8, 16, 32, 64):\n dtype = getattr(np, f\"uint{width}\")\n max_val, min_val = np.iinfo(dtype).max, np.iinfo(dtype).min\n uint_data[f\"uint{width}\"] = np.array(\n [max_val, max_val - 1, min_val + 1, min_val + 2] * 10, dtype=dtype\n )\n\n # float\n for width in (32, 64):\n dtype = getattr(np, f\"float{width}\")\n max_val, min_val = np.finfo(dtype).max, np.finfo(dtype).min\n float_data[f\"float{width}\"] = np.array(\n [max_val, max_val - 1, min_val + 1, min_val + 2] * 10, dtype=dtype\n )\n if has_nulls:\n float_data[f\"float{width}_null\"] = np.array(\n [max_val, None, min_val + 1, min_val + 2] * 10, dtype=dtype\n )\n\n # datetime\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_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_get_data_of_all_types.for_unit_in_s_ms__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/hdk/utils.py_get_data_of_all_types.for_unit_in_s_ms__", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/hdk/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 246, "span_ids": ["get_data_of_all_types"], "tokens": 527}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_data_of_all_types(\n has_nulls=False, exclude_dtypes=None, include_dtypes=None\n) -> Dict[str, np.ndarray]:\n # ... other code\n for unit in (\"s\", \"ms\", \"ns\"):\n datetime_data[f\"datetime64[{unit}]\"] = np.array(\n [0, 1, 2, 3] * 10, dtype=np.dtype(f\"datetime64[{unit}]\")\n )\n if has_nulls:\n datetime_data[f\"datetime64[{unit}]_null\"] = np.array(\n [0, None, 2, 3] * 10, dtype=np.dtype(f\"datetime64[{unit}]\")\n )\n\n # string\n string_data[\"string\"] = np.array(\n # Test multi-byte characters as well to ensure that the chunking works correctly for them\n [\"English: test string\", \" \", \"Chinese: \u6d4b\u8bd5\u5b57\u7b26\u4e32\", \"Russian: \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\"]\n * 10\n )\n if has_nulls:\n string_data[\"string_null\"] = np.array(\n [\"English: test string\", None, \"Chinese: \u6d4b\u8bd5\u5b57\u7b26\u4e32\", \"Russian: \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\"]\n * 10\n )\n\n # category\n category_data[\"category_string\"] = pandas.Categorical(\n [\"Sample\", \"te\", \" \", \"xt\"] * 10\n )\n # HDK does not support non-string categories\n # category_data[\"category_int\"] = pandas.Categorical([1, 2, 3, 4] * 10)\n if has_nulls:\n category_data[\"category_string_null\"] = pandas.Categorical(\n [\"Sample\", None, \" \", \"xt\"] * 10\n )\n\n data = {\n **bool_data,\n **int_data,\n **uint_data,\n **float_data,\n **datetime_data,\n **string_data,\n **category_data,\n }\n\n if include_dtypes is not None:\n filtered_keys = (\n key\n for key in data.keys()\n if any(key.startswith(dtype) for dtype in include_dtypes)\n )\n data = {key: data[key] for key in filtered_keys}\n\n if exclude_dtypes is not None:\n filtered_keys = (\n key\n for key in data.keys()\n if not any(key.startswith(dtype) for dtype in exclude_dtypes)\n )\n data = {key: data[key] for key in filtered_keys}\n\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/pandas/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/pandas/__init__.py__", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/pandas/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/interchange/dataframe_protocol/pandas/test_protocol.py_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/pandas/test_protocol.py_pd_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/pandas/test_protocol.py", "file_name": "test_protocol.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 57, "span_ids": ["test_categorical_from_dataframe", "test_simple_import", "eval_df_protocol", "docstring"], "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": "import modin.pandas as pd\nfrom modin.pandas.utils import from_dataframe\nfrom modin.pandas.test.utils import df_equals, test_data\nfrom modin.test.test_utils import warns_that_defaulting_to_pandas\n\n\ndef eval_df_protocol(modin_df_producer):\n internal_modin_df_producer = modin_df_producer.__dataframe__()\n # Our configuration in pytest.ini requires that we explicitly catch all\n # instances of defaulting to pandas, this one raises a warning on `.from_dataframe`\n with warns_that_defaulting_to_pandas():\n modin_df_consumer = from_dataframe(modin_df_producer)\n internal_modin_df_consumer = from_dataframe(internal_modin_df_producer)\n\n # TODO: the following assertions verify that `from_dataframe` doesn't return\n # the same object untouched due to optimization branching, it actually should\n # do so but the logic is not implemented yet, so the assertions are passing\n # for now. It's required to replace the producer's type with a different one\n # to consumer when we have some other implementation of the protocol as the\n # assertions may start failing shortly.\n assert modin_df_producer is not modin_df_consumer\n assert internal_modin_df_producer is not internal_modin_df_consumer\n assert (\n modin_df_producer._query_compiler._modin_frame\n is not modin_df_consumer._query_compiler._modin_frame\n )\n\n df_equals(modin_df_producer, modin_df_consumer)\n df_equals(modin_df_producer, internal_modin_df_consumer)\n\n\ndef test_simple_import():\n modin_df = pd.DataFrame(test_data[\"int_data\"])\n eval_df_protocol(modin_df)\n\n\ndef test_categorical_from_dataframe():\n modin_df = pd.DataFrame(\n {\"foo\": pd.Series([\"0\", \"1\", \"2\", \"3\", \"0\", \"3\", \"2\", \"3\"], dtype=\"category\")}\n )\n eval_df_protocol(modin_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_pytest_test_only_one_dtype.for_column_in_columns_.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_pytest_test_only_one_dtype.for_column_in_columns_.None_2", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 50, "span_ids": ["df_from_dict", "test_only_one_dtype", "docstring"], "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 pytest\nimport math\nimport ctypes\n\nimport modin.pandas as pd\n\n\n@pytest.fixture\ndef df_from_dict():\n def maker(dct, is_categorical=False):\n df = pd.DataFrame(dct, dtype=(\"category\" if is_categorical else None))\n return df\n\n return maker\n\n\n@pytest.mark.parametrize(\n \"test_data\",\n [\n {\"a\": [\"foo\", \"bar\"], \"b\": [\"baz\", \"qux\"]},\n {\"a\": [1.5, 2.5, 3.5], \"b\": [9.2, 10.5, 11.8]},\n {\"A\": [1, 2, 3, 4], \"B\": [1, 2, 3, 4]},\n ],\n ids=[\"str_data\", \"float_data\", \"int_data\"],\n)\ndef test_only_one_dtype(test_data, df_from_dict):\n columns = list(test_data.keys())\n df = df_from_dict(test_data)\n dfX = df.__dataframe__()\n\n column_size = len(test_data[columns[0]])\n for column in columns:\n assert dfX.get_column_by_name(column).null_count == 0\n assert dfX.get_column_by_name(column).size() == column_size\n assert dfX.get_column_by_name(column).offset == 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_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_float_int_test_float_int.assert_dfX_get_column_by_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_float_int_test_float_int.assert_dfX_get_column_by_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 75, "span_ids": ["test_float_int"], "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": "def test_float_int(df_from_dict):\n df = df_from_dict(\n {\n \"a\": [1, 2, 3],\n \"b\": [3, 4, 5],\n \"c\": [1.5, 2.5, 3.5],\n \"d\": [9, 10, 11],\n \"e\": [True, False, True],\n \"f\": [\"a\", \"\", \"c\"],\n }\n )\n dfX = df.__dataframe__()\n columns = {\"a\": 0, \"b\": 0, \"c\": 2, \"d\": 0, \"e\": 20, \"f\": 21}\n\n for column, kind in columns.items():\n colX = dfX.get_column_by_name(column)\n assert colX.null_count == 0\n assert colX.size() == 3\n assert colX.offset == 0\n\n assert colX.dtype[0] == kind\n\n assert dfX.get_column_by_name(\"c\").dtype[1] == 64", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_na_float_test_categorical.assert_isinstance_is_dict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_na_float_test_categorical.assert_isinstance_is_dict", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 102, "span_ids": ["test_categorical", "test_noncategorical", "test_na_float"], "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_na_float(df_from_dict):\n df = df_from_dict({\"a\": [1.0, math.nan, 2.0]})\n dfX = df.__dataframe__()\n colX = dfX.get_column_by_name(\"a\")\n assert colX.null_count == 1\n\n\ndef test_noncategorical(df_from_dict):\n df = df_from_dict({\"a\": [1, 2, 3]})\n dfX = df.__dataframe__()\n colX = dfX.get_column_by_name(\"a\")\n with pytest.raises(TypeError):\n colX.describe_categorical\n\n\ndef test_categorical(df_from_dict):\n df = df_from_dict(\n {\"weekday\": [\"Mon\", \"Tue\", \"Mon\", \"Wed\", \"Mon\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"]},\n is_categorical=True,\n )\n\n colX = df.__dataframe__().get_column_by_name(\"weekday\")\n is_ordered, is_dictionary, _ = colX.describe_categorical.values()\n assert isinstance(is_ordered, bool)\n assert isinstance(is_dictionary, 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_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_dataframe_test_dataframe.assert_list_dfX_select_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_dataframe_test_dataframe.assert_list_dfX_select_co", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 117, "span_ids": ["test_dataframe"], "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_dataframe(df_from_dict):\n df = df_from_dict(\n {\"x\": [True, True, False], \"y\": [1, 2, 0], \"z\": [9.2, 10.5, 11.8]}\n )\n dfX = df.__dataframe__()\n\n assert dfX.num_columns() == 3\n assert dfX.num_rows() == 3\n assert dfX.num_chunks() == 1\n assert list(dfX.column_names()) == [\"x\", \"y\", \"z\"]\n assert list(dfX.select_columns((0, 2)).column_names()) == list(\n dfX.select_columns_by_name((\"x\", \"z\")).column_names()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_df_get_chunks_test_get_columns.assert_dfX_get_column_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_df_get_chunks_test_get_columns.assert_dfX_get_column_1_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 145, "span_ids": ["test_get_columns", "test_column_get_chunks", "test_df_get_chunks"], "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": "@pytest.mark.parametrize([\"size\", \"n_chunks\"], [(10, 3), (12, 3), (12, 5)])\ndef test_df_get_chunks(size, n_chunks, df_from_dict):\n df = df_from_dict({\"x\": list(range(size))})\n dfX = df.__dataframe__()\n chunks = list(dfX.get_chunks(n_chunks))\n assert len(chunks) == n_chunks\n assert sum(chunk.num_rows() for chunk in chunks) == size\n\n\n@pytest.mark.parametrize([\"size\", \"n_chunks\"], [(10, 3), (12, 3), (12, 5)])\ndef test_column_get_chunks(size, n_chunks, df_from_dict):\n df = df_from_dict({\"x\": list(range(size))})\n dfX = df.__dataframe__()\n chunks = list(dfX.get_column(0).get_chunks(n_chunks))\n assert len(chunks) == n_chunks\n assert sum(chunk.size() for chunk in chunks) == size\n\n\ndef test_get_columns(df_from_dict):\n df = df_from_dict({\"a\": [0, 1], \"b\": [2.5, 3.5]})\n dfX = df.__dataframe__()\n for colX in dfX.get_columns():\n assert colX.size() == 2\n assert colX.num_chunks() == 1\n assert dfX.get_column(0).dtype[0] == 0\n assert dfX.get_column(1).dtype[0] == 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_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_buffer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/interchange/dataframe_protocol/test_general.py_test_buffer_", "embedding": null, "metadata": {"file_path": "modin/test/interchange/dataframe_protocol/test_general.py", "file_name": "test_general.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 174, "span_ids": ["test_buffer"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_buffer(df_from_dict):\n arr = [0, 1, -1]\n df = df_from_dict({\"a\": arr})\n dfX = df.__dataframe__()\n colX = dfX.get_column(0)\n bufX = colX.get_buffers()\n\n dataBuf, dataDtype = bufX[\"data\"]\n assert dataBuf.bufsize > 0\n assert dataBuf.ptr != 0\n device, _ = dataBuf.__dlpack_device__()\n\n assert dataDtype[0] == 0\n\n if device == 1: # CPU-only as we're going to directly read memory here\n bitwidth = dataDtype[1]\n ctype = {\n 8: ctypes.c_int8,\n 16: ctypes.c_int16,\n 32: ctypes.c_int32,\n 64: ctypes.c_int64,\n }[bitwidth]\n\n for idx, truth in enumerate(arr):\n val = ctype.from_address(dataBuf.ptr + idx * (bitwidth // 8)).value\n assert val == truth, f\"Buffer at index {idx} mismatch\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/base/test_internals.py_pandas_test_insert_item.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/base/test_internals.py_pandas_test_insert_item.None_1", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/base/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 96, "span_ids": ["test_insert_item", "docstring"], "tokens": 653}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pandas\nimport pytest\n\nfrom modin.pandas.test.utils import (\n test_data_values,\n create_test_dfs,\n df_equals,\n)\nfrom modin.config import NPartitions\nimport modin.pandas as pd\n\nNPartitions.put(4)\n\n\n@pytest.mark.parametrize(\"axis\", [0, 1])\n@pytest.mark.parametrize(\"item_length\", [0, 1, 2])\n@pytest.mark.parametrize(\"loc\", [\"first\", \"first + 1\", \"middle\", \"penult\", \"last\"])\n@pytest.mark.parametrize(\"replace\", [True, False])\ndef test_insert_item(axis, item_length, loc, replace):\n data = test_data_values[0]\n\n def post_fn(df):\n return (\n (df.iloc[:, :-item_length], df.iloc[:, -item_length:])\n if axis\n else (df.iloc[:-item_length, :], df.iloc[-item_length:, :])\n )\n\n def get_loc(frame, loc):\n locs_dict = {\n \"first\": 0,\n \"first + 1\": 1,\n \"middle\": len(frame.axes[axis]) // 2,\n \"penult\": len(frame.axes[axis]) - 1,\n \"last\": len(frame.axes[axis]),\n }\n return locs_dict[loc]\n\n def get_reference(df, value, loc):\n if axis == 0:\n first_mask = df.iloc[:loc]\n if replace:\n loc += 1\n second_mask = df.iloc[loc:]\n else:\n first_mask = df.iloc[:, :loc]\n if replace:\n loc += 1\n second_mask = df.iloc[:, loc:]\n return pandas.concat([first_mask, value, second_mask], axis=axis)\n\n md_frames, pd_frames = create_test_dfs(data, post_fn=post_fn)\n md_item1, md_item2 = md_frames\n pd_item1, pd_item2 = pd_frames\n\n index_loc = get_loc(pd_item1, loc)\n\n pd_res = get_reference(pd_item1, loc=index_loc, value=pd_item2)\n md_res = md_item1._query_compiler.insert_item(\n axis=axis, loc=index_loc, value=md_item2._query_compiler, replace=replace\n ).to_pandas()\n df_equals(\n md_res,\n pd_res,\n # This test causes an empty slice to be generated thus triggering:\n # https://github.com/modin-project/modin/issues/5974\n check_dtypes=axis != 0,\n )\n\n index_loc = get_loc(pd_item2, loc)\n\n pd_res = get_reference(pd_item2, loc=index_loc, value=pd_item1)\n md_res = md_item2._query_compiler.insert_item(\n axis=axis, loc=index_loc, value=md_item1._query_compiler, replace=replace\n ).to_pandas()\n\n df_equals(\n md_res,\n pd_res,\n # This test causes an empty slice to be generated thus triggering:\n # https://github.com/modin-project/modin/issues/5974\n check_dtypes=axis != 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_modin-project__modin/modin/test/storage_formats/base/test_internals.py_test_repr_size_issue_6104_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/base/test_internals.py_test_repr_size_issue_6104_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/base/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 112, "span_ids": ["test_repr_size_issue_6104"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"num_rows\", list(range(1, 5)), ids=lambda x: f\"num_rows={x}\")\n@pytest.mark.parametrize(\"num_cols\", list(range(1, 5)), ids=lambda x: f\"num_cols={x}\")\ndef test_repr_size_issue_6104(num_rows, num_cols):\n # this tests an edge case where we used to select exactly num_cols / 2 + 1 columns\n # from both the front and the back of the dataframe, but the dataframe is such a\n # length that the front and back columns overlap at one column. The result is that\n # we convert one column twice to pandas, although we would never see the duplicate\n # column in the output because pandas would also only represent the num_cols / 2\n # columns from the front and back.\n df = pd.DataFrame([list(range(4)) for _ in range(4)])\n pandas_repr_df = df._build_repr_df(num_rows, num_cols)\n assert pandas_repr_df.columns.is_unique\n assert pandas_repr_df.index.is_unique", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/cudf/test_gpu_managers.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/cudf/test_gpu_managers.py__", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/cudf/test_gpu_managers.py", "file_name": "test_gpu_managers.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/storage_formats/cudf/test_internals.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/cudf/test_internals.py__", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/cudf/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/modin/test/storage_formats/hdk/test_internals.py_pytest_test_hdk_import.if_res_returncode_0_.pytest_fail_str_res_stder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/hdk/test_internals.py_pytest_test_hdk_import.if_res_returncode_0_.pytest_fail_str_res_stder", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/hdk/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 88, "span_ids": ["test_hdk_import", "docstring"], "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": "import pytest\nimport sys\nimport subprocess\n\n\n@pytest.mark.parametrize(\n \"import_strategy\",\n [\n pytest.param(\n \"\"\"\nimport modin.config as cfg\ncfg.Engine.put('Native') # 'hdk'/'dbe' would be imported with dlopen flags first time\ncfg.StorageFormat.put('HDK')\ncfg.IsExperimental.put(True)\nimport modin.pandas as pd\n\"\"\",\n id=\"config_hdk_first-import_modin_second\",\n ),\n pytest.param(\n \"\"\"\nimport modin.pandas as pd\nimport modin.config as cfg\ncfg.Engine.put('Native')\ncfg.StorageFormat.put('HDK')\ncfg.IsExperimental.put(True)\n\"\"\",\n id=\"import_modin_first-config_hdk_second\",\n ),\n ],\n)\n@pytest.mark.parametrize(\"has_other_engines\", [True, False])\ndef test_hdk_import(import_strategy, has_other_engines):\n \"\"\"\n Test import of HDK engine.\n\n The import of DbWorker requires to set special dlopen flags which make it then\n incompatible to import some other libraries further (like ``pyarrow.gandiva``).\n This test verifies that it's not the case when a user naturally imports Modin\n with HDK engine.\n\n Parameters\n ----------\n import_strategy : str\n There are several scenarios of how a user can import Modin with HDK engine:\n configure Modin first to use HDK engine and then import ``modin.pandas`` or vice versa.\n This parameters holds a python code, implementing one of these scenarios.\n has_other_engines : bool\n The problem with import may appear depending on whether other engines are\n installed. This parameter indicates whether to remove modules for\n non-hdk engines before the test.\n\n Notes\n -----\n The failed import flow may cause segfault, which causes to crash the pytest itself.\n This makes us to run the test in a separate process and check its exit-code to\n decide the success of the test.\n \"\"\"\n\n remove_other_engines = \"\"\"\nimport sys\nsys.modules['ray'] = None\nsys.modules['dask'] = None\n\"\"\"\n\n if not has_other_engines:\n import_strategy = f\"{remove_other_engines}\\n{import_strategy}\"\n\n res = subprocess.run(\n [sys.executable, \"-c\", import_strategy],\n stderr=subprocess.PIPE,\n stdout=subprocess.PIPE,\n )\n\n if res.returncode != 0:\n pytest.fail(str(res.stderr))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/hdk/test_internals.py_test_hdk_compatibility_with_pyarrow_gandiva_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/hdk/test_internals.py_test_hdk_compatibility_with_pyarrow_gandiva_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/hdk/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 152, "span_ids": ["test_hdk_compatibility_with_pyarrow_gandiva"], "tokens": 526}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"import_strategy, expected_to_fail\",\n [\n pytest.param(\n \"\"\"\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import DbWorker\nimport pyarrow.gandiva\n\"\"\",\n True,\n id=\"import_pydbe_first-pyarrow_gandiva_second\",\n ),\n pytest.param(\n \"\"\"\nimport pyarrow.gandiva\nfrom modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import DbWorker\n\"\"\",\n False,\n id=\"import_pyarrow_gandiva_first-pydbe_second\",\n ),\n ],\n)\ndef test_hdk_compatibility_with_pyarrow_gandiva(import_strategy, expected_to_fail):\n \"\"\"\n Test the current status of compatibility of DbWorker and pyarrow.gandiva packages.\n\n If this test appears to fail, it means that these packages are now compatible/incopmatible,\n if it's so, please post the actual compatibility status to the issue:\n https://github.com/modin-project/modin/issues/3865\n And then inverse `expected_to_fail` parameter for the scenario that has changed its behavior.\n\n Parameters\n ----------\n import_strategy : str\n There are several scenarios of how a user can import DbWorker and pyarrow.gandiva.\n This parameters holds a python code, implementing one of the scenarios.\n expected_to_fail : bool\n Indicates the estimated compatibility status for the specified `import_strategy`.\n True - the strategy expected to fail, False - the strategy expected to pass.\n Note: we can't use built-in ``pytest.marks.xfail`` as we need to check that the\n expected failure was caused by LLVM error.\n \"\"\"\n res = subprocess.run(\n [sys.executable, \"-c\", import_strategy],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n )\n\n if expected_to_fail:\n assert (\n res.returncode != 0\n ), \"DbWorker and pyarrow.gandiva are now compatible! Please check the test's doc-string for further instructions.\"\n else:\n assert (\n res.returncode == 0\n ), \"DbWorker and pyarrow.gandiva are now incompatible! Please check the test's doc-string for further instructions.\"\n\n if res.returncode != 0:\n error_msg = res.stderr.decode(\"utf-8\")\n assert (\n error_msg.find(\"LLVM ERROR\") != -1\n ), f\"Expected to fail because of LLVM error, but failed because of:\\n{error_msg}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_pd_if_Engine_get_Ray_.else_.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_pd_if_Engine_get_Ray_.else_.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 80, "span_ids": ["docstring"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import modin.pandas as pd\nfrom modin.pandas.test.utils import (\n create_test_dfs,\n test_data_values,\n df_equals,\n)\nfrom modin.config import NPartitions, Engine, MinPartitionSize\nfrom modin.distributed.dataframe.pandas import from_partitions\nfrom modin.core.storage_formats.pandas.utils import split_result_of_axis_func_pandas\n\nimport numpy as np\nimport pandas\nimport pytest\n\nNPartitions.put(4)\n\nif Engine.get() == \"Ray\":\n from modin.core.execution.ray.implementations.pandas_on_ray.partitioning import (\n PandasOnRayDataframePartition,\n )\n from modin.core.execution.ray.implementations.pandas_on_ray.partitioning import (\n PandasOnRayDataframeColumnPartition,\n PandasOnRayDataframeRowPartition,\n )\n from modin.core.execution.ray.common import RayWrapper\n\n block_partition_class = PandasOnRayDataframePartition\n virtual_column_partition_class = PandasOnRayDataframeColumnPartition\n virtual_row_partition_class = PandasOnRayDataframeRowPartition\n put = RayWrapper.put\nelif Engine.get() == \"Dask\":\n from modin.core.execution.dask.implementations.pandas_on_dask.partitioning import (\n PandasOnDaskDataframeColumnPartition,\n PandasOnDaskDataframeRowPartition,\n )\n from modin.core.execution.dask.implementations.pandas_on_dask.partitioning import (\n PandasOnDaskDataframePartition,\n )\n from modin.core.execution.dask.common import DaskWrapper\n\n # initialize modin dataframe to initialize dask\n pd.DataFrame()\n\n def put(x):\n return DaskWrapper.put(x, hash=False)\n\n block_partition_class = PandasOnDaskDataframePartition\n virtual_column_partition_class = PandasOnDaskDataframeColumnPartition\n virtual_row_partition_class = PandasOnDaskDataframeRowPartition\nelif Engine.get() == \"Python\":\n from modin.core.execution.python.implementations.pandas_on_python.partitioning import (\n PandasOnPythonDataframeColumnPartition,\n PandasOnPythonDataframeRowPartition,\n PandasOnPythonDataframePartition,\n )\n from modin.core.execution.python.common import PythonWrapper\n\n def put(x):\n return PythonWrapper.put(x, hash=False)\n\n block_partition_class = PandasOnPythonDataframePartition\n virtual_column_partition_class = PandasOnPythonDataframeColumnPartition\n virtual_row_partition_class = PandasOnPythonDataframeRowPartition\nelse:\n raise NotImplementedError(\n f\"These test suites are not implemented for the '{Engine.get()}' engine\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_construct_modin_df_by_scheme_construct_modin_df_by_scheme.return.md_df": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_construct_modin_df_by_scheme_construct_modin_df_by_scheme.return.md_df", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 115, "span_ids": ["construct_modin_df_by_scheme"], "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": "def construct_modin_df_by_scheme(pandas_df, partitioning_scheme):\n \"\"\"\n Build ``modin.pandas.DataFrame`` from ``pandas.DataFrame`` according the `partitioning_scheme`.\n\n Parameters\n ----------\n pandas_df : pandas.DataFrame\n partitioning_scheme : dict[{\"row_lengths\", \"column_widths\"}] -> list of ints\n\n Returns\n -------\n modin.pandas.DataFrame\n \"\"\"\n row_partitions = split_result_of_axis_func_pandas(\n axis=0,\n num_splits=len(partitioning_scheme[\"row_lengths\"]),\n result=pandas_df,\n length_list=partitioning_scheme[\"row_lengths\"],\n )\n partitions = [\n split_result_of_axis_func_pandas(\n axis=1,\n num_splits=len(partitioning_scheme[\"column_widths\"]),\n result=row_part,\n length_list=partitioning_scheme[\"column_widths\"],\n )\n for row_part in row_partitions\n ]\n\n md_df = from_partitions(\n [[put(part) for part in row_parts] for row_parts in partitions], axis=None\n )\n return md_df", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_modify_config_validate_partitions_cache.for_i_in_range_df__partit.for_j_in_range_df__partit.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_modify_config_validate_partitions_cache.for_i_in_range_df__partit.for_j_in_range_df__partit.None_1", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 146, "span_ids": ["modify_config", "validate_partitions_cache"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef modify_config(request):\n values = request.param\n old_values = {}\n\n for key, value in values.items():\n old_values[key] = key.get()\n key.put(value)\n\n yield # waiting for the test to be completed\n # restoring old parameters\n for key, value in old_values.items():\n key.put(value)\n\n\ndef validate_partitions_cache(df):\n \"\"\"Assert that the ``PandasDataframe`` shape caches correspond to the actual partition's shapes.\"\"\"\n row_lengths = df._row_lengths_cache\n column_widths = df._column_widths_cache\n\n assert row_lengths is not None\n assert column_widths is not None\n assert df._partitions.shape[0] == len(row_lengths)\n assert df._partitions.shape[1] == len(column_widths)\n\n for i in range(df._partitions.shape[0]):\n for j in range(df._partitions.shape[1]):\n assert df._partitions[i, j].length() == row_lengths[i]\n assert df._partitions[i, j].width() == column_widths[j]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_aligning_blocks_test_aligning_partitions.repr_modin_df2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_aligning_blocks_test_aligning_partitions.repr_modin_df2_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 183, "span_ids": ["test_aligning_blocks_with_duplicated_index", "test_aligning_partitions", "test_aligning_blocks"], "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": "def test_aligning_blocks():\n # Test problem when modin frames have the same number of rows, but different\n # blocks (partition.list_of_blocks). See #2322 for details\n accm = pd.DataFrame([\"-22\\n\"] * 162)\n accm = accm.iloc[2:, :]\n accm.reset_index(drop=True, inplace=True)\n accm[\"T\"] = pd.Series([\"24.67\\n\"] * 145)\n\n # see #2322 for details\n repr(accm)\n\n\ndef test_aligning_blocks_with_duplicated_index():\n # Same problem as in `test_aligning_blocks` but with duplicated values in index.\n data11 = [0, 1]\n data12 = [2, 3]\n\n data21 = [0]\n data22 = [1, 2, 3]\n\n df1 = pd.concat((pd.DataFrame(data11), pd.DataFrame(data12)))\n df2 = pd.concat((pd.DataFrame(data21), pd.DataFrame(data22)))\n\n repr(df1 - df2)\n\n\ndef test_aligning_partitions():\n data = [0, 1, 2, 3, 4, 5]\n modin_df1, _ = create_test_dfs({\"a\": data, \"b\": data})\n modin_df = modin_df1.loc[:2]\n\n modin_df2 = pd.concat((modin_df, modin_df))\n\n modin_df2[\"c\"] = modin_df1[\"b\"]\n repr(modin_df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_take_2d_labels_or_positional_test_take_2d_labels_or_positional.df_equals_md_df_pd_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_take_2d_labels_or_positional_test_take_2d_labels_or_positional.df_equals_md_df_pd_df_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 186, "end_line": 204, "span_ids": ["test_take_2d_labels_or_positional"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"row_labels\", [None, [(\"a\", \"\")], [\"a\"]])\n@pytest.mark.parametrize(\"col_labels\", [None, [\"a1\"], [(\"c1\", \"z\")]])\ndef test_take_2d_labels_or_positional(row_labels, col_labels):\n kwargs = {\n \"index\": [[\"a\", \"b\", \"c\", \"d\"], [\"\", \"\", \"x\", \"y\"]],\n \"columns\": [[\"a1\", \"b1\", \"c1\", \"d1\"], [\"\", \"\", \"z\", \"x\"]],\n }\n md_df, pd_df = create_test_dfs(np.random.rand(4, 4), **kwargs)\n\n _row_labels = slice(None) if row_labels is None else row_labels\n _col_labels = slice(None) if col_labels is None else col_labels\n pd_df = pd_df.loc[_row_labels, _col_labels]\n modin_frame = md_df._query_compiler._modin_frame\n new_modin_frame = modin_frame.take_2d_labels_or_positional(\n row_labels=row_labels, col_labels=col_labels\n )\n md_df._query_compiler._modin_frame = new_modin_frame\n\n df_equals(md_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_apply_func_to_both_axis_test_apply_func_to_both_axis.df_equals_md_df_pd_df_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_apply_func_to_both_axis_test_apply_func_to_both_axis.df_equals_md_df_pd_df_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 207, "end_line": 259, "span_ids": ["test_apply_func_to_both_axis"], "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": "@pytest.mark.parametrize(\"has_partitions_shape_cache\", [True, False])\n@pytest.mark.parametrize(\"has_frame_shape_cache\", [True, False])\ndef test_apply_func_to_both_axis(has_partitions_shape_cache, has_frame_shape_cache):\n \"\"\"\n Test ``modin.core.dataframe.pandas.dataframe.dataframe.PandasDataframe.apply_select_indices`` functionality of broadcasting non-distributed items.\n \"\"\"\n data = test_data_values[0]\n\n md_df, pd_df = create_test_dfs(data)\n values = pd_df.values + 1\n\n pd_df.iloc[:, :] = values\n\n modin_frame = md_df._query_compiler._modin_frame\n\n if has_frame_shape_cache:\n # Explicitly compute rows & columns shapes to store this info in frame's cache\n modin_frame.row_lengths\n modin_frame.column_widths\n else:\n # Explicitly reset frame's cache\n modin_frame._row_lengths_cache = None\n modin_frame._column_widths_cache = None\n\n for row in modin_frame._partitions:\n for part in row:\n if has_partitions_shape_cache:\n # Explicitly compute partition shape to store this info in its cache\n part.length()\n part.width()\n else:\n # Explicitly reset partition's shape cache\n part._length_cache = None\n part._width_cache = None\n\n def func_to_apply(partition, row_internal_indices, col_internal_indices, item):\n partition.iloc[row_internal_indices, col_internal_indices] = item\n return partition\n\n new_modin_frame = modin_frame.apply_select_indices(\n axis=None,\n func=func_to_apply,\n # Passing none-slices does not trigger shapes recomputation and so the cache is untouched.\n row_labels=slice(None),\n col_labels=slice(None),\n keep_remaining=True,\n new_index=pd_df.index,\n new_columns=pd_df.columns,\n item_to_distribute=values,\n )\n md_df._query_compiler._modin_frame = new_modin_frame\n\n df_equals(md_df, pd_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_rebalance_partitions_test_rebalance_partitions._over_the_same_axis_from": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_rebalance_partitions_test_rebalance_partitions._over_the_same_axis_from", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 345, "span_ids": ["test_rebalance_partitions"], "tokens": 790}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"test_type\",\n [\n \"many_small_dfs\",\n \"concatted_df_with_small_dfs\",\n \"large_df_plus_small_dfs\",\n ],\n)\n@pytest.mark.parametrize(\n \"set_num_partitions\",\n [1, 4],\n indirect=True,\n)\ndef test_rebalance_partitions(test_type, set_num_partitions):\n num_partitions = NPartitions.get()\n if test_type == \"many_small_dfs\":\n small_dfs = [\n pd.DataFrame(\n [[i + j for j in range(0, 1000)]],\n columns=[f\"col{j}\" for j in range(0, 1000)],\n index=pd.Index([i]),\n )\n for i in range(1, 100001, 1000)\n ]\n large_df = pd.concat(small_dfs)\n col_length = 100\n elif test_type == \"concatted_df_with_small_dfs\":\n small_dfs = [\n pd.DataFrame(\n [[i + j for j in range(0, 1000)]],\n columns=[f\"col{j}\" for j in range(0, 1000)],\n index=pd.Index([i]),\n )\n for i in range(1, 100001, 1000)\n ]\n large_df = pd.concat([pd.concat(small_dfs)] + small_dfs[:3])\n col_length = 103\n else:\n large_df = pd.DataFrame(\n [[i + j for j in range(1, 1000)] for i in range(0, 100000, 1000)],\n columns=[f\"col{j}\" for j in range(1, 1000)],\n index=pd.Index(list(range(0, 100000, 1000))),\n )\n small_dfs = [\n pd.DataFrame(\n [[i + j for j in range(0, 1000)]],\n columns=[f\"col{j}\" for j in range(0, 1000)],\n index=pd.Index([i]),\n )\n for i in range(1, 4001, 1000)\n ]\n large_df = pd.concat([large_df] + small_dfs[:3])\n col_length = 103\n large_modin_frame = large_df._query_compiler._modin_frame\n assert large_modin_frame._partitions.shape == (\n num_partitions,\n num_partitions,\n ), \"Partitions were not rebalanced after concat.\"\n assert all(\n isinstance(ptn, large_modin_frame._partition_mgr_cls._column_partitions_class)\n for ptn in large_modin_frame._partitions.flatten()\n )\n # The following check tests that we can correctly form full-axis virtual partitions\n # over the orthogonal axis from non-full-axis virtual partitions.\n\n def col_apply_func(col):\n assert len(col) == col_length, \"Partial axis partition detected.\"\n return col + 1\n\n large_apply_result = large_df.apply(col_apply_func)\n large_apply_result_frame = large_apply_result._query_compiler._modin_frame\n assert large_apply_result_frame._partitions.shape == (\n num_partitions,\n num_partitions,\n ), \"Partitions list shape is incorrect.\"\n assert all(\n isinstance(ptn, large_apply_result_frame._partition_mgr_cls._partition_class)\n for ptn in large_apply_result_frame._partitions.flatten()\n ), \"Partitions are not block partitioned after column-wise apply.\"\n large_df = pd.DataFrame(\n query_compiler=large_df._query_compiler.__constructor__(large_modin_frame)\n )\n # The following check tests that we can correctly form full-axis virtual partitions\n # over the same axis from non-full-axis virtual partitions.\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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_rebalance_partitions.row_apply_func_test_rebalance_partitions.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_rebalance_partitions.row_apply_func_test_rebalance_partitions.None_7", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 347, "end_line": 371, "span_ids": ["test_rebalance_partitions"], "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": "@pytest.mark.parametrize(\n \"test_type\",\n [\n \"many_small_dfs\",\n \"concatted_df_with_small_dfs\",\n \"large_df_plus_small_dfs\",\n ],\n)\n@pytest.mark.parametrize(\n \"set_num_partitions\",\n [1, 4],\n indirect=True,\n)\ndef test_rebalance_partitions(test_type, set_num_partitions):\n # ... other code\n\n def row_apply_func(row):\n assert len(row) == 1000, \"Partial axis partition detected.\"\n return row + 1\n\n large_apply_result = large_df.apply(row_apply_func, axis=1)\n large_apply_result_frame = large_apply_result._query_compiler._modin_frame\n assert large_apply_result_frame._partitions.shape == (\n num_partitions,\n num_partitions,\n ), \"Partitions list shape is incorrect.\"\n assert all(\n isinstance(ptn, large_apply_result_frame._partition_mgr_cls._partition_class)\n for ptn in large_apply_result_frame._partitions.flatten()\n ), \"Partitions are not block partitioned after row-wise apply.\"\n\n large_apply_result = large_df.applymap(lambda x: x)\n large_apply_result_frame = large_apply_result._query_compiler._modin_frame\n assert large_apply_result_frame._partitions.shape == (\n num_partitions,\n num_partitions,\n ), \"Partitions list shape is incorrect.\"\n assert all(\n isinstance(ptn, large_apply_result_frame._partition_mgr_cls._partition_class)\n for ptn in large_apply_result_frame._partitions.flatten()\n ), \"Partitions are not block partitioned after element-wise apply.\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue_TestDrainVirtualPartitionCallQueue._Test_draining_virtual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue_TestDrainVirtualPartitionCallQueue._Test_draining_virtual_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 374, "end_line": 391, "span_ids": ["TestDrainVirtualPartitionCallQueue"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"axis,virtual_partition_class\",\n ((0, virtual_column_partition_class), (1, virtual_row_partition_class)),\n ids=[\"partitions_spanning_all_columns\", \"partitions_spanning_all_rows\"],\n)\nclass TestDrainVirtualPartitionCallQueue:\n \"\"\"Test draining virtual partition call queues.\n\n Test creating a virtual partition made of block partitions and/or one or\n more layers of virtual partitions, draining the top-level partition's\n call queue, and getting the result.\n\n In all these test cases, the full_axis argument doesn't matter for\n correctness because it only affects `apply`, which is not used here.\n Still, virtual partition users are not supposed to create full-axis\n virtual partitions out of other full-axis virtual partitions, so\n set full_axis to False everywhere.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues_TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues_TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues.df_equals_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 393, "end_line": 429, "span_ids": ["TestDrainVirtualPartitionCallQueue.test_from_virtual_partitions_with_call_queues"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"axis,virtual_partition_class\",\n ((0, virtual_column_partition_class), (1, virtual_row_partition_class)),\n ids=[\"partitions_spanning_all_columns\", \"partitions_spanning_all_rows\"],\n)\nclass TestDrainVirtualPartitionCallQueue:\n\n def test_from_virtual_partitions_with_call_queues(\n self,\n axis,\n virtual_partition_class,\n ):\n # reverse the dataframe along the virtual partition axis.\n def reverse(df):\n return df.iloc[::-1, :] if axis == 0 else df.iloc[:, ::-1]\n\n level_zero_blocks_first = [\n block_partition_class(put(pandas.DataFrame([0]))),\n block_partition_class(put(pandas.DataFrame([1]))),\n ]\n level_one_virtual_first = virtual_partition_class(\n level_zero_blocks_first, full_axis=False\n )\n level_one_virtual_first = level_one_virtual_first.add_to_apply_calls(reverse)\n level_zero_blocks_second = [\n block_partition_class(put(pandas.DataFrame([2]))),\n block_partition_class(put(pandas.DataFrame([3]))),\n ]\n level_one_virtual_second = virtual_partition_class(\n level_zero_blocks_second, full_axis=False\n )\n level_one_virtual_second = level_one_virtual_second.add_to_apply_calls(reverse)\n level_two_virtual = virtual_partition_class(\n [level_one_virtual_first, level_one_virtual_second], full_axis=False\n )\n level_two_virtual.drain_call_queue()\n if axis == 0:\n expected_df = pandas.DataFrame([1, 0, 3, 2], index=[0, 0, 0, 0])\n else:\n expected_df = pandas.DataFrame([[1, 0, 3, 2]], columns=[0, 0, 0, 0])\n df_equals(\n level_two_virtual.to_pandas(),\n expected_df,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues_TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues.df_equals_level_two_virtu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues_TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues.df_equals_level_two_virtu", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 431, "end_line": 459, "span_ids": ["TestDrainVirtualPartitionCallQueue.test_from_block_and_virtual_partition_with_call_queues"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"axis,virtual_partition_class\",\n ((0, virtual_column_partition_class), (1, virtual_row_partition_class)),\n ids=[\"partitions_spanning_all_columns\", \"partitions_spanning_all_rows\"],\n)\nclass TestDrainVirtualPartitionCallQueue:\n\n def test_from_block_and_virtual_partition_with_call_queues(\n self, axis, virtual_partition_class\n ):\n # make a function that reverses the dataframe along the virtual\n # partition axis.\n # for testing axis == 0, start with two 2-rows-by-1-column blocks. for\n # axis == 1, start with two 1-rows-by-2-column blocks.\n def reverse(df):\n return df.iloc[::-1, :] if axis == 0 else df.iloc[:, ::-1]\n\n block_data = [[0, 1], [2, 3]] if axis == 0 else [[[0, 1]], [[2, 3]]]\n level_zero_blocks = [\n block_partition_class(put(pandas.DataFrame(block_data[0]))),\n block_partition_class(put(pandas.DataFrame(block_data[1]))),\n ]\n level_zero_blocks[0] = level_zero_blocks[0].add_to_apply_calls(reverse)\n level_one_virtual = virtual_partition_class(\n level_zero_blocks[1], full_axis=False\n )\n level_one_virtual = level_one_virtual.add_to_apply_calls(reverse)\n level_two_virtual = virtual_partition_class(\n [level_zero_blocks[0], level_one_virtual], full_axis=False\n )\n level_two_virtual.drain_call_queue()\n if axis == 0:\n expected_df = pandas.DataFrame([1, 0, 3, 2], index=[1, 0, 1, 0])\n else:\n expected_df = pandas.DataFrame([[1, 0, 3, 2]], columns=[1, 0, 1, 0])\n df_equals(level_two_virtual.to_pandas(), expected_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels_TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels_TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels.df_equals_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 461, "end_line": 485, "span_ids": ["TestDrainVirtualPartitionCallQueue.test_virtual_partition_call_queues_at_three_levels"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"axis,virtual_partition_class\",\n ((0, virtual_column_partition_class), (1, virtual_row_partition_class)),\n ids=[\"partitions_spanning_all_columns\", \"partitions_spanning_all_rows\"],\n)\nclass TestDrainVirtualPartitionCallQueue:\n\n def test_virtual_partition_call_queues_at_three_levels(\n self, axis, virtual_partition_class\n ):\n block = block_partition_class(put(pandas.DataFrame([1])))\n level_one_virtual = virtual_partition_class([block], full_axis=False)\n level_one_virtual = level_one_virtual.add_to_apply_calls(\n lambda df: pandas.concat([df, pandas.DataFrame([2])])\n )\n level_two_virtual = virtual_partition_class(\n [level_one_virtual], full_axis=False\n )\n level_two_virtual = level_two_virtual.add_to_apply_calls(\n lambda df: pandas.concat([df, pandas.DataFrame([3])])\n )\n level_three_virtual = virtual_partition_class(\n [level_two_virtual], full_axis=False\n )\n level_three_virtual = level_three_virtual.add_to_apply_calls(\n lambda df: pandas.concat([df, pandas.DataFrame([4])])\n )\n level_three_virtual.drain_call_queue()\n df_equals(\n level_three_virtual.to_pandas(),\n pd.DataFrame([1, 2, 3, 4], index=[0, 0, 0, 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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_virtual_partition_apply_not_returning_pandas_dataframe_test_virtual_partition_apply_not_returning_pandas_dataframe.assert_apply_result_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_virtual_partition_apply_not_returning_pandas_dataframe_test_virtual_partition_apply_not_returning_pandas_dataframe.assert_apply_result_1", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 488, "end_line": 503, "span_ids": ["test_virtual_partition_apply_not_returning_pandas_dataframe"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"virtual_partition_class\",\n (virtual_column_partition_class, virtual_row_partition_class),\n ids=[\"partitions_spanning_all_columns\", \"partitions_spanning_all_rows\"],\n)\ndef test_virtual_partition_apply_not_returning_pandas_dataframe(\n virtual_partition_class,\n):\n # see https://github.com/modin-project/modin/issues/4811\n\n partition = virtual_partition_class(\n block_partition_class(put(pandas.DataFrame())), full_axis=False\n )\n\n apply_result = partition.apply(lambda df: 1).get()\n assert apply_result == 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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_virtual_partition_dup_object_ref_test_virtual_partition_dup_object_ref.partition_wait_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_virtual_partition_dup_object_ref_test_virtual_partition_dup_object_ref.partition_wait_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 506, "end_line": 521, "span_ids": ["test_virtual_partition_dup_object_ref"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n Engine.get() != \"Ray\",\n reason=\"Only ray.wait() does not take duplicate object refs.\",\n)\ndef test_virtual_partition_dup_object_ref():\n # See https://github.com/modin-project/modin/issues/5045\n frame_c = pd.DataFrame(np.zeros((100, 20), dtype=np.float32, order=\"C\"))\n frame_c = [frame_c] * 20\n df = pd.concat(frame_c)\n partition = df._query_compiler._modin_frame._partitions.flatten()[0]\n obj_refs = partition.list_of_blocks\n assert len(obj_refs) != len(\n set(obj_refs)\n ), \"Test setup did not contain duplicate objects\"\n # The below call to wait() should not crash\n partition.wait()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py___test_reorder_labels_cache_axis_positions___test_reorder_labels_cache_axis_positions._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py___test_reorder_labels_cache_axis_positions___test_reorder_labels_cache_axis_positions._", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 524, "end_line": 534, "span_ids": ["impl:28"], "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": "__test_reorder_labels_cache_axis_positions = [\n pytest.param(lambda index: None, id=\"no_reordering\"),\n pytest.param(lambda index: np.arange(len(index) - 1, -1, -1), id=\"reordering_only\"),\n pytest.param(\n lambda index: [0, 1, 2, len(index) - 3, len(index) - 2, len(index) - 1],\n id=\"projection_only\",\n ),\n pytest.param(\n lambda index: np.repeat(np.arange(len(index)), repeats=3), id=\"size_grow\"\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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_reorder_labels_cache_test_reorder_labels_cache.validate_partitions_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_reorder_labels_cache_test_reorder_labels_cache.validate_partitions_cache", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 537, "end_line": 592, "span_ids": ["test_reorder_labels_cache"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"row_positions\", __test_reorder_labels_cache_axis_positions)\n@pytest.mark.parametrize(\"col_positions\", __test_reorder_labels_cache_axis_positions)\n@pytest.mark.parametrize(\n \"partitioning_scheme\",\n [\n pytest.param(\n lambda df: {\n \"row_lengths\": [df.shape[0]],\n \"column_widths\": [df.shape[1]],\n },\n id=\"single_partition\",\n ),\n pytest.param(\n lambda df: {\n \"row_lengths\": [32, max(0, df.shape[0] - 32)],\n \"column_widths\": [32, max(0, df.shape[1] - 32)],\n },\n id=\"two_unbalanced_partitions\",\n ),\n pytest.param(\n lambda df: {\n \"row_lengths\": [df.shape[0] // NPartitions.get()] * NPartitions.get(),\n \"column_widths\": [df.shape[1] // NPartitions.get()] * NPartitions.get(),\n },\n id=\"perfect_partitioning\",\n ),\n pytest.param(\n lambda df: {\n \"row_lengths\": [2**i for i in range(NPartitions.get())],\n \"column_widths\": [2**i for i in range(NPartitions.get())],\n },\n id=\"unbalanced_partitioning_equals_npartition\",\n ),\n pytest.param(\n lambda df: {\n \"row_lengths\": [2] * (df.shape[0] // 2),\n \"column_widths\": [2] * (df.shape[1] // 2),\n },\n id=\"unbalanced_partitioning\",\n ),\n ],\n)\ndef test_reorder_labels_cache(\n row_positions,\n col_positions,\n partitioning_scheme,\n):\n pandas_df = pandas.DataFrame(test_data_values[0])\n\n md_df = construct_modin_df_by_scheme(pandas_df, partitioning_scheme(pandas_df))\n md_df = md_df._query_compiler._modin_frame\n\n result = md_df._reorder_labels(\n row_positions(md_df.index), col_positions(md_df.columns)\n )\n validate_partitions_cache(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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_reorder_labels_dtypes_test_reorder_labels_dtypes.df_equals_result_dtypes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_reorder_labels_dtypes_test_reorder_labels_dtypes.df_equals_result_dtypes_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 595, "end_line": 620, "span_ids": ["test_reorder_labels_dtypes"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_reorder_labels_dtypes():\n pandas_df = pandas.DataFrame(\n {\n \"a\": [1, 2, 3, 4],\n \"b\": [1.0, 2.4, 3.4, 4.5],\n \"c\": [\"a\", \"b\", \"c\", \"d\"],\n \"d\": pd.to_datetime([1, 2, 3, 4], unit=\"D\"),\n }\n )\n\n md_df = construct_modin_df_by_scheme(\n pandas_df,\n partitioning_scheme={\n \"row_lengths\": [len(pandas_df)],\n \"column_widths\": [\n len(pandas_df) // 2,\n len(pandas_df) // 2 + len(pandas_df) % 2,\n ],\n },\n )\n md_df = md_df._query_compiler._modin_frame\n\n result = md_df._reorder_labels(\n row_positions=None, col_positions=np.arange(len(md_df.columns) - 1, -1, -1)\n )\n df_equals(result.dtypes, result.to_pandas().dtypes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_partitioning_test_merge_partitioning.res_6.merge_partitioning_left_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_partitioning_test_merge_partitioning.res_6.merge_partitioning_left_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 623, "end_line": 702, "span_ids": ["test_merge_partitioning"], "tokens": 771}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"left_partitioning, right_partitioning, ref_with_cache_available, ref_with_no_cache\",\n # Note: this test takes into consideration that `MinPartitionSize == 32` and `NPartitions == 4`\n [\n (\n [2],\n [2],\n 1, # the num_splits is computed like (2 + 2 = 4 / chunk_size = 1 split)\n 2, # the num_splits is just splits sum (1 + 1 == 2)\n ),\n (\n [24],\n [54],\n 3, # the num_splits is computed like (24 + 54 = 78 / chunk_size = 3 splits)\n 2, # the num_splits is just splits sum (1 + 1 == 2)\n ),\n (\n [2],\n [299],\n 4, # the num_splits is bounded by NPartitions (2 + 299 = 301 / chunk_size = 10 splits -> bound by 4)\n 2, # the num_splits is just splits sum (1 + 1 == 2)\n ),\n (\n [32, 32],\n [128],\n 4, # the num_splits is bounded by NPartitions (32 + 32 + 128 = 192 / chunk_size = 6 splits -> bound by 4)\n 3, # the num_splits is just splits sum (2 + 1 == 3)\n ),\n (\n [128] * 7,\n [128] * 6,\n 4, # the num_splits is bounded by NPartitions (128 * 7 + 128 * 6 = 1664 / chunk_size = 52 splits -> bound by 4)\n 4, # the num_splits is just splits sum bound by NPartitions (7 + 6 = 13 splits -> 4 splits)\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"modify_config\", [{NPartitions: 4, MinPartitionSize: 32}], indirect=True\n)\ndef test_merge_partitioning(\n left_partitioning,\n right_partitioning,\n ref_with_cache_available,\n ref_with_no_cache,\n modify_config,\n):\n from modin.core.storage_formats.pandas.utils import merge_partitioning\n\n left_df = pandas.DataFrame(\n [np.arange(sum(left_partitioning)) for _ in range(sum(left_partitioning))]\n )\n right_df = pandas.DataFrame(\n [np.arange(sum(right_partitioning)) for _ in range(sum(right_partitioning))]\n )\n\n left = construct_modin_df_by_scheme(\n left_df, {\"row_lengths\": left_partitioning, \"column_widths\": left_partitioning}\n )._query_compiler._modin_frame\n right = construct_modin_df_by_scheme(\n right_df,\n {\"row_lengths\": right_partitioning, \"column_widths\": right_partitioning},\n )._query_compiler._modin_frame\n\n assert left.row_lengths == left.column_widths == left_partitioning\n assert right.row_lengths == right.column_widths == right_partitioning\n\n res = merge_partitioning(left, right, axis=0)\n assert res == ref_with_cache_available\n\n res = merge_partitioning(left, right, axis=1)\n assert res == ref_with_cache_available\n\n (\n left._row_lengths_cache,\n left._column_widths_cache,\n right._row_lengths_cache,\n right._column_widths_cache,\n ) = [None] * 4\n\n res = merge_partitioning(left, right, axis=0)\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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_partitioning.assert_res_ref_with_no_test_merge_partitioning.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_partitioning.assert_res_ref_with_no_test_merge_partitioning.None_8", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 703, "end_line": 726, "span_ids": ["test_merge_partitioning"], "tokens": 638}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"left_partitioning, right_partitioning, ref_with_cache_available, ref_with_no_cache\",\n # Note: this test takes into consideration that `MinPartitionSize == 32` and `NPartitions == 4`\n [\n (\n [2],\n [2],\n 1, # the num_splits is computed like (2 + 2 = 4 / chunk_size = 1 split)\n 2, # the num_splits is just splits sum (1 + 1 == 2)\n ),\n (\n [24],\n [54],\n 3, # the num_splits is computed like (24 + 54 = 78 / chunk_size = 3 splits)\n 2, # the num_splits is just splits sum (1 + 1 == 2)\n ),\n (\n [2],\n [299],\n 4, # the num_splits is bounded by NPartitions (2 + 299 = 301 / chunk_size = 10 splits -> bound by 4)\n 2, # the num_splits is just splits sum (1 + 1 == 2)\n ),\n (\n [32, 32],\n [128],\n 4, # the num_splits is bounded by NPartitions (32 + 32 + 128 = 192 / chunk_size = 6 splits -> bound by 4)\n 3, # the num_splits is just splits sum (2 + 1 == 3)\n ),\n (\n [128] * 7,\n [128] * 6,\n 4, # the num_splits is bounded by NPartitions (128 * 7 + 128 * 6 = 1664 / chunk_size = 52 splits -> bound by 4)\n 4, # the num_splits is just splits sum bound by NPartitions (7 + 6 = 13 splits -> 4 splits)\n ),\n ],\n)\n@pytest.mark.parametrize(\n \"modify_config\", [{NPartitions: 4, MinPartitionSize: 32}], indirect=True\n)\ndef test_merge_partitioning(\n left_partitioning,\n right_partitioning,\n ref_with_cache_available,\n ref_with_no_cache,\n modify_config,\n):\n # ... other code\n assert res == ref_with_no_cache\n # Verifying that no computations are being triggered\n assert all(\n cache is None\n for cache in (\n left._row_lengths_cache,\n left._column_widths_cache,\n right._row_lengths_cache,\n right._column_widths_cache,\n )\n )\n\n res = merge_partitioning(left, right, axis=1)\n assert res == ref_with_no_cache\n # Verifying that no computations are being triggered\n assert all(\n cache is None\n for cache in (\n left._row_lengths_cache,\n left._column_widths_cache,\n right._row_lengths_cache,\n right._column_widths_cache,\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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_repartitioning_test_repartitioning.df_equals_res_to_pandas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_repartitioning_test_repartitioning.df_equals_res_to_pandas_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 729, "end_line": 765, "span_ids": ["test_repartitioning"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"set_num_partitions\", [2], indirect=True)\ndef test_repartitioning(set_num_partitions):\n \"\"\"\n This test verifies that 'keep_partitioning=False' doesn't actually preserve partitioning.\n\n For more details see: https://github.com/modin-project/modin/issues/5621\n \"\"\"\n assert NPartitions.get() == 2\n\n pandas_df = pandas.DataFrame(\n {\"a\": [1, 1, 2, 2], \"b\": [3, 4, 5, 6], \"c\": [1, 2, 3, 4], \"d\": [4, 5, 6, 7]}\n )\n\n modin_df = construct_modin_df_by_scheme(\n pandas_df=pandas.DataFrame(\n {\"a\": [1, 1, 2, 2], \"b\": [3, 4, 5, 6], \"c\": [1, 2, 3, 4], \"d\": [4, 5, 6, 7]}\n ),\n partitioning_scheme={\"row_lengths\": [4], \"column_widths\": [2, 2]},\n )\n\n modin_frame = modin_df._query_compiler._modin_frame\n\n assert modin_frame._partitions.shape == (1, 2)\n assert modin_frame.column_widths == [2, 2]\n\n res = modin_frame.apply_full_axis(\n axis=1,\n func=lambda df: df,\n keep_partitioning=False,\n new_index=[0, 1, 2, 3],\n new_columns=[\"a\", \"b\", \"c\", \"d\"],\n )\n\n assert res._partitions.shape == (1, 1)\n assert res.column_widths == [4]\n df_equals(res._partitions[0, 0].to_pandas(), pandas_df)\n df_equals(res.to_pandas(), pandas_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_kernel_test_split_partitions_kernel.if_not_ascending_.bounds.bounds_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_kernel_test_split_partitions_kernel.if_not_ascending_.bounds.bounds_1_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 768, "end_line": 833, "span_ids": ["test_split_partitions_kernel"], "tokens": 662}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"col_name\", [\"numeric_col\", \"non_numeric_col\"])\n@pytest.mark.parametrize(\"ascending\", [True, False])\n@pytest.mark.parametrize(\"num_pivots\", [3, 2, 1])\n@pytest.mark.parametrize(\"all_pivots_are_unique\", [True, False])\ndef test_split_partitions_kernel(\n col_name, ascending, num_pivots, all_pivots_are_unique\n):\n \"\"\"\n This test verifies proper work of the `split_partitions_using_pivots_for_sort` function\n used in partitions reshuffling.\n\n The function being tested splits the passed dataframe into parts according\n to the 'pivots' indicating boundary values for the parts.\n\n Parameters\n ----------\n col_name : {\"numeric_col\", \"non_numeric_col\"}\n The tested function takes a key column name to which the pivot values belong.\n The function may behave differently depending on the type of that column.\n ascending : {True, False}\n The split parts are returned either in ascending or descending order.\n This parameter helps us to test both of the cases.\n num_pivots : {3, 2, 1}\n The function's behavior may depend on the number of boundary values being passed.\n all_pivots_are_unique : {True, False}\n Duplicate pivot values cause empty partitions to be produced. This parameter helps\n to verify that the function still behaves correctly in such cases.\n \"\"\"\n from modin.core.dataframe.pandas.dataframe.utils import (\n split_partitions_using_pivots_for_sort,\n )\n\n random_state = np.random.RandomState(42)\n\n df = pandas.DataFrame(\n {\n \"numeric_col\": range(9),\n \"non_numeric_col\": list(\"abcdefghi\"),\n }\n )\n min_val, max_val = df[col_name].iloc[0], df[col_name].iloc[-1]\n\n # Selecting random boundary values for the key column\n pivots = random_state.choice(df[col_name], num_pivots, replace=False)\n if not all_pivots_are_unique:\n # Making the 'pivots' contain only duplicate values\n pivots = np.repeat(pivots[0], num_pivots)\n # The tested function assumes that we pass pivots in the ascending order\n pivots = np.sort(pivots)\n\n # Randomly reordering rows in the dataframe\n df = df.reindex(random_state.permutation(df.index))\n bins = split_partitions_using_pivots_for_sort(\n df,\n col_name,\n is_numeric_column=pandas.api.types.is_numeric_dtype(df.dtypes[col_name]),\n pivots=pivots,\n ascending=ascending,\n )\n\n # Building reference bounds to make the result verification simpler\n bounds = np.concatenate([[min_val], pivots, [max_val]])\n if not ascending:\n # If the order is descending we want bounds to be in the descending order as well:\n # Ex: bounds = [0, 2, 5, 10] for ascending and [10, 5, 2, 0] for descending.\n bounds = bounds[::-1]\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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_kernel.for_idx_part_in_enumerat_test_split_partitions_kernel.for_idx_part_in_enumerat.if_ascending_.else_.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_kernel.for_idx_part_in_enumerat_test_split_partitions_kernel.for_idx_part_in_enumerat.if_ascending_.else_.assert_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 835, "end_line": 849, "span_ids": ["test_split_partitions_kernel"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"col_name\", [\"numeric_col\", \"non_numeric_col\"])\n@pytest.mark.parametrize(\"ascending\", [True, False])\n@pytest.mark.parametrize(\"num_pivots\", [3, 2, 1])\n@pytest.mark.parametrize(\"all_pivots_are_unique\", [True, False])\ndef test_split_partitions_kernel(\n col_name, ascending, num_pivots, all_pivots_are_unique\n):\n # ... other code\n\n for idx, part in enumerate(bins):\n if ascending:\n # Check that each part is in the range of 'bound[i] <= part <= bound[i + 1]'\n # Example, if the `pivots` were [2, 5] and the min/max values for the colum are min=0, max=10\n # Then each part satisfies: 0 <= part[0] <= 2; 2 <= part[1] <= 5; 5 <= part[2] <= 10\n assert (\n (bounds[idx] <= part[col_name]) & (part[col_name] <= bounds[idx + 1])\n ).all()\n else:\n # Check that each part is in the range of 'bound[i + 1] <= part <= bound[i]'\n # Example, if the `pivots` were [2, 5] and the min/max values for the colum are min=0, max=10\n # Then each part satisfies: 5 <= part[0] <= 10; 2 <= part[1] <= 5; 0 <= part[2] <= 2\n assert (\n (bounds[idx + 1] <= part[col_name]) & (part[col_name] <= bounds[idx])\n ).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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_with_empty_pivots_test_split_partitions_with_empty_pivots.assert_result_0_equals_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partitions_with_empty_pivots_test_split_partitions_with_empty_pivots.assert_result_0_equals_d", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 852, "end_line": 880, "span_ids": ["test_split_partitions_with_empty_pivots"], "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": "@pytest.mark.parametrize(\"col_name\", [\"numeric_col\", \"non_numeric_col\"])\n@pytest.mark.parametrize(\"ascending\", [True, False])\ndef test_split_partitions_with_empty_pivots(col_name, ascending):\n \"\"\"\n This test verifies that the splitting function performs correctly when an empty pivots list is passed.\n The expected behavior is to return a single split consisting of the exact copy of the input dataframe.\n \"\"\"\n from modin.core.dataframe.pandas.dataframe.utils import (\n split_partitions_using_pivots_for_sort,\n )\n\n df = pandas.DataFrame(\n {\n \"numeric_col\": range(9),\n \"non_numeric_col\": list(\"abcdefghi\"),\n }\n )\n\n result = split_partitions_using_pivots_for_sort(\n df,\n col_name,\n is_numeric_column=pandas.api.types.is_numeric_dtype(df.dtypes[col_name]),\n pivots=[],\n ascending=ascending,\n )\n # We're expecting to recieve a single split here\n assert isinstance(result, tuple)\n assert len(result) == 1\n assert result[0].equals(df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_shuffle_partitions_with_empty_pivots_test_shuffle_partitions_with_empty_pivots.assert_ref_equals_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_shuffle_partitions_with_empty_pivots_test_shuffle_partitions_with_empty_pivots.assert_ref_equals_res_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 883, "end_line": 919, "span_ids": ["test_shuffle_partitions_with_empty_pivots"], "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": "@pytest.mark.parametrize(\"ascending\", [True, False])\ndef test_shuffle_partitions_with_empty_pivots(ascending):\n \"\"\"\n This test verifies that the `PartitionMgr.shuffle_partitions` method can handle empty pivots list.\n \"\"\"\n modin_frame = pd.DataFrame(\n np.array([[\"hello\", \"goodbye\"], [\"hello\", \"Hello\"]])\n )._query_compiler._modin_frame\n\n assert modin_frame._partitions.shape == (1, 1)\n\n from modin.core.dataframe.pandas.dataframe.utils import (\n build_sort_functions,\n )\n\n column_name = modin_frame.columns[1]\n\n shuffle_functions = build_sort_functions(\n # These are the parameters we pass in the `.sort_by()` implementation\n modin_frame,\n column=column_name,\n method=\"inverted_cdf\",\n ascending=ascending,\n ideal_num_new_partitions=1,\n )\n\n new_partitions = modin_frame._partition_mgr_cls.shuffle_partitions(\n modin_frame._partitions,\n index=0,\n shuffle_functions=shuffle_functions,\n final_shuffle_func=lambda df: df.sort_values(column_name),\n )\n ref = modin_frame.to_pandas().sort_values(column_name)\n res = new_partitions[0, 0].get()\n\n assert new_partitions.shape == (1, 1)\n assert ref.equals(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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partition_preserve_names_test_split_partition_preserve_names.for_part_in_splits_.assert_part_columns_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_split_partition_preserve_names_test_split_partition_preserve_names.for_part_in_splits_.assert_part_columns_name_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 922, "end_line": 954, "span_ids": ["test_split_partition_preserve_names"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"ascending\", [True, False])\ndef test_split_partition_preserve_names(ascending):\n \"\"\"\n This test verifies that the dataframes being split by ``split_partitions_using_pivots_for_sort``\n preserve their index/column names.\n \"\"\"\n from modin.core.dataframe.pandas.dataframe.utils import (\n split_partitions_using_pivots_for_sort,\n )\n\n df = pandas.DataFrame(\n {\n \"numeric_col\": range(9),\n \"non_numeric_col\": list(\"abcdefghi\"),\n }\n )\n index_name = \"custom_name\"\n df.index.name = index_name\n df.columns.name = index_name\n\n # Pivots that contain empty bins\n pivots = [2, 2, 5, 7]\n splits = split_partitions_using_pivots_for_sort(\n df,\n column=\"numeric_col\",\n is_numeric_column=True,\n pivots=pivots,\n ascending=ascending,\n )\n\n for part in splits:\n assert part.index.name == index_name\n assert part.columns.name == index_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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_preserves_metadata_test_merge_preserves_metadata.None_2.else_.if_not_has_dtypes_metadat.assert_not_modin_frame_ha": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_merge_preserves_metadata_test_merge_preserves_metadata.None_2.else_.if_not_has_dtypes_metadat.assert_not_modin_frame_ha", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 957, "end_line": 993, "span_ids": ["test_merge_preserves_metadata"], "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": "@pytest.mark.parametrize(\"has_cols_metadata\", [True, False])\n@pytest.mark.parametrize(\"has_dtypes_metadata\", [True, False])\ndef test_merge_preserves_metadata(has_cols_metadata, has_dtypes_metadata):\n df1 = pd.DataFrame({\"a\": [1, 1, 2, 2], \"b\": list(\"abcd\")})\n df2 = pd.DataFrame({\"a\": [4, 2, 1, 3], \"b\": list(\"bcaf\"), \"c\": [3, 2, 1, 0]})\n\n modin_frame = df1._query_compiler._modin_frame\n\n if has_cols_metadata:\n # Verify that there were initially materialized metadata\n assert modin_frame.has_materialized_columns\n else:\n modin_frame._columns_cache = None\n\n if has_dtypes_metadata:\n # Verify that there were initially materialized metadata\n assert modin_frame.has_dtypes_cache\n else:\n modin_frame.set_dtypes_cache(None)\n\n res = df1.merge(df2, on=\"b\")._query_compiler._modin_frame\n\n if has_cols_metadata:\n assert res.has_materialized_columns\n if has_dtypes_metadata:\n assert res.has_dtypes_cache\n else:\n # Verify that no materialization was triggered\n assert not res.has_dtypes_cache\n assert not modin_frame.has_dtypes_cache\n else:\n # Verify that no materialization was triggered\n assert not res.has_materialized_columns\n assert not res.has_dtypes_cache\n assert not modin_frame.has_materialized_columns\n if not has_dtypes_metadata:\n assert not modin_frame.has_dtypes_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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_binary_op_preserve_dtypes_test_binary_op_preserve_dtypes.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_binary_op_preserve_dtypes_test_binary_op_preserve_dtypes.None_7", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 996, "end_line": 1025, "span_ids": ["test_binary_op_preserve_dtypes"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_binary_op_preserve_dtypes():\n df = pd.DataFrame({\"a\": [1, 2, 3], \"b\": [4.0, 5.0, 6.0]})\n\n def setup_cache(df, has_cache=True):\n if has_cache:\n _ = df.dtypes\n assert df._query_compiler._modin_frame.has_materialized_dtypes\n else:\n df._query_compiler._modin_frame.set_dtypes_cache(None)\n assert not df._query_compiler._modin_frame.has_materialized_dtypes\n return df\n\n def assert_cache(df, has_cache=True):\n assert not (has_cache ^ df._query_compiler._modin_frame.has_materialized_dtypes)\n\n # Check when `other` is a non-distributed object\n assert_cache(setup_cache(df) + 2.0)\n assert_cache(setup_cache(df) + {\"a\": 2.0, \"b\": 4})\n assert_cache(setup_cache(df) + [2.0, 4])\n assert_cache(setup_cache(df) + np.array([2.0, 4]))\n\n # Check when `other` is a dataframe\n other = pd.DataFrame({\"b\": [3, 4, 5], \"c\": [4.0, 5.0, 6.0]})\n assert_cache(setup_cache(df) + setup_cache(other, has_cache=True))\n assert_cache(setup_cache(df) + setup_cache(other, has_cache=False), has_cache=False)\n\n # Check when `other` is a series\n other = pd.Series({\"b\": 3.0, \"c\": 4.0})\n assert_cache(setup_cache(df) + setup_cache(other, has_cache=True))\n assert_cache(setup_cache(df) + setup_cache(other, has_cache=False), has_cache=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_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_setitem_bool_preserve_dtypes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/storage_formats/pandas/test_internals.py_test_setitem_bool_preserve_dtypes_", "embedding": null, "metadata": {"file_path": "modin/test/storage_formats/pandas/test_internals.py", "file_name": "test_internals.py", "file_type": "text/x-python", "category": "test", "start_line": 1028, "end_line": 1045, "span_ids": ["test_setitem_bool_preserve_dtypes"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_setitem_bool_preserve_dtypes():\n df = pd.DataFrame({\"a\": [1, 1, 2, 2], \"b\": [3, 4, 5, 6]})\n indexer = pd.Series([True, False, True, False])\n\n assert df._query_compiler._modin_frame.has_materialized_dtypes\n\n # slice(None) as a col_loc\n df.loc[indexer] = 2.0\n assert df._query_compiler._modin_frame.has_materialized_dtypes\n\n # list as a col_loc\n df.loc[indexer, [\"a\", \"b\"]] = 2.0\n assert df._query_compiler._modin_frame.has_materialized_dtypes\n\n # scalar as a col_loc\n df.loc[indexer, \"a\"] = 2.0\n assert df._query_compiler._modin_frame.has_materialized_dtypes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_docstring_urls.py_from_urllib_request_impor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_docstring_urls.py_from_urllib_request_impor_", "embedding": null, "metadata": {"file_path": "modin/test/test_docstring_urls.py", "file_name": "test_docstring_urls.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 50, "span_ids": ["test_all_urls_exist", "doc_urls", "docstring"], "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 urllib.request import urlopen\nfrom urllib.error import HTTPError\nfrom concurrent.futures import ThreadPoolExecutor\nimport pkgutil\nimport importlib\nimport pytest\n\nimport modin.pandas\n\n\n@pytest.fixture\ndef doc_urls(get_generated_doc_urls):\n # ensure all docstring are generated - import _everything_ under 'modin.pandas'\n for modinfo in pkgutil.walk_packages(modin.pandas.__path__, \"modin.pandas.\"):\n try:\n importlib.import_module(modinfo.name)\n except ModuleNotFoundError:\n # some optional 3rd-party dep missing, ignore\n pass\n return sorted(get_generated_doc_urls())\n\n\ndef test_all_urls_exist(doc_urls):\n broken = []\n\n def _test_url(url):\n try:\n with urlopen(url):\n pass\n except HTTPError:\n broken.append(url)\n\n with ThreadPoolExecutor(32) as pool:\n pool.map(_test_url, doc_urls)\n\n assert not broken, \"Invalid URLs detected\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_catcher.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_catcher.py_os_", "embedding": null, "metadata": {"file_path": "modin/test/test_envvar_catcher.py", "file_name": "test_envvar_catcher.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 33, "span_ids": ["nameset", "test_envvar_catcher", "docstring"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport pytest\n\n\n@pytest.fixture\ndef nameset():\n name = \"hey_i_am_an_env_var\"\n os.environ[name] = \"i am a value\"\n yield name\n del os.environ[name]\n\n\ndef test_envvar_catcher(nameset):\n with pytest.raises(AssertionError):\n os.environ.get(\"Modin_FOO\", \"bar\")\n with pytest.raises(AssertionError):\n \"modin_qux\" not in os.environ\n assert \"yay_random_name\" not in os.environ\n assert os.environ[nameset]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_npartitions.py_pd_test_set_npartitions.assert_part_shape_0_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_npartitions.py_pd_test_set_npartitions.assert_part_shape_0_n", "embedding": null, "metadata": {"file_path": "modin/test/test_envvar_npartitions.py", "file_name": "test_envvar_npartitions.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 27, "span_ids": ["test_set_npartitions", "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": "import modin.pandas as pd\nimport numpy as np\nimport pytest\n\nfrom modin.config import NPartitions\n\n\n@pytest.mark.parametrize(\"num_partitions\", [2, 4, 6, 8, 10])\ndef test_set_npartitions(num_partitions):\n NPartitions.put(num_partitions)\n data = np.random.randint(0, 100, size=(2**16, 2**8))\n df = pd.DataFrame(data)\n part_shape = df._query_compiler._modin_frame._partitions.shape\n assert part_shape[0] == num_partitions and part_shape[1] == min(num_partitions, 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_modin-project__modin/modin/test/test_envvar_npartitions.py_test_runtime_change_npartitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_envvar_npartitions.py_test_runtime_change_npartitions_", "embedding": null, "metadata": {"file_path": "modin/test/test_envvar_npartitions.py", "file_name": "test_envvar_npartitions.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 47, "span_ids": ["test_runtime_change_npartitions"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"left_num_partitions\", [2, 4, 6, 8, 10])\n@pytest.mark.parametrize(\"right_num_partitions\", [2, 4, 6, 8, 10])\ndef test_runtime_change_npartitions(left_num_partitions, right_num_partitions):\n NPartitions.put(left_num_partitions)\n data = np.random.randint(0, 100, size=(2**16, 2**8))\n left_df = pd.DataFrame(data)\n part_shape = left_df._query_compiler._modin_frame._partitions.shape\n assert part_shape[0] == left_num_partitions and part_shape[1] == min(\n left_num_partitions, 8\n )\n\n NPartitions.put(right_num_partitions)\n right_df = pd.DataFrame(data)\n part_shape = right_df._query_compiler._modin_frame._partitions.shape\n assert part_shape[0] == right_num_partitions and part_shape[1] == min(\n right_num_partitions, 8\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_executions_api.py_pytest_test_base_abstract_methods.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_executions_api.py_pytest_test_base_abstract_methods.assert_", "embedding": null, "metadata": {"file_path": "modin/test/test_executions_api.py", "file_name": "test_executions_api.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 50, "span_ids": ["test_base_abstract_methods", "docstring"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom modin.core.storage_formats import (\n BaseQueryCompiler,\n PandasQueryCompiler,\n)\nfrom modin.experimental.core.storage_formats.pyarrow import PyarrowQueryCompiler\n\n\nBASE_EXECUTION = BaseQueryCompiler\nEXECUTIONS = [PandasQueryCompiler, PyarrowQueryCompiler]\n\n\ndef test_base_abstract_methods():\n allowed_abstract_methods = [\n \"__init__\",\n \"free\",\n \"finalize\",\n \"to_pandas\",\n \"from_pandas\",\n \"from_arrow\",\n \"default_to_pandas\",\n \"from_dataframe\",\n \"to_dataframe\",\n ]\n\n not_implemented_methods = BASE_EXECUTION.__abstractmethods__.difference(\n allowed_abstract_methods\n )\n\n # sorting for beauty output in error\n not_implemented_methods = list(not_implemented_methods)\n not_implemented_methods.sort()\n\n assert (\n len(not_implemented_methods) == 0\n ), f\"{BASE_EXECUTION} has not implemented abstract methods: {not_implemented_methods}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_executions_api.py_test_api_consistent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_executions_api.py_test_api_consistent_", "embedding": null, "metadata": {"file_path": "modin/test/test_executions_api.py", "file_name": "test_executions_api.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 65, "span_ids": ["test_api_consistent"], "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": "@pytest.mark.parametrize(\"execution\", EXECUTIONS)\ndef test_api_consistent(execution):\n base_methods = set(BASE_EXECUTION.__dict__)\n custom_methods = set(\n [key for key in execution.__dict__.keys() if not key.startswith(\"_\")]\n )\n\n extra_methods = custom_methods.difference(base_methods)\n # checking that custom execution do not implements extra api methods\n assert (\n len(extra_methods) == 0\n ), f\"{execution} implement these extra methods: {extra_methods}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_headers.py_os_test_headers.for_subdir_dirs_files_i.for_file_in_files_.if_file_endswith_py_a.with_open_filepath_r_.for_left_right_in_zip_.assert_left_right": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_headers.py_os_test_headers.for_subdir_dirs_files_i.for_file_in_files_.if_file_endswith_py_a.with_open_filepath_r_.for_left_right_in_zip_.assert_left_right", "embedding": null, "metadata": {"file_path": "modin/test/test_headers.py", "file_name": "test_headers.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 38, "span_ids": ["test_headers", "docstring"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom os.path import dirname, abspath\n\n\n# This is the python file root directory (modin/modin)\nrootdir = dirname(dirname(abspath(__file__)))\nexclude_files = [\"_version.py\"]\n\n\ndef test_headers():\n with open(\"{}{}\".format(dirname(rootdir), \"/LICENSE_HEADER\"), \"r\") as f:\n # Lines to check each line individually\n header_lines = f.readlines()\n\n for subdir, dirs, files in os.walk(rootdir):\n for file in files:\n filepath = os.path.join(subdir, file)\n if file.endswith(\".py\") and file not in exclude_files:\n with open(filepath, \"r\", encoding=\"utf8\") as f:\n # Lines for line by line comparison\n py_file_lines = f.readlines()\n for left, right in zip(\n header_lines, py_file_lines[: len(header_lines)]\n ):\n assert left == right", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_headers.py_test_line_endings_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_headers.py_test_line_endings_", "embedding": null, "metadata": {"file_path": "modin/test/test_headers.py", "file_name": "test_headers.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 55, "span_ids": ["test_line_endings"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_line_endings():\n # This is the project root\n rootdir = dirname(dirname(abspath(__file__)))\n for subdir, dirs, files in os.walk(rootdir):\n if any(i in subdir for i in [\".git\", \".idea\", \"__pycache__\"]):\n continue\n for file in files:\n filepath = os.path.join(subdir, file)\n with open(filepath, \"rb+\") as f:\n file_contents = f.read()\n new_contents = file_contents.replace(b\"\\r\\n\", b\"\\n\")\n assert new_contents == file_contents, \"File has CRLF: {}\".format(\n filepath\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_pytest__FakeLogger.clear.cls._loggers._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_pytest__FakeLogger.clear.cls._loggers._", "embedding": null, "metadata": {"file_path": "modin/test/test_logging.py", "file_name": "test_logging.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 45, "span_ids": ["_FakeLogger.info", "_FakeLogger.exception", "_FakeLogger.__init__", "_FakeLogger.clear", "_FakeLogger.get", "docstring", "_FakeLogger", "_FakeLogger.make"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport logging\nimport collections\n\nimport modin.logging\nfrom modin.config import LogMode\n\n\nclass _FakeLogger:\n _loggers = {}\n\n def __init__(self, namespace):\n self.messages = collections.defaultdict(list)\n self.namespace = namespace\n\n def info(self, message, *args, **kw):\n self.messages[\"info\"].append(message.format(*args, **kw))\n\n def exception(self, message, *args, **kw):\n self.messages[\"exception\"].append(message.format(*args, **kw))\n\n @classmethod\n def make(cls, namespace):\n return cls._loggers.setdefault(namespace, cls(namespace))\n\n @classmethod\n def get(cls, namespace=\"modin.logger.default\"):\n return cls._loggers[namespace].messages\n\n @classmethod\n def clear(cls):\n cls._loggers = {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py__get_logger_test_function_decorator.assert_get_log_messages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py__get_logger_test_function_decorator.assert_get_log_messages_", "embedding": null, "metadata": {"file_path": "modin/test/test_logging.py", "file_name": "test_logging.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 87, "span_ids": ["mock_get_logger", "test_function_decorator", "_get_logger", "get_log_messages"], "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": "def _get_logger(namespace=\"modin.logger.default\"):\n return _FakeLogger.make(namespace)\n\n\ndef mock_get_logger(ctx):\n ctx.setattr(logging, \"getLogger\", _get_logger)\n\n\n@pytest.fixture\ndef get_log_messages():\n old = LogMode.get()\n LogMode.enable()\n modin.logging.get_logger() # initialize the logging pior to mocking getLogger()\n\n yield _FakeLogger.get\n\n _FakeLogger.clear()\n LogMode.put(old)\n\n\ndef test_function_decorator(monkeypatch, get_log_messages):\n @modin.logging.enable_logging\n def func(do_raise):\n if do_raise:\n raise ValueError()\n\n with monkeypatch.context() as ctx:\n # NOTE: we cannot patch in the fixture as mockin logger.getLogger()\n # without monkeypatch.context() breaks pytest\n mock_get_logger(ctx)\n\n func(do_raise=False)\n with pytest.raises(ValueError):\n func(do_raise=True)\n\n assert \"func\" in get_log_messages()[\"info\"][0]\n assert \"START\" in get_log_messages()[\"info\"][0]\n assert get_log_messages(\"modin.logger.errors\")[\"exception\"] == [\n \"STOP::PANDAS-API::func\"\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_function_decorator_on_outer_function_6237_test_function_decorator_on_outer_function_6237.assert_get_log_messages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_function_decorator_on_outer_function_6237_test_function_decorator_on_outer_function_6237.assert_get_log_messages_", "embedding": null, "metadata": {"file_path": "modin/test/test_logging.py", "file_name": "test_logging.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 109, "span_ids": ["test_function_decorator_on_outer_function_6237"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_function_decorator_on_outer_function_6237(monkeypatch, get_log_messages):\n @modin.logging.enable_logging\n def inner_func():\n raise ValueError()\n\n @modin.logging.enable_logging\n def outer_func():\n inner_func()\n\n with monkeypatch.context() as ctx:\n # NOTE: we cannot patch in the fixture as mockin logger.getLogger()\n # without monkeypatch.context() breaks pytest\n mock_get_logger(ctx)\n\n with pytest.raises(ValueError):\n outer_func()\n\n assert get_log_messages(\"modin.logger.errors\")[\"exception\"] == [\n \"STOP::PANDAS-API::inner_func\"\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_class_decorator_test_class_decorator.assert_get_log_messages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_class_decorator_test_class_decorator.assert_get_log_messages_", "embedding": null, "metadata": {"file_path": "modin/test/test_logging.py", "file_name": "test_logging.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 148, "span_ids": ["test_class_decorator"], "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 test_class_decorator(monkeypatch, get_log_messages):\n @modin.logging.enable_logging(\"CUSTOM\")\n class Foo:\n def method1(self):\n pass\n\n @classmethod\n def method2(cls):\n pass\n\n @staticmethod\n def method3():\n pass\n\n class Bar(Foo):\n def method4(self):\n pass\n\n with monkeypatch.context() as ctx:\n mock_get_logger(ctx)\n Foo().method1()\n Foo.method2()\n Foo.method3()\n\n Bar().method1()\n Bar().method4()\n\n assert get_log_messages()[\"info\"] == [\n \"START::CUSTOM::Foo.method1\",\n \"STOP::CUSTOM::Foo.method1\",\n \"START::CUSTOM::Foo.method2\",\n \"STOP::CUSTOM::Foo.method2\",\n \"START::CUSTOM::Foo.method3\",\n \"STOP::CUSTOM::Foo.method3\",\n \"START::CUSTOM::Foo.method1\",\n \"STOP::CUSTOM::Foo.method1\",\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_class_inheritance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_logging.py_test_class_inheritance_", "embedding": null, "metadata": {"file_path": "modin/test/test_logging.py", "file_name": "test_logging.py", "file_type": "text/x-python", "category": "test", "start_line": 151, "end_line": 174, "span_ids": ["test_class_inheritance"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_class_inheritance(monkeypatch, get_log_messages):\n class Foo(modin.logging.ClassLogger, modin_layer=\"CUSTOM\"):\n def method1(self):\n pass\n\n class Bar(Foo):\n def method2(self):\n pass\n\n with monkeypatch.context() as ctx:\n mock_get_logger(ctx)\n Foo().method1()\n Bar().method1()\n Bar().method2()\n\n assert get_log_messages()[\"info\"] == [\n \"START::CUSTOM::Foo.method1\",\n \"STOP::CUSTOM::Foo.method1\",\n \"START::CUSTOM::Foo.method1\",\n \"STOP::CUSTOM::Foo.method1\",\n \"START::CUSTOM::Bar.method2\",\n \"STOP::CUSTOM::Bar.method2\",\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_np_pd_DataFrame_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_np_pd_DataFrame_", "embedding": null, "metadata": {"file_path": "modin/test/test_partition_api.py", "file_name": "test_partition_api.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 64, "span_ids": ["impl:33", "docstring"], "tokens": 489}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import numpy as np\nimport pandas\nimport pytest\n\nimport modin.pandas as pd\nfrom modin.distributed.dataframe.pandas import unwrap_partitions, from_partitions\nfrom modin.config import Engine, NPartitions\nfrom modin.pandas.test.utils import df_equals, test_data\nfrom modin.pandas.indexing import compute_sliced_len\nfrom modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher\n\nPartitionClass = (\n FactoryDispatcher.get_factory().io_cls.frame_cls._partition_mgr_cls._partition_class\n)\n\nif Engine.get() == \"Ray\":\n from modin.core.execution.ray.common import RayWrapper\n from modin.core.execution.ray.common.utils import ObjectIDType\n\n put_func = RayWrapper.put\n get_func = RayWrapper.materialize\n is_future = lambda obj: isinstance(obj, ObjectIDType) # noqa: E731\nelif Engine.get() == \"Dask\":\n from modin.core.execution.dask.common import DaskWrapper\n from distributed import Future\n\n # Looks like there is a key collision;\n # https://github.com/dask/distributed/issues/3703#issuecomment-619446739\n # recommends to use `hash=False`. Perhaps this should be the default value of `put`.\n put_func = lambda obj: DaskWrapper.put(obj, hash=False) # noqa: E731\n get_func = DaskWrapper.materialize\n is_future = lambda obj: isinstance(obj, Future) # noqa: E731\nelif Engine.get() == \"Unidist\":\n from modin.core.execution.unidist.common import UnidistWrapper\n from unidist import is_object_ref\n\n put_func = UnidistWrapper.put\n get_func = UnidistWrapper.materialize\n is_future = is_object_ref\nelif Engine.get() == \"Python\":\n put_func = lambda x: x # noqa: E731\n get_func = lambda x: x # noqa: E731\n is_future = lambda obj: isinstance(obj, object) # noqa: E731\nelse:\n raise NotImplementedError(\n f\"'{Engine.get()}' engine is not supported by these test suites\"\n )\n\nNPartitions.put(4)\n# HACK: implicit engine initialization (Modin issue #2989)\npd.DataFrame([])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_unwrap_partitions_test_unwrap_partitions.if_axis_is_None_.else_.for_item_idx_in_range_len.if_Engine_get_in_Ray_.df_equals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_unwrap_partitions_test_unwrap_partitions.if_axis_is_None_.else_.for_item_idx_in_range_len.if_Engine_get_in_Ray_.df_equals_", "embedding": null, "metadata": {"file_path": "modin/test/test_partition_api.py", "file_name": "test_partition_api.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 114, "span_ids": ["test_unwrap_partitions"], "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": "@pytest.mark.parametrize(\"axis\", [None, 0, 1])\n@pytest.mark.parametrize(\"reverse_index\", [True, False])\n@pytest.mark.parametrize(\"reverse_columns\", [True, False])\ndef test_unwrap_partitions(axis, reverse_index, reverse_columns):\n data = test_data[\"int_data\"]\n\n def get_df(lib, data):\n df = lib.DataFrame(data)\n if reverse_index:\n df.index = df.index[::-1]\n if reverse_columns:\n df.columns = df.columns[::-1]\n return df\n\n df = get_df(pd, data)\n # `df` should not have propagated the index and column updates to its\n # partitions yet. The partitions of `expected_df` should have the updated\n # metadata because we construct `expected_df` directly from the updated\n # pandas dataframe.\n expected_df = pd.DataFrame(get_df(pandas, data))\n expected_partitions = expected_df._query_compiler._modin_frame._partitions\n if axis is None:\n actual_partitions = np.array(unwrap_partitions(df, axis=axis))\n assert expected_partitions.shape == actual_partitions.shape\n for row_idx in range(expected_partitions.shape[0]):\n for col_idx in range(expected_partitions.shape[1]):\n df_equals(\n get_func(expected_partitions[row_idx][col_idx].list_of_blocks[0]),\n get_func(actual_partitions[row_idx][col_idx]),\n )\n else:\n expected_axis_partitions = (\n expected_df._query_compiler._modin_frame._partition_mgr_cls.axis_partition(\n expected_partitions, axis ^ 1\n )\n )\n expected_axis_partitions = [\n axis_partition.force_materialization().unwrap(squeeze=True)\n for axis_partition in expected_axis_partitions\n ]\n actual_axis_partitions = unwrap_partitions(df, axis=axis)\n assert len(expected_axis_partitions) == len(actual_axis_partitions)\n for item_idx in range(len(expected_axis_partitions)):\n if Engine.get() in [\"Ray\", \"Dask\", \"Unidist\"]:\n df_equals(\n get_func(expected_axis_partitions[item_idx]),\n get_func(actual_axis_partitions[item_idx]),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_from_partitions_test_from_partitions.df_equals_expected_df_ac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_from_partitions_test_from_partitions.df_equals_expected_df_ac", "embedding": null, "metadata": {"file_path": "modin/test/test_partition_api.py", "file_name": "test_partition_api.py", "file_type": "text/x-python", "category": "test", "start_line": 117, "end_line": 157, "span_ids": ["test_from_partitions"], "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": "@pytest.mark.parametrize(\"column_widths\", [None, \"column_widths\"])\n@pytest.mark.parametrize(\"row_lengths\", [None, \"row_lengths\"])\n@pytest.mark.parametrize(\"columns\", [None, \"columns\"])\n@pytest.mark.parametrize(\"index\", [None, \"index\"])\n@pytest.mark.parametrize(\"axis\", [None, 0, 1])\ndef test_from_partitions(axis, index, columns, row_lengths, column_widths):\n data = test_data[\"int_data\"]\n df1, df2 = pandas.DataFrame(data), pandas.DataFrame(data)\n num_rows, num_cols = df1.shape\n expected_df = pandas.concat([df1, df2], axis=1 if axis is None else axis)\n\n index = expected_df.index if index == \"index\" else None\n columns = expected_df.columns if columns == \"columns\" else None\n row_lengths = (\n None\n if row_lengths is None\n else [num_rows, num_rows]\n if axis == 0\n else [num_rows]\n )\n column_widths = (\n None\n if column_widths is None\n else [num_cols]\n if axis == 0\n else [num_cols, num_cols]\n )\n futures = []\n if axis is None:\n futures = [[put_func(df1), put_func(df2)]]\n else:\n futures = [put_func(df1), put_func(df2)]\n actual_df = from_partitions(\n futures,\n axis,\n index=index,\n columns=columns,\n row_lengths=row_lengths,\n column_widths=column_widths,\n )\n df_equals(expected_df, actual_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_from_partitions_mismatched_labels_test_from_partitions_mismatched_labels.df_equals_expected_df_ac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_from_partitions_mismatched_labels_test_from_partitions_mismatched_labels.df_equals_expected_df_ac", "embedding": null, "metadata": {"file_path": "modin/test/test_partition_api.py", "file_name": "test_partition_api.py", "file_type": "text/x-python", "category": "test", "start_line": 160, "end_line": 181, "span_ids": ["test_from_partitions_mismatched_labels"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"columns\", [\"original_col\", \"new_col\"])\n@pytest.mark.parametrize(\"index\", [\"original_idx\", \"new_idx\"])\n@pytest.mark.parametrize(\"axis\", [None, 0, 1])\ndef test_from_partitions_mismatched_labels(axis, index, columns):\n expected_df = pd.DataFrame(test_data[\"int_data\"])\n partitions = unwrap_partitions(expected_df, axis=axis)\n\n index = (\n expected_df.index\n if index == \"original_idx\"\n else [f\"row{i}\" for i in expected_df.index]\n )\n columns = (\n expected_df.columns\n if columns == \"original_col\"\n else [f\"col{i}\" for i in expected_df.columns]\n )\n\n expected_df.index = index\n expected_df.columns = columns\n actual_df = from_partitions(partitions, axis=axis, index=index, columns=columns)\n df_equals(expected_df, actual_df)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_mask_preserve_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_partition_api.py_test_mask_preserve_cache_", "embedding": null, "metadata": {"file_path": "modin/test/test_partition_api.py", "file_name": "test_partition_api.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 230, "span_ids": ["test_mask_preserve_cache"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"row_labels\", [[0, 2], slice(None)])\n@pytest.mark.parametrize(\"col_labels\", [[0, 2], slice(None)])\n@pytest.mark.parametrize(\"is_length_future\", [False, True])\n@pytest.mark.parametrize(\"is_width_future\", [False, True])\ndef test_mask_preserve_cache(row_labels, col_labels, is_length_future, is_width_future):\n def deserialize(obj):\n if is_future(obj):\n return get_func(obj)\n return obj\n\n def compute_length(indices, length):\n if not isinstance(indices, slice):\n return len(indices)\n return compute_sliced_len(indices, length)\n\n df = pandas.DataFrame({\"a\": [1, 2, 3, 4], \"b\": [5, 6, 7, 8], \"c\": [9, 10, 11, 12]})\n obj_id = put_func(df)\n\n partition_shape = [\n put_func(len(df)) if is_length_future else len(df),\n put_func(len(df.columns)) if is_width_future else len(df.columns),\n ]\n\n source_partition = PartitionClass(obj_id, *partition_shape)\n masked_partition = source_partition.mask(\n row_labels=row_labels, col_labels=col_labels\n )\n\n expected_length = compute_length(row_labels, len(df))\n expected_width = compute_length(col_labels, len(df.columns))\n\n # Check that the cache is preserved\n assert expected_length == deserialize(masked_partition._length_cache)\n assert expected_width == deserialize(masked_partition._width_cache)\n # Check that the cache is interpreted properly\n assert expected_length == masked_partition.length()\n assert expected_width == masked_partition.width()\n # Recompute shape explicitly to check that the cached data was correct\n expected_length, expected_width = [\n masked_partition._length_cache,\n masked_partition._width_cache,\n ]\n masked_partition._length_cache = None\n masked_partition._width_cache = None\n assert expected_length == masked_partition.length()\n assert expected_width == masked_partition.width()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_pytest_test_doc_inherit_prop_builder.assert_Child_prop_C": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_pytest_test_doc_inherit_prop_builder.assert_Child_prop_C", "embedding": null, "metadata": {"file_path": "modin/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 138, "span_ids": ["test_doc_inherit_props", "BaseParent.clsmtd", "BaseChild", "wrapped_cls", "BaseParent.base_method", "test_doc_inherit_methods", "BaseParent.method", "docstring", "BaseChild.no_overwrite", "BaseChild:3", "_check_doc", "BaseChild.own_method", "BaseParent.static", "BaseParent", "test_doc_inherit_special", "test_doc_inherit_clslevel", "BaseChild.method", "BaseParent.prop", "test_doc_inherit_prop_builder"], "tokens": 658}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport modin.utils\nimport json\nimport pandas\nimport modin.pandas as pd\n\nfrom textwrap import dedent, indent\nfrom modin.error_message import ErrorMessage\nfrom modin.pandas.test.utils import create_test_dfs\n\n\n# Note: classes below are used for purely testing purposes - they\n# simulate real-world use cases for _inherit_docstring\nclass BaseParent:\n def method(self):\n \"\"\"ordinary method (base)\"\"\"\n\n def base_method(self):\n \"\"\"ordinary method in base only\"\"\"\n\n @property\n def prop(self):\n \"\"\"property\"\"\"\n\n @staticmethod\n def static():\n \"\"\"static method\"\"\"\n\n @classmethod\n def clsmtd(cls):\n \"\"\"class method\"\"\"\n\n\nclass BaseChild(BaseParent):\n \"\"\"this is class docstring\"\"\"\n\n def method(self):\n \"\"\"ordinary method (child)\"\"\"\n\n def own_method(self):\n \"\"\"own method\"\"\"\n\n def no_overwrite(self):\n \"\"\"another own method\"\"\"\n\n F = property(method)\n\n\n@pytest.fixture(scope=\"module\")\ndef wrapped_cls():\n @modin.utils._inherit_docstrings(BaseChild)\n class Wrapped:\n def method(self):\n pass\n\n def base_method(self):\n pass\n\n def own_method(self):\n pass\n\n def no_overwrite(self):\n \"\"\"not overwritten doc\"\"\"\n\n @property\n def prop(self):\n return None\n\n @staticmethod\n def static():\n pass\n\n @classmethod\n def clsmtd(cls):\n pass\n\n F = property(method)\n\n return Wrapped\n\n\ndef _check_doc(wrapped, orig):\n assert wrapped.__doc__ == orig.__doc__\n if isinstance(wrapped, property):\n assert wrapped.fget.__doc_inherited__\n else:\n assert wrapped.__doc_inherited__\n\n\ndef test_doc_inherit_clslevel(wrapped_cls):\n _check_doc(wrapped_cls, BaseChild)\n\n\ndef test_doc_inherit_methods(wrapped_cls):\n _check_doc(wrapped_cls.method, BaseChild.method)\n _check_doc(wrapped_cls.base_method, BaseParent.base_method)\n _check_doc(wrapped_cls.own_method, BaseChild.own_method)\n assert wrapped_cls.no_overwrite.__doc__ != BaseChild.no_overwrite.__doc__\n assert not getattr(wrapped_cls.no_overwrite, \"__doc_inherited__\", False)\n\n\ndef test_doc_inherit_special(wrapped_cls):\n _check_doc(wrapped_cls.static, BaseChild.static)\n _check_doc(wrapped_cls.clsmtd, BaseChild.clsmtd)\n\n\ndef test_doc_inherit_props(wrapped_cls):\n assert type(wrapped_cls.method) == type(BaseChild.method) # noqa: E721\n _check_doc(wrapped_cls.prop, BaseChild.prop)\n _check_doc(wrapped_cls.F, BaseChild.F)\n\n\ndef test_doc_inherit_prop_builder():\n def builder(name):\n return property(lambda self: name)\n\n class Parent:\n prop = builder(\"Parent\")\n\n @modin.utils._inherit_docstrings(Parent)\n class Child(Parent):\n prop = builder(\"Child\")\n\n assert Parent().prop == \"Parent\"\n assert Child().prop == \"Child\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_append_to_docstring_test_align_indents.assert_source_result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_append_to_docstring_test_align_indents.assert_source_result", "embedding": null, "metadata": {"file_path": "modin/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 141, "end_line": 187, "span_ids": ["test_append_to_docstring", "test_align_indents"], "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 \"source_doc,to_append,expected\",\n [\n (\n \"One-line doc.\",\n \"One-line message.\",\n \"One-line doc.One-line message.\",\n ),\n (\n \"\"\"\n Regular doc-string\n With the setted indent style.\n \"\"\",\n \"\"\"\n Doc-string having different indents\n in comparison with the regular one.\n \"\"\",\n \"\"\"\n Regular doc-string\n With the setted indent style.\n\n Doc-string having different indents\n in comparison with the regular one.\n \"\"\",\n ),\n ],\n)\ndef test_append_to_docstring(source_doc, to_append, expected):\n def source_fn():\n pass\n\n source_fn.__doc__ = source_doc\n result_fn = modin.utils.append_to_docstring(to_append)(source_fn)\n\n answer = dedent(result_fn.__doc__)\n expected = dedent(expected)\n\n assert answer == expected\n\n\ndef test_align_indents():\n source = \"\"\"\n Source string that sets\n the indent pattern.\"\"\"\n target = indent(source, \" \" * 5)\n result = modin.utils.align_indents(source, target)\n assert source == 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_modin-project__modin/modin/test/test_utils.py_test_format_string_test_format_string.assert_answer_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_format_string_test_format_string.assert_answer_expected", "embedding": null, "metadata": {"file_path": "modin/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 190, "end_line": 245, "span_ids": ["test_format_string"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_format_string():\n template = \"\"\"\n Source template string that has some {inline_placeholder}s.\n Placeholder1:\n {new_line_placeholder1}\n Placeholder2:\n {new_line_placeholder2}\n Placeholder3:\n {new_line_placeholder3}\n Placeholder4:\n {new_line_placeholder4}Text text:\n Placeholder5:\n {new_line_placeholder5}\n \"\"\"\n\n singleline_value = \"Single-line value\"\n multiline_value = \"\"\"\n Some string\n Having different indentation\n From the source one.\"\"\"\n multiline_value_new_line_at_the_end = multiline_value + \"\\n\"\n multiline_value_new_line_at_the_begin = \"\\n\" + multiline_value\n\n expected = \"\"\"\n Source template string that has some Single-line values.\n Placeholder1:\n Some string\n Having different indentation\n From the source one.\n Placeholder2:\n Single-line value\n Placeholder3:\n \n Some string\n Having different indentation\n From the source one.\n Placeholder4:\n Some string\n Having different indentation\n From the source one.\n Text text:\n Placeholder5:\n Some string\n Having different indentation\n From the source one.\n \"\"\" # noqa: W293\n answer = modin.utils.format_string(\n template,\n inline_placeholder=singleline_value,\n new_line_placeholder1=multiline_value,\n new_line_placeholder2=singleline_value,\n new_line_placeholder3=multiline_value_new_line_at_the_begin,\n new_line_placeholder4=multiline_value_new_line_at_the_end,\n new_line_placeholder5=multiline_value,\n )\n assert answer == 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_modin-project__modin/modin/test/test_utils.py_warns_that_defaulting_to_pandas_warns_that_defaulting_to_pandas.return.pytest_warns_UserWarning_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_warns_that_defaulting_to_pandas_warns_that_defaulting_to_pandas.return.pytest_warns_UserWarning_", "embedding": null, "metadata": {"file_path": "modin/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 248, "end_line": 273, "span_ids": ["warns_that_defaulting_to_pandas"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def warns_that_defaulting_to_pandas(prefix=None, suffix=None):\n \"\"\"\n Assert that code warns that it's defaulting to pandas.\n\n Parameters\n ----------\n prefix : Optional[str]\n If specified, checks that the start of the warning message matches this argument\n before \"[Dd]efaulting to pandas\".\n suffix : Optional[str]\n If specified, checks that the end of the warning message matches this argument\n after \"[Dd]efaulting to pandas\".\n\n Returns\n -------\n pytest.recwarn.WarningsChecker\n A WarningsChecker checking for a UserWarning saying that Modin is\n defaulting to Pandas.\n \"\"\"\n match = \"[Dd]efaulting to pandas\"\n if prefix:\n # Message may be separated by newlines\n match = match + \"(.|\\\\n)+\"\n if suffix:\n match += \"(.|\\\\n)+\" + suffix\n return pytest.warns(UserWarning, match=match)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_show_versions_test_warns_that_defaulting_to_pandas.None_1.ErrorMessage_default_to_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_show_versions_test_warns_that_defaulting_to_pandas.None_1.ErrorMessage_default_to_p", "embedding": null, "metadata": {"file_path": "modin/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 276, "end_line": 292, "span_ids": ["test_show_versions", "test_warns_that_defaulting_to_pandas"], "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": "@pytest.mark.parametrize(\"as_json\", [True, False])\ndef test_show_versions(as_json, capsys):\n modin.utils.show_versions(as_json=as_json)\n versions = capsys.readouterr().out\n assert modin.__version__ in versions\n\n if as_json:\n versions = json.loads(versions)\n assert versions[\"modin dependencies\"][\"modin\"] == modin.__version__\n\n\ndef test_warns_that_defaulting_to_pandas():\n with warns_that_defaulting_to_pandas():\n ErrorMessage.default_to_pandas()\n\n with warns_that_defaulting_to_pandas():\n ErrorMessage.default_to_pandas(message=\"Function 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_modin-project__modin/modin/test/test_utils.py_test_assert_dtypes_equal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/test/test_utils.py_test_assert_dtypes_equal_", "embedding": null, "metadata": {"file_path": "modin/test/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 295, "end_line": 338, "span_ids": ["test_assert_dtypes_equal"], "tokens": 505}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_assert_dtypes_equal():\n \"\"\"Verify that `assert_dtypes_equal` from test utils works correctly (raises an error when it has to).\"\"\"\n from modin.pandas.test.utils import assert_dtypes_equal\n\n # Serieses with equal dtypes\n sr1, sr2 = pd.Series([1.0]), pandas.Series([1.0])\n assert sr1.dtype == sr2.dtype == \"float\"\n assert_dtypes_equal(sr1, sr2) # shouldn't raise an error since dtypes are equal\n\n # Serieses with different dtypes belonging to the same class\n sr1 = sr1.astype(\"int\")\n assert sr1.dtype != sr2.dtype and sr1.dtype == \"int\"\n assert_dtypes_equal(sr1, sr2) # shouldn't raise an error since both are numeric\n\n # Serieses with different dtypes not belonging to the same class\n sr2 = sr2.astype(\"str\")\n assert sr1.dtype != sr2.dtype and sr2.dtype == \"object\"\n with pytest.raises(AssertionError):\n assert_dtypes_equal(sr1, sr2)\n\n # Dfs with equal dtypes\n df1, df2 = create_test_dfs({\"a\": [1], \"b\": [1.0]})\n assert_dtypes_equal(df1, df2) # shouldn't raise an error since dtypes are equal\n\n # Dfs with different dtypes belonging to the same class\n df1 = df1.astype({\"a\": \"float\"})\n assert df1.dtypes[\"a\"] != df2.dtypes[\"a\"]\n assert_dtypes_equal(df1, df2) # shouldn't raise an error since both are numeric\n\n # Dfs with different dtypes\n df2 = df2.astype(\"str\")\n with pytest.raises(AssertionError):\n assert_dtypes_equal(sr1, sr2)\n\n # Dfs with categorical dtypes\n df1 = df1.astype(\"category\")\n df2 = df2.astype(\"category\")\n assert_dtypes_equal(df1, df2) # shouldn't raise an error since both are categorical\n\n # Dfs with different dtypes (categorical and str)\n df1 = df1.astype({\"a\": \"str\"})\n with pytest.raises(AssertionError):\n assert_dtypes_equal(df1, df2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_importlib__get_indent.return.min_indents_if_indents_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_importlib__get_indent.return.min_indents_if_indents_e", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 132, "span_ids": ["_get_indent", "SupportsPrivateToPandas", "SupportsPublicToNumPy", "SupportsPrivateToNumPy._to_numpy", "_make_api_url", "SupportsPublicToNumPy.to_numpy", "impl:7", "SupportsPrivateToPandas._to_pandas", "SupportsPrivateToNumPy", "docstring", "SupportsPublicToPandas", "SupportsPublicToPandas.to_pandas"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import importlib\nimport types\nfrom typing import Any, Callable, List, Mapping, Optional, Union, TypeVar\nimport re\nimport sys\nimport json\nimport codecs\n\nif sys.version_info < (3, 8):\n from typing_extensions import Protocol, runtime_checkable\nelse:\n from typing import Protocol, runtime_checkable\n\nfrom textwrap import dedent, indent\nfrom packaging import version\n\nimport pandas\nimport numpy as np\n\nfrom pandas.util._decorators import Appender # type: ignore\nfrom pandas.util._print_versions import _get_sys_info, _get_dependency_info # type: ignore[attr-defined]\nfrom pandas._typing import JSONSerializable\n\nfrom modin.config import Engine, StorageFormat, IsExperimental, ExperimentalNumPyAPI\nfrom modin._version import get_versions\n\nT = TypeVar(\"T\")\n\"\"\"Generic type parameter\"\"\"\n\nFn = TypeVar(\"Fn\", bound=Callable)\n\"\"\"Function type parameter (used in decorators that don't change a function's signature)\"\"\"\n\n\n@runtime_checkable\nclass SupportsPrivateToPandas(Protocol): # noqa: PR01\n \"\"\"Structural type for objects with a ``_to_pandas`` method (note the leading underscore).\"\"\"\n\n def _to_pandas(self) -> Any: # noqa: GL08\n # TODO add proper return type\n pass\n\n\n@runtime_checkable\nclass SupportsPublicToPandas(Protocol): # noqa: PR01\n \"\"\"Structural type for objects with a ``to_pandas`` method (without a leading underscore).\"\"\"\n\n def to_pandas(self) -> Any: # noqa: GL08\n pass\n\n\n@runtime_checkable\nclass SupportsPublicToNumPy(Protocol): # noqa: PR01\n \"\"\"Structural type for objects with a ``to_numpy`` method (without a leading underscore).\"\"\"\n\n def to_numpy(self) -> Any: # noqa: GL08\n pass\n\n\n@runtime_checkable\nclass SupportsPrivateToNumPy(Protocol): # noqa: PR01\n \"\"\"Structural type for objects with a ``_to_numpy`` method (note the leading underscore).\"\"\"\n\n def _to_numpy(self) -> Any: # noqa: GL08\n pass\n\n\nMIN_RAY_VERSION = version.parse(\"1.4.0\")\nMIN_DASK_VERSION = version.parse(\"2.22.0\")\nMIN_UNIDIST_VERSION = version.parse(\"0.2.1\")\n\nPANDAS_API_URL_TEMPLATE = f\"https://pandas.pydata.org/pandas-docs/version/{pandas.__version__}/reference/api/{{}}.html\"\n\nMODIN_UNNAMED_SERIES_LABEL = \"__reduced__\"\n\"\"\"\nThe '__reduced__' name is used internally by the query compiler as a column name to\nrepresent pandas Series objects that are not explicitly assigned a name, so as to\ndistinguish between an N-element series and 1xN dataframe.\n\"\"\"\n\n\ndef _make_api_url(token: str) -> str:\n \"\"\"\n Generate the link to pandas documentation.\n\n Parameters\n ----------\n token : str\n Part of URL to use for generation.\n\n Returns\n -------\n str\n URL to pandas doc.\n\n Notes\n -----\n This function is extracted for better testability.\n \"\"\"\n return PANDAS_API_URL_TEMPLATE.format(token)\n\n\ndef _get_indent(doc: str) -> int:\n \"\"\"\n Compute indentation in docstring.\n\n Parameters\n ----------\n doc : str\n The docstring to compute indentation for.\n\n Returns\n -------\n int\n Minimal indent (excluding empty lines).\n \"\"\"\n indents = _get_indents(doc)\n return min(indents) if indents else 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_modin-project__modin/modin/utils.py__get_indents__get_indents.return.indents": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__get_indents__get_indents.return.indents", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 162, "span_ids": ["_get_indents"], "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 _get_indents(source: Union[list, str]) -> list:\n \"\"\"\n Compute indentation for each line of the source string.\n\n Parameters\n ----------\n source : str or list of str\n String to compute indents for. Passed list considered\n as a list of lines of the source string.\n\n Returns\n -------\n list of ints\n List containing computed indents for each line.\n \"\"\"\n indents = []\n\n if not isinstance(source, list):\n source = source.splitlines()\n\n for line in source:\n if not line.strip():\n continue\n for pos, ch in enumerate(line):\n if ch != \" \":\n break\n indents.append(pos)\n return indents", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_format_string_format_string.return.template_format_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_format_string_format_string.return.template_format_kwargs_", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 225, "span_ids": ["format_string"], "tokens": 499}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_string(template: str, **kwargs: str) -> str:\n \"\"\"\n Insert passed values at the corresponding placeholders of the specified template.\n\n In contrast with the regular ``str.format()`` this function computes proper\n indents for the placeholder values.\n\n Parameters\n ----------\n template : str\n Template to substitute values in.\n **kwargs : dict\n Dictionary that maps placeholder names with values.\n\n Returns\n -------\n str\n Formated string.\n \"\"\"\n # We want to change indentation only for those values which placeholders are located\n # at the start of the line, in that case the placeholder sets an indentation\n # that the filling value has to obey.\n # RegExp determining placeholders located at the beginning of the line.\n regex = r\"^( *)\\{(\\w+)\\}\"\n for line in template.splitlines():\n if line.strip() == \"\":\n continue\n match = re.search(regex, line)\n if match is None:\n continue\n nspaces = len(match.group(1))\n key = match.group(2)\n\n value = kwargs.get(key)\n if not value:\n continue\n value = dedent(value)\n\n # Since placeholder is located at the beginning of a new line,\n # it already has '\\n' before it, so to avoid double new lines\n # we want to discard the first leading '\\n' at the value line,\n # the others leading '\\n' are considered as being put on purpose\n if value[0] == \"\\n\":\n value = value[1:]\n # `.splitlines()` doesn't preserve last empty line,\n # so we have to restore it further\n value_lines = value.splitlines()\n # We're not indenting the first line of the value, since it's already indented\n # properly because of the placeholder indentation.\n indented_lines = [\n indent(line, \" \" * nspaces) if line != \"\\n\" else line\n for line in value_lines[1:]\n ]\n # If necessary, restoring the last line dropped by `.splitlines()`\n if value[-1] == \"\\n\":\n indented_lines += [\" \" * nspaces]\n\n indented_value = \"\\n\".join([value_lines[0], *indented_lines])\n kwargs[key] = indented_value\n\n return template.format(**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_modin-project__modin/modin/utils.py_align_indents_append_to_docstring.return.decorator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_align_indents_append_to_docstring.return.decorator", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 267, "span_ids": ["append_to_docstring", "align_indents"], "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 align_indents(source: str, target: str) -> str:\n \"\"\"\n Align indents of two strings.\n\n Parameters\n ----------\n source : str\n Source string to align indents with.\n target : str\n Target string to align indents.\n\n Returns\n -------\n str\n Target string with indents aligned with the source.\n \"\"\"\n source_indent = _get_indent(source)\n target = dedent(target)\n return indent(target, \" \" * source_indent)\n\n\ndef append_to_docstring(message: str) -> Callable[[Fn], Fn]:\n \"\"\"\n Create a decorator which appends passed message to the function's docstring.\n\n Parameters\n ----------\n message : str\n Message to append.\n\n Returns\n -------\n callable\n \"\"\"\n\n def decorator(func: Fn) -> Fn:\n to_append = align_indents(func.__doc__ or \"\", message)\n return Appender(to_append)(func)\n\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__replace_doc__replace_doc.if_parent_cls_and_isinsta.else_.target_obj.__doc__.doc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__replace_doc__replace_doc.if_parent_cls_and_isinsta.else_.target_obj.__doc__.doc", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 270, "end_line": 360, "span_ids": ["_replace_doc"], "tokens": 823}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _replace_doc(\n source_obj: object,\n target_obj: object,\n overwrite: bool,\n apilink: Optional[Union[str, List[str]]],\n parent_cls: Optional[Fn] = None,\n attr_name: Optional[str] = None,\n) -> None:\n \"\"\"\n Replace docstring in `target_obj`, possibly taking from `source_obj` and augmenting.\n\n Can append the link to pandas API online documentation.\n\n Parameters\n ----------\n source_obj : object\n Any object from which to take docstring from.\n target_obj : object\n The object which docstring to replace.\n overwrite : bool\n Forces replacing the docstring with the one from `source_obj` even\n if `target_obj` has its own non-empty docstring.\n apilink : str | List[str], optional\n If non-empty, insert the link(s) to pandas API documentation.\n Should be the prefix part in the URL template, e.g. \"pandas.DataFrame\".\n parent_cls : class, optional\n If `target_obj` is an attribute of a class, `parent_cls` should be that class.\n This is used for generating the API URL as well as for handling special cases\n like `target_obj` being a property.\n attr_name : str, optional\n Gives the name to `target_obj` if it's an attribute of `parent_cls`.\n Needed to handle some special cases and in most cases could be determined automatically.\n \"\"\"\n if isinstance(target_obj, (staticmethod, classmethod)):\n # we cannot replace docs on decorated objects, we must replace them\n # on original functions instead\n target_obj = target_obj.__func__\n\n source_doc = source_obj.__doc__ or \"\"\n target_doc = target_obj.__doc__ or \"\"\n overwrite = overwrite or not target_doc\n doc = source_doc if overwrite else target_doc\n\n if parent_cls and not attr_name:\n if isinstance(target_obj, property):\n attr_name = target_obj.fget.__name__ # type: ignore[union-attr]\n elif isinstance(target_obj, (staticmethod, classmethod)):\n attr_name = target_obj.__func__.__name__\n else:\n attr_name = target_obj.__name__ # type: ignore[attr-defined]\n\n if (\n source_doc.strip()\n and apilink\n and \"pandas API documentation for \" not in target_doc\n and (not (attr_name or \"\").startswith(\"_\"))\n ):\n apilink_l = [apilink] if not isinstance(apilink, list) and apilink else apilink\n links = []\n for link in apilink_l:\n if attr_name:\n token = f\"{link}.{attr_name}\"\n else:\n token = link\n url = _make_api_url(token)\n links.append(f\"`{token} <{url}>`_\")\n\n indent_line = \" \" * _get_indent(doc)\n notes_section = f\"\\n{indent_line}Notes\\n{indent_line}-----\\n\"\n\n url_line = f\"{indent_line}See pandas API documentation for {', '.join(links)} for more.\\n\"\n notes_section_with_url = notes_section + url_line\n\n if notes_section in doc:\n doc = doc.replace(notes_section, notes_section_with_url)\n else:\n doc += notes_section_with_url\n\n if parent_cls and isinstance(target_obj, property):\n if overwrite:\n target_obj.fget.__doc_inherited__ = True # type: ignore[union-attr]\n assert attr_name is not None\n setattr(\n parent_cls,\n attr_name,\n property(target_obj.fget, target_obj.fset, target_obj.fdel, doc),\n )\n else:\n if overwrite:\n target_obj.__doc_inherited__ = True # type: ignore[attr-defined]\n target_obj.__doc__ = doc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__inherit_docstrings__inherit_docstrings._documentable_obj.return.bool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__inherit_docstrings__inherit_docstrings._documentable_obj.return.bool_", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 363, "end_line": 408, "span_ids": ["_inherit_docstrings"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _inherit_docstrings(\n parent: object,\n excluded: List[object] = [],\n overwrite_existing: bool = False,\n apilink: Optional[Union[str, List[str]]] = None,\n) -> Callable[[Fn], Fn]:\n \"\"\"\n Create a decorator which overwrites decorated object docstring(s).\n\n It takes `parent` __doc__ attribute. Also overwrites __doc__ of\n methods and properties defined in the target or its ancestors if it's a class\n with the __doc__ of matching methods and properties from the `parent`.\n\n Parameters\n ----------\n parent : object\n Parent object from which the decorated object inherits __doc__.\n excluded : list, default: []\n List of parent objects from which the class does not\n inherit docstrings.\n overwrite_existing : bool, default: False\n Allow overwriting docstrings that already exist in\n the decorated class.\n apilink : str | List[str], optional\n If non-empty, insert the link(s) to pandas API documentation.\n Should be the prefix part in the URL template, e.g. \"pandas.DataFrame\".\n\n Returns\n -------\n callable\n Decorator which replaces the decorated object's documentation with `parent` documentation.\n\n Notes\n -----\n Keep in mind that the function will override docstrings even for attributes which\n are not defined in target class (but are defined in the ancestor class),\n which means that ancestor class attribute docstrings could also change.\n \"\"\"\n\n def _documentable_obj(obj: object) -> bool:\n \"\"\"Check if `obj` docstring could be patched.\"\"\"\n return bool(\n callable(obj)\n or (isinstance(obj, property) and obj.fget)\n or (isinstance(obj, (staticmethod, classmethod)) and obj.__func__)\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_modin-project__modin/modin/utils.py__inherit_docstrings.decorator__inherit_docstrings.return.decorator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__inherit_docstrings.decorator__inherit_docstrings.return.decorator", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 410, "end_line": 442, "span_ids": ["_inherit_docstrings"], "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 _inherit_docstrings(\n parent: object,\n excluded: List[object] = [],\n overwrite_existing: bool = False,\n apilink: Optional[Union[str, List[str]]] = None,\n) -> Callable[[Fn], Fn]:\n # ... other code\n\n def decorator(cls_or_func: Fn) -> Fn:\n if parent not in excluded:\n _replace_doc(parent, cls_or_func, overwrite_existing, apilink)\n\n if not isinstance(cls_or_func, types.FunctionType):\n seen = set()\n for base in cls_or_func.__mro__: # type: ignore[attr-defined]\n if base is object:\n continue\n for attr, obj in base.__dict__.items():\n if attr in seen:\n continue\n seen.add(attr)\n parent_obj = getattr(parent, attr, None)\n if (\n parent_obj in excluded\n or not _documentable_obj(parent_obj)\n or not _documentable_obj(obj)\n ):\n continue\n\n _replace_doc(\n parent_obj,\n obj,\n overwrite_existing,\n apilink,\n parent_cls=cls_or_func,\n attr_name=attr,\n )\n\n return cls_or_func\n\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__TODO_add_proper_type_an_to_numpy.return.array": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__TODO_add_proper_type_an_to_numpy.return.array", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 445, "end_line": 484, "span_ids": ["_inherit_docstrings", "to_pandas", "to_numpy"], "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": "# TODO add proper type annotation\ndef to_pandas(modin_obj: SupportsPrivateToPandas) -> Any:\n \"\"\"\n Convert a Modin DataFrame/Series to a pandas DataFrame/Series.\n\n Parameters\n ----------\n modin_obj : modin.DataFrame, modin.Series\n The Modin DataFrame/Series to convert.\n\n Returns\n -------\n pandas.DataFrame or pandas.Series\n Converted object with type depending on input.\n \"\"\"\n return modin_obj._to_pandas()\n\n\ndef to_numpy(\n modin_obj: Union[SupportsPrivateToNumPy, SupportsPublicToNumPy]\n) -> np.ndarray:\n \"\"\"\n Convert a Modin object to a NumPy array.\n\n Parameters\n ----------\n modin_obj : modin.DataFrame, modin.Series, modin.numpy.array\n The Modin distributed object to convert.\n\n Returns\n -------\n numpy.array\n Converted object with type depending on input.\n \"\"\"\n if isinstance(modin_obj, SupportsPrivateToNumPy):\n return modin_obj._to_numpy()\n array = modin_obj.to_numpy()\n if ExperimentalNumPyAPI.get():\n array = array._to_numpy()\n return array", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_hashable_hashable.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_hashable_hashable.return.True", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 487, "end_line": 509, "span_ids": ["hashable"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def hashable(obj: bool) -> bool:\n \"\"\"\n Return whether the `obj` is hashable.\n\n Parameters\n ----------\n obj : object\n The object to check.\n\n Returns\n -------\n bool\n \"\"\"\n # Happy path: if there's no __hash__ method, the object definitely isn't hashable\n if not hasattr(obj, \"__hash__\"):\n return False\n # Otherwise, we may still need to check for type errors, as in the case of `hash(([],))`.\n # (e.g. an unhashable object inside a tuple)\n try:\n hash(obj)\n except TypeError:\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_modin-project__modin/modin/utils.py_try_cast_to_pandas_try_cast_to_pandas.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_try_cast_to_pandas_try_cast_to_pandas.return.obj", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 512, "end_line": 559, "span_ids": ["try_cast_to_pandas"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_cast_to_pandas(obj: Any, squeeze: bool = False) -> Any:\n \"\"\"\n Convert `obj` and all nested objects from Modin to pandas if it is possible.\n\n If no convertion possible return `obj`.\n\n Parameters\n ----------\n obj : object\n Object to convert from Modin to pandas.\n squeeze : bool, default: False\n Squeeze the converted object(s) before returning them.\n\n Returns\n -------\n object\n Converted object.\n \"\"\"\n if isinstance(obj, SupportsPrivateToPandas):\n result = obj._to_pandas()\n if squeeze:\n result = result.squeeze(axis=1)\n return result\n if isinstance(obj, SupportsPublicToPandas):\n result = obj.to_pandas()\n if squeeze:\n result = result.squeeze(axis=1)\n # Query compiler case, it doesn't have logic about convertion to Series\n if (\n isinstance(getattr(result, \"name\", None), str)\n and result.name == MODIN_UNNAMED_SERIES_LABEL\n ):\n result.name = None\n return result\n if isinstance(obj, (list, tuple)):\n return type(obj)([try_cast_to_pandas(o, squeeze=squeeze) for o in obj])\n if isinstance(obj, dict):\n return {k: try_cast_to_pandas(v, squeeze=squeeze) for k, v in obj.items()}\n if callable(obj):\n module_hierarchy = getattr(obj, \"__module__\", \"\").split(\".\")\n fn_name = getattr(obj, \"__name__\", None)\n if fn_name and module_hierarchy[0] == \"modin\":\n return (\n getattr(pandas.DataFrame, fn_name, obj)\n if module_hierarchy[-1] == \"dataframe\"\n else getattr(pandas.Series, fn_name, obj)\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_modin-project__modin/modin/utils.py_wrap_into_list_wrap_into_list.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_wrap_into_list_wrap_into_list.return.res", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 562, "end_line": 593, "span_ids": ["wrap_into_list"], "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 wrap_into_list(*args: Any, skipna: bool = True) -> List[Any]:\n \"\"\"\n Wrap a sequence of passed values in a flattened list.\n\n If some value is a list by itself the function appends its values\n to the result one by one instead inserting the whole list object.\n\n Parameters\n ----------\n *args : tuple\n Objects to wrap into a list.\n skipna : bool, default: True\n Whether or not to skip nan or None values.\n\n Returns\n -------\n list\n Passed values wrapped in a list.\n \"\"\"\n\n def isnan(o: Any) -> bool:\n return o is None or (isinstance(o, float) and np.isnan(o))\n\n res = []\n for o in args:\n if skipna and isnan(o):\n continue\n if isinstance(o, list):\n res.extend(o)\n else:\n res.append(o)\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_modin-project__modin/modin/utils.py_wrap_udf_function_wrap_udf_function.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_wrap_udf_function_wrap_udf_function.return.wrapper", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 596, "end_line": 617, "span_ids": ["wrap_udf_function"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def wrap_udf_function(func: Callable) -> Callable:\n \"\"\"\n Create a decorator that makes `func` return pandas objects instead of Modin.\n\n Parameters\n ----------\n func : callable\n Function to wrap.\n\n Returns\n -------\n callable\n \"\"\"\n\n def wrapper(*args: Any, **kwargs: Any) -> Any:\n result = func(*args, **kwargs)\n # if user accidently returns modin DataFrame or Series\n # casting it back to pandas to properly process\n return try_cast_to_pandas(result)\n\n wrapper.__name__ = func.__name__\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_get_current_execution_instancer.return._class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_get_current_execution_instancer.return._class_", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 620, "end_line": 648, "span_ids": ["get_current_execution", "instancer"], "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 get_current_execution() -> str:\n \"\"\"\n Return current execution name as a string.\n\n Returns\n -------\n str\n Returns On-like string.\n \"\"\"\n return f\"{'Experimental' if IsExperimental.get() else ''}{StorageFormat.get()}On{Engine.get()}\"\n\n\ndef instancer(_class: Callable[[], T]) -> T:\n \"\"\"\n Create a dummy instance each time this is imported.\n\n This serves the purpose of allowing us to use all of pandas plotting methods\n without aliasing and writing each of them ourselves.\n\n Parameters\n ----------\n _class : object\n\n Returns\n -------\n object\n Instance of `_class`.\n \"\"\"\n return _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_modin-project__modin/modin/utils.py_import_optional_dependency_import_optional_dependency.try_.except_ImportError_.raise_ImportError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py_import_optional_dependency_import_optional_dependency.try_.except_ImportError_.raise_ImportError_", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 651, "end_line": 673, "span_ids": ["import_optional_dependency"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def import_optional_dependency(name: str, message: str) -> types.ModuleType:\n \"\"\"\n Import an optional dependecy.\n\n Parameters\n ----------\n name : str\n The module name.\n message : str\n Additional text to include in the ImportError message.\n\n Returns\n -------\n module : ModuleType\n The imported module.\n \"\"\"\n try:\n return importlib.import_module(name)\n except ImportError:\n raise ImportError(\n f\"Missing optional dependency '{name}'. {message} \"\n + f\"Use pip or conda to install {name}.\"\n ) from None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__get_modin_deps_info__get_modin_deps_info.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__get_modin_deps_info__get_modin_deps_info.return.result", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 676, "end_line": 716, "span_ids": ["_get_modin_deps_info"], "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": "def _get_modin_deps_info() -> Mapping[str, Optional[JSONSerializable]]:\n \"\"\"\n Return Modin-specific dependencies information as a JSON serializable dictionary.\n\n Returns\n -------\n Mapping[str, Optional[pandas.JSONSerializable]]\n The dictionary of Modin dependencies and their versions.\n \"\"\"\n import modin # delayed import so modin.__init__ is fully initialized\n\n result = {\"modin\": modin.__version__}\n\n for pkg_name, pkg_version in [\n (\"ray\", MIN_RAY_VERSION),\n (\"dask\", MIN_DASK_VERSION),\n (\"distributed\", MIN_DASK_VERSION),\n ]:\n try:\n pkg = importlib.import_module(pkg_name)\n except ImportError:\n result[pkg_name] = None\n else:\n result[pkg_name] = pkg.__version__ + (\n f\" (outdated; >={pkg_version} required)\"\n if version.parse(pkg.__version__) < pkg_version\n else \"\"\n )\n\n try:\n # We import ``DbWorker`` from this module since correct import of ``DbWorker`` itself\n # from HDK is located in it with all the necessary options for dlopen.\n from modin.experimental.core.execution.native.implementations.hdk_on_native.db_worker import ( # noqa\n DbWorker,\n )\n\n result[\"hdk\"] = \"present\"\n except ImportError:\n result[\"hdk\"] = None\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_modin-project__modin/modin/utils.py__Disable_flake8_checks_f_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/utils.py__Disable_flake8_checks_f_", "embedding": null, "metadata": {"file_path": "modin/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 719, "end_line": 781, "span_ids": ["_get_modin_deps_info", "ModinAssumptionError", "show_versions"], "tokens": 534}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Disable flake8 checks for print() in this file\n# flake8: noqa: T001\ndef show_versions(as_json: Union[str, bool] = False) -> None:\n \"\"\"\n Provide useful information, important for bug reports.\n\n It comprises info about hosting operation system, pandas version,\n and versions of other installed relative packages.\n\n Parameters\n ----------\n as_json : str or bool, default: False\n * If False, outputs info in a human readable form to the console.\n * If str, it will be considered as a path to a file.\n Info will be written to that file in JSON format.\n * If True, outputs info in JSON format to the console.\n\n Notes\n -----\n This is mostly a copy of pandas.show_versions() but adds separate listing\n of Modin-specific dependencies.\n \"\"\"\n sys_info = _get_sys_info()\n sys_info[\"commit\"] = get_versions()[\"full-revisionid\"]\n modin_deps = _get_modin_deps_info()\n deps = _get_dependency_info()\n\n if as_json:\n j = {\n \"system\": sys_info,\n \"modin dependencies\": modin_deps,\n \"dependencies\": deps,\n }\n\n if as_json is True:\n sys.stdout.writelines(json.dumps(j, indent=2))\n else:\n assert isinstance(as_json, str) # needed for mypy\n with codecs.open(as_json, \"wb\", encoding=\"utf8\") as f:\n json.dump(j, f, indent=2)\n\n else:\n assert isinstance(sys_info[\"LOCALE\"], dict) # needed for mypy\n language_code = sys_info[\"LOCALE\"][\"language-code\"]\n encoding = sys_info[\"LOCALE\"][\"encoding\"]\n sys_info[\"LOCALE\"] = f\"{language_code}.{encoding}\"\n\n maxlen = max(max(len(x) for x in d) for d in (deps, modin_deps))\n print(\"\\nINSTALLED VERSIONS\")\n print(\"------------------\")\n for k, v in sys_info.items():\n print(f\"{k:<{maxlen}}: {v}\")\n for name, d in ((\"Modin\", modin_deps), (\"pandas\", deps)):\n print(f\"\\n{name} dependencies\\n{'-' * (len(name) + 13)}\")\n for k, v in d.items():\n print(f\"{k:<{maxlen}}: {v}\")\n\n\nclass ModinAssumptionError(Exception):\n \"\"\"An exception that allows us defaults to pandas if any assumption fails.\"\"\"\n\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/__init__.py__", "embedding": null, "metadata": {"file_path": "scripts/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/scripts/doc_checker.py_argparse_MODIN_ERROR_CODES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_argparse_MODIN_ERROR_CODES._", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 70, "span_ids": ["impl:18", "docstring"], "tokens": 470}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport pathlib\nimport subprocess\nimport os\nimport re\nimport ast\nfrom typing import List\nimport sys\nimport inspect\nimport shutil\nimport logging\nimport functools\nfrom numpydoc.validate import Docstring\nfrom numpydoc.docscrape import NumpyDocString\n\nimport types\n\n# fake cuDF-related modules if they're missing\nfor mod_name in (\"cudf\", \"cupy\"):\n try:\n __import__(mod_name)\n except ImportError:\n sys.modules[mod_name] = types.ModuleType(\n mod_name, f\"fake {mod_name} for checking docstrings\"\n )\nif not hasattr(sys.modules[\"cudf\"], \"DataFrame\"):\n sys.modules[\"cudf\"].DataFrame = type(\"DataFrame\", (object,), {})\nif not hasattr(sys.modules[\"cupy\"], \"ndarray\"):\n sys.modules[\"cupy\"].ndarray = type(\"ndarray\", (object,), {})\n\nlogging.basicConfig(\n stream=sys.stdout, format=\"%(levelname)s:%(message)s\", level=logging.INFO\n)\n\nMODIN_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\"))\nsys.path.insert(0, MODIN_PATH)\n\n# error codes that pandas test in CI\n# https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks\nNUMPYDOC_BASE_ERROR_CODES = {\n *(\"GL01\", \"GL02\", \"GL03\", \"GL05\", \"GL06\", \"GL07\", \"GL08\", \"GL09\", \"GL10\"),\n *(\"SS02\", \"SS03\", \"SS04\", \"SS05\", \"PR01\", \"PR02\", \"PR03\", \"PR04\", \"PR05\"),\n *(\"PR08\", \"PR09\", \"PR10\", \"RT01\", \"RT04\", \"RT05\", \"SA02\", \"SA03\"),\n}\n\nMODIN_ERROR_CODES = {\n \"MD01\": \"'{parameter}' description should be '[type], default: [value]', found: '{found}'\",\n \"MD02\": \"Spelling error in line: {line}, found: '{word}', reference: '{reference}'\",\n \"MD03\": \"Section contents is over-indented (in section '{section}')\",\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_optional_args_get_optional_args.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_optional_args_get_optional_args.return._", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 95, "span_ids": ["get_optional_args"], "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 get_optional_args(doc: Docstring) -> dict:\n \"\"\"\n Get optional parameters for the object for which the docstring is checked.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n Docstring handler.\n\n Returns\n -------\n dict\n Dict with default argument names and its values.\n \"\"\"\n obj = doc.obj\n if not callable(obj) or inspect.isclass(obj):\n return {}\n signature = inspect.signature(obj)\n return {\n k: v.default\n for k, v in signature.parameters.items()\n if v.default is not inspect.Parameter.empty\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_optional_args_check_optional_args.return.errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_optional_args_check_optional_args.return.errors", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 136, "span_ids": ["check_optional_args"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_optional_args(doc: Docstring) -> list:\n \"\"\"\n Check type description of optional arguments.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n\n Returns\n -------\n list\n List of tuples with Modin error code and its description.\n \"\"\"\n if not doc.doc_parameters:\n return []\n optional_args = get_optional_args(doc)\n if not optional_args:\n return []\n\n errors = []\n for parameter in optional_args:\n # case when not all parameters are listed in \"Parameters\" section;\n # it's handled by numpydoc itself\n if parameter not in doc.doc_parameters:\n continue\n type_line = doc.doc_parameters[parameter][0]\n has_default = \"default: \" in type_line\n has_optional = \"optional\" in type_line\n if not (has_default ^ has_optional):\n errors.append(\n (\n \"MD01\",\n MODIN_ERROR_CODES[\"MD01\"].format(\n parameter=parameter,\n found=type_line,\n ),\n )\n )\n return errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_spelling_words_check_spelling_words.return.errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_spelling_words_check_spelling_words.return.errors", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 207, "span_ids": ["check_spelling_words"], "tokens": 539}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_spelling_words(doc: Docstring) -> list:\n \"\"\"\n Check spelling of chosen words in doc.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n Docstring handler.\n\n Returns\n -------\n list\n List of tuples with Modin error code and its description.\n\n Notes\n -----\n Any special words enclosed in apostrophes(\") are treated as python string\n constants and are not checked for spelling.\n \"\"\"\n if not doc.raw_doc:\n return []\n components = set(\n [\"Modin\", \"pandas\", \"NumPy\", \"Ray\", \"Dask\"]\n + [\"PyArrow\", \"HDK\", \"XGBoost\", \"Plasma\"]\n )\n check_words = \"|\".join(x.lower() for x in components)\n\n # comments work only with re.VERBOSE\n pattern = r\"\"\"\n (?: # non-capturing group\n [^-\\\\\\w\\/] # any symbol except: '-', '\\', '/' and any from [a-zA-Z0-9_]\n | ^ # or line start\n )\n ({check_words}) # words to check, example - \"modin|pandas|numpy\"\n (?: # non-capturing group\n [^-\"\\.\\/\\w\\\\] # any symbol except: '-', '\"', '.', '\\', '/' and any from [a-zA-Z0-9_]\n | \\.\\s # or '.' and any whitespace\n | \\.$ # or '.' and line end\n | $ # or line end\n )\n \"\"\".format(\n check_words=check_words\n )\n results = [\n set(re.findall(pattern, line, re.I | re.VERBOSE)) - components\n for line in doc.raw_doc.splitlines()\n ]\n\n docstring_start_line = None\n for idx, line in enumerate(inspect.getsourcelines(doc.code_obj)[0]):\n if '\"\"\"' in line or \"'''\" in line:\n docstring_start_line = doc.source_file_def_line + idx\n break\n\n errors = []\n for line_idx, words_in_line in enumerate(results):\n for word in words_in_line:\n reference = [x for x in components if x.lower() == word.lower()][0]\n errors.append(\n (\n \"MD02\",\n MODIN_ERROR_CODES[\"MD02\"].format(\n line=docstring_start_line + line_idx,\n word=word,\n reference=reference,\n ),\n )\n )\n return errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_docstring_indention_check_docstring_indention.return.errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_docstring_indention_check_docstring_indention.return.errors", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 237, "span_ids": ["check_docstring_indention"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_docstring_indention(doc: Docstring) -> list:\n \"\"\"\n Check indention of docstring since numpydoc reports weird results.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n Docstring handler.\n\n Returns\n -------\n list\n List of tuples with Modin error code and its description.\n \"\"\"\n from modin.utils import _get_indent\n\n numpy_docstring = NumpyDocString(doc.clean_doc)\n numpy_docstring._doc.reset()\n numpy_docstring._parse_summary()\n sections = list(numpy_docstring._read_sections())\n errors = []\n for section in sections:\n description = \"\\n\".join(section[1])\n if _get_indent(description) != 0:\n errors.append(\n (\"MD03\", MODIN_ERROR_CODES[\"MD03\"].format(section=section[0]))\n )\n return errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_validate_modin_error_validate_modin_error.return.results": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_validate_modin_error_validate_modin_error.return.results", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 240, "end_line": 260, "span_ids": ["validate_modin_error"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def validate_modin_error(doc: Docstring, results: dict) -> list:\n \"\"\"\n Validate custom Modin errors.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n Docstring handler.\n results : dict\n Dictionary that numpydoc.validate.validate return.\n\n Returns\n -------\n dict\n Updated dict with Modin custom errors.\n \"\"\"\n errors = check_optional_args(doc)\n errors += check_spelling_words(doc)\n errors += check_docstring_indention(doc)\n results[\"errors\"].extend(errors)\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_modin-project__modin/scripts/doc_checker.py_skip_check_if_noqa_skip_check_if_noqa.return.err_code_in_noqa_checks": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_skip_check_if_noqa_skip_check_if_noqa.return.err_code_in_noqa_checks", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 291, "span_ids": ["skip_check_if_noqa"], "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": "def skip_check_if_noqa(doc: Docstring, err_code: str, noqa_checks: list) -> bool:\n \"\"\"\n Skip the check that matches `err_code` if `err_code` found in noqa string.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n Docstring handler.\n err_code : str\n Error code found by numpydoc.\n noqa_checks : list\n Found noqa checks.\n\n Returns\n -------\n bool\n Return True if 'noqa' found.\n \"\"\"\n if noqa_checks == [\"all\"]:\n return True\n\n # GL08 - missing docstring in an arbitary object; numpydoc code\n if err_code == \"GL08\":\n name = doc.name.split(\".\")[-1]\n # Numpydoc recommends to add docstrings of __init__ method in class docstring.\n # So there is no error if docstring is missing in __init__\n if name == \"__init__\":\n return True\n return err_code in noqa_checks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_noqa_checks_get_noqa_checks.return._check_strip_for_check_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_noqa_checks_get_noqa_checks.return._check_strip_for_check_", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 294, "end_line": 340, "span_ids": ["get_noqa_checks"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_noqa_checks(doc: Docstring) -> list:\n \"\"\"\n Get codes after `# noqa`.\n\n Parameters\n ----------\n doc : numpydoc.validate.Docstring\n Docstring handler.\n\n Returns\n -------\n list\n List with codes.\n\n Notes\n -----\n If noqa doesn't have any codes - returns [\"all\"].\n \"\"\"\n source = doc.method_source\n if not source:\n return []\n\n noqa_str = \"\"\n if not inspect.ismodule(doc.obj):\n # find last line of obj definition\n for line in source.split(\"\\n\"):\n if \")\" in line and \":\" in line.split(\")\", 1)[1]:\n noqa_str = line\n break\n else:\n # noqa string is defined as the first line before the docstring\n if not doc.raw_doc:\n # noqa string is meaningless if there is no docstring in module\n return []\n lines = source.split(\"\\n\")\n for idx, line in enumerate(lines):\n if '\"\"\"' in line or \"'''\" in line:\n noqa_str = lines[idx - 1]\n break\n\n if \"# noqa:\" in noqa_str:\n noqa_checks = noqa_str.split(\"# noqa:\", 1)[1].split(\",\")\n elif \"# noqa\" in noqa_str:\n noqa_checks = [\"all\"]\n else:\n noqa_checks = []\n return [check.strip() for check in noqa_checks]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py__code_snippet_from_numpy_validate_object.return.errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py__code_snippet_from_numpy_validate_object.return.errors", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 343, "end_line": 380, "span_ids": ["validate_object", "get_noqa_checks"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# code snippet from numpydoc\ndef validate_object(import_path: str) -> list:\n \"\"\"\n Check docstrings of an entity that can be imported.\n\n Parameters\n ----------\n import_path : str\n Python-like import path.\n\n Returns\n -------\n errors : list\n List with string representations of errors.\n \"\"\"\n from numpydoc.validate import validate\n\n errors = []\n doc = Docstring(import_path)\n if getattr(doc.obj, \"__doc_inherited__\", False) or (\n isinstance(doc.obj, property)\n and getattr(doc.obj.fget, \"__doc_inherited__\", False)\n ):\n # do not check inherited docstrings\n return errors\n results = validate(import_path)\n results = validate_modin_error(doc, results)\n noqa_checks = get_noqa_checks(doc)\n for err_code, err_desc in results[\"errors\"]:\n if (\n err_code not in NUMPYDOC_BASE_ERROR_CODES\n and err_code not in MODIN_ERROR_CODES\n ) or skip_check_if_noqa(doc, err_code, noqa_checks):\n continue\n errors.append(\n \":\".join([import_path, str(results[\"file_line\"]), err_code, err_desc])\n )\n return errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_numpydoc_validate_numpydoc_validate.return.is_successfull": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_numpydoc_validate_numpydoc_validate.return.is_successfull", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 450, "span_ids": ["numpydoc_validate"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def numpydoc_validate(path: pathlib.Path) -> bool:\n \"\"\"\n Perform numpydoc checks.\n\n Parameters\n ----------\n path : pathlib.Path\n Filename or directory path for check.\n\n Returns\n -------\n is_successfull : bool\n Return True if all checks are successful.\n \"\"\"\n is_successfull = True\n\n if path.is_file():\n walker = ((str(path.parent), [], [path.name]),)\n else:\n walker = os.walk(path)\n\n for root, _, files in walker:\n if \"__pycache__\" in root:\n continue\n for _file in files:\n if not _file.endswith(\".py\"):\n continue\n\n current_path = os.path.join(root, _file)\n # get importable name\n module_name = current_path.replace(\"/\", \".\").replace(\"\\\\\", \".\")\n # remove \".py\"\n module_name = os.path.splitext(module_name)[0]\n\n with open(current_path) as fd:\n file_contents = fd.read()\n\n # using static parsing for collecting module, functions, classes and their methods\n module = ast.parse(file_contents)\n\n def is_public_func(node):\n return isinstance(node, ast.FunctionDef) and (\n not node.name.startswith(\"__\") or node.name.endswith(\"__\")\n )\n\n functions = [node for node in module.body if is_public_func(node)]\n classes = [node for node in module.body if isinstance(node, ast.ClassDef)]\n methods = [\n f\"{module_name}.{_class.name}.{node.name}\"\n for _class in classes\n for node in _class.body\n if is_public_func(node)\n ]\n\n # numpydoc docstrings validation\n # docstrings are taken dynamically\n to_validate = (\n [module_name]\n + [f\"{module_name}.{x.name}\" for x in (functions + classes)]\n + methods\n )\n results = list(map(validate_object, to_validate))\n is_successfull_file = not any(results)\n if not is_successfull_file:\n logging.info(f\"NUMPYDOC OUTPUT FOR {current_path}\")\n [logging.error(error) for errors in results for error in errors]\n is_successfull &= is_successfull_file\n return is_successfull", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_pydocstyle_validate_pydocstyle_validate.return.True_if_result_returncode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_pydocstyle_validate_pydocstyle_validate.return.True_if_result_returncode", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 453, "end_line": 495, "span_ids": ["pydocstyle_validate"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pydocstyle_validate(\n path: pathlib.Path, add_ignore: List[str], use_numpydoc: bool\n) -> int:\n \"\"\"\n Perform pydocstyle checks.\n\n Parameters\n ----------\n path : pathlib.Path\n Filename or directory path for check.\n add_ignore : List[int]\n `pydocstyle` error codes which are not verified.\n use_numpydoc : bool\n Disable duplicate `pydocstyle` checks if `numpydoc` is in use.\n\n Returns\n -------\n bool\n Return True if all pydocstyle checks are successful.\n \"\"\"\n pydocstyle = \"pydocstyle\"\n if not shutil.which(pydocstyle):\n raise ValueError(f\"{pydocstyle} not found in PATH\")\n # These check can be done with numpydoc tool, so disable them for pydocstyle.\n if use_numpydoc:\n add_ignore.extend([\"D100\", \"D101\", \"D102\", \"D103\", \"D104\", \"D105\"])\n result = subprocess.run(\n [\n pydocstyle,\n \"--convention\",\n \"numpy\",\n \"--add-ignore\",\n \",\".join(add_ignore),\n str(path),\n ],\n text=True,\n capture_output=True,\n )\n if result.returncode:\n logging.info(f\"PYDOCSTYLE OUTPUT FOR {path}\")\n logging.error(result.stdout)\n logging.error(result.stderr)\n return True if result.returncode == 0 else 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_modin-project__modin/scripts/doc_checker.py_monkeypatching_monkeypatching.sys.setdlopenflags.Mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_monkeypatching_monkeypatching.sys.setdlopenflags.Mock_", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 498, "end_line": 534, "span_ids": ["monkeypatching"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def monkeypatching():\n \"\"\"Monkeypatch not installed modules and decorators which change __doc__ attribute.\"\"\"\n import ray\n import pandas.util\n import modin.utils\n from unittest.mock import Mock\n\n def monkeypatch(*args, **kwargs):\n if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):\n # This is the case where the decorator is just @ray.remote without parameters.\n return args[0]\n return lambda cls_or_func: cls_or_func\n\n ray.remote = monkeypatch\n pandas.util.cache_readonly = property\n\n # We are mocking packages we don't need for docs checking in order to avoid import errors\n sys.modules[\"pyarrow.gandiva\"] = Mock()\n sys.modules[\"sqlalchemy\"] = Mock()\n\n modin.utils.instancer = functools.wraps(modin.utils.instancer)(lambda cls: cls)\n\n # monkey-patch numpydoc for working correctly with properties\n def load_obj(name, old_load_obj=Docstring._load_obj):\n obj = old_load_obj(name)\n if isinstance(obj, property):\n obj = obj.fget\n return obj\n\n Docstring._load_obj = staticmethod(load_obj)\n\n # for testing hdk-engine docs without `pyhdk` installation\n # TODO: check if we could remove these lines\n sys.modules[\"pyhdk\"] = Mock()\n # enable docs testing on windows\n sys.getdlopenflags = Mock()\n sys.setdlopenflags = Mock()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_validate_validate.return.is_successfull": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_validate_validate.return.is_successfull", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 537, "end_line": 564, "span_ids": ["validate"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def validate(\n paths: List[pathlib.Path], add_ignore: List[str], use_numpydoc: bool\n) -> bool:\n \"\"\"\n Perform pydocstyle and numpydoc checks.\n\n Parameters\n ----------\n paths : List[pathlib.Path]\n Filenames of directories for check.\n add_ignore : List[str]\n `pydocstyle` error codes which are not verified.\n use_numpydoc : bool\n Determine if numpydoc checks are needed.\n\n Returns\n -------\n is_successfull : bool\n Return True if all checks are successful.\n \"\"\"\n is_successfull = True\n for path in paths:\n if not pydocstyle_validate(path, add_ignore, use_numpydoc):\n is_successfull = False\n if use_numpydoc:\n if not numpydoc_validate(path):\n is_successfull = False\n return is_successfull", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_args_check_args.for_path_in_args_paths_.if_not_abs_path_startswit.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_check_args_check_args.for_path_in_args_paths_.if_not_abs_path_startswit.raise_ValueError_", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 567, "end_line": 590, "span_ids": ["check_args"], "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 check_args(args: argparse.Namespace):\n \"\"\"\n Check the obtained values for correctness.\n\n Parameters\n ----------\n args : argparse.Namespace\n Parser arguments.\n\n Raises\n ------\n ValueError\n Occurs in case of non-existent files or directories.\n \"\"\"\n for path in args.paths:\n if not path.exists():\n raise ValueError(f\"{path} does not exist\")\n abs_path = os.path.abspath(path)\n if not abs_path.startswith(MODIN_PATH):\n raise ValueError(\n \"it is unsupported to use this script on files from another \"\n + f\"repository; script' repo '{MODIN_PATH}', \"\n + f\"input path '{abs_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_modin-project__modin/scripts/doc_checker.py_get_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/doc_checker.py_get_args_", "embedding": null, "metadata": {"file_path": "scripts/doc_checker.py", "file_name": "doc_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 593, "end_line": 634, "span_ids": ["impl:20", "get_args"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_args() -> argparse.Namespace:\n \"\"\"\n Get args from cli with validation.\n\n Returns\n -------\n argparse.Namespace\n \"\"\"\n parser = argparse.ArgumentParser(\n description=\"Check docstrings by using pydocstyle and numpydoc\"\n )\n parser.add_argument(\n \"paths\",\n nargs=\"+\",\n type=pathlib.Path,\n help=\"Filenames or directories; in case of direstories perform recursive check\",\n )\n parser.add_argument(\n \"--add-ignore\",\n nargs=\"*\",\n default=[],\n help=\"Pydocstyle error codes; for example: D100,D100,D102\",\n )\n parser.add_argument(\n \"--disable-numpydoc\",\n default=False,\n action=\"store_true\",\n help=\"Determine if numpydoc checks are not needed\",\n )\n args = parser.parse_args()\n check_args(args)\n return args\n\n\nif __name__ == \"__main__\":\n args = get_args()\n monkeypatching()\n if not validate(args.paths, args.add_ignore, not args.disable_numpydoc):\n logging.error(\"INVALID DOCUMENTATION FOUND\")\n exit(1)\n logging.info(\"SUCCESSFUL CHECK\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_re_GithubUserResolver.__register.self___cache_f_name_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_re_GithubUserResolver.__register.self___cache_f_name_e", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 66, "span_ids": ["GithubUserResolver.__try_user", "GithubUserResolver", "GithubUserResolver.__search_commits", "GithubUserResolver.__init__", "imports", "GithubUserResolver.__resolve_single", "GithubUserResolver.__register", "GithubUserResolver.__search_github", "GithubUserResolver.__resolve_cache", "GithubUserResolver.__is_email"], "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": "import re\nimport json\nimport atexit\nimport collections\nimport argparse\nfrom pathlib import Path\nimport sys\nfrom packaging import version\n\nimport pygit2\nimport github\n\n\nclass GithubUserResolver:\n def __init__(self, email2commit, token):\n self.__cache_file = Path(__file__).parent / \"gh-users-cache.json\"\n self.__cache = (\n json.loads(self.__cache_file.read_text())\n if self.__cache_file.exists()\n else {}\n )\n # filter unknown users hoping we'd be able to find them this time\n self.__cache = {key: value for key, value in self.__cache.items() if value}\n # using anonymous access if token not specified\n self.__github = github.Github(token or None)\n self.__modin_repo = self.__github.get_repo(\"modin-project/modin\")\n self.__email2commit = email2commit\n atexit.register(self.__save)\n\n def __search_commits(self, term):\n if commit := self.__email2commit.get(term):\n gh_commit = self.__modin_repo.get_commit(str(commit))\n return gh_commit.author.login\n return None\n\n @staticmethod\n def __is_email(term):\n return re.match(r\".*@.*\\..*\", term)\n\n def __search_github(self, term):\n search = f\"in:email {term}\" if self.__is_email(term) else f\"fullname:{term}\"\n match = [user.login for user in self.__github.search_users(search)]\n return match[0] if len(match) == 1 else None\n\n def __try_user(self, term):\n if self.__is_email(term):\n return None\n try:\n return self.__github.get_user(term).login\n except github.GithubException as ex:\n if ex.status != 404:\n raise\n return None\n\n def __resolve_single(self, term):\n return (\n self.__search_commits(term)\n or self.__search_github(term)\n or self.__try_user(term)\n )\n\n def __resolve_cache(self, name, email):\n return self.__cache.get(f\"{name} <{email}>\", None)\n\n def __register(self, name, email, match):\n self.__cache[f\"{name} <{email}>\"] = match", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GithubUserResolver.resolve_GithubUserResolver.resolve.return.logins_unknowns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GithubUserResolver.resolve_GithubUserResolver.resolve.return.logins_unknowns", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 84, "span_ids": ["GithubUserResolver.resolve"], "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 GithubUserResolver:\n\n def resolve(self, people):\n logins, unknowns = set(), set()\n\n for name, email in people:\n if match := self.__resolve_cache(name, email):\n logins.add(match)\n elif match := self.__resolve_single(email):\n self.__register(name, email, match)\n logins.add(match)\n else:\n if match := self.__resolve_single(name):\n logins.add(match)\n else:\n unknowns.add((name, email))\n self.__register(name, email, match)\n\n return logins, unknowns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GithubUserResolver.resolve_by_reviews_GithubUserResolver.__save.self___cache_file_write_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GithubUserResolver.resolve_by_reviews_GithubUserResolver.__save.self___cache_file_write_t", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 106, "span_ids": ["GithubUserResolver.resolve_by_reviews", "GithubUserResolver.__save"], "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 GithubUserResolver:\n\n def resolve_by_reviews(self, unknowns, email2pr):\n logins, new_unknowns = set(), set()\n for name, email in unknowns:\n commit = self.__modin_repo.get_commit(str(email2pr[email]))\n found = set()\n for pull in commit.get_pulls():\n for review in pull.get_reviews():\n user = review.user\n if user.name == name and (not user.email or user.email == email):\n found.add(user.login)\n\n if len(found) == 1:\n self.__register(name, email, list(found)[0])\n logins |= found\n else:\n new_unknowns.add((name, email))\n\n return logins, new_unknowns\n\n def __save(self):\n self.__cache_file.write_text(json.dumps(self.__cache, indent=4, sort_keys=True))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GitWrapper_GitWrapper.get_previous_release.return.prev_ref_self_repo_refer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GitWrapper_GitWrapper.get_previous_release.return.prev_ref_self_repo_refer", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 130, "span_ids": ["GitWrapper.get_previous_release", "GitWrapper.is_on_master", "GitWrapper.__init__", "GitWrapper"], "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 GitWrapper:\n def __init__(self):\n self.repo = pygit2.Repository(Path(__file__).parent)\n\n def is_on_master(self):\n return self.repo.references[\"refs/heads/master\"] == self.repo.head\n\n def get_previous_release(self, rel_type):\n tags = [\n (entry, version.parse(entry.lstrip(\"refs/tags/\")))\n for entry in self.repo.references\n if entry.startswith(\"refs/tags/\")\n ]\n # filter away legacy versions (which aren't following the proper naming schema)\n tags = [(entry, ver) for entry, ver in tags if isinstance(ver, version.Version)]\n if rel_type == \"minor\":\n # leave only minor releases\n tags = [(entry, ver) for entry, ver in tags if ver.micro == 0]\n else:\n assert rel_type == \"patch\"\n prev_ref, prev_ver = max(tags, key=lambda pair: pair[1])\n return prev_ref, self.repo.references[prev_ref].peel(), prev_ver", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GitWrapper.get_commits_upto_GitWrapper.ensure_title_link.return.title": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_GitWrapper.get_commits_upto_GitWrapper.ensure_title_link.return.title", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 146, "span_ids": ["GitWrapper.get_commits_upto", "GitWrapper.ensure_title_link"], "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 GitWrapper:\n\n def get_commits_upto(self, stop_commit):\n history = []\n for obj in self.repo.walk(self.repo.head.target):\n if obj.id == stop_commit.id:\n break\n history.append(obj)\n else:\n raise ValueError(\"Current HEAD is not derived from previous release\")\n return history\n\n def ensure_title_link(self, obj: pygit2.Commit):\n title = obj.message.splitlines()[0]\n if not re.match(r\".*\\(#(\\d+)\\)$\", title):\n title += f\" ({obj.short_id})\"\n return title", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_make_notes_make_notes.sys_stdout_write_notes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_make_notes_make_notes.sys_stdout_write_notes_", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 254, "span_ids": ["make_notes"], "tokens": 845}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_notes(args):\n wrapper = GitWrapper()\n release_type = \"minor\" if wrapper.is_on_master() else \"patch\"\n sys.stderr.write(f\"Detected release type: {release_type}\\n\")\n\n prev_ref, prev_commit, prev_ver = wrapper.get_previous_release(release_type)\n sys.stderr.write(f\"Previous {release_type} release: {prev_ref}\\n\")\n\n next_major, next_minor, next_patch = prev_ver.release\n if release_type == \"minor\":\n next_minor += 1\n elif release_type == \"patch\":\n next_patch += 1\n else:\n raise ValueError(f\"Unexpected release type: {release_type}\")\n next_ver = version.Version(f\"{next_major}.{next_minor}.{next_patch}\")\n\n sys.stderr.write(f\"Computing release notes for {prev_ver} -> {next_ver}...\\n\")\n try:\n history = wrapper.get_commits_upto(prev_commit)\n except ValueError as ex:\n sys.stderr.write(\n f\"{ex}: did you forget to checkout correct branch or pull tags?\"\n )\n return 1\n if not history:\n sys.stderr.write(f\"No commits since {prev_ver} found, nothing to generate!\\n\")\n return 1\n\n titles = collections.defaultdict(list)\n people = set()\n email2commit, email2pr = {}, {}\n for obj in history:\n title = obj.message.splitlines()[0]\n titles[title.split(\"-\")[0]].append(obj)\n new_people = set(\n re.findall(\n r\"(?:(?:Signed-off-by|Co-authored-by):\\s*)([\\w\\s,]+?)\\s*<([^>]+)>\",\n obj.message,\n )\n )\n for _, email in new_people:\n email2pr[email] = obj.id\n people |= new_people\n email2commit[obj.author.email] = obj.id\n sys.stderr.write(f\"Found {len(history)} commit(s) since {prev_ref}\\n\")\n\n sys.stderr.write(\"Resolving contributors...\\n\")\n user_resolver = GithubUserResolver(email2commit, args.token)\n logins, unknowns = user_resolver.resolve(people)\n new_logins, unknowns = user_resolver.resolve_by_reviews(unknowns, email2pr)\n logins |= new_logins\n sys.stderr.write(f\"Found {len(logins)} GitHub usernames.\\n\")\n if unknowns:\n sys.stderr.write(\n f\"Warning! Failed to resolve {len(unknowns)} usernames, please resolve them manually!\\n\"\n )\n\n sections = [\n (\"Stability and Bugfixes\", \"FIX\"),\n (\"Performance enhancements\", \"PERF\"),\n (\"Refactor Codebase\", \"REFACTOR\"),\n (\"Update testing suite\", \"TEST\"),\n (\"Documentation improvements\", \"DOCS\"),\n (\"New Features\", \"FEAT\"),\n ]\n\n notes = rf\"\"\"Modin {next_ver}\n\n\n\nKey Features and Updates Since {prev_ver}\n-------------------------------{'-' * len(str(prev_ver))}\n\"\"\"\n\n def _add_section(section, prs):\n nonlocal notes\n if prs:\n notes += f\"* {section}\\n\"\n notes += \"\\n\".join(\n [\n f\" * {wrapper.ensure_title_link(obj)}\"\n for obj in sorted(prs, key=lambda obj: obj.message)\n ]\n )\n notes += \"\\n\"\n\n for section, key in sections:\n _add_section(section, titles.pop(key, None))\n\n uncategorized = sum(titles.values(), [])\n _add_section(\"Uncategorized improvements\", uncategorized)\n\n notes += r\"\"\"\nContributors\n------------\n\"\"\"\n notes += \"\\n\".join(f\"@{login}\" for login in sorted(logins)) + \"\\n\"\n notes += (\n \"\\n\".join(\n f\" {name} <{email}>\" for name, email in sorted(unknowns)\n )\n + \"\\n\"\n )\n\n sys.stdout.write(notes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/release.py_main_", "embedding": null, "metadata": {"file_path": "scripts/release.py", "file_name": "release.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 277, "span_ids": ["impl", "main"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n parse = argparse.ArgumentParser()\n parse.add_argument(\n \"--token\",\n type=str,\n default=\"\",\n help=\"GitHub token for queries (optional, bumps up rate limit)\",\n )\n parse.set_defaults(func=lambda _: parse.print_usage())\n subparsers = parse.add_subparsers()\n\n notes = subparsers.add_parser(\"notes\", help=\"Generate release notes\")\n notes.set_defaults(func=make_notes)\n\n args = parse.parse_args()\n sys.exit(args.func(args))\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/__init__.py__", "embedding": null, "metadata": {"file_path": "scripts/test/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "test", "start_line": 13, "end_line": 13, "span_ids": [], "tokens": 0}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "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_modin-project__modin/scripts/test/examples.py__noqa_MD01_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/examples.py__noqa_MD01_", "embedding": null, "metadata": {"file_path": "scripts/test/examples.py", "file_name": "examples.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 60, "span_ids": ["optional_square_empty_parameters", "optional_square", "square_summary", "docstring", "weakdict"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# noqa: MD01\n\nclass weakdict(dict): # noqa: GL08\n __slots__ = (\"__weakref__\",)\n\n\ndef optional_square(number: int = 5) -> int: # noqa\n \"\"\"\n Square `number`.\n\n The function from Modin.\n\n Parameters\n ----------\n number : int\n Some number.\n\n Notes\n -----\n The `optional_square` Modin function from modin/scripts/examples.py.\n \"\"\"\n return number ** 2\n\n\ndef optional_square_empty_parameters(number: int = 5) -> int:\n \"\"\"\n Parameters\n ----------\n \"\"\"\n return number ** 2\n\n\ndef square_summary(number: int) -> int: # noqa: PR01, GL08\n \"\"\"\n Square `number`.\n\n See https://github.com/ray-project/ray.\n\n Examples\n --------\n The function that will never be used in modin.pandas.DataFrame same as in\n pandas or NumPy.\n \"\"\"\n return number ** 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_modin-project__modin/scripts/test/test_doc_checker.py_pytest_test_get_optional_args.assert_optional_args_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_pytest_test_get_optional_args.assert_optional_args_r", "embedding": null, "metadata": {"file_path": "scripts/test/test_doc_checker.py", "file_name": "test_doc_checker.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 37, "span_ids": ["test_get_optional_args", "docstring"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nfrom scripts.doc_checker import (\n get_optional_args,\n check_optional_args,\n MODIN_ERROR_CODES,\n check_spelling_words,\n get_noqa_checks,\n)\nfrom numpydoc.validate import Docstring\n\n\n@pytest.mark.parametrize(\n \"import_path, result\",\n [\n (\"scripts.test.examples.optional_square\", {\"number\": 5}),\n (\"scripts.test.examples.optional_square_empty_parameters\", {\"number\": 5}),\n (\"scripts.test.examples.square_summary\", {}),\n (\"scripts.test.examples.weakdict\", {}),\n (\"scripts.test.examples\", {}),\n ],\n)\ndef test_get_optional_args(import_path, result):\n optional_args = get_optional_args(Docstring(import_path))\n assert optional_args == 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_modin-project__modin/scripts/test/test_doc_checker.py_test_check_optional_args_test_check_optional_args.assert_errors_result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_check_optional_args_test_check_optional_args.assert_errors_result", "embedding": null, "metadata": {"file_path": "scripts/test/test_doc_checker.py", "file_name": "test_doc_checker.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 60, "span_ids": ["test_check_optional_args"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"import_path, result\",\n [\n (\n \"scripts.test.examples.optional_square\",\n [\n (\n \"MD01\",\n MODIN_ERROR_CODES[\"MD01\"].format(parameter=\"number\", found=\"int\"),\n )\n ],\n ),\n (\"scripts.test.examples.optional_square_empty_parameters\", []),\n (\"scripts.test.examples.square_summary\", []),\n (\"scripts.test.examples.weakdict\", []),\n (\"scripts.test.examples\", []),\n ],\n)\ndef test_check_optional_args(import_path, result):\n errors = check_optional_args(Docstring(import_path))\n assert errors == 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_modin-project__modin/scripts/test/test_doc_checker.py_test_check_spelling_words_test_check_spelling_words.for_error_in_errors_.assert_error_in_result_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_check_spelling_words_test_check_spelling_words.for_error_in_errors_.assert_error_in_result_er", "embedding": null, "metadata": {"file_path": "scripts/test/test_doc_checker.py", "file_name": "test_doc_checker.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 93, "span_ids": ["test_check_spelling_words"], "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": "@pytest.mark.parametrize(\n \"import_path, result\",\n [\n (\"scripts.test.examples.optional_square\", []),\n (\n \"scripts.test.examples.square_summary\",\n [\n (\"MD02\", 57, \"Pandas\", \"pandas\"),\n (\"MD02\", 57, \"Numpy\", \"NumPy\"),\n ],\n ),\n (\"scripts.test.examples.optional_square_empty_parameters\", []),\n (\"scripts.test.examples.weakdict\", []),\n (\"scripts.test.examples\", []),\n ],\n)\ndef test_check_spelling_words(import_path, result):\n result_errors = []\n for code, line, word, reference in result:\n result_errors.append(\n (\n code,\n MODIN_ERROR_CODES[code].format(\n line=line, word=word, reference=reference\n ),\n )\n )\n errors = check_spelling_words(Docstring(import_path))\n # the order of incorrect words found on the same line is not guaranteed\n for error in errors:\n assert error in result_errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_get_noqa_checks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/scripts/test/test_doc_checker.py_test_get_noqa_checks_", "embedding": null, "metadata": {"file_path": "scripts/test/test_doc_checker.py", "file_name": "test_doc_checker.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 109, "span_ids": ["test_get_noqa_checks"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"import_path, result\",\n [\n (\"scripts.test.examples.optional_square\", [\"all\"]),\n (\"scripts.test.examples.optional_square_empty_parameters\", []),\n (\"scripts.test.examples.square_summary\", [\"PR01\", \"GL08\"]),\n (\"scripts.test.examples.weakdict\", [\"GL08\"]),\n (\"scripts.test.examples\", [\"MD02\"]),\n ],\n)\ndef test_get_noqa_checks(import_path, result):\n noqa_checks = get_noqa_checks(Docstring(import_path))\n assert noqa_checks == 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_modin-project__modin/setup.py_from_setuptools_import_se_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/setup.py_from_setuptools_import_se_", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 68, "span_ids": ["impl:22", "AddPthFileBuild._get_data_files", "imports", "AddPthFileSDist.make_distribution", "AddPthFileBuild", "AddPthFileSDist"], "tokens": 595}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\nimport versioneer\n\nwith open(\"README.md\", \"r\", encoding=\"utf-8\") as fh:\n long_description = fh.read()\n\ndask_deps = [\"dask>=2.22.0\", \"distributed>=2.22.0\"]\nray_deps = [\"ray[default]>=1.13.0\", \"pyarrow\"]\nunidist_deps = [\"unidist[mpi]>=0.2.1\"]\nremote_deps = [\"rpyc==4.1.5\", \"cloudpickle\", \"boto3\"]\nspreadsheet_deps = [\"modin-spreadsheet>=0.1.0\"]\nsql_deps = [\"dfsql>=0.4.2\", \"pyparsing<=2.4.7\"]\nall_deps = dask_deps + ray_deps + unidist_deps + remote_deps + spreadsheet_deps\n\n# Distribute 'modin-autoimport-pandas.pth' along with binary and source distributions.\n# This file provides the \"import pandas before Ray init\" feature if specific\n# environment variable is set (see https://github.com/modin-project/modin/issues/4564).\ncmdclass = versioneer.get_cmdclass()\nextra_files = [\"modin-autoimport-pandas.pth\"]\n\n\nclass AddPthFileBuild(cmdclass[\"build_py\"]):\n def _get_data_files(self):\n return (super()._get_data_files() or []) + [\n (\".\", \".\", self.build_lib, extra_files)\n ]\n\n\nclass AddPthFileSDist(cmdclass[\"sdist\"]):\n def make_distribution(self):\n self.filelist.extend(extra_files)\n return super().make_distribution()\n\n\ncmdclass[\"build_py\"] = AddPthFileBuild\ncmdclass[\"sdist\"] = AddPthFileSDist\n\nsetup(\n name=\"modin\",\n version=versioneer.get_version(),\n cmdclass=cmdclass,\n description=\"Modin: Make your pandas code run faster by changing one line of code.\",\n packages=find_packages(exclude=[\"scripts\", \"scripts.*\"]),\n include_package_data=True,\n license=\"Apache 2\",\n url=\"https://github.com/modin-project/modin\",\n long_description=long_description,\n long_description_content_type=\"text/markdown\",\n install_requires=[\n \"pandas>=2,<2.1\",\n \"packaging\",\n \"numpy>=1.18.5\",\n \"fsspec\",\n \"psutil\",\n ],\n extras_require={\n # can be installed by pip install modin[dask]\n \"dask\": dask_deps,\n \"ray\": ray_deps,\n \"unidist\": unidist_deps,\n \"remote\": remote_deps,\n \"spreadsheet\": spreadsheet_deps,\n \"sql\": sql_deps,\n \"all\": all_deps,\n },\n python_requires=\">=3.8\",\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_matplotlib_None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_matplotlib_None_9", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle10.py", "file_name": "kaggle10.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 89, "span_ids": ["imports", "impl:49"], "tokens": 799}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport numpy as np # linear algebra\nimport modin.pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\ndata = pd.read_csv(\"column_2C_weka.csv\")\nprint(plt.style.available) # look at available plot styles\nplt.style.use(\"ggplot\")\ndata.head()\ndata.info()\ndata.describe()\ncolor_list = [\"red\" if i == \"Abnormal\" else \"green\" for i in data.loc[:, \"class\"]]\npd.plotting.scatter_matrix(\n data.loc[:, data.columns != \"class\"],\n c=color_list,\n figsize=[15, 15],\n diagonal=\"hist\",\n alpha=0.5,\n s=200,\n marker=\"*\",\n edgecolor=\"black\",\n)\nplt.show()\nsns.countplot(x=\"class\", data=data)\ndata.loc[:, \"class\"].value_counts()\nfrom sklearn.neighbors import KNeighborsClassifier\n\nknn = KNeighborsClassifier(n_neighbors=3)\nx, y = data.loc[:, data.columns != \"class\"], data.loc[:, \"class\"]\nknn.fit(x, y)\nprediction = knn.predict(x)\nprint(\"Prediction: {}\".format(prediction))\nfrom sklearn.model_selection import train_test_split\n\nx_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=1)\nknn = KNeighborsClassifier(n_neighbors=3)\nx, y = data.loc[:, data.columns != \"class\"], data.loc[:, \"class\"]\nknn.fit(x_train, y_train)\nprediction = knn.predict(x_test)\nprint(\"With KNN (K=3) accuracy is: \", knn.score(x_test, y_test)) # accuracy\nneig = np.arange(1, 25)\ntrain_accuracy = []\ntest_accuracy = []\nfor i, k in enumerate(neig):\n knn = KNeighborsClassifier(n_neighbors=k)\n knn.fit(x_train, y_train)\n train_accuracy.append(knn.score(x_train, y_train))\n test_accuracy.append(knn.score(x_test, y_test))\nplt.figure(figsize=[13, 8])\nplt.plot(neig, test_accuracy, label=\"Testing Accuracy\")\nplt.plot(neig, train_accuracy, label=\"Training Accuracy\")\nplt.legend()\nplt.title(\"-value VS Accuracy\")\nplt.xlabel(\"Number of Neighbors\")\nplt.ylabel(\"Accuracy\")\nplt.xticks(neig)\nplt.savefig(\"graph.png\")\nplt.show()\nprint(\n \"Best accuracy is {} with K = {}\".format(\n np.max(test_accuracy), 1 + test_accuracy.index(np.max(test_accuracy))\n )\n)\ndata1 = data[data[\"class\"] == \"A\"]\nx = np.array(data1.loc[:, \"pelvic_incidence\"]).reshape(-1, 1)\ny = np.array(data1.loc[:, \"sacral_slope\"]).reshape(-1, 1)\nplt.figure(figsize=[10, 10])\nplt.scatter(x=x, y=y)\nplt.xlabel(\"pelvic_incidence\")\nplt.ylabel(\"sacral_slope\")\nplt.show()\nfrom sklearn.linear_model import LinearRegression\n\nreg = LinearRegression()\npredict_space = np.linspace(min(x), max(x)).reshape(-1, 1)\nreg.fit(x, y)\npredicted = reg.predict(predict_space)\nprint(\"R^2 score: \", reg.score(x, y))\nplt.plot(predict_space, predicted, color=\"black\", linewidth=3)\nplt.scatter(x=x, y=y)\nplt.xlabel(\"pelvic_incidence\")\nplt.ylabel(\"sacral_slope\")\nplt.show()\nfrom sklearn.model_selection import cross_val_score\nx_train, x_test, y_train, y_test = train_test_split(\n x, y, test_size=0.3, random_state=42\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_reg_15_print_Best_score_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_reg_15_print_Best_score_fo", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle10.py", "file_name": "kaggle10.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 164, "span_ids": ["impl:101", "impl:49"], "tokens": 788}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from sklearn.model_selection import cross_val_score\n\nreg = LinearRegression()\nk = 5\ncv_result = cross_val_score(reg, x, y, cv=k) # uses R^2 as score\nprint(\"CV Scores: \", cv_result)\nprint(\"CV scores average: \", np.sum(cv_result) / k)\nfrom sklearn.linear_model import Ridge\n\nx_train, x_test, y_train, y_test = train_test_split(x, y, random_state=2, test_size=0.3)\nridge = Ridge(alpha=0.1, normalize=True)\nridge.fit(x_train, y_train)\nridge_predict = ridge.predict(x_test)\nprint(\"Ridge score: \", ridge.score(x_test, y_test))\nfrom sklearn.linear_model import Lasso\n\nx = np.array(\n data1.loc[\n :,\n [\n \"pelvic_incidence\",\n \"pelvic_tilt numeric\",\n \"lumbar_lordosis_angle\",\n \"pelvic_radius\",\n ],\n ]\n)\nx_train, x_test, y_train, y_test = train_test_split(x, y, random_state=3, test_size=0.3)\nlasso = Lasso(alpha=0.1, normalize=True)\nlasso.fit(x_train, y_train)\nridge_predict = lasso.predict(x_test)\nprint(\"Lasso score: \", lasso.score(x_test, y_test))\nprint(\"Lasso coefficients: \", lasso.coef_)\nfrom sklearn.metrics import classification_report, confusion_matrix\nfrom sklearn.ensemble import RandomForestClassifier\n\nx, y = data.loc[:, data.columns != \"class\"], data.loc[:, \"class\"]\nx_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=1)\nrf = RandomForestClassifier(random_state=4)\nrf.fit(x_train, y_train)\ny_pred = rf.predict(x_test)\ncm = confusion_matrix(y_test, y_pred)\nprint(\"Confusion matrix: \\n\", cm)\nprint(\"Classification report: \\n\", classification_report(y_test, y_pred))\nsns.heatmap(cm, annot=True, fmt=\"d\")\nplt.show()\nfrom sklearn.metrics import roc_curve\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import confusion_matrix, classification_report\n\ndata[\"class_binary\"] = [1 if i == \"Abnormal\" else 0 for i in data.loc[:, \"class\"]]\nx, y = (\n data.loc[:, (data.columns != \"class\") & (data.columns != \"class_binary\")],\n data.loc[:, \"class_binary\"],\n)\nx_train, x_test, y_train, y_test = train_test_split(\n x, y, test_size=0.3, random_state=42\n)\nlogreg = LogisticRegression()\nlogreg.fit(x_train, y_train)\ny_pred_prob = logreg.predict_proba(x_test)[:, 1]\nfpr, tpr, thresholds = roc_curve(y_test, y_pred_prob)\nplt.plot([0, 1], [0, 1], \"k--\")\nplt.plot(fpr, tpr)\nplt.xlabel(\"False Positive Rate\")\nplt.ylabel(\"True Positive Rate\")\nplt.title(\"ROC\")\nplt.show()\nfrom sklearn.model_selection import GridSearchCV\n\ngrid = {\"n_neighbors\": np.arange(1, 50)}\nknn = KNeighborsClassifier()\nknn_cv = GridSearchCV(knn, grid, cv=3) # GridSearchCV\nknn_cv.fit(x, y) # Fit\nprint(\"Tuned hyperparameter k: {}\".format(knn_cv.best_params_))\nprint(\"Best score: {}\".format(knn_cv.best_score_))\nx_train, x_test, y_train, y_test = train_test_split(\n x, y, test_size=0.3, random_state=12\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_param_grid_dendrogram_merg_leaf_rot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_param_grid_dendrogram_merg_leaf_rot", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle10.py", "file_name": "kaggle10.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 235, "span_ids": ["impl:101", "impl:142", "impl:195"], "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": "from sklearn.linear_model import Lasso\nparam_grid = {\"C\": np.logspace(-3, 3, 7), \"penalty\": [\"l1\", \"l2\"]}\nx_train, x_test, y_train, y_test = train_test_split(\n x, y, test_size=0.3, random_state=12\n)\nlogreg = LogisticRegression()\nlogreg_cv = GridSearchCV(logreg, param_grid, cv=3)\nlogreg_cv.fit(x_train, y_train)\nprint(\"Tuned hyperparameters : {}\".format(logreg_cv.best_params_))\nprint(\"Best Accuracy: {}\".format(logreg_cv.best_score_))\ndata = pd.read_csv(\"column_2C_weka.csv\")\ndf = pd.get_dummies(data)\ndf.head(10)\ndf.drop(\"class_Normal\", axis=1, inplace=True)\ndf.head(10)\nfrom sklearn.svm import SVC\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.pipeline import Pipeline\n\nsteps = [(\"scalar\", StandardScaler()), (\"SVM\", SVC())]\npipeline = Pipeline(steps)\nparameters = {\"SVM__C\": [1, 10, 100], \"SVM__gamma\": [0.1, 0.01]}\nx_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=1)\ncv = GridSearchCV(pipeline, param_grid=parameters, cv=3)\ncv.fit(x_train, y_train)\ny_pred = cv.predict(x_test)\nprint(\"Accuracy: {}\".format(cv.score(x_test, y_test)))\nprint(\"Tuned Model Parameters: {}\".format(cv.best_params_))\ndata = pd.read_csv(\"column_2C_weka.csv\")\nplt.scatter(data[\"pelvic_radius\"], data[\"degree_spondylolisthesis\"])\nplt.xlabel(\"pelvic_radius\")\nplt.ylabel(\"degree_spondylolisthesis\")\nplt.show()\ndata2 = data.loc[:, [\"degree_spondylolisthesis\", \"pelvic_radius\"]]\nfrom sklearn.cluster import KMeans\n\nkmeans = KMeans(n_clusters=2)\nkmeans.fit(data2)\nlabels = kmeans.predict(data2)\nplt.scatter(data[\"pelvic_radius\"], data[\"degree_spondylolisthesis\"], c=labels)\nplt.xlabel(\"pelvic_radius\")\nplt.xlabel(\"degree_spondylolisthesis\")\nplt.show()\ndf = pd.DataFrame({\"labels\": labels, \"class\": data[\"class\"]})\nct = pd.crosstab(df[\"labels\"], df[\"class\"])\nprint(ct)\ninertia_list = np.empty(8)\nfor i in range(1, 8):\n kmeans = KMeans(n_clusters=i)\n kmeans.fit(data2)\n inertia_list[i] = kmeans.inertia_\nplt.plot(range(0, 8), inertia_list, \"-o\")\nplt.xlabel(\"Number of cluster\")\nplt.ylabel(\"Inertia\")\nplt.show()\ndata = pd.read_csv(\"column_2C_weka.csv\")\ndata3 = data.drop(\"class\", axis=1)\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.pipeline import make_pipeline\n\nscalar = StandardScaler()\nkmeans = KMeans(n_clusters=2)\npipe = make_pipeline(scalar, kmeans)\npipe.fit(data3)\nlabels = pipe.predict(data3)\ndf = pd.DataFrame({\"labels\": labels, \"class\": data[\"class\"]})\nct = pd.crosstab(df[\"labels\"], df[\"class\"])\nprint(ct)\nfrom scipy.cluster.hierarchy import linkage, dendrogram\n\nmerg = linkage(data3.iloc[200:220, :], method=\"single\")\ndendrogram(merg, leaf_rotation=90, leaf_font_size=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_modin-project__modin/stress_tests/kaggle/kaggle10.py_None_86_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle10.py_None_86_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle10.py", "file_name": "kaggle10.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 268, "span_ids": ["impl:195"], "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": "plt.show()\nfrom sklearn.manifold import TSNE\n\nmodel = TSNE(learning_rate=100)\ntransformed = model.fit_transform(data2)\nx = transformed[:, 0]\ny = transformed[:, 1]\nplt.scatter(x, y, c=color_list)\nplt.xlabel(\"pelvic_radius\")\nplt.xlabel(\"degree_spondylolisthesis\")\nplt.show()\nfrom sklearn.decomposition import PCA\n\nmodel = PCA()\nmodel.fit(data3)\ntransformed = model.transform(data3)\nprint(\"Principle components: \", model.components_)\nscaler = StandardScaler()\npca = PCA()\npipeline = make_pipeline(scaler, pca)\npipeline.fit(data3)\nplt.bar(range(pca.n_components_), pca.explained_variance_)\nplt.xlabel(\"PCA feature\")\nplt.ylabel(\"variance\")\nplt.show()\npca = PCA(n_components=2)\npca.fit(data3)\ntransformed = pca.transform(data3)\nx = transformed[:, 0]\ny = transformed[:, 1]\nplt.scatter(x, y, c=color_list)\nplt.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_modin-project__modin/stress_tests/kaggle/kaggle12.py_matplotlib_IDtest.test_PassengerId_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_matplotlib_IDtest.test_PassengerId_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport modin.pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom collections import Counter\nfrom sklearn.ensemble import (\n RandomForestClassifier,\n AdaBoostClassifier,\n GradientBoostingClassifier,\n ExtraTreesClassifier,\n VotingClassifier,\n)\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.svm import SVC\nfrom sklearn.model_selection import (\n GridSearchCV,\n cross_val_score,\n StratifiedKFold,\n learning_curve,\n)\n\nsns.set(style=\"white\", context=\"notebook\", palette=\"deep\")\ntrain = pd.read_csv(\"train.csv\")\ntest = pd.read_csv(\"test.csv\")\nIDtest = test[\"PassengerId\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_detect_outliers_detect_outliers.return.multiple_outliers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_detect_outliers_detect_outliers.return.multiple_outliers", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 48, "span_ids": ["detect_outliers"], "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 detect_outliers(df, n, features):\n outlier_indices = []\n for col in features:\n Q1 = np.percentile(df[col], 25)\n Q3 = np.percentile(df[col], 75)\n IQR = Q3 - Q1\n outlier_step = 1.5 * IQR\n outlier_list_col = df[\n (df[col] < Q1 - outlier_step) | (df[col] > Q3 + outlier_step)\n ].index\n outlier_indices.extend(outlier_list_col)\n outlier_indices = Counter(outlier_indices)\n multiple_outliers = [k for k, v in outlier_indices.items() if v > n]\n return multiple_outliers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_Outliers_to_drop_g_28.sns_factorplot_y_Age_x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_Outliers_to_drop_g_28.sns_factorplot_y_Age_x", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 116, "span_ids": ["impl:9", "impl:56"], "tokens": 811}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "Outliers_to_drop = detect_outliers(train, 2, [\"Age\", \"SibSp\", \"Parch\", \"Fare\"])\ntrain.loc[Outliers_to_drop] # Show the outliers rows\ntrain = train.drop(Outliers_to_drop, axis=0).reset_index(drop=True)\ntrain_len = len(train)\ndataset = pd.concat(list_of_objs=[train, test], axis=0).reset_index(drop=True)\ndataset = dataset.fillna(np.nan)\ndataset.isnull().sum()\ntrain.info()\ntrain.isnull().sum()\ntrain.head()\ntrain.dtypes\ntrain.describe()\ng = sns.heatmap(\n train[[\"Survived\", \"SibSp\", \"Parch\", \"Age\", \"Fare\"]].corr(),\n annot=True,\n fmt=\".2f\",\n cmap=\"coolwarm\",\n)\ng = sns.factorplot(\n x=\"SibSp\", y=\"Survived\", data=train, kind=\"bar\", size=6, palette=\"muted\"\n)\ng.despine(left=True)\ng = g.set_ylabels(\"survival probability\")\ng = sns.factorplot(\n x=\"Parch\", y=\"Survived\", data=train, kind=\"bar\", size=6, palette=\"muted\"\n)\ng.despine(left=True)\ng = g.set_ylabels(\"survival probability\")\ndataset[\"Fare\"].isnull().sum()\ndataset[\"Fare\"] = dataset[\"Fare\"].fillna(dataset[\"Fare\"].median())\ng = sns.distplot(\n dataset[\"Fare\"], color=\"m\", label=\"Skewness : %.2f\" % (dataset[\"Fare\"].skew())\n)\ng = g.legend(loc=\"best\")\ndataset[\"Fare\"] = dataset[\"Fare\"].map(lambda i: np.log(i) if i > 0 else 0)\ng = sns.distplot(\n dataset[\"Fare\"], color=\"b\", label=\"Skewness : %.2f\" % (dataset[\"Fare\"].skew())\n)\ng = g.legend(loc=\"best\")\ng = sns.barplot(x=\"Sex\", y=\"Survived\", data=train)\ng = g.set_ylabel(\"Survival Probability\")\ntrain[[\"Sex\", \"Survived\"]].groupby(\"Sex\").mean()\ng = sns.factorplot(\n x=\"Pclass\", y=\"Survived\", data=train, kind=\"bar\", size=6, palette=\"muted\"\n)\ng.despine(left=True)\ng = g.set_ylabels(\"survival probability\")\ng = sns.factorplot(\n x=\"Pclass\", y=\"Survived\", hue=\"Sex\", data=train, size=6, kind=\"bar\", palette=\"muted\"\n)\ng.despine(left=True)\ng = g.set_ylabels(\"survival probability\")\ndataset[\"Embarked\"].isnull().sum()\ndataset[\"Embarked\"] = dataset[\"Embarked\"].fillna(\"S\")\ng = sns.factorplot(\n x=\"Embarked\", y=\"Survived\", data=train, size=6, kind=\"bar\", palette=\"muted\"\n)\ng.despine(left=True)\ng = g.set_ylabels(\"survival probability\")\ng = sns.factorplot(\n \"Pclass\", col=\"Embarked\", data=train, size=6, kind=\"count\", palette=\"muted\"\n)\ng.despine(left=True)\ng = g.set_ylabels(\"Count\")\ng = sns.factorplot(y=\"Age\", x=\"Sex\", data=dataset, kind=\"box\")\ng = sns.factorplot(y=\"Age\", x=\"Sex\", hue=\"Pclass\", data=dataset, kind=\"box\")\ndataset[\"Title\"] = dataset[\"Title\"].map(\n {\"Master\": 0, \"Miss\": 1, \"Ms\": 1, \"Mme\": 1, \"Mlle\": 1, \"Mrs\": 1, \"Mr\": 2, \"Rare\": 3}\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_g_29_dataset_MedF_dataset": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_g_29_dataset_MedF_dataset", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 177, "span_ids": ["impl:56", "impl:100"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "g.despine(left=True)\ng = sns.factorplot(y=\"Age\", x=\"Parch\", data=dataset, kind=\"box\")\ng = sns.factorplot(y=\"Age\", x=\"SibSp\", data=dataset, kind=\"box\")\ndataset[\"Sex\"] = dataset[\"Sex\"].map({\"male\": 0, \"female\": 1})\ng = sns.heatmap(\n dataset[[\"Age\", \"Sex\", \"SibSp\", \"Parch\", \"Pclass\"]].corr(), cmap=\"BrBG\", annot=True\n)\nindex_NaN_age = list(dataset[\"Age\"][dataset[\"Age\"].isnull()].index)\nfor i in index_NaN_age:\n age_med = dataset[\"Age\"].median()\n age_pred = dataset[\"Age\"][\n (\n (dataset[\"SibSp\"] == dataset.iloc[i][\"SibSp\"])\n & (dataset[\"Parch\"] == dataset.iloc[i][\"Parch\"])\n & (dataset[\"Pclass\"] == dataset.iloc[i][\"Pclass\"])\n )\n ].median()\n if not np.isnan(age_pred):\n dataset[\"Age\"].iloc[i] = age_pred\n else:\n dataset[\"Age\"].iloc[i] = age_med\ng = sns.factorplot(x=\"Survived\", y=\"Age\", data=train, kind=\"box\")\ng = sns.factorplot(x=\"Survived\", y=\"Age\", data=train, kind=\"violin\")\ndataset[\"Name\"].head()\ndataset_title = [i.split(\",\")[1].split(\".\")[0].strip() for i in dataset[\"Name\"]]\ndataset[\"Title\"] = pd.Series(dataset_title)\ndataset[\"Title\"].head()\ng = sns.countplot(x=\"Title\", data=dataset)\ng = plt.setp(g.get_xticklabels(), rotation=45)\ndataset[\"Title\"] = dataset[\"Title\"].replace(\n [\n \"Lady\",\n \"the Countess\",\n \"Countess\",\n \"Capt\",\n \"Col\",\n \"Don\",\n \"Dr\",\n \"Major\",\n \"Rev\",\n \"Sir\",\n \"Jonkheer\",\n \"Dona\",\n ],\n \"Rare\",\n)\ndataset[\"Title\"] = dataset[\"Title\"].map(\n {\"Master\": 0, \"Miss\": 1, \"Ms\": 1, \"Mme\": 1, \"Mlle\": 1, \"Mrs\": 1, \"Mr\": 2, \"Rare\": 3}\n)\ndataset[\"Title\"] = dataset[\"Title\"].astype(int)\ng = sns.countplot(dataset[\"Title\"])\ng = g.set_xticklabels([\"Master\", \"Miss/Ms/Mme/Mlle/Mrs\", \"Mr\", \"Rare\"])\ng = sns.factorplot(x=\"Title\", y=\"Survived\", data=dataset, kind=\"bar\")\ng = g.set_xticklabels([\"Master\", \"Miss-Mrs\", \"Mr\", \"Rare\"])\ng = g.set_ylabels(\"survival probability\")\ndataset.drop(labels=[\"Name\"], axis=1, inplace=True)\ndataset[\"Fsize\"] = dataset[\"SibSp\"] + dataset[\"Parch\"] + 1\ng = sns.factorplot(x=\"Fsize\", y=\"Survived\", data=dataset)\ng = g.set_ylabels(\"Survival Probability\")\ndataset[\"Single\"] = dataset[\"Fsize\"].map(lambda s: 1 if s == 1 else 0)\ndataset[\"SmallF\"] = dataset[\"Fsize\"].map(lambda s: 1 if s == 2 else 0)\ndataset[\"MedF\"] = dataset[\"Fsize\"].map(lambda s: 1 if 3 <= s <= 4 else 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_modin-project__modin/stress_tests/kaggle/kaggle12.py_dataset_LargeF_datas_cv_results._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_dataset_LargeF_datas_cv_results._", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 248, "span_ids": ["impl:133", "impl:183"], "tokens": 752}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "dataset[\"LargeF\"] = dataset[\"Fsize\"].map(lambda s: 1 if s >= 5 else 0)\ng = sns.factorplot(x=\"Single\", y=\"Survived\", data=dataset, kind=\"bar\")\ng = g.set_ylabels(\"Survival Probability\")\ng = sns.factorplot(x=\"SmallF\", y=\"Survived\", data=dataset, kind=\"bar\")\ng = g.set_ylabels(\"Survival Probability\")\ng = sns.factorplot(x=\"MedF\", y=\"Survived\", data=dataset, kind=\"bar\")\ng = g.set_ylabels(\"Survival Probability\")\ng = sns.factorplot(x=\"LargeF\", y=\"Survived\", data=dataset, kind=\"bar\")\ng = g.set_ylabels(\"Survival Probability\")\ndataset = pd.get_dummies(dataset, columns=[\"Title\"])\ndataset = pd.get_dummies(dataset, columns=[\"Embarked\"], prefix=\"Em\")\ndataset.head()\ndataset[\"Cabin\"].head()\ndataset[\"Cabin\"].describe()\ndataset[\"Cabin\"].isnull().sum()\ndataset[\"Cabin\"][dataset[\"Cabin\"].notnull()].head()\ndataset[\"Cabin\"] = pd.Series(\n [i[0] if not pd.isnull(i) else \"X\" for i in dataset[\"Cabin\"]]\n)\ng = sns.countplot(dataset[\"Cabin\"], order=[\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"T\", \"X\"])\ng = sns.factorplot(\n y=\"Survived\",\n x=\"Cabin\",\n data=dataset,\n kind=\"bar\",\n order=[\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"T\", \"X\"],\n)\ng = g.set_ylabels(\"Survival Probability\")\ndataset = pd.get_dummies(dataset, columns=[\"Cabin\"], prefix=\"Cabin\")\ndataset[\"Ticket\"].head()\nTicket = []\nfor i in list(dataset.Ticket):\n if not i.isdigit():\n Ticket.append(\n i.replace(\".\", \"\").replace(\"/\", \"\").strip().split(\" \")[0]\n ) # Take prefix\n else:\n Ticket.append(\"X\")\ndataset[\"Ticket\"] = Ticket\ndataset[\"Ticket\"].head()\ndataset = pd.get_dummies(dataset, columns=[\"Ticket\"], prefix=\"T\")\ndataset[\"Pclass\"] = dataset[\"Pclass\"].astype(\"category\")\ndataset = pd.get_dummies(dataset, columns=[\"Pclass\"], prefix=\"Pc\")\ndataset.drop(labels=[\"PassengerId\"], axis=1, inplace=True)\ndataset.head()\ntrain = dataset[:train_len]\ntest = dataset[train_len:]\ntest.drop(labels=[\"Survived\"], axis=1, inplace=True)\ntrain[\"Survived\"] = train[\"Survived\"].astype(int)\nY_train = train[\"Survived\"]\nX_train = train.drop(labels=[\"Survived\"], axis=1)\nkfold = StratifiedKFold(n_splits=10)\nrandom_state = 2\nclassifiers = []\nclassifiers.append(SVC(random_state=random_state))\nclassifiers.append(DecisionTreeClassifier(random_state=random_state))\nclassifiers.append(\n AdaBoostClassifier(\n DecisionTreeClassifier(random_state=random_state),\n random_state=random_state,\n learning_rate=0.1,\n )\n)\nclassifiers.append(RandomForestClassifier(random_state=random_state))\nclassifiers.append(ExtraTreesClassifier(random_state=random_state))\nclassifiers.append(GradientBoostingClassifier(random_state=random_state))\nclassifiers.append(MLPClassifier(random_state=random_state))\nclassifiers.append(KNeighborsClassifier())\nclassifiers.append(LogisticRegression(random_state=random_state))\nclassifiers.append(LinearDiscriminantAnalysis())\ncv_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_modin-project__modin/stress_tests/kaggle/kaggle12.py_for_classifier_in_classif_GBC.GradientBoostingClassifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_for_classifier_in_classif_GBC.GradientBoostingClassifie", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 249, "end_line": 335, "span_ids": ["impl:235", "impl:183"], "tokens": 728}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "for classifier in classifiers:\n cv_results.append(\n cross_val_score(\n classifier, X_train, y=Y_train, scoring=\"accuracy\", cv=kfold, n_jobs=4\n )\n )\ncv_means = []\ncv_std = []\nfor cv_result in cv_results:\n cv_means.append(cv_result.mean())\n cv_std.append(cv_result.std())\ncv_res = pd.DataFrame(\n {\n \"CrossValMeans\": cv_means,\n \"CrossValerrors\": cv_std,\n \"Algorithm\": [\n \"SVC\",\n \"DecisionTree\",\n \"AdaBoost\",\n \"RandomForest\",\n \"ExtraTrees\",\n \"GradientBoosting\",\n \"MultipleLayerPerceptron\",\n \"KNeighboors\",\n \"LogisticRegression\",\n \"LinearDiscriminantAnalysis\",\n ],\n }\n)\ng = sns.barplot(\n \"CrossValMeans\",\n \"Algorithm\",\n data=cv_res,\n palette=\"Set3\",\n orient=\"h\",\n **{\"xerr\": cv_std}\n)\ng.set_xlabel(\"Mean Accuracy\")\ng = g.set_title(\"Cross validation scores\")\nDTC = DecisionTreeClassifier()\nadaDTC = AdaBoostClassifier(DTC, random_state=7)\nada_param_grid = {\n \"base_estimator__criterion\": [\"gini\", \"entropy\"],\n \"base_estimator__splitter\": [\"best\", \"random\"],\n \"algorithm\": [\"SAMME\", \"SAMME.R\"],\n \"n_estimators\": [1, 2],\n \"learning_rate\": [0.0001, 0.001, 0.01, 0.1, 0.2, 0.3, 1.5],\n}\ngsadaDTC = GridSearchCV(\n adaDTC, param_grid=ada_param_grid, cv=kfold, scoring=\"accuracy\", n_jobs=4, verbose=1\n)\ngsadaDTC.fit(X_train, Y_train)\nada_best = gsadaDTC.best_estimator_\ngsadaDTC.best_score_\nExtC = ExtraTreesClassifier()\nex_param_grid = {\n \"max_depth\": [None],\n \"max_features\": [1, 3, 10],\n \"min_samples_split\": [2, 3, 10],\n \"min_samples_leaf\": [1, 3, 10],\n \"bootstrap\": [False],\n \"n_estimators\": [100, 300],\n \"criterion\": [\"gini\"],\n}\ngsExtC = GridSearchCV(\n ExtC, param_grid=ex_param_grid, cv=kfold, scoring=\"accuracy\", n_jobs=4, verbose=1\n)\ngsExtC.fit(X_train, Y_train)\nExtC_best = gsExtC.best_estimator_\ngsExtC.best_score_\nRFC = RandomForestClassifier()\nrf_param_grid = {\n \"max_depth\": [None],\n \"max_features\": [1, 3, 10],\n \"min_samples_split\": [2, 3, 10],\n \"min_samples_leaf\": [1, 3, 10],\n \"bootstrap\": [False],\n \"n_estimators\": [100, 300],\n \"criterion\": [\"gini\"],\n}\ngsRFC = GridSearchCV(\n RFC, param_grid=rf_param_grid, cv=kfold, scoring=\"accuracy\", n_jobs=4, verbose=1\n)\ngsRFC.fit(X_train, Y_train)\nRFC_best = gsRFC.best_estimator_\ngsRFC.best_score_\nGBC = GradientBoostingClassifier()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_gb_param_grid_gsSVMC_best_score_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_gb_param_grid_gsSVMC_best_score_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 336, "end_line": 361, "span_ids": ["impl:267", "impl:235"], "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": "gb_param_grid = {\n \"loss\": [\"deviance\"],\n \"n_estimators\": [100, 200, 300],\n \"learning_rate\": [0.1, 0.05, 0.01],\n \"max_depth\": [4, 8],\n \"min_samples_leaf\": [100, 150],\n \"max_features\": [0.3, 0.1],\n}\ngsGBC = GridSearchCV(\n GBC, param_grid=gb_param_grid, cv=kfold, scoring=\"accuracy\", n_jobs=4, verbose=1\n)\ngsGBC.fit(X_train, Y_train)\nGBC_best = gsGBC.best_estimator_\ngsGBC.best_score_\nSVMC = SVC(probability=True)\nsvc_param_grid = {\n \"kernel\": [\"rbf\"],\n \"gamma\": [0.001, 0.01, 0.1, 1],\n \"C\": [1, 10, 50, 100, 200, 300, 1000],\n}\ngsSVMC = GridSearchCV(\n SVMC, param_grid=svc_param_grid, cv=kfold, scoring=\"accuracy\", n_jobs=4, verbose=1\n)\ngsSVMC.fit(X_train, Y_train)\nSVMC_best = gsSVMC.best_estimator_\ngsSVMC.best_score_", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_plot_learning_curve_plot_learning_curve.return.plt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_plot_learning_curve_plot_learning_curve.return.plt", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 364, "end_line": 408, "span_ids": ["plot_learning_curve"], "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 plot_learning_curve(\n estimator,\n title,\n X,\n y,\n ylim=None,\n cv=None,\n n_jobs=-1,\n train_sizes=np.linspace(0.1, 1.0, 5),\n):\n \"\"\"Generate a simple plot of the test and training learning curve\"\"\"\n plt.figure()\n plt.title(title)\n if ylim is not None:\n plt.ylim(*ylim)\n plt.xlabel(\"Training examples\")\n plt.ylabel(\"Score\")\n train_sizes, train_scores, test_scores = learning_curve(\n estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes\n )\n train_scores_mean = np.mean(train_scores, axis=1)\n train_scores_std = np.std(train_scores, axis=1)\n test_scores_mean = np.mean(test_scores, axis=1)\n test_scores_std = np.std(test_scores, axis=1)\n plt.grid()\n plt.fill_between(\n train_sizes,\n train_scores_mean - train_scores_std,\n train_scores_mean + train_scores_std,\n alpha=0.1,\n color=\"r\",\n )\n plt.fill_between(\n train_sizes,\n test_scores_mean - test_scores_std,\n test_scores_mean + test_scores_std,\n alpha=0.1,\n color=\"g\",\n )\n plt.plot(train_sizes, train_scores_mean, \"o-\", color=\"r\", label=\"Training score\")\n plt.plot(\n train_sizes, test_scores_mean, \"o-\", color=\"g\", label=\"Cross-validation score\"\n )\n plt.legend(loc=\"best\")\n return plt", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_g_96_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle12.py_g_96_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle12.py", "file_name": "kaggle12.py", "file_type": "text/x-python", "category": "implementation", "start_line": 411, "end_line": 486, "span_ids": ["impl:326", "impl:281"], "tokens": 696}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "g = plot_learning_curve(\n gsRFC.best_estimator_, \"RF mearning curves\", X_train, Y_train, cv=kfold\n)\ng = plot_learning_curve(\n gsExtC.best_estimator_, \"ExtraTrees learning curves\", X_train, Y_train, cv=kfold\n)\ng = plot_learning_curve(\n gsSVMC.best_estimator_, \"SVC learning curves\", X_train, Y_train, cv=kfold\n)\ng = plot_learning_curve(\n gsadaDTC.best_estimator_, \"AdaBoost learning curves\", X_train, Y_train, cv=kfold\n)\ng = plot_learning_curve(\n gsGBC.best_estimator_,\n \"GradientBoosting learning curves\",\n X_train,\n Y_train,\n cv=kfold,\n)\nnrows = ncols = 2\nfig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=\"all\", figsize=(15, 15))\nnames_classifiers = [\n (\"AdaBoosting\", ada_best),\n (\"ExtraTrees\", ExtC_best),\n (\"RandomForest\", RFC_best),\n (\"GradientBoosting\", GBC_best),\n]\nnclassifier = 0\nfor row in range(nrows):\n for col in range(ncols):\n name = names_classifiers[nclassifier][0]\n classifier = names_classifiers[nclassifier][1]\n indices = np.argsort(classifier.feature_importances_)[::-1][:40]\n g = sns.barplot(\n y=X_train.columns[indices][:40],\n x=classifier.feature_importances_[indices][:40],\n orient=\"h\",\n ax=axes[row][col],\n )\n g.set_xlabel(\"Relative importance\", fontsize=12)\n g.set_ylabel(\"Features\", fontsize=12)\n g.tick_params(labelsize=9)\n g.set_title(name + \" feature importance\")\n nclassifier += 1\ntest_Survived_RFC = pd.Series(RFC_best.predict(test), name=\"RFC\")\ntest_Survived_ExtC = pd.Series(ExtC_best.predict(test), name=\"ExtC\")\ntest_Survived_SVMC = pd.Series(SVMC_best.predict(test), name=\"SVC\")\ntest_Survived_AdaC = pd.Series(ada_best.predict(test), name=\"Ada\")\ntest_Survived_GBC = pd.Series(GBC_best.predict(test), name=\"GBC\")\nensemble_results = pd.concat(\n [\n test_Survived_RFC,\n test_Survived_ExtC,\n test_Survived_AdaC,\n test_Survived_GBC,\n test_Survived_SVMC,\n ],\n axis=1,\n)\ng = sns.heatmap(ensemble_results.corr(), annot=True)\nvotingC = VotingClassifier(\n estimators=[\n (\"rfc\", RFC_best),\n (\"extc\", ExtC_best),\n (\"svc\", SVMC_best),\n (\"adac\", ada_best),\n (\"gbc\", GBC_best),\n ],\n voting=\"soft\",\n n_jobs=4,\n)\nvotingC = votingC.fit(X_train, Y_train)\ntest_Survived = pd.Series(votingC.predict(test), name=\"Survived\")\nresults = pd.concat([IDtest, test_Survived], axis=1)\nresults.to_csv(\"ensemble_python_voting.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle13.py__usr_bin_env_python_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle13.py__usr_bin_env_python_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle13.py", "file_name": "kaggle13.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["docstring"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python\nimport matplotlib\n\nmatplotlib.use(\"PS\")\nimport modin.pandas as pd\nimport warnings # current version of seaborn generates a bunch of warnings that we'll ignore\n\nwarnings.filterwarnings(\"ignore\")\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nsns.set(style=\"white\", color_codes=True)\niris = pd.read_csv(\"Iris.csv\") # the iris dataset is now a Pandas DataFrame\niris.head()\niris[\"Species\"].value_counts()\niris.plot(kind=\"scatter\", x=\"SepalLengthCm\", y=\"SepalWidthCm\")\nsns.jointplot(x=\"SepalLengthCm\", y=\"SepalWidthCm\", data=iris, size=5)\nsns.FacetGrid(iris, hue=\"Species\", size=5).map(\n plt.scatter, \"SepalLengthCm\", \"SepalWidthCm\"\n).add_legend()\nsns.boxplot(x=\"Species\", y=\"PetalLengthCm\", data=iris)\nax = sns.boxplot(x=\"Species\", y=\"PetalLengthCm\", data=iris)\nax = sns.stripplot(\n x=\"Species\", y=\"PetalLengthCm\", data=iris, jitter=True, edgecolor=\"gray\"\n)\nsns.violinplot(x=\"Species\", y=\"PetalLengthCm\", data=iris, size=6)\nsns.FacetGrid(iris, hue=\"Species\", size=6).map(\n sns.kdeplot, \"PetalLengthCm\"\n).add_legend()\niris.drop(\"Id\", axis=1).boxplot(by=\"Species\", figsize=(12, 6))\nfrom pandas.tools.plotting import andrews_curves\n\nandrews_curves(iris.drop(\"Id\", axis=1), \"Species\")\nfrom pandas.tools.plotting import parallel_coordinates\n\nparallel_coordinates(iris.drop(\"Id\", axis=1), \"Species\")\nfrom pandas.tools.plotting import radviz\n\nradviz(iris.drop(\"Id\", axis=1), \"Species\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_matplotlib__Checking_the_Initials_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_matplotlib__Checking_the_Initials_w", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 57, "span_ids": ["imports", "impl:32"], "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": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport modin.pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nplt.style.use(\"fivethirtyeight\")\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\ndata = pd.read_csv(\"train.csv\")\ndata.head()\ndata.isnull().sum() # checking for total null values\ndata.groupby([\"Sex\", \"Survived\"])[\"Survived\"].count()\nf, ax = plt.subplots(1, 2, figsize=(18, 8))\ndata[[\"Sex\", \"Survived\"]].groupby([\"Sex\"]).mean().plot.bar(ax=ax[0])\nax[0].set_title(\"Survived vs Sex\")\nsns.countplot(\"Sex\", hue=\"Survived\", data=data, ax=ax[1])\nax[1].set_title(\"Sex:Survived vs Dead\")\nplt.show()\npd.crosstab(data.Pclass, data.Survived, margins=True).style.background_gradient(\n cmap=\"summer_r\"\n)\nf, ax = plt.subplots(1, 2, figsize=(18, 8))\ndata[\"Pclass\"].value_counts().plot.bar(\n color=[\"#CD7F32\", \"#FFDF00\", \"#D3D3D3\"], ax=ax[0]\n)\nax[0].set_title(\"Number Of Passengers By Pclass\")\nax[0].set_ylabel(\"Count\")\nsns.countplot(\"Pclass\", hue=\"Survived\", data=data, ax=ax[1])\nax[1].set_title(\"Pclass:Survived vs Dead\")\nplt.show()\npd.crosstab(\n [data.Sex, data.Survived], data.Pclass, margins=True\n).style.background_gradient(cmap=\"summer_r\")\nsns.factorplot(\"Pclass\", \"Survived\", hue=\"Sex\", data=data)\nplt.show()\nprint(\"Oldest Passenger was of:\", data[\"Age\"].max(), \"Years\")\nprint(\"Youngest Passenger was of:\", data[\"Age\"].min(), \"Years\")\nprint(\"Average Age on the ship:\", data[\"Age\"].mean(), \"Years\")\nf, ax = plt.subplots(1, 2, figsize=(18, 8))\nsns.violinplot(\"Pclass\", \"Age\", hue=\"Survived\", data=data, split=True, ax=ax[0])\nax[0].set_title(\"Pclass and Age vs Survived\")\nax[0].set_yticks(range(0, 110, 10))\nsns.violinplot(\"Sex\", \"Age\", hue=\"Survived\", data=data, split=True, ax=ax[1])\nax[1].set_title(\"Sex and Age vs Survived\")\nax[1].set_yticks(range(0, 110, 10))\nplt.show()\ndata[\"Initial\"] = 0\nfor i in data:\n data[\"Initial\"] = data.Name.str.extract(\n r\"([A-Za-z]+)\\.\" # noqa: W605\n ) # lets extract the Salutations\npd.crosstab(data.Initial, data.Sex).T.style.background_gradient(\n cmap=\"summer_r\"\n) # Checking the Initials with the Sex\ndata.loc[(data[\"Fare\"] > 31) & (data[\"Fare\"] <= 513), \"Fare_cat\"] = 3\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.ensemble import AdaBoostClassifier", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_data_Initial_replace__None_59": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_data_Initial_replace__None_59", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 133, "span_ids": ["impl:32", "impl:54"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "data[\"Initial\"].replace(\n [\n \"Mlle\",\n \"Mme\",\n \"Ms\",\n \"Dr\",\n \"Major\",\n \"Lady\",\n \"Countess\",\n \"Jonkheer\",\n \"Col\",\n \"Rev\",\n \"Capt\",\n \"Sir\",\n \"Don\",\n ],\n [\n \"Miss\",\n \"Miss\",\n \"Miss\",\n \"Mr\",\n \"Mr\",\n \"Mrs\",\n \"Mrs\",\n \"Other\",\n \"Other\",\n \"Other\",\n \"Mr\",\n \"Mr\",\n \"Mr\",\n ],\n inplace=True,\n)\ndata.groupby(\"Initial\")[\"Age\"].mean() # lets check the average age by Initials\ndata.loc[(data.Age.isnull()) & (data.Initial == \"Mr\"), \"Age\"] = 33\ndata.loc[(data.Age.isnull()) & (data.Initial == \"Mrs\"), \"Age\"] = 36\ndata.loc[(data.Age.isnull()) & (data.Initial == \"Master\"), \"Age\"] = 5\ndata.loc[(data.Age.isnull()) & (data.Initial == \"Miss\"), \"Age\"] = 22\ndata.loc[(data.Age.isnull()) & (data.Initial == \"Other\"), \"Age\"] = 46\ndata.Age.isnull().any() # So no null values left finally\nf, ax = plt.subplots(1, 2, figsize=(20, 10))\ndata[data[\"Survived\"] == 0].Age.plot.hist(\n ax=ax[0], bins=20, edgecolor=\"black\", color=\"red\"\n)\nax[0].set_title(\"Survived= 0\")\nx1 = list(range(0, 85, 5))\nax[0].set_xticks(x1)\ndata[data[\"Survived\"] == 1].Age.plot.hist(\n ax=ax[1], color=\"green\", bins=20, edgecolor=\"black\"\n)\nax[1].set_title(\"Survived= 1\")\nx2 = list(range(0, 85, 5))\nax[1].set_xticks(x2)\nplt.show()\nsns.factorplot(\"Pclass\", \"Survived\", col=\"Initial\", data=data)\nplt.show()\npd.crosstab(\n [data.Embarked, data.Pclass], [data.Sex, data.Survived], margins=True\n).style.background_gradient(cmap=\"summer_r\")\nsns.factorplot(\"Embarked\", \"Survived\", data=data)\nfig = plt.gcf()\nfig.set_size_inches(5, 3)\nplt.show()\nf, ax = plt.subplots(2, 2, figsize=(20, 15))\nsns.countplot(\"Embarked\", data=data, ax=ax[0, 0])\nax[0, 0].set_title(\"No. Of Passengers Boarded\")\nsns.countplot(\"Embarked\", hue=\"Sex\", data=data, ax=ax[0, 1])\nax[0, 1].set_title(\"Male-Female Split for Embarked\")\nsns.countplot(\"Embarked\", hue=\"Survived\", data=data, ax=ax[1, 0])\nax[1, 0].set_title(\"Embarked vs Survived\")\nsns.countplot(\"Embarked\", hue=\"Pclass\", data=data, ax=ax[1, 1])\nax[1, 1].set_title(\"Embarked vs Pclass\")\nplt.subplots_adjust(wspace=0.2, hspace=0.5)\nplt.show()\nsns.factorplot(\"Pclass\", \"Survived\", hue=\"Sex\", col=\"Embarked\", data=data)\nplt.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_modin-project__modin/stress_tests/kaggle/kaggle14.py_data_Embarked_fillna___Alone": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_data_Embarked_fillna___Alone", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 185, "span_ids": ["impl:121", "impl:54", "impl:88"], "tokens": 773}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "data[\"Embarked\"].fillna(\"S\", inplace=True)\ndata.Embarked.isnull().any() # Finally No NaN values\npd.crosstab([data.SibSp], data.Survived).style.background_gradient(cmap=\"summer_r\")\nf, ax = plt.subplots(1, 2, figsize=(20, 8))\nsns.barplot(\"SibSp\", \"Survived\", data=data, ax=ax[0])\nax[0].set_title(\"SibSp vs Survived\")\nsns.factorplot(\"SibSp\", \"Survived\", data=data, ax=ax[1])\nax[1].set_title(\"SibSp vs Survived\")\nplt.close(2)\nplt.show()\npd.crosstab(data.SibSp, data.Pclass).style.background_gradient(cmap=\"summer_r\")\npd.crosstab(data.Parch, data.Pclass).style.background_gradient(cmap=\"summer_r\")\nf, ax = plt.subplots(1, 2, figsize=(20, 8))\nsns.barplot(\"Parch\", \"Survived\", data=data, ax=ax[0])\nax[0].set_title(\"Parch vs Survived\")\nsns.factorplot(\"Parch\", \"Survived\", data=data, ax=ax[1])\nax[1].set_title(\"Parch vs Survived\")\nplt.close(2)\nplt.show()\nprint(\"Highest Fare was:\", data[\"Fare\"].max())\nprint(\"Lowest Fare was:\", data[\"Fare\"].min())\nprint(\"Average Fare was:\", data[\"Fare\"].mean())\nf, ax = plt.subplots(1, 3, figsize=(20, 8))\nsns.distplot(data[data[\"Pclass\"] == 1].Fare, ax=ax[0])\nax[0].set_title(\"Fares in Pclass 1\")\nsns.distplot(data[data[\"Pclass\"] == 2].Fare, ax=ax[1])\nax[1].set_title(\"Fares in Pclass 2\")\nsns.distplot(data[data[\"Pclass\"] == 3].Fare, ax=ax[2])\nax[2].set_title(\"Fares in Pclass 3\")\nplt.show()\nsns.heatmap(\n data.corr(), annot=True, cmap=\"RdYlGn\", linewidths=0.2\n) # data.corr()-->correlation matrix\nfig = plt.gcf()\nfig.set_size_inches(10, 8)\nplt.show()\ndata[\"Age_band\"] = 0\ndata.loc[data[\"Age\"] <= 16, \"Age_band\"] = 0\ndata.loc[(data[\"Age\"] > 16) & (data[\"Age\"] <= 32), \"Age_band\"] = 1\ndata.loc[(data[\"Age\"] > 32) & (data[\"Age\"] <= 48), \"Age_band\"] = 2\ndata.loc[(data[\"Age\"] > 48) & (data[\"Age\"] <= 64), \"Age_band\"] = 3\ndata.loc[data[\"Age\"] > 64, \"Age_band\"] = 4\ndata.head(2)\ndata[\"Age_band\"].value_counts().to_frame().style.background_gradient(\n cmap=\"summer\"\n) # checking the number of passenegers in each band\nsns.factorplot(\"Age_band\", \"Survived\", data=data, col=\"Pclass\")\nplt.show()\ndata[\"Family_Size\"] = 0\ndata[\"Family_Size\"] = data[\"Parch\"] + data[\"SibSp\"] # family size\ndata[\"Alone\"] = 0\ndata.loc[data.Family_Size == 0, \"Alone\"] = 1 # Alone\nfrom sklearn.model_selection import cross_val_predict", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_None_24_prediction1.model_predict_test_X_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_None_24_prediction1.model_predict_test_X_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 246, "span_ids": ["impl:121", "impl:151"], "tokens": 764}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "plt.show()\nf, ax = plt.subplots(1, 2, figsize=(18, 6))\nsns.factorplot(\"Family_Size\", \"Survived\", data=data, ax=ax[0])\nax[0].set_title(\"Family_Size vs Survived\")\nsns.factorplot(\"Alone\", \"Survived\", data=data, ax=ax[1])\nax[1].set_title(\"Alone vs Survived\")\nplt.close(2)\nplt.close(3)\nplt.show()\nsns.factorplot(\"Alone\", \"Survived\", data=data, hue=\"Sex\", col=\"Pclass\")\nplt.show()\ndata[\"Fare_Range\"] = pd.qcut(data[\"Fare\"], 4)\ndata.groupby([\"Fare_Range\"])[\"Survived\"].mean().to_frame().style.background_gradient(\n cmap=\"summer_r\"\n)\ndata[\"Fare_cat\"] = 0\ndata.loc[data[\"Fare\"] <= 7.91, \"Fare_cat\"] = 0\ndata.loc[(data[\"Fare\"] > 7.91) & (data[\"Fare\"] <= 14.454), \"Fare_cat\"] = 1\ndata.loc[(data[\"Fare\"] > 14.454) & (data[\"Fare\"] <= 31), \"Fare_cat\"] = 2\ndata.loc[(data[\"Fare\"] > 31) & (data[\"Fare\"] <= 513), \"Fare_cat\"] = 3\nsns.factorplot(\"Fare_cat\", \"Survived\", data=data, hue=\"Sex\")\nplt.show()\ndata[\"Sex\"].replace([\"male\", \"female\"], [0, 1], inplace=True)\ndata[\"Embarked\"].replace([\"S\", \"C\", \"Q\"], [0, 1, 2], inplace=True)\ndata[\"Initial\"].replace(\n [\"Mr\", \"Mrs\", \"Miss\", \"Master\", \"Other\"], [0, 1, 2, 3, 4], inplace=True\n)\ndata.drop(\n [\"Name\", \"Age\", \"Ticket\", \"Fare\", \"Cabin\", \"Fare_Range\", \"PassengerId\"],\n axis=1,\n inplace=True,\n)\nsns.heatmap(\n data.corr(), annot=True, cmap=\"RdYlGn\", linewidths=0.2, annot_kws={\"size\": 20}\n)\nfig = plt.gcf()\nfig.set_size_inches(18, 15)\nplt.xticks(fontsize=14)\nplt.yticks(fontsize=14)\nplt.show()\nfrom sklearn.linear_model import LogisticRegression # logistic regression\nfrom sklearn import svm # support vector Machine\nfrom sklearn.ensemble import RandomForestClassifier # Random Forest\nfrom sklearn.neighbors import KNeighborsClassifier # KNN\nfrom sklearn.naive_bayes import GaussianNB # Naive bayes\nfrom sklearn.tree import DecisionTreeClassifier # Decision Tree\nfrom sklearn.model_selection import train_test_split # training and testing data split\nfrom sklearn import metrics # accuracy measure\nfrom sklearn.metrics import confusion_matrix # for confusion matrix\n\ntrain, test = train_test_split(\n data, test_size=0.3, random_state=0, stratify=data[\"Survived\"]\n)\ntrain_X = train[train.columns[1:]]\ntrain_Y = train[train.columns[:1]]\ntest_X = test[test.columns[1:]]\ntest_Y = test[test.columns[:1]]\nX = data[data.columns[1:]]\nY = data[\"Survived\"]\nmodel = svm.SVC(kernel=\"rbf\", C=1, gamma=0.1)\nmodel.fit(train_X, train_Y)\nprediction1 = model.predict(test_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_modin-project__modin/stress_tests/kaggle/kaggle14.py_print_Accuracy_for_rbf_S_plt_title_Average_CV_Mea": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_print_Accuracy_for_rbf_S_plt_title_Average_CV_Mea", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 247, "end_line": 336, "span_ids": ["impl:191", "impl:151", "impl:249"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "data.loc[(data[\"Age\"] > 16) & (data[\"Age\"] <= 32), \"Age_band\"] = 1\nprint(\"Accuracy for rbf SVM is \", metrics.accuracy_score(prediction1, test_Y))\nmodel = svm.SVC(kernel=\"linear\", C=0.1, gamma=0.1)\nmodel.fit(train_X, train_Y)\nprediction2 = model.predict(test_X)\nprint(\"Accuracy for linear SVM is\", metrics.accuracy_score(prediction2, test_Y))\nmodel = LogisticRegression()\nmodel.fit(train_X, train_Y)\nprediction3 = model.predict(test_X)\nprint(\n \"The accuracy of the Logistic Regression is\",\n metrics.accuracy_score(prediction3, test_Y),\n)\nmodel = DecisionTreeClassifier()\nmodel.fit(train_X, train_Y)\nprediction4 = model.predict(test_X)\nprint(\n \"The accuracy of the Decision Tree is\", metrics.accuracy_score(prediction4, test_Y)\n)\nmodel = KNeighborsClassifier()\nmodel.fit(train_X, train_Y)\nprediction5 = model.predict(test_X)\nprint(\"The accuracy of the KNN is\", metrics.accuracy_score(prediction5, test_Y))\na_index = list(range(1, 11))\na = pd.Series()\nx = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\nfor i in list(range(1, 11)):\n model = KNeighborsClassifier(n_neighbors=i)\n model.fit(train_X, train_Y)\n prediction = model.predict(test_X)\n a = a.append(pd.Series(metrics.accuracy_score(prediction, test_Y)))\nplt.plot(a_index, a)\nplt.xticks(x)\nfig = plt.gcf()\nfig.set_size_inches(12, 6)\nplt.show()\nprint(\n \"Accuracies for different values of n are:\",\n a.values,\n \"with the max value as \",\n a.values.max(),\n)\nmodel = GaussianNB()\nmodel.fit(train_X, train_Y)\nprediction6 = model.predict(test_X)\nprint(\"The accuracy of the NaiveBayes is\", metrics.accuracy_score(prediction6, test_Y))\nmodel = RandomForestClassifier(n_estimators=100)\nmodel.fit(train_X, train_Y)\nprediction7 = model.predict(test_X)\nprint(\n \"The accuracy of the Random Forests is\", metrics.accuracy_score(prediction7, test_Y)\n)\nfrom sklearn.model_selection import KFold # for K-fold cross validation\nfrom sklearn.model_selection import cross_val_score # score evaluation\nfrom sklearn.model_selection import cross_val_predict # prediction\n\nkfold = KFold(n_splits=10, random_state=22) # k=10, split the data into 10 equal parts\nxyz = []\naccuracy = []\nstd = []\nclassifiers = [\n \"Linear Svm\",\n \"Radial Svm\",\n \"Logistic Regression\",\n \"KNN\",\n \"Decision Tree\",\n \"Naive Bayes\",\n \"Random Forest\",\n]\nmodels = [\n svm.SVC(kernel=\"linear\"),\n svm.SVC(kernel=\"rbf\"),\n LogisticRegression(),\n KNeighborsClassifier(n_neighbors=9),\n DecisionTreeClassifier(),\n GaussianNB(),\n RandomForestClassifier(n_estimators=100),\n]\nfor i in models:\n model = i\n cv_result = cross_val_score(model, X, Y, cv=kfold, scoring=\"accuracy\")\n xyz.append(cv_result.mean())\n std.append(cv_result.std())\n accuracy.append(cv_result)\nnew_models_dataframe2 = pd.DataFrame({\"CV Mean\": xyz, \"Std\": std}, index=classifiers)\nnew_models_dataframe2\nplt.subplots(figsize=(12, 6))\nbox = pd.DataFrame(accuracy, index=[classifiers])\nbox.T.boxplot()\nnew_models_dataframe2[\"CV Mean\"].plot.barh(width=0.8)\nplt.title(\"Average CV Mean Accuracy\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_fig_38_hyper_52._n_estimators_n_estima": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_fig_38_hyper_52._n_estimators_n_estima", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 375, "span_ids": ["impl:293", "impl:249"], "tokens": 728}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "plt.show()\nfig = plt.gcf()\nfig.set_size_inches(8, 5)\nplt.show()\nf, ax = plt.subplots(3, 3, figsize=(12, 10))\ny_pred = cross_val_predict(svm.SVC(kernel=\"rbf\"), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[0, 0], annot=True, fmt=\"2.0f\")\nax[0, 0].set_title(\"Matrix for rbf-SVM\")\ny_pred = cross_val_predict(svm.SVC(kernel=\"linear\"), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[0, 1], annot=True, fmt=\"2.0f\")\nax[0, 1].set_title(\"Matrix for Linear-SVM\")\ny_pred = cross_val_predict(KNeighborsClassifier(n_neighbors=9), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[0, 2], annot=True, fmt=\"2.0f\")\nax[0, 2].set_title(\"Matrix for KNN\")\ny_pred = cross_val_predict(RandomForestClassifier(n_estimators=100), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[1, 0], annot=True, fmt=\"2.0f\")\nax[1, 0].set_title(\"Matrix for Random-Forests\")\ny_pred = cross_val_predict(LogisticRegression(), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[1, 1], annot=True, fmt=\"2.0f\")\nax[1, 1].set_title(\"Matrix for Logistic Regression\")\ny_pred = cross_val_predict(DecisionTreeClassifier(), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[1, 2], annot=True, fmt=\"2.0f\")\nax[1, 2].set_title(\"Matrix for Decision Tree\")\ny_pred = cross_val_predict(GaussianNB(), X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, y_pred), ax=ax[2, 0], annot=True, fmt=\"2.0f\")\nax[2, 0].set_title(\"Matrix for Naive Bayes\")\nplt.subplots_adjust(hspace=0.2, wspace=0.2)\nplt.show()\nfrom sklearn.model_selection import GridSearchCV\n\nC = [0.05, 0.1, 0.2, 0.3, 0.25, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]\ngamma = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]\nkernel = [\"rbf\", \"linear\"]\nhyper = {\"kernel\": kernel, \"C\": C, \"gamma\": gamma}\ngd = GridSearchCV(estimator=svm.SVC(), param_grid=hyper, verbose=True)\ngd.fit(X, Y)\nprint(gd.best_score_)\nprint(gd.best_estimator_)\nn_estimators = range(100, 1000, 100)\nhyper = {\"n_estimators\": n_estimators}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_gd_53_gd_71.GridSearchCV_estimator_Ad": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_gd_53_gd_71.GridSearchCV_estimator_Ad", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 376, "end_line": 438, "span_ids": ["impl:293", "impl:325", "impl:366"], "tokens": 755}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "plt.show()\ngd = GridSearchCV(\n estimator=RandomForestClassifier(random_state=0), param_grid=hyper, verbose=True\n)\ngd.fit(X, Y)\nprint(gd.best_score_)\nprint(gd.best_estimator_)\nfrom sklearn.ensemble import VotingClassifier\n\nensemble_lin_rbf = VotingClassifier(\n estimators=[\n (\"KNN\", KNeighborsClassifier(n_neighbors=10)),\n (\"RBF\", svm.SVC(probability=True, kernel=\"rbf\", C=0.5, gamma=0.1)),\n (\"RFor\", RandomForestClassifier(n_estimators=500, random_state=0)),\n (\"LR\", LogisticRegression(C=0.05)),\n (\"DT\", DecisionTreeClassifier(random_state=0)),\n (\"NB\", GaussianNB()),\n (\"svm\", svm.SVC(kernel=\"linear\", probability=True)),\n ],\n voting=\"soft\",\n).fit(train_X, train_Y)\nprint(\"The accuracy for ensembled model is:\", ensemble_lin_rbf.score(test_X, test_Y))\ncross = cross_val_score(ensemble_lin_rbf, X, Y, cv=10, scoring=\"accuracy\")\nprint(\"The cross validated score is\", cross.mean())\nfrom sklearn.ensemble import BaggingClassifier\n\nmodel = BaggingClassifier(\n base_estimator=KNeighborsClassifier(n_neighbors=3), random_state=0, n_estimators=700\n)\nmodel.fit(train_X, train_Y)\nprediction = model.predict(test_X)\nprint(\"The accuracy for bagged KNN is:\", metrics.accuracy_score(prediction, test_Y))\nresult = cross_val_score(model, X, Y, cv=10, scoring=\"accuracy\")\nprint(\"The cross validated score for bagged KNN is:\", result.mean())\nmodel = BaggingClassifier(\n base_estimator=DecisionTreeClassifier(), random_state=0, n_estimators=100\n)\nmodel.fit(train_X, train_Y)\nprediction = model.predict(test_X)\nprint(\n \"The accuracy for bagged Decision Tree is:\",\n metrics.accuracy_score(prediction, test_Y),\n)\nresult = cross_val_score(model, X, Y, cv=10, scoring=\"accuracy\")\nprint(\"The cross validated score for bagged Decision Tree is:\", result.mean())\nfrom sklearn.ensemble import AdaBoostClassifier\n\nada = AdaBoostClassifier(n_estimators=200, random_state=0, learning_rate=0.1)\nresult = cross_val_score(ada, X, Y, cv=10, scoring=\"accuracy\")\nprint(\"The cross validated score for AdaBoost is:\", result.mean())\nfrom sklearn.ensemble import GradientBoostingClassifier\n\ngrad = GradientBoostingClassifier(n_estimators=500, random_state=0, learning_rate=0.1)\nresult = cross_val_score(grad, X, Y, cv=10, scoring=\"accuracy\")\nprint(\"The cross validated score for Gradient Boosting is:\", result.mean())\nimport xgboost as xg\n\nxgboost = xg.XGBClassifier(n_estimators=900, learning_rate=0.1)\nresult = cross_val_score(xgboost, X, Y, cv=10, scoring=\"accuracy\")\nprint(\"The cross validated score for XGBoost is:\", result.mean())\nn_estimators = list(range(100, 1100, 100))\nlearn_rate = [0.05, 0.1, 0.2, 0.3, 0.25, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]\nhyper = {\"n_estimators\": n_estimators, \"learning_rate\": learn_rate}\ngd = GridSearchCV(estimator=AdaBoostClassifier(), param_grid=hyper, verbose=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_modin-project__modin/stress_tests/kaggle/kaggle14.py_None_173_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle14.py_None_173_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle14.py", "file_name": "kaggle14.py", "file_type": "text/x-python", "category": "implementation", "start_line": 439, "end_line": 472, "span_ids": ["impl:366"], "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": "gd.fit(X, Y)\nprint(gd.best_score_)\nprint(gd.best_estimator_)\nada = AdaBoostClassifier(n_estimators=200, random_state=0, learning_rate=0.05)\nresult = cross_val_predict(ada, X, Y, cv=10)\nsns.heatmap(confusion_matrix(Y, result), cmap=\"winter\", annot=True, fmt=\"2.0f\")\nplt.show()\nf, ax = plt.subplots(2, 2, figsize=(15, 12))\nmodel = RandomForestClassifier(n_estimators=500, random_state=0)\nmodel.fit(X, Y)\npd.Series(model.feature_importances_, X.columns).sort_values(ascending=True).plot.barh(\n width=0.8, ax=ax[0, 0]\n)\nax[0, 0].set_title(\"Feature Importance in Random Forests\")\nmodel = AdaBoostClassifier(n_estimators=200, learning_rate=0.05, random_state=0)\nmodel.fit(X, Y)\npd.Series(model.feature_importances_, X.columns).sort_values(ascending=True).plot.barh(\n width=0.8, ax=ax[0, 1], color=\"#ddff11\"\n)\nax[0, 1].set_title(\"Feature Importance in AdaBoost\")\nmodel = GradientBoostingClassifier(n_estimators=500, learning_rate=0.1, random_state=0)\nmodel.fit(X, Y)\npd.Series(model.feature_importances_, X.columns).sort_values(ascending=True).plot.barh(\n width=0.8, ax=ax[1, 0], cmap=\"RdYlGn_r\"\n)\nax[1, 0].set_title(\"Feature Importance in Gradient Boosting\")\nmodel = xg.XGBClassifier(n_estimators=900, learning_rate=0.1)\nmodel.fit(X, Y)\npd.Series(model.feature_importances_, X.columns).sort_values(ascending=True).plot.barh(\n width=0.8, ax=ax[1, 1], color=\"#FD0F00\"\n)\nax[1, 1].set_title(\"Feature Importance in XgBoost\")\nplt.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_modin-project__modin/stress_tests/kaggle/kaggle17.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle17.py__", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle17.py", "file_name": "kaggle17.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["imports"], "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 modin.pandas as pd\n\nmelbourne_file_path = \"melb_data.csv\"\nmelbourne_data = pd.read_csv(melbourne_file_path)\nprint(melbourne_data.columns)\nmelbourne_price_data = melbourne_data.Price\nprint(melbourne_price_data.head())\ncolumns_of_interest = [\"Landsize\", \"BuildingArea\"]\ntwo_columns_of_data = melbourne_data[columns_of_interest]\ntwo_columns_of_data.describe()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py__usr_bin_env_python__None_33": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py__usr_bin_env_python__None_33", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 101, "span_ids": ["impl:46", "impl:35", "split_cat", "docstring"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python # noqa: E902\nimport matplotlib\n\nmatplotlib.use(\"PS\")\nimport nltk\nimport string\nimport re\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nsns.set(style=\"white\")\nfrom nltk.tokenize import word_tokenize, sent_tokenize\nfrom nltk.corpus import stopwords\nfrom sklearn.feature_extraction import stop_words\nfrom collections import Counter\nfrom wordcloud import WordCloud\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.decomposition import LatentDirichletAllocation\nimport plotly.offline as py\nimport plotly.graph_objs as go\nimport bokeh.plotting as bp\nfrom bokeh.models import HoverTool # BoxSelectTool\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.plotting import show, output_notebook # figure\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nimport logging\n\nlogging.getLogger(\"lda\").setLevel(logging.WARNING)\nnltk.download(\"punkt\")\nnltk.download(\"stopwords\")\ntrain = pd.read_csv(\"train.csv\")\ntest = pd.read_csv(\"test.csv\")\nprint(train.shape)\nprint(test.shape)\ntrain.dtypes\ntrain.head()\ntrain.price.describe()\nplt.subplot(1, 2, 1)\n(train[\"price\"]).plot.hist(bins=50, figsize=(20, 10), edgecolor=\"white\", range=[0, 250])\nplt.xlabel(\"price+\", fontsize=17)\nplt.ylabel(\"frequency\", fontsize=17)\nplt.tick_params(labelsize=15)\nplt.title(\"Price Distribution - Training Set\", fontsize=17)\nplt.subplot(1, 2, 2)\nnp.log(train[\"price\"] + 1).plot.hist(bins=50, figsize=(20, 10), edgecolor=\"white\")\nplt.xlabel(\"log(price+1)\", fontsize=17)\nplt.ylabel(\"frequency\", fontsize=17)\nplt.tick_params(labelsize=15)\nplt.title(\"Log(Price) Distribution - Training Set\", fontsize=17)\nplt.show()\ntrain.shipping.value_counts() / len(train)\nprc_shipBySeller = train.loc[train.shipping == 1, \"price\"]\nprc_shipByBuyer = train.loc[train.shipping == 0, \"price\"]\nfig, ax = plt.subplots(figsize=(20, 10))\nax.hist(\n np.log(prc_shipBySeller + 1),\n color=\"#8CB4E1\",\n alpha=1.0,\n bins=50,\n label=\"Price when Seller pays Shipping\",\n)\nax.hist(\n np.log(prc_shipByBuyer + 1),\n color=\"#007D00\",\n alpha=0.7,\n bins=50,\n label=\"Price when Buyer pays Shipping\",\n)\nax.set(title=\"Histogram Comparison\", ylabel=\"% of Dataset in Bin\")\nplt.xlabel(\"log(price+1)\", fontsize=17)\nplt.ylabel(\"frequency\", fontsize=17)\nplt.title(\"Price Distribution by Shipping Type\", fontsize=17)\nplt.tick_params(labelsize=15)\nplt.show()\nprint(\n \"There are %d unique values in the category column.\"\n % train[\"category_name\"].nunique()\n)\ntrain[\"category_name\"].value_counts()[:5]\nprint(\n \"There are %d items that do not have a label.\"\n % train[\"category_name\"].isnull().sum()\n)\n\n\ndef split_cat(text):\n try:\n return text.split(\"/\")\n except Exception:\n return (\"No Label\", \"No Label\", \"No Label\")\n\n\ntrain[\"general_cat\"], train[\"subcat_1\"], train[\"subcat_2\"] = zip(\n *train[\"category_name\"].apply(lambda x: split_cat(x))\n)\ntrain.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_modin-project__modin/stress_tests/kaggle/kaggle18.py_test_general_cat_test_df.train_groupby_desc_len_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_test_general_cat_test_df.train_groupby_desc_len_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 177, "span_ids": ["impl:93", "impl:85", "wordCount", "impl:46"], "tokens": 725}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "test[\"general_cat\"], test[\"subcat_1\"], test[\"subcat_2\"] = zip(\n *test[\"category_name\"].apply(lambda x: split_cat(x))\n)\nprint(\"There are %d unique first sub-categories.\" % train[\"subcat_1\"].nunique())\nprint(\"There are %d unique second sub-categories.\" % train[\"subcat_2\"].nunique())\nx = train[\"general_cat\"].value_counts().index.values.astype(\"str\")\ny = train[\"general_cat\"].value_counts().values\npct = [(\"%.2f\" % (v * 100)) + \"%\" for v in (y / len(train))]\ntrace1 = go.Bar(x=x, y=y, text=pct)\nlayout = {\n \"title\": \"Number of Items by Main Category\",\n \"yaxis\": {\"title\": \"Count\"},\n \"xaxis\": {\"title\": \"Category\"},\n}\nfig = {\"data\": [trace1], \"layout\": layout}\npy.iplot(fig)\nx = train[\"subcat_1\"].value_counts().index.values.astype(\"str\")[:15]\ny = train[\"subcat_1\"].value_counts().values[:15]\npct = [(\"%.2f\" % (v * 100)) + \"%\" for v in (y / len(train))][:15]\ntrace1 = go.Bar(\n x=x,\n y=y,\n text=pct,\n marker={\n \"color\": y,\n \"colorscale\": \"Portland\",\n \"showscale\": True,\n \"reversescale\": False,\n },\n)\nlayout = {\n \"title\": \"Number of Items by Sub Category (Top 15)\",\n \"yaxis\": {\"title\": \"Count\"},\n \"xaxis\": {\"title\": \"SubCategory\"},\n}\nfig = {\"data\": [trace1], \"layout\": layout}\npy.iplot(fig)\ngeneral_cats = train[\"general_cat\"].unique()\nx = [train.loc[train[\"general_cat\"] == cat, \"price\"] for cat in general_cats]\ndata = [\n go.Box(x=np.log(x[i] + 1), name=general_cats[i]) for i in range(len(general_cats))\n]\nlayout = {\n \"title\": \"Price Distribution by General Category\",\n \"yaxis\": {\"title\": \"Frequency\"},\n \"xaxis\": {\"title\": \"Category\"},\n}\nfig = {\"data\": data, \"layout\": layout}\npy.iplot(fig)\nprint(\n \"There are %d unique brand names in the training dataset.\"\n % train[\"brand_name\"].nunique()\n)\nx = train[\"brand_name\"].value_counts().index.values.astype(\"str\")[:10]\ny = train[\"brand_name\"].value_counts().values[:10]\n\n\ndef wordCount(text):\n try:\n text = text.lower()\n regex = re.compile(\"[\" + re.escape(string.punctuation) + \"0-9\\\\r\\\\t\\\\n]\")\n txt = regex.sub(\" \", text)\n words = [\n w\n for w in txt.split(\" \")\n if w not in stop_words.ENGLISH_STOP_WORDS and len(w) > 3\n ]\n return len(words)\n except Exception:\n return 0\n\n\ntrain[\"desc_len\"] = train[\"item_description\"].apply(lambda x: wordCount(x))\ntest[\"desc_len\"] = test[\"item_description\"].apply(lambda x: wordCount(x))\ntrain.head()\ndf = train.groupby(\"desc_len\")[\"price\"].mean().reset_index()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_trace1_24_stop.set_stopwords_words_engl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_trace1_24_stop.set_stopwords_words_engl", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 193, "span_ids": ["impl:93"], "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": "trace1 = go.Scatter(\n x=df[\"desc_len\"],\n y=np.log(df[\"price\"] + 1),\n mode=\"lines+markers\",\n name=\"lines+markers\",\n)\nlayout = {\n \"title\": \"Average Log(Price) by Description Length\",\n \"yaxis\": {\"title\": \"Average Log(Price)\"},\n \"xaxis\": {\"title\": \"Description Length\"},\n}\nfig = {\"data\": [trace1], \"layout\": layout}\npy.iplot(fig)\ntrain.item_description.isnull().sum()\ntrain = train[pd.notnull(train[\"item_description\"])]\nstop = set(stopwords.words(\"english\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_tokenize_tokenize.try_.except_TypeError_as_err_.print_text_err_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_tokenize_tokenize.try_.except_TypeError_as_err_.print_text_err_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 213, "span_ids": ["tokenize"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def tokenize(text):\n \"\"\"\n sent_tokenize(): segment text into sentences\n word_tokenize(): break sentences into words\n \"\"\"\n try:\n regex = re.compile(\"[\" + re.escape(string.punctuation) + \"0-9\\\\r\\\\t\\\\n]\")\n text = regex.sub(\" \", text) # remove punctuation\n tokens_ = [word_tokenize(s) for s in sent_tokenize(text)]\n tokens = []\n for token_by_sent in tokens_:\n tokens += token_by_sent\n tokens = list(filter(lambda t: t.lower() not in stop, tokens))\n filtered_tokens = [w for w in tokens if re.search(\"[a-zA-Z]\", w)]\n filtered_tokens = [w.lower() for w in filtered_tokens if len(w) >= 3]\n return filtered_tokens\n except TypeError as err:\n print(text, err)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_cat_desc_stop_38.set_stopwords_words_engl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_cat_desc_stop_38.set_stopwords_words_engl", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 216, "end_line": 233, "span_ids": ["impl:110"], "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": "cat_desc = {}\nfor cat in general_cats:\n text = \" \".join(train.loc[train[\"general_cat\"] == cat, \"item_description\"].values)\n cat_desc[cat] = tokenize(text)\nflat_lst = [item for sublist in list(cat_desc.values()) for item in sublist]\nallWordsCount = Counter(flat_lst)\nall_top10 = allWordsCount.most_common(20)\nx = [w[0] for w in all_top10]\ny = [w[1] for w in all_top10]\ntrace1 = go.Bar(x=x, y=y, text=pct)\nlayout = {\n \"title\": \"Word Frequency\",\n \"yaxis\": {\"title\": \"Count\"},\n \"xaxis\": {\"title\": \"Word\"},\n}\nfig = {\"data\": [trace1], \"layout\": layout}\npy.iplot(fig)\nstop = set(stopwords.words(\"english\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_tokenize_3_tokenize_3.try_.except_TypeError_as_err_.print_text_err_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_tokenize_3_tokenize_3.try_.except_TypeError_as_err_.print_text_err_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 249, "span_ids": ["tokenize_3"], "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 tokenize(text):\n try:\n regex = re.compile(\"[\" + re.escape(string.punctuation) + \"0-9\\\\r\\\\t\\\\n]\")\n text = regex.sub(\" \", text) # remove punctuation\n tokens_ = [word_tokenize(s) for s in sent_tokenize(text)]\n tokens = []\n for token_by_sent in tokens_:\n tokens += token_by_sent\n tokens = list(filter(lambda t: t.lower() not in stop, tokens))\n filtered_tokens = [w for w in tokens if re.search(\"[a-zA-Z]\", w)]\n filtered_tokens = [w.lower() for w in filtered_tokens if len(w) >= 3]\n return filtered_tokens\n except TypeError as err:\n print(text, err)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_train_tokens_train__output_notebook_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_train_tokens_train__output_notebook_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 326, "span_ids": ["impl:159", "generate_wordcloud", "impl:135"], "tokens": 728}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "train[\"tokens\"] = train[\"item_description\"].map(tokenize)\ntest[\"tokens\"] = test[\"item_description\"].map(tokenize)\ntrain.reset_index(drop=True, inplace=True)\ntest.reset_index(drop=True, inplace=True)\nfor description, tokens in zip(\n train[\"item_description\"].head(), train[\"tokens\"].head()\n):\n print(\"description:\", description)\n print(\"tokens:\", tokens)\n print()\ncat_desc = {}\nfor cat in general_cats:\n text = \" \".join(train.loc[train[\"general_cat\"] == cat, \"item_description\"].values)\n cat_desc[cat] = tokenize(text)\nimport sys\n\nsys.exit()\nwomen100 = Counter(cat_desc[\"Women\"]).most_common(100)\nbeauty100 = Counter(cat_desc[\"Beauty\"]).most_common(100)\nkids100 = Counter(cat_desc[\"Kids\"]).most_common(100)\nelectronics100 = Counter(cat_desc[\"Electronics\"]).most_common(100)\n\n\ndef generate_wordcloud(tup):\n wordcloud = WordCloud(\n background_color=\"white\", max_words=50, max_font_size=40, random_state=42\n ).generate(str(tup))\n return wordcloud\n\n\nfig, axes = plt.subplots(2, 2, figsize=(30, 15))\nax = axes[0, 0]\nax.imshow(generate_wordcloud(women100), interpolation=\"bilinear\")\nax.axis(\"off\")\nax.set_title(\"Women Top 100\", fontsize=30)\nax = axes[0, 1]\nax.imshow(generate_wordcloud(beauty100))\nax.axis(\"off\")\nax.set_title(\"Beauty Top 100\", fontsize=30)\nax = axes[1, 0]\nax.imshow(generate_wordcloud(kids100))\nax.axis(\"off\")\nax.set_title(\"Kids Top 100\", fontsize=30)\nax = axes[1, 1]\nax.imshow(generate_wordcloud(electronics100))\nax.axis(\"off\")\nax.set_title(\"Electronic Top 100\", fontsize=30)\nvectorizer = TfidfVectorizer(\n min_df=10, max_features=180000, tokenizer=tokenize, ngram_range=(1, 2)\n)\nall_desc = np.append(train[\"item_description\"].values, test[\"item_description\"].values)\nvz = vectorizer.fit_transform(list(all_desc))\ntfidf = dict(zip(vectorizer.get_feature_names(), vectorizer.idf_))\ntfidf = pd.DataFrame(columns=[\"tfidf\"]).from_dict(dict(tfidf), orient=\"index\")\ntfidf.columns = [\"tfidf\"]\ntfidf.sort_values(by=[\"tfidf\"], ascending=True).head(10)\ntfidf.sort_values(by=[\"tfidf\"], ascending=False).head(10)\ntrn = train.copy()\ntst = test.copy()\ntrn[\"is_train\"] = 1\ntst[\"is_train\"] = 0\nsample_sz = 15000\ncombined_df = pd.concat([trn, tst])\ncombined_sample = combined_df.sample(n=sample_sz)\nvz_sample = vectorizer.fit_transform(list(combined_sample[\"item_description\"]))\nfrom sklearn.decomposition import TruncatedSVD\n\nn_comp = 30\nsvd = TruncatedSVD(n_components=n_comp, random_state=42)\nsvd_tfidf = svd.fit_transform(vz_sample)\nfrom sklearn.manifold import TSNE\n\ntsne_model = TSNE(n_components=2, verbose=1, random_state=42, n_iter=500)\ntsne_tfidf = tsne_model.fit_transform(svd_tfidf)\noutput_notebook()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_plot_tfidf_kmeans_df_category_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_plot_tfidf_kmeans_df_category_c", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 327, "end_line": 414, "span_ids": ["impl:268", "impl:223", "impl:159"], "tokens": 704}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "plot_tfidf = bp.figure(\n plot_width=700,\n plot_height=600,\n title=\"tf-idf clustering of the item description\",\n tools=\"pan,wheel_zoom,box_zoom,reset,hover,previewsave\",\n x_axis_type=None,\n y_axis_type=None,\n min_border=1,\n)\ncombined_sample.reset_index(inplace=True, drop=True)\ntfidf_df = pd.DataFrame(tsne_tfidf, columns=[\"x\", \"y\"])\ntfidf_df[\"description\"] = combined_sample[\"item_description\"]\ntfidf_df[\"tokens\"] = combined_sample[\"tokens\"]\ntfidf_df[\"category\"] = combined_sample[\"general_cat\"]\nplot_tfidf.scatter(x=\"x\", y=\"y\", source=tfidf_df, alpha=0.7)\nhover = plot_tfidf.select({\"type\": HoverTool})\nhover.tooltips = {\n \"description\": \"@description\",\n \"tokens\": \"@tokens\",\n \"category\": \"@category\",\n}\nshow(plot_tfidf)\nfrom sklearn.cluster import MiniBatchKMeans\n\nnum_clusters = 30 # need to be selected wisely\nkmeans_model = MiniBatchKMeans(\n n_clusters=num_clusters,\n init=\"k-means++\",\n n_init=1,\n init_size=1000,\n batch_size=1000,\n verbose=0,\n max_iter=1000,\n)\nkmeans = kmeans_model.fit(vz)\nkmeans_clusters = kmeans.predict(vz)\nkmeans_distances = kmeans.transform(vz)\nsorted_centroids = kmeans.cluster_centers_.argsort()[:, ::-1]\nterms = vectorizer.get_feature_names()\nfor i in range(num_clusters):\n print(\"Cluster %d:\" % i)\n aux = \"\"\n for j in sorted_centroids[i, :10]:\n aux += terms[j] + \" | \"\n print(aux)\n print()\nkmeans = kmeans_model.fit(vz_sample)\nkmeans_clusters = kmeans.predict(vz_sample)\nkmeans_distances = kmeans.transform(vz_sample)\ntsne_kmeans = tsne_model.fit_transform(kmeans_distances)\ncolormap = np.array(\n [\n \"#6d8dca\",\n \"#69de53\",\n \"#723bca\",\n \"#c3e14c\",\n \"#c84dc9\",\n \"#68af4e\",\n \"#6e6cd5\",\n \"#e3be38\",\n \"#4e2d7c\",\n \"#5fdfa8\",\n \"#d34690\",\n \"#3f6d31\",\n \"#d44427\",\n \"#7fcdd8\",\n \"#cb4053\",\n \"#5e9981\",\n \"#803a62\",\n \"#9b9e39\",\n \"#c88cca\",\n \"#e1c37b\",\n \"#34223b\",\n \"#bdd8a3\",\n \"#6e3326\",\n \"#cfbdce\",\n \"#d07d3c\",\n \"#52697d\",\n \"#194196\",\n \"#d27c88\",\n \"#36422b\",\n \"#b68f79\",\n ]\n)\nkmeans_df = pd.DataFrame(tsne_kmeans, columns=[\"x\", \"y\"])\nkmeans_df[\"cluster\"] = kmeans_clusters\nkmeans_df[\"description\"] = combined_sample[\"item_description\"]\nkmeans_df[\"category\"] = combined_sample[\"general_cat\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_plot_kmeans_show_plot_lda_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_plot_kmeans_show_plot_lda_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 415, "end_line": 496, "span_ids": ["impl:268", "impl:314"], "tokens": 725}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "plot_kmeans = bp.figure(\n plot_width=700,\n plot_height=600,\n title=\"KMeans clustering of the description\",\n tools=\"pan,wheel_zoom,box_zoom,reset,hover,previewsave\",\n x_axis_type=None,\n y_axis_type=None,\n min_border=1,\n)\nsource = ColumnDataSource(\n data={\n \"x\": kmeans_df[\"x\"],\n \"y\": kmeans_df[\"y\"],\n \"color\": colormap[kmeans_clusters],\n \"description\": kmeans_df[\"description\"],\n \"category\": kmeans_df[\"category\"],\n \"cluster\": kmeans_df[\"cluster\"],\n }\n)\nplot_kmeans.scatter(x=\"x\", y=\"y\", color=\"color\", source=source)\nhover = plot_kmeans.select({\"type\": HoverTool})\nhover.tooltips = {\n \"description\": \"@description\",\n \"category\": \"@category\",\n \"cluster\": \"@cluster\",\n}\nshow(plot_kmeans)\ncvectorizer = CountVectorizer(\n min_df=4, max_features=180000, tokenizer=tokenize, ngram_range=(1, 2)\n)\ncvz = cvectorizer.fit_transform(combined_sample[\"item_description\"])\nlda_model = LatentDirichletAllocation(\n n_components=20, learning_method=\"online\", max_iter=20, random_state=42\n)\nX_topics = lda_model.fit_transform(cvz)\nn_top_words = 10\ntopic_summaries = []\ntopic_word = lda_model.components_ # get the topic words\nvocab = cvectorizer.get_feature_names()\nfor i, topic_dist in enumerate(topic_word):\n topic_words = np.array(vocab)[np.argsort(topic_dist)][: -(n_top_words + 1) : -1]\n topic_summaries.append(\" \".join(topic_words))\n print(\"Topic {}: {}\".format(i, \" | \".join(topic_words)))\ntsne_lda = tsne_model.fit_transform(X_topics)\nunnormalized = np.matrix(X_topics)\ndoc_topic = unnormalized / unnormalized.sum(axis=1)\nlda_keys = []\nfor i, tweet in enumerate(combined_sample[\"item_description\"]):\n lda_keys += [doc_topic[i].argmax()]\nlda_df = pd.DataFrame(tsne_lda, columns=[\"x\", \"y\"])\nlda_df[\"description\"] = combined_sample[\"item_description\"]\nlda_df[\"category\"] = combined_sample[\"general_cat\"]\nlda_df[\"topic\"] = lda_keys\nlda_df[\"topic\"] = lda_df[\"topic\"].map(int)\nplot_lda = bp.figure(\n plot_width=700,\n plot_height=600,\n title=\"LDA topic visualization\",\n tools=\"pan,wheel_zoom,box_zoom,reset,hover,previewsave\",\n x_axis_type=None,\n y_axis_type=None,\n min_border=1,\n)\nsource = ColumnDataSource(\n data={\n \"x\": lda_df[\"x\"],\n \"y\": lda_df[\"y\"],\n \"color\": colormap[lda_keys],\n \"description\": lda_df[\"description\"],\n \"topic\": lda_df[\"topic\"],\n \"category\": lda_df[\"category\"],\n }\n)\nplot_lda.scatter(source=source, x=\"x\", y=\"y\", color=\"color\")\nhover = plot_kmeans.select({\"type\": HoverTool})\nhover = plot_lda.select({\"type\": HoverTool})\nhover.tooltips = {\n \"description\": \"@description\",\n \"topic\": \"@topic\",\n \"category\": \"@category\",\n}\nshow(plot_lda)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_prepareLDAData_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle18.py_prepareLDAData_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle18.py", "file_name": "kaggle18.py", "file_type": "text/x-python", "category": "implementation", "start_line": 499, "end_line": 516, "span_ids": ["prepareLDAData", "impl:332"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def prepareLDAData():\n data = {\n \"vocab\": vocab,\n \"doc_topic_dists\": doc_topic,\n \"doc_lengths\": list(lda_df[\"len_docs\"]),\n \"term_frequency\": cvectorizer.vocabulary_,\n \"topic_term_dists\": lda_model.components_,\n }\n return data\n\n\nimport pyLDAvis\n\nlda_df[\"len_docs\"] = combined_sample[\"tokens\"].map(len)\nldadata = prepareLDAData()\npyLDAvis.enable_notebook()\nprepared_data = pyLDAvis.prepare(**ldadata)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py__usr_bin_env_python_data_8.train_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py__usr_bin_env_python_data_8.train_copy_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle19.py", "file_name": "kaggle19.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["impl:32", "docstring"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python\n# coding: utf-8\nimport matplotlib\n\nmatplotlib.use(\"PS\")\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\ntrain = pd.read_csv(\"train.csv\")\ntrain.info()\ntrain.head()\nprint(\n \"The average person kills {:.4f} players, 99% of people have {} kills or less, while the most kills ever recorded is {}.\".format(\n train[\"kills\"].mean(), train[\"kills\"].quantile(0.99), train[\"kills\"].max()\n )\n)\ndata = train.copy()\ndata.loc[data[\"kills\"] > data[\"kills\"].quantile(0.99)] = \"8+\"\nplt.figure(figsize=(15, 10))\nsns.countplot(data[\"kills\"].astype(\"str\").sort_values())\nplt.title(\"Kill Count\", fontsize=15)\nplt.show()\ndata = train.copy()\ndata = data[data[\"kills\"] == 0]\nplt.figure(figsize=(15, 10))\nplt.title(\"Damage Dealt by 0 killers\", fontsize=15)\nplt.show()\nprint(\n \"{} players ({:.4f}%) have won without a single kill!\".format(\n len(data[data[\"winPlacePerc\"] == 1]),\n 100 * len(data[data[\"winPlacePerc\"] == 1]) / len(train),\n )\n)\ndata1 = train[train[\"damageDealt\"] == 0].copy()\nprint(\n \"{} players ({:.4f}%) have won without dealing damage!\".format(\n len(data1[data1[\"winPlacePerc\"] == 1]),\n 100 * len(data1[data1[\"winPlacePerc\"] == 1]) / len(train),\n )\n)\nkills = train.copy()\nkills[\"killsCategories\"] = pd.cut(\n kills[\"kills\"],\n [-1, 0, 2, 5, 10, 60],\n labels=[\"0_kills\", \"1-2_kills\", \"3-5_kills\", \"6-10_kills\", \"10+_kills\"],\n)\nplt.figure(figsize=(15, 8))\nsns.boxplot(x=\"killsCategories\", y=\"winPlacePerc\", data=kills)\nplt.show()\nprint(\n \"The average person walks for {:.1f}m, 99% of people have walked {}m or less, while the marathoner champion walked for {}m.\".format(\n train[\"walkDistance\"].mean(),\n train[\"walkDistance\"].quantile(0.99),\n train[\"walkDistance\"].max(),\n )\n)\ndata = train.copy()\ndata = data[data[\"walkDistance\"] < train[\"walkDistance\"].quantile(0.99)]\nplt.figure(figsize=(15, 10))\nplt.title(\"Walking Distance Distribution\", fontsize=15)\nsns.distplot(data[\"walkDistance\"])\nplt.show()\nprint(\n \"{} players ({:.4f}%) walked 0 meters. This means that they die before even taking a step or they are afk (more possible).\".format(\n len(data[data[\"walkDistance\"] == 0]),\n 100 * len(data1[data1[\"walkDistance\"] == 0]) / len(train),\n )\n)\nprint(\n \"The average person drives for {:.1f}m, 99% of people have drived {}m or less, while the formula 1 champion drived for {}m.\".format(\n train[\"rideDistance\"].mean(),\n train[\"rideDistance\"].quantile(0.99),\n train[\"rideDistance\"].max(),\n )\n)\ndata = train.copy()\ntrain[[\"playersJoined\", \"kills\", \"killsNorm\", \"damageDealt\", \"damageDealtNorm\"]][5: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_modin-project__modin/stress_tests/kaggle/kaggle19.py_data_9_plt_text_4_0_6_Heals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_data_9_plt_text_4_0_6_Heals_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle19.py", "file_name": "kaggle19.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 137, "span_ids": ["impl:57", "impl:85", "impl:32"], "tokens": 752}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "data = data[data[\"rideDistance\"] < train[\"rideDistance\"].quantile(0.9)]\nplt.figure(figsize=(15, 10))\nplt.title(\"Ride Distance Distribution\", fontsize=15)\nsns.distplot(data[\"rideDistance\"])\nplt.show()\nprint(\n \"{} players ({:.4f}%) drived for 0 meters. This means that they don't have a driving licence yet.\".format(\n len(data[data[\"rideDistance\"] == 0]),\n 100 * len(data1[data1[\"rideDistance\"] == 0]) / len(train),\n )\n)\nf, ax1 = plt.subplots(figsize=(20, 10))\nsns.pointplot(\n x=\"vehicleDestroys\", y=\"winPlacePerc\", data=data, color=\"#606060\", alpha=0.8\n)\nplt.xlabel(\"Number of Vehicle Destroys\", fontsize=15, color=\"blue\")\nplt.ylabel(\"Win Percentage\", fontsize=15, color=\"blue\")\nplt.title(\"Vehicle Destroys/ Win Ratio\", fontsize=20, color=\"blue\")\nplt.grid()\nplt.show()\nprint(\n \"The average person swims for {:.1f}m, 99% of people have swimemd {}m or less, while the olympic champion swimmed for {}m.\".format(\n train[\"swimDistance\"].mean(),\n train[\"swimDistance\"].quantile(0.99),\n train[\"swimDistance\"].max(),\n )\n)\ndata = train.copy()\ndata = data[data[\"swimDistance\"] < train[\"swimDistance\"].quantile(0.95)]\nplt.figure(figsize=(15, 10))\nplt.title(\"Swim Distance Distribution\", fontsize=15)\nsns.distplot(data[\"swimDistance\"])\nplt.show()\nswim = train.copy()\nswim[\"swimDistance\"] = pd.cut(\n swim[\"swimDistance\"], [-1, 0, 5, 20, 5286], labels=[\"0m\", \"1-5m\", \"6-20m\", \"20m+\"]\n)\nplt.figure(figsize=(15, 8))\nsns.boxplot(x=\"swimDistance\", y=\"winPlacePerc\", data=swim)\nplt.show()\nprint(\n \"The average person uses {:.1f} heal items, 99% of people use {} or less, while the doctor used {}.\".format(\n train[\"heals\"].mean(), train[\"heals\"].quantile(0.99), train[\"heals\"].max()\n )\n)\nprint(\n \"The average person uses {:.1f} boost items, 99% of people use {} or less, while the doctor used {}.\".format(\n train[\"boosts\"].mean(), train[\"boosts\"].quantile(0.99), train[\"boosts\"].max()\n )\n)\ndata = train.copy()\ndata = data[data[\"heals\"] < data[\"heals\"].quantile(0.99)]\ndata = data[data[\"boosts\"] < data[\"boosts\"].quantile(0.99)]\nf, ax1 = plt.subplots(figsize=(20, 10))\nsns.pointplot(x=\"heals\", y=\"winPlacePerc\", data=data, color=\"lime\", alpha=0.8)\nsns.pointplot(x=\"boosts\", y=\"winPlacePerc\", data=data, color=\"blue\", alpha=0.8)\nplt.text(4, 0.6, \"Heals\", color=\"lime\", fontsize=17, style=\"italic\") # The +1 is to avoid infinity, because there are entries where heals>0 and walkDistance=0. Strange.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_plt_text_4_0_55_Boosts_plt_text_14_0_45_Duos_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_plt_text_4_0_55_Boosts_plt_text_14_0_45_Duos_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle19.py", "file_name": "kaggle19.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 177, "span_ids": ["impl:111", "impl:85"], "tokens": 775}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "plt.text(4, 0.55, \"Boosts\", color=\"blue\", fontsize=17, style=\"italic\")\nplt.xlabel(\"Number of heal/boost items\", fontsize=15, color=\"blue\")\nplt.ylabel(\"Win Percentage\", fontsize=15, color=\"blue\")\nplt.title(\"Heals vs Boosts\", fontsize=20, color=\"blue\")\nplt.grid()\nplt.show()\nsolos = train[train[\"numGroups\"] > 50]\nduos = train[(train[\"numGroups\"] > 25) & (train[\"numGroups\"] <= 50)]\nsquads = train[train[\"numGroups\"] <= 25]\nprint(\n \"There are {} ({:.2f}%) solo games, {} ({:.2f}%) duo games and {} ({:.2f}%) squad games.\".format(\n len(solos),\n 100 * len(solos) / len(train),\n len(duos),\n 100 * len(duos) / len(train),\n len(squads),\n 100 * len(squads) / len(train),\n )\n)\nf, ax1 = plt.subplots(figsize=(20, 10))\nsns.pointplot(x=\"kills\", y=\"winPlacePerc\", data=solos, color=\"black\", alpha=0.8)\nsns.pointplot(x=\"kills\", y=\"winPlacePerc\", data=duos, color=\"#CC0000\", alpha=0.8)\nsns.pointplot(x=\"kills\", y=\"winPlacePerc\", data=squads, color=\"#3399FF\", alpha=0.8)\nplt.text(37, 0.6, \"Solos\", color=\"black\", fontsize=17, style=\"italic\")\nplt.text(37, 0.55, \"Duos\", color=\"#CC0000\", fontsize=17, style=\"italic\")\nplt.text(37, 0.5, \"Squads\", color=\"#3399FF\", fontsize=17, style=\"italic\")\nplt.xlabel(\"Number of kills\", fontsize=15, color=\"blue\")\nplt.ylabel(\"Win Percentage\", fontsize=15, color=\"blue\")\nplt.title(\"Solo vs Duo vs Squad Kills\", fontsize=20, color=\"blue\")\nplt.grid()\nplt.show()\nf, ax1 = plt.subplots(figsize=(20, 10))\nsns.pointplot(x=\"DBNOs\", y=\"winPlacePerc\", data=duos, color=\"#CC0000\", alpha=0.8)\nsns.pointplot(x=\"DBNOs\", y=\"winPlacePerc\", data=squads, color=\"#3399FF\", alpha=0.8)\nsns.pointplot(x=\"assists\", y=\"winPlacePerc\", data=duos, color=\"#FF6666\", alpha=0.8)\nsns.pointplot(x=\"assists\", y=\"winPlacePerc\", data=squads, color=\"#CCE5FF\", alpha=0.8)\nsns.pointplot(x=\"revives\", y=\"winPlacePerc\", data=duos, color=\"#660000\", alpha=0.8)\nsns.pointplot(x=\"revives\", y=\"winPlacePerc\", data=squads, color=\"#000066\", alpha=0.8)\nplt.text(14, 0.5, \"Duos - Assists\", color=\"#FF6666\", fontsize=17, style=\"italic\")\nplt.text(14, 0.45, \"Duos - DBNOs\", color=\"#CC0000\", fontsize=17, style=\"italic\") # The +1 is to avoid infinity. # The +1 is to avoid infinity, because there are entries where kills>0 and walkDistance=0. Strange.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_plt_text_14_0_4_Duos__train_healsAndBoostsPerW": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_plt_text_14_0_4_Duos__train_healsAndBoostsPerW", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle19.py", "file_name": "kaggle19.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 229, "span_ids": ["impl:111", "impl:158", "impl:130"], "tokens": 821}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "print(\n \"{} players ({:.4f}%) have won without a single kill!\".format(\n len(data[data[\"winPlacePerc\"] == 1]),\n 100 * len(data[data[\"winPlacePerc\"] == 1]) / len(train),\n )\n)\nf, ax1 = plt.subplots(figsize=(20, 10))\nf, ax1 = plt.subplots(figsize=(20, 10))\nplt.text(14, 0.4, \"Duos - Revives\", color=\"#660000\", fontsize=17, style=\"italic\")\nplt.text(14, 0.35, \"Squads - Assists\", color=\"#CCE5FF\", fontsize=17, style=\"italic\")\nplt.text(14, 0.3, \"Squads - DBNOs\", color=\"#3399FF\", fontsize=17, style=\"italic\")\nplt.text(14, 0.25, \"Squads - Revives\", color=\"#000066\", fontsize=17, style=\"italic\")\nplt.xlabel(\"Number of DBNOs/Assits/Revives\", fontsize=15, color=\"blue\")\nplt.ylabel(\"Win Percentage\", fontsize=15, color=\"blue\")\nplt.title(\"Duo vs Squad DBNOs, Assists, and Revives\", fontsize=20, color=\"blue\")\nplt.grid()\nplt.show()\nf, ax = plt.subplots(figsize=(15, 15))\nsns.heatmap(train.corr(), annot=True, linewidths=0.5, fmt=\".1f\", ax=ax)\nplt.show()\nk = 5 # number of variables for heatmap\nf, ax = plt.subplots(figsize=(11, 11))\ncols = train.corr().nlargest(k, \"winPlacePerc\")[\"winPlacePerc\"].index\ncm = np.corrcoef(train[cols].values.T)\nsns.set(font_scale=1.25)\nhm = sns.heatmap(\n cm,\n cbar=True,\n annot=True,\n square=True,\n fmt=\".2f\",\n annot_kws={\"size\": 10},\n yticklabels=cols.values,\n xticklabels=cols.values,\n)\nplt.show()\ntrain[\"playersJoined\"] = train.groupby(\"matchId\")[\"matchId\"].transform(\"count\")\ndata = train.copy()\ndata = data[data[\"playersJoined\"] > 49]\ntrain[\"killsNorm\"] = train[\"kills\"] * ((100 - train[\"playersJoined\"]) / 100 + 1)\ntrain[\"damageDealtNorm\"] = train[\"damageDealt\"] * (\n (100 - train[\"playersJoined\"]) / 100 + 1\n)\ntrain[[\"playersJoined\", \"kills\", \"killsNorm\", \"damageDealt\", \"damageDealtNorm\"]][5:8]\ntrain[\"healsAndBoosts\"] = train[\"heals\"] + train[\"boosts\"]\ntrain[\"totalDistance\"] = (\n train[\"walkDistance\"] + train[\"rideDistance\"] + train[\"swimDistance\"]\n)\ntrain[\"boostsPerWalkDistance\"] = train[\"boosts\"] / (\n train[\"walkDistance\"] + 1\n) # The +1 is to avoid infinity, because there are entries where boosts>0 and walkDistance=0. Strange.\ntrain[\"boostsPerWalkDistance\"].fillna(0, inplace=True)\ntrain[\"healsPerWalkDistance\"] = train[\"heals\"] / (\n train[\"walkDistance\"] + 1\n) # The +1 is to avoid infinity, because there are entries where heals>0 and walkDistance=0. Strange.\ntrain[\"healsPerWalkDistance\"].fillna(0, inplace=True)\ntrain[\"healsAndBoostsPerWalkDistance\"] = train[\"healsAndBoosts\"] / (\n train[\"walkDistance\"] + 1\n) # The +1 is to avoid infinity.\ntrain[\"healsAndBoostsPerWalkDistance\"].fillna(0, inplace=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_modin-project__modin/stress_tests/kaggle/kaggle19.py_train__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle19.py_train__", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle19.py", "file_name": "kaggle19.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 252, "span_ids": ["impl:158"], "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": "f, ax1 = plt.subplots(figsize=(20, 10))\ntrain[\n [\n \"walkDistance\",\n \"boosts\",\n \"boostsPerWalkDistance\",\n \"heals\",\n \"healsPerWalkDistance\",\n \"healsAndBoosts\",\n \"healsAndBoostsPerWalkDistance\",\n ]\n][40:45]\ntrain[\"killsPerWalkDistance\"] = train[\"kills\"] / (\n train[\"walkDistance\"] + 1\n) # The +1 is to avoid infinity, because there are entries where kills>0 and walkDistance=0. Strange.\ntrain[\"killsPerWalkDistance\"].fillna(0, inplace=True)\ntrain[\n [\"kills\", \"walkDistance\", \"rideDistance\", \"killsPerWalkDistance\", \"winPlacePerc\"]\n].sort_values(by=\"killsPerWalkDistance\").tail(10)\ntrain[\"team\"] = [\n 1 if i > 50 else 2 if (i > 25 & i <= 50) else 4 for i in train[\"numGroups\"]\n]\ntrain.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_modin-project__modin/stress_tests/kaggle/kaggle20.py_matplotlib_data_23.pd_concat_y_data_n_2_il": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_matplotlib_data_23.pd_concat_y_data_n_2_il", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle20.py", "file_name": "kaggle20.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 69, "span_ids": ["imports", "impl:48"], "tokens": 793}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport numpy as np # linear algebra\nimport modin.pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport seaborn as sns # data visualization library\nimport matplotlib.pyplot as plt\nimport time\n\ndata = pd.read_csv(\"data.csv\")\ndata.head() # head method show only first 5 rows\ncol = data.columns\nprint(col)\ny = data.diagnosis # M or B\nlist = [\"Unnamed: 32\", \"id\", \"diagnosis\"]\nx = data.drop(list, axis=1)\nx.head()\nax = sns.countplot(y, label=\"Count\") # M = 212, B = 357\nx.describe()\ndata_dia = y\ndata = x\ndata_n_2 = (data - data.mean()) / (data.std()) # standardization\ndata = pd.concat([y, data_n_2.iloc[:, 0:10]], axis=1)\ndata = pd.melt(data, id_vars=\"diagnosis\", var_name=\"features\", value_name=\"value\")\nplt.figure(figsize=(10, 10))\nsns.violinplot(\n x=\"features\", y=\"value\", hue=\"diagnosis\", data=data, split=True, inner=\"quart\"\n)\nplt.xticks(rotation=90)\ndata = pd.concat([y, data_n_2.iloc[:, 10:20]], axis=1)\ndata = pd.melt(data, id_vars=\"diagnosis\", var_name=\"features\", value_name=\"value\")\nplt.figure(figsize=(10, 10))\nsns.violinplot(\n x=\"features\", y=\"value\", hue=\"diagnosis\", data=data, split=True, inner=\"quart\"\n)\nplt.xticks(rotation=90)\ndata = pd.concat([y, data_n_2.iloc[:, 20:31]], axis=1)\ndata = pd.melt(data, id_vars=\"diagnosis\", var_name=\"features\", value_name=\"value\")\nplt.figure(figsize=(10, 10))\nsns.violinplot(\n x=\"features\", y=\"value\", hue=\"diagnosis\", data=data, split=True, inner=\"quart\"\n)\nplt.xticks(rotation=90)\nplt.figure(figsize=(10, 10))\nsns.boxplot(x=\"features\", y=\"value\", hue=\"diagnosis\", data=data)\nplt.xticks(rotation=90)\nsns.jointplot(\n x.loc[:, \"concavity_worst\"],\n x.loc[:, \"concave points_worst\"],\n kind=\"regg\",\n color=\"#ce1414\",\n)\nsns.set(style=\"white\")\ndf = x.loc[:, [\"radius_worst\", \"perimeter_worst\", \"area_worst\"]]\ng = sns.PairGrid(df, diag_sharey=False)\ng.map_lower(sns.kdeplot, cmap=\"Blues_d\")\ng.map_upper(plt.scatter)\ng.map_diag(sns.kdeplot, lw=3)\nsns.set(style=\"whitegrid\", palette=\"muted\")\ndata_dia = y\ndata = x\ndata_n_2 = (data - data.mean()) / (data.std()) # standardization\ndata = pd.concat([y, data_n_2.iloc[:, 0:10]], axis=1)\ndata = pd.melt(data, id_vars=\"diagnosis\", var_name=\"features\", value_name=\"value\")\nplt.figure(figsize=(10, 10))\ntic = time.time()\nsns.swarmplot(x=\"features\", y=\"value\", hue=\"diagnosis\", data=data)\nplt.xticks(rotation=90)\ndata = pd.concat([y, data_n_2.iloc[:, 10:20]], axis=1)\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.feature_selection import chi2\nfrom sklearn.feature_selection import RFE\nfrom sklearn.feature_selection import RFECV", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_data_24_None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_data_24_None_13", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle20.py", "file_name": "kaggle20.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 137, "span_ids": ["impl:94", "impl:48"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "sns.violinplot(\n x=\"features\", y=\"value\", hue=\"diagnosis\", data=data, split=True, inner=\"quart\"\n)\nplt.figure(figsize=(10, 10))\nsns.violinplot(\n x=\"features\", y=\"value\", hue=\"diagnosis\", data=data, split=True, inner=\"quart\"\n)\nplt.xticks(rotation=90)\ndata = pd.melt(data, id_vars=\"diagnosis\", var_name=\"features\", value_name=\"value\")\nplt.figure(figsize=(10, 10))\nsns.swarmplot(x=\"features\", y=\"value\", hue=\"diagnosis\", data=data)\nplt.xticks(rotation=90)\ndata = pd.concat([y, data_n_2.iloc[:, 20:31]], axis=1)\ndata = pd.melt(data, id_vars=\"diagnosis\", var_name=\"features\", value_name=\"value\")\nplt.figure(figsize=(10, 10))\nsns.swarmplot(x=\"features\", y=\"value\", hue=\"diagnosis\", data=data)\ntoc = time.time()\nplt.xticks(rotation=90)\nprint(\"swarm plot time: \", toc - tic, \" s\")\nf, ax = plt.subplots(figsize=(18, 18))\nsns.heatmap(x.corr(), annot=True, linewidths=0.5, fmt=\".1f\", ax=ax)\ndrop_list1 = [\n \"perimeter_mean\",\n \"radius_mean\",\n \"compactness_mean\",\n \"concave points_mean\",\n \"radius_se\",\n \"perimeter_se\",\n \"radius_worst\",\n \"perimeter_worst\",\n \"compactness_worst\",\n \"concave points_worst\",\n \"compactness_se\",\n \"concave points_se\",\n \"texture_worst\",\n \"area_worst\",\n]\nx_1 = x.drop(drop_list1, axis=1) # do not modify x, we will use it later\nx_1.head()\nf, ax = plt.subplots(figsize=(14, 14))\nsns.heatmap(x_1.corr(), annot=True, linewidths=0.5, fmt=\".1f\", ax=ax)\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import confusion_matrix # f1_score\nfrom sklearn.metrics import accuracy_score\n\nx_train, x_test, y_train, y_test = train_test_split(\n x_1, y, test_size=0.3, random_state=42\n)\nclf_rf = RandomForestClassifier(random_state=43)\nclr_rf = clf_rf.fit(x_train, y_train)\nac = accuracy_score(y_test, clf_rf.predict(x_test))\nprint(\"Accuracy is: \", ac)\ncm = confusion_matrix(y_test, clf_rf.predict(x_test))\nsns.heatmap(cm, annot=True, fmt=\"d\")\nfrom sklearn.feature_selection import SelectKBest\nfrom sklearn.feature_selection import chi2\n\nselect_feature = SelectKBest(chi2, k=5).fit(x_train, y_train)\nprint(\"Score list:\", select_feature.scores_)\nprint(\"Feature list:\", x_train.columns)\nx_train_2 = select_feature.transform(x_train)\nx_test_2 = select_feature.transform(x_test)\nclf_rf_2 = RandomForestClassifier()\nclr_rf_2 = clf_rf_2.fit(x_train_2, y_train)\nac_2 = accuracy_score(y_test, clf_rf_2.predict(x_test_2))\nprint(\"Accuracy is: \", ac_2)\ncm_2 = confusion_matrix(y_test, clf_rf_2.predict(x_test_2))\nsns.heatmap(cm_2, annot=True, fmt=\"d\")\nfrom sklearn.feature_selection import RFE\n\nclf_rf_3 = RandomForestClassifier()\nrfe = RFE(estimator=clf_rf_3, n_features_to_select=5, step=1)\nrfe = rfe.fit(x_train, y_train)\nprint(\"Chosen best 5 feature by rfe:\", x_train.columns[rfe.support_])\nfrom sklearn.feature_selection import RFECV", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_clf_rf_4_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle20.py_clf_rf_4_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle20.py", "file_name": "kaggle20.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 189, "span_ids": ["impl:139", "impl:94"], "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": "clf_rf_4 = RandomForestClassifier()\nrfecv = RFECV(\n estimator=clf_rf_4, step=1, cv=5, scoring=\"accuracy\"\n) # 5-fold cross-validation\nrfecv = rfecv.fit(x_train, y_train)\nprint(\"Optimal number of features :\", rfecv.n_features_)\nprint(\"Best features :\", x_train.columns[rfecv.support_])\nimport matplotlib.pyplot as plt\n\nplt.figure()\nplt.xlabel(\"Number of features selected\")\nplt.ylabel(\"Cross validation score of number of selected features\")\nplt.plot(range(1, len(rfecv.grid_scores_) + 1), rfecv.grid_scores_)\nplt.show()\nclf_rf_5 = RandomForestClassifier()\nclr_rf_5 = clf_rf_5.fit(x_train, y_train)\nimportances = clr_rf_5.feature_importances_\nstd = np.std([tree.feature_importances_ for tree in clf_rf.estimators_], axis=0)\nindices = np.argsort(importances)[::-1]\nprint(\"Feature ranking:\")\nfor f in range(x_train.shape[1]):\n print(\"%d. feature %d (%f)\" % (f + 1, indices[f], importances[indices[f]]))\nplt.figure(1, figsize=(14, 13))\nplt.title(\"Feature importances\")\nplt.bar(\n range(x_train.shape[1]),\n importances[indices],\n color=\"g\",\n yerr=std[indices],\n align=\"center\",\n)\nplt.xticks(range(x_train.shape[1]), x_train.columns[indices], rotation=90)\nplt.xlim([-1, x_train.shape[1]])\nplt.show()\nx_train, x_test, y_train, y_test = train_test_split(\n x, y, test_size=0.3, random_state=42\n)\nx_train_N = (x_train - x_train.mean()) / (x_train.max() - x_train.min())\nx_test_N = (x_test - x_test.mean()) / (x_test.max() - x_test.min())\nfrom sklearn.decomposition import PCA\n\npca = PCA()\npca.fit(x_train_N)\nplt.figure(1, figsize=(14, 13))\nplt.clf()\nplt.axes([0.2, 0.2, 0.7, 0.7])\nplt.plot(pca.explained_variance_ratio_, linewidth=2)\nplt.axis(\"tight\")\nplt.xlabel(\"n_components\")\nplt.ylabel(\"explained_variance_ratio_\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle22.py_matplotlib_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle22.py_matplotlib_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle22.py", "file_name": "kaggle22.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 76, "span_ids": ["imports", "get_mdl", "impl:35", "tokenize", "pr", "impl:39", "impl:26"], "tokens": 574}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport modin.pandas as pd\nimport numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.feature_extraction.text import TfidfVectorizer # CountVectorizer\n\ntrain = pd.read_csv(\"train.csv\")\ntest = pd.read_csv(\"test.csv\")\nsubm = pd.read_csv(\"sample_submission.csv\")\ntrain.head()\ntrain[\"comment_text\"][0]\ntrain[\"comment_text\"][2]\nlens = train.comment_text.str.len()\nlens.mean(), lens.std(), lens.max()\nlens.hist()\nlabel_cols = [\"toxic\", \"severe_toxic\", \"obscene\", \"threat\", \"insult\", \"identity_hate\"]\ntrain[\"none\"] = 1 - train[label_cols].max(axis=1)\ntrain.describe()\nlen(train), len(test)\nCOMMENT = \"comment_text\"\ntrain[COMMENT].fillna(\"unknown\", inplace=True)\ntest[COMMENT].fillna(\"unknown\", inplace=True)\nimport re\nimport string\n\nre_tok = re.compile(f\"([{string.punctuation}\u201c\u201d\u00a8\u00ab\u00bb\u00ae\u00b4\u00b7\u00ba\u00bd\u00be\u00bf\u00a1\u00a7\u00a3\u20a4\u2018\u2019])\")\n\n\ndef tokenize(s):\n return re_tok.sub(r\" \\1 \", s).split()\n\n\nn = train.shape[0]\nvec = TfidfVectorizer(\n ngram_range=(1, 2),\n tokenizer=tokenize,\n min_df=3,\n max_df=0.9,\n strip_accents=\"unicode\",\n use_idf=1,\n smooth_idf=1,\n sublinear_tf=1,\n)\ntrn_term_doc = vec.fit_transform(train[COMMENT])\ntest_term_doc = vec.transform(test[COMMENT])\ntrn_term_doc, test_term_doc\n\n\ndef pr(y_i, y):\n p = x[y == y_i].sum(0)\n return (p + 1) / ((y == y_i).sum() + 1)\n\n\nx = trn_term_doc\ntest_x = test_term_doc\n\n\ndef get_mdl(y):\n y = y.values\n r = np.log(pr(1, y) / pr(0, y))\n m = LogisticRegression(C=4, dual=True)\n x_nb = x.multiply(r)\n return m.fit(x_nb, y), r\n\n\npreds = np.zeros((len(test), len(label_cols)))\nfor i, j in enumerate(label_cols):\n print(\"fit\", j)\n m, r = get_mdl(train[j])\n preds[:, i] = m.predict_proba(test_x.multiply(r))[:, 1]\nsubmid = pd.DataFrame({\"id\": subm[\"id\"]})\nsubmission = pd.concat([submid, pd.DataFrame(preds, columns=label_cols)], axis=1)\nsubmission.to_csv(\"submission.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle3.py__usr_bin_env_python_a_b_c_tuble_ex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py__usr_bin_env_python_a_b_c_tuble_ex_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle3.py", "file_name": "kaggle3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 93, "span_ids": ["docstring:18", "impl:74", "tuble_ex", "docstring"], "tokens": 823}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python\nimport matplotlib\n\nmatplotlib.use(\"PS\")\nimport numpy as np # linear algebra\nimport modin.pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport seaborn as sns # visualization tool\n\ndata = pd.read_csv(\"pokemon.csv\")\ndata.info()\ndata.corr()\nf, ax = plt.subplots(figsize=(18, 18))\nsns.heatmap(data.corr(), annot=True, linewidths=0.5, fmt=\".1f\", ax=ax)\ndata.head(10)\ndata.columns\ndata.Speed.plot(\n kind=\"line\",\n color=\"g\",\n label=\"Speed\",\n linewidth=1,\n alpha=0.5,\n grid=True,\n linestyle=\":\",\n)\ndata.Defense.plot(\n color=\"r\", label=\"Defense\", linewidth=1, alpha=0.5, grid=True, linestyle=\"-.\"\n)\nplt.legend(loc=\"upper right\") # legend = puts label into plot\nplt.xlabel(\"x axis\") # label = name of label\nplt.ylabel(\"y axis\")\nplt.title(\"Line Plot\") # title = title of plot\ndata.plot(kind=\"scatter\", x=\"Attack\", y=\"Defense\", alpha=0.5, color=\"red\")\nplt.xlabel(\"Attack\") # label = name of label\nplt.ylabel(\"Defence\")\nplt.title(\"Attack Defense Scatter Plot\") # title = title of plot\ndata.Speed.plot(kind=\"hist\", bins=50, figsize=(12, 12))\ndata.Speed.plot(kind=\"hist\", bins=50)\ndictionary = {\"spain\": \"madrid\", \"usa\": \"vegas\"}\nprint(dictionary.keys())\nprint(dictionary.values())\ndictionary[\"spain\"] = \"barcelona\" # update existing entry\nprint(dictionary)\ndictionary[\"france\"] = \"paris\" # Add new entry\nprint(dictionary)\ndel dictionary[\"spain\"] # remove entry with key 'spain'\nprint(dictionary)\nprint(\"france\" in dictionary) # check include or not\ndictionary.clear() # remove all entries in dict\nprint(dictionary)\nprint(dictionary) # it gives error because dictionary is deleted\ndata = pd.read_csv(\"pokemon.csv\")\nseries = data[\"Defense\"] # data['Defense'] = series\nprint(type(series))\ndata_frame = data[[\"Defense\"]] # data[['Defense']] = data frame\nprint(type(data_frame))\nprint(3 > 2)\nprint(3 != 2)\nprint(True and False)\nprint(True or False)\nx = (\n data[\"Defense\"] > 200\n) # There are only 3 pokemons who have higher defense value than 200\ndata[x]\ndata[np.logical_and(data[\"Defense\"] > 200, data[\"Attack\"] > 100)]\ndata[(data[\"Defense\"] > 200) & (data[\"Attack\"] > 100)]\ni = 0\nwhile i != 5:\n print(\"i is: \", i)\n i += 1\nprint(i, \" is equal to 5\")\nlis = [1, 2, 3, 4, 5]\nfor i in lis:\n print(\"i is: \", i)\nprint(\"\")\nfor index, value in enumerate(lis):\n print(index, \" : \", value)\nprint(\"\")\ndictionary = {\"spain\": \"madrid\", \"france\": \"paris\"}\nfor key, value in dictionary.items():\n print(key, \" : \", value)\nprint(\"\")\nfor index, value in data[[\"Attack\"]][0:1].iterrows():\n print(index, \" : \", value)\n\n\ndef tuble_ex():\n \"\"\" return defined t tuble\"\"\"\n t = (1, 2, 3)\n return t\n\n\na, b, c = tuble_ex()\ndata.dtypes # returns nothing because we do not have nan values\ndf\nplt\ndata.HP[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_modin-project__modin/stress_tests/kaggle/kaggle3.py_print_a_b_c__data2_32.data_Defense_head_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_print_a_b_c__data2_32.data_Defense_head_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle3.py", "file_name": "kaggle3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 216, "span_ids": ["f_4", "f_2", "impl:74", "f", "square", "f_5", "impl:93", "impl:78", "impl:90", "f_6", "impl:83", "impl:87", "impl:88"], "tokens": 818}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "print(a, b, c)\nx = 2\n\n\ndef f():\n x = 3\n return x\n\n\nprint(x) # x = 2 global scope\nprint(f()) # x = 3 local scope\nx = 5\n\n\ndef f():\n y = 2 * x # there is no local scope x\n return y\n\n\nprint(f()) # it uses global scope x\nimport builtins\n\ndir(builtins)\n\n\ndef square():\n \"\"\" return square of value \"\"\"\n\n def add():\n \"\"\" add two local variable \"\"\"\n x = 2\n y = 3\n z = x + y\n return z\n\n return add() ** 2\n\n\nprint(square())\n\n\ndef f(a, b=1, c=2):\n y = a + b + c\n return y\n\n\nprint(f(5))\nprint(f(5, 4, 3))\n\n\ndef f(*args):\n for i in args:\n print(i)\n\n\nf(1)\nprint(\"\")\nf(1, 2, 3, 4)\n\n\ndef f(**kwargs):\n \"\"\" print key and value of dictionary\"\"\"\n for (\n key,\n value,\n ) in (\n kwargs.items()\n ): # If you do not understand this part turn for loop part and look at dictionary in for loop\n print(key, \" \", value)\n\n\nf(country=\"spain\", capital=\"madrid\", population=123456)\nnumber_list = [1, 2, 3]\ny = map(lambda x: x ** 2, number_list)\nprint(list(y))\nname = \"ronaldo\"\nit = iter(name)\nprint(next(it)) # print next iteration\nprint(*it) # print remaining iteration\nlist1 = [1, 2, 3, 4]\nlist2 = [5, 6, 7, 8]\nz = zip(list1, list2)\nprint(z)\nz_list = list(z)\nprint(z_list)\nun_zip = zip(*z_list)\nun_list1, un_list2 = list(un_zip) # unzip returns tuble\nprint(un_list1)\nprint(un_list2)\nprint(type(un_list2))\nnum1 = [1, 2, 3]\nnum2 = [i + 1 for i in num1]\nprint(num2)\nnum1 = [5, 10, 15]\nnum2 = [i ** 2 if i == 10 else i - 5 if i < 7 else i + 5 for i in num1]\nprint(num2)\nthreshold = sum(data.Speed) / len(data.Speed)\ndata[\"speed_level\"] = [\"high\" if i > threshold else \"low\" for i in data.Speed]\ndata.loc[:10, [\"speed_level\", \"Speed\"]] # we will learn loc more detailed later\ndata = pd.read_csv(\"pokemon.csv\")\ndata.head() # head shows first 5 rows\ndata.tail()\ndata.columns\ndata.shape\ndata.info()\nprint(\n data[\"Type 1\"].value_counts(dropna=False)\n) # if there are nan values that also be counted\ndata.describe() # ignore null entries\ndata.boxplot(column=\"Attack\", by=\"Legendary\")\ndata_new = data.head() # I only take 5 rows into new data\ndata_new\nmelted = pd.melt(frame=data_new, id_vars=\"Name\", value_vars=[\"Attack\", \"Defense\"])\nmelted\nmelted.pivot(index=\"Name\", columns=\"variable\", values=\"value\")\ndata1 = data.head()\ndata2 = data.tail()\nconc_data_row = pd.concat(\n [data1, data2], axis=0, ignore_index=True\n) # axis = 0 : adds dataframes in row\nconc_data_row\ndata1 = data[\"Attack\"].head()\ndata2 = data[\"Defense\"].head()\ndata2\ndf", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_conc_data_col__data_frames": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_conc_data_col__data_frames", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle3.py", "file_name": "kaggle3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 297, "span_ids": ["impl:163", "impl:215"], "tokens": 804}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib.pyplot as plt\nprint(dictionary)\nprint(3 != 2)\nprint(\"\")\ndata2 =\n # ... other code\nconc_data_col = pd.concat([data1, data2], axis=1) # axis = 0 : adds dataframes in row\nconc_data_col\ndata.dtypes\ndata[\"Type 1\"] = data[\"Type 1\"].astype(\"category\")\ndata[\"Speed\"] = data[\"Speed\"].astype(\"float\")\ndata.dtypes\ndata.info()\ndata[\"Type 2\"].value_counts(dropna=False)\ndata1 = (\n data\n) # also we will use data to fill missing value so I assign it to data1 variable\ndata1[\"Type 2\"].dropna(\n inplace=True\n) # inplace = True means we do not assign it to new variable. Changes automatically assigned to data\nassert 1 == 1 # return nothing because it is true\nassert data[\"Type 2\"].notnull().all() # returns nothing because we drop nan values\ndata[\"Type 2\"].fillna(\"empty\", inplace=True)\nassert (\n data[\"Type 2\"].notnull().all()\n) # returns nothing because we do not have nan values\ncountry = [\"Spain\", \"France\"]\npopulation = [\"11\", \"12\"]\nlist_label = [\"country\", \"population\"]\nlist_col = [country, population]\nzipped = list(zip(list_label, list_col))\ndata_dict = dict(zipped)\ndf = pd.DataFrame(data_dict)\ndf\ndf[\"capital\"] = [\"madrid\", \"paris\"]\ndf\ndf[\"income\"] = 0 # Broadcasting entire column\ndf\ndata1 = data.loc[:, [\"Attack\", \"Defense\", \"Speed\"]]\ndata1.plot()\ndata1.plot(subplots=True)\nplt.show()\ndata1.plot(kind=\"scatter\", x=\"Attack\", y=\"Defense\")\nplt.show()\ndata1.plot(kind=\"hist\", y=\"Defense\", bins=50, range=(0, 250), normed=True)\nfig, axes = plt.subplots(nrows=2, ncols=1)\ndata1.plot(kind=\"hist\", y=\"Defense\", bins=50, range=(0, 250), normed=True, ax=axes[0])\ndata1.plot(\n kind=\"hist\",\n y=\"Defense\",\n bins=50,\n range=(0, 250),\n normed=True,\n ax=axes[1],\n cumulative=True,\n)\nplt.savefig(\"graph.png\")\nplt\ndata.describe()\ntime_list = [\"1992-03-08\", \"1992-04-12\"]\nprint(type(time_list[1])) # As you can see date is string\ndatetime_object = pd.to_datetime(time_list)\nprint(type(datetime_object))\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\ndata2 = data.head()\ndate_list = [\"1992-01-10\", \"1992-02-10\", \"1992-03-10\", \"1993-03-15\", \"1993-03-16\"]\ndatetime_object = pd.to_datetime(date_list)\ndata2[\"date\"] = datetime_object\ndata2 = data2.set_index(\"date\")\ndata2\nprint(data2.loc[\"1993-03-16\"])\nprint(data2.loc[\"1992-03-10\":\"1993-03-16\"])\ndata2.resample(\"A\").mean()\ndata2.resample(\"M\").mean()\ndata2.resample(\"M\").first().interpolate(\"linear\")\ndata2.resample(\"M\").mean().interpolate(\"linear\")\ndata = pd.read_csv(\"pokemon.csv\")\ndata = data.set_index(\"#\")\ndata.head()\ndata[\"HP\"][1]\ndata.HP[1]\ndata.loc[1, [\"HP\"]]\ndata[[\"HP\", \"Attack\"]]\nprint(type(data[\"HP\"])) # series\nprint(type(data[[\"HP\"]])) # data frames", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_data_loc_1_10_HP_Defe_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle3.py_data_loc_1_10_HP_Defe_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle3.py", "file_name": "kaggle3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 350, "span_ids": ["div", "impl:259", "impl:215"], "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": "print(\"\")\ndata.loc[1:10, \"HP\":\"Defense\"] # 10 and \"Defense\" are inclusive\ndata.loc[10:1:-1, \"HP\":\"Defense\"]\ndata.loc[1:10, \"Speed\":]\nboolean = data.HP > 200\ndata[boolean]\nfirst_filter = data.HP > 150\nsecond_filter = data.Speed > 35\ndata[first_filter & second_filter]\ndata.HP[data.Speed < 15]\n\n\ndef div(n):\n return n / 2\n\n\ndata.HP.apply(div)\ndata.HP.apply(lambda n: n / 2)\ndata[\"total_power\"] = data.Attack + data.Defense\ndata.head()\nprint(data.index.name)\ndata.index.name = \"index_name\"\ndata.head()\ndata.head()\ndata3 = data.copy()\ndata3.index = range(100, 100 + len(data3.index), 1)\ndata3.head()\ndata = pd.read_csv(\"pokemon.csv\")\ndata.head()\ndata1 = data.set_index([\"Type 1\", \"Type 2\"])\ndata1.head(100)\ndic = {\n \"treatment\": [\"A\", \"A\", \"B\", \"B\"],\n \"gender\": [\"F\", \"M\", \"F\", \"M\"],\n \"response\": [10, 45, 5, 9],\n \"age\": [15, 4, 72, 65],\n}\ndf = pd.DataFrame(dic)\ndf\ndf.pivot(index=\"treatment\", columns=\"gender\", values=\"response\")\ndf1 = df.set_index([\"treatment\", \"gender\"])\ndf1\ndf1.unstack(level=0)\ndf1.unstack(level=1)\ndf2 = df1.swaplevel(0, 1)\ndf2\ndf\npd.melt(df, id_vars=\"treatment\", value_vars=[\"age\", \"response\"])\ndf\ndf.groupby(\"treatment\").mean() # mean is aggregation / reduce method\ndf.groupby(\"treatment\").age.max()\ndf.groupby(\"treatment\")[[\"age\", \"response\"]].min()\ndf.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_modin-project__modin/stress_tests/kaggle/kaggle4.py_matplotlib_print_all_data_size_is_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_matplotlib_print_all_data_size_is_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle4.py", "file_name": "kaggle4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["imports", "ignore_warn", "impl:5", "impl:52"], "tokens": 749}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport numpy as np # linear algebra\nimport modin.pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt # Matlab-style plotting\nimport seaborn as sns\n\ncolor = sns.color_palette()\nsns.set_style(\"darkgrid\")\nimport warnings\n\n\ndef ignore_warn(*args, **kwargs):\n pass\n\n\nwarnings.warn = ignore_warn # ignore annoying warning (from sklearn and seaborn)\nfrom scipy import stats\nfrom scipy.stats import norm, skew # for some statistics\n\npd.set_option(\n \"display.float_format\", lambda x: \"{:.3f}\".format(x)\n) # Limiting floats output to 3 decimal points\ntrain = pd.read_csv(\"train.csv\")\ntest = pd.read_csv(\"test.csv\")\ntrain.head(5)\ntest.head(5)\nprint(\"The train data size before dropping Id feature is : {} \".format(train.shape))\nprint(\"The test data size before dropping Id feature is : {} \".format(test.shape))\ntrain_ID = train[\"Id\"]\ntest_ID = test[\"Id\"]\ntrain.drop(\"Id\", axis=1, inplace=True)\ntest.drop(\"Id\", axis=1, inplace=True)\nprint(\"\\nThe train data size after dropping Id feature is : {} \".format(train.shape))\nprint(\"The test data size after dropping Id feature is : {} \".format(test.shape))\nfig, ax = plt.subplots()\nax.scatter(x=train[\"GrLivArea\"], y=train[\"SalePrice\"])\nplt.ylabel(\"SalePrice\", fontsize=13)\nplt.xlabel(\"GrLivArea\", fontsize=13)\nplt.show()\ntrain = train.drop(\n train[(train[\"GrLivArea\"] > 4000) & (train[\"SalePrice\"] < 300000)].index\n)\nfig, ax = plt.subplots()\nax.scatter(train[\"GrLivArea\"], train[\"SalePrice\"])\nplt.ylabel(\"SalePrice\", fontsize=13)\nplt.xlabel(\"GrLivArea\", fontsize=13)\nplt.show()\nsns.distplot(train[\"SalePrice\"], fit=norm)\n(mu, sigma) = norm.fit(train[\"SalePrice\"])\nprint(\"\\n mu = {:.2f} and sigma = {:.2f}\\n\".format(mu, sigma))\nplt.legend(\n [r\"Normal dist. ($\\mu=$ {:.2f} and $\\sigma=$ {:.2f} )\".format(mu, sigma)],\n loc=\"best\", # noqa: W605\n)\nplt.ylabel(\"Frequency\")\nplt.title(\"SalePrice distribution\")\nfig = plt.figure()\nres = stats.probplot(train[\"SalePrice\"], plot=plt)\nplt.show()\ntrain[\"SalePrice\"] = np.log1p(train[\"SalePrice\"])\nsns.distplot(train[\"SalePrice\"], fit=norm)\n(mu, sigma) = norm.fit(train[\"SalePrice\"])\nprint(\"\\n mu = {:.2f} and sigma = {:.2f}\\n\".format(mu, sigma))\nplt.legend(\n [r\"Normal dist. ($\\mu=$ {:.2f} and $\\sigma=$ {:.2f} )\".format(mu, sigma)],\n loc=\"best\", # noqa: W605\n)\nplt.ylabel(\"Frequency\")\nplt.title(\"SalePrice distribution\")\nfig = plt.figure()\nres = stats.probplot(train[\"SalePrice\"], plot=plt)\nplt.show()\nntrain = train.shape[0]\nntest = test.shape[0]\ny_train = train.SalePrice.values\nall_data = pd.concat((train, test)).reset_index(drop=True)\nall_data.drop([\"SalePrice\"], axis=1, inplace=True)\nprint(\"all_data size is : {}\".format(all_data.shape))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_all_data_na_None_21": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_all_data_na_None_21", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle4.py", "file_name": "kaggle4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 136, "span_ids": ["impl:52", "impl:92"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "all_data_na = (all_data.isnull().sum() / len(all_data)) * 100\nall_data_na = all_data_na.drop(all_data_na[all_data_na == 0].index).sort_values(\n ascending=False\n)[:30]\nmissing_data = pd.DataFrame({\"Missing Ratio\": all_data_na})\nmissing_data.head(20)\ncorrmat = train.corr()\nplt.subplots(figsize=(12, 9))\nsns.heatmap(corrmat, vmax=0.9, square=True)\nall_data[\"PoolQC\"] = all_data[\"PoolQC\"].fillna(\"None\")\nall_data[\"MiscFeature\"] = all_data[\"MiscFeature\"].fillna(\"None\")\nall_data[\"Alley\"] = all_data[\"Alley\"].fillna(\"None\")\nall_data[\"Fence\"] = all_data[\"Fence\"].fillna(\"None\")\nall_data[\"FireplaceQu\"] = all_data[\"FireplaceQu\"].fillna(\"None\")\nall_data[\"LotFrontage\"] = all_data.groupby(\"Neighborhood\")[\"LotFrontage\"].transform(\n lambda x: x.fillna(x.median())\n)\nfor col in (\"GarageType\", \"GarageFinish\", \"GarageQual\", \"GarageCond\"):\n all_data[col] = all_data[col].fillna(\"None\")\nfor col in (\"GarageYrBlt\", \"GarageArea\", \"GarageCars\"):\n all_data[col] = all_data[col].fillna(0)\nfor col in (\n \"BsmtFinSF1\",\n \"BsmtFinSF2\",\n \"BsmtUnfSF\",\n \"TotalBsmtSF\",\n \"BsmtFullBath\",\n \"BsmtHalfBath\",\n):\n all_data[col] = all_data[col].fillna(0)\nfor col in (\"BsmtQual\", \"BsmtCond\", \"BsmtExposure\", \"BsmtFinType1\", \"BsmtFinType2\"):\n all_data[col] = all_data[col].fillna(\"None\")\nall_data[\"MasVnrType\"] = all_data[\"MasVnrType\"].fillna(\"None\")\nall_data[\"MasVnrArea\"] = all_data[\"MasVnrArea\"].fillna(0)\nall_data[\"MSZoning\"] = all_data[\"MSZoning\"].fillna(all_data[\"MSZoning\"].mode()[0])\nall_data = all_data.drop([\"Utilities\"], axis=1)\nall_data[\"Functional\"] = all_data[\"Functional\"].fillna(\"Typ\")\nall_data[\"Electrical\"] = all_data[\"Electrical\"].fillna(all_data[\"Electrical\"].mode()[0])\nall_data[\"KitchenQual\"] = all_data[\"KitchenQual\"].fillna(\n all_data[\"KitchenQual\"].mode()[0]\n)\nall_data[\"Exterior1st\"] = all_data[\"Exterior1st\"].fillna(\n all_data[\"Exterior1st\"].mode()[0]\n)\nall_data[\"Exterior2nd\"] = all_data[\"Exterior2nd\"].fillna(\n all_data[\"Exterior2nd\"].mode()[0]\n)\nall_data[\"SaleType\"] = all_data[\"SaleType\"].fillna(all_data[\"SaleType\"].mode()[0])\nall_data[\"MSSubClass\"] = all_data[\"MSSubClass\"].fillna(\"None\")\nall_data_na = (all_data.isnull().sum() / len(all_data)) * 100\nall_data_na = all_data_na.drop(all_data_na[all_data_na == 0].index).sort_values(\n ascending=False\n)\nmissing_data = pd.DataFrame({\"Missing Ratio\": all_data_na})\nmissing_data.head()\nall_data[\"MSSubClass\"] = all_data[\"MSSubClass\"].apply(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_modin-project__modin/stress_tests/kaggle/kaggle4.py_all_data_OverallCond__ENet.make_pipeline_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_all_data_OverallCond__ENet.make_pipeline_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle4.py", "file_name": "kaggle4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 231, "span_ids": ["impl:92", "impl:118", "impl:166", "impl:156", "rmsle_cv"], "tokens": 769}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "all_data[\"OverallCond\"] = all_data[\"OverallCond\"].astype(str)\nall_data[\"YrSold\"] = all_data[\"YrSold\"].astype(str)\nall_data[\"MoSold\"] = all_data[\"MoSold\"].astype(str)\nfrom sklearn.preprocessing import LabelEncoder\n\ncols = (\n \"FireplaceQu\",\n \"BsmtQual\",\n \"BsmtCond\",\n \"GarageQual\",\n \"GarageCond\",\n \"ExterQual\",\n \"ExterCond\",\n \"HeatingQC\",\n \"PoolQC\",\n \"KitchenQual\",\n \"BsmtFinType1\",\n \"BsmtFinType2\",\n \"Functional\",\n \"Fence\",\n \"BsmtExposure\",\n \"GarageFinish\",\n \"LandSlope\",\n \"LotShape\",\n \"PavedDrive\",\n \"Street\",\n \"Alley\",\n \"CentralAir\",\n \"MSSubClass\",\n \"OverallCond\",\n \"YrSold\",\n \"MoSold\",\n)\nfor c in cols:\n lbl = LabelEncoder()\n lbl.fit(list(all_data[c].values))\n all_data[c] = lbl.transform(list(all_data[c].values))\nprint(\"Shape all_data: {}\".format(all_data.shape))\nall_data[\"TotalSF\"] = (\n all_data[\"TotalBsmtSF\"] + all_data[\"1stFlrSF\"] + all_data[\"2ndFlrSF\"]\n)\nnumeric_feats = all_data.dtypes[all_data.dtypes != \"object\"].index\nskewed_feats = (\n all_data[numeric_feats]\n .apply(lambda x: skew(x.dropna()))\n .sort_values(ascending=False)\n)\nprint(\"\\nSkew in numerical features: \\n\")\nskewness = pd.DataFrame({\"Skew\": skewed_feats})\nskewness.head(10)\nskewness = skewness[abs(skewness) > 0.75]\nprint(\n \"There are {} skewed numerical features to Box Cox transform\".format(\n skewness.shape[0]\n )\n)\nfrom scipy.special import boxcox1p\n\nskewed_features = skewness.index\nlam = 0.15\nfor feat in skewed_features:\n # all_data[feat] += 1\n all_data[feat] = boxcox1p(all_data[feat], lam)\nall_data = pd.get_dummies(all_data)\nprint(all_data.shape)\ntrain = all_data[:ntrain]\ntest = all_data[ntrain:]\nfrom sklearn.linear_model import ElasticNet, Lasso # BayesianRidge, LassoLarsIC\nfrom sklearn.ensemble import GradientBoostingRegressor # RandomForestRegressor\nfrom sklearn.kernel_ridge import KernelRidge\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import RobustScaler\nfrom sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin, clone\nfrom sklearn.model_selection import KFold, cross_val_score # train_test_split\nfrom sklearn.metrics import mean_squared_error\nimport xgboost as xgb\nimport lightgbm as lgb\n\nn_folds = 5\n\n\ndef rmsle_cv(model):\n kf = KFold(n_folds, shuffle=True, random_state=42).get_n_splits(train.values)\n rmse = np.sqrt(\n -cross_val_score(\n model, train.values, y_train, scoring=\"neg_mean_squared_error\", cv=kf\n )\n )\n return rmse\n\n\nlasso = make_pipeline(RobustScaler(), Lasso(alpha=0.0005, random_state=1))\nENet = make_pipeline(\n RobustScaler(), ElasticNet(alpha=0.0005, l1_ratio=0.9, random_state=3)\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_KRR_None_48": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_KRR_None_48", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle4.py", "file_name": "kaggle4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 232, "end_line": 304, "span_ids": ["AveragingModels.__init__", "AveragingModels.predict", "impl:166", "AveragingModels.fit", "impl:196", "impl:192", "AveragingModels"], "tokens": 676}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "KRR = KernelRidge(alpha=0.6, kernel=\"polynomial\", degree=2, coef0=2.5)\nGBoost = GradientBoostingRegressor(\n n_estimators=1,\n learning_rate=0.05,\n max_depth=4,\n max_features=\"sqrt\",\n min_samples_leaf=15,\n min_samples_split=10,\n loss=\"huber\",\n random_state=5,\n)\nmodel_xgb = xgb.XGBRegressor(\n colsample_bytree=0.4603,\n gamma=0.0468,\n learning_rate=0.05,\n max_depth=3,\n min_child_weight=1.7817,\n n_estimators=1,\n reg_alpha=0.4640,\n reg_lambda=0.8571,\n subsample=0.5213,\n silent=1,\n random_state=7,\n nthread=-1,\n)\nmodel_lgb = lgb.LGBMRegressor(\n objective=\"regression\",\n num_leaves=5,\n learning_rate=0.05,\n n_estimators=1,\n max_bin=55,\n bagging_fraction=0.8,\n bagging_freq=5,\n feature_fraction=0.2319,\n feature_fraction_seed=9,\n bagging_seed=9,\n min_data_in_leaf=6,\n min_sum_hessian_in_leaf=11,\n)\nscore = rmsle_cv(lasso)\nprint(\"\\nLasso score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std()))\nscore = rmsle_cv(ENet)\nprint(\"ElasticNet score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std()))\nscore = rmsle_cv(KRR)\nprint(\"Kernel Ridge score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std()))\nscore = rmsle_cv(GBoost)\nprint(\"Gradient Boosting score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std()))\nscore = rmsle_cv(model_xgb)\nprint(\"Xgboost score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std()))\nscore = rmsle_cv(model_lgb)\nprint(\"LGBM score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std()))\n\n\nclass AveragingModels(BaseEstimator, RegressorMixin, TransformerMixin):\n def __init__(self, models):\n self.models = models\n\n def fit(self, X, y):\n self.models_ = [clone(x) for x in self.models]\n for model in self.models_:\n model.fit(X, y)\n return self\n\n def predict(self, X):\n predictions = np.column_stack([model.predict(X) for model in self.models_])\n return np.mean(predictions, axis=1)\n\n\naveraged_models = AveragingModels(models=(ENet, GBoost, KRR, lasso))\nscore = rmsle_cv(averaged_models)\nprint(\n \" Averaged base models score: {:.4f} ({:.4f})\\n\".format(score.mean(), score.std())\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_StackingAveragedModels_StackingAveragedModels.fit.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_StackingAveragedModels_StackingAveragedModels.fit.return.self", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle4.py", "file_name": "kaggle4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 326, "span_ids": ["StackingAveragedModels.__init__", "StackingAveragedModels", "StackingAveragedModels.fit"], "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 StackingAveragedModels(BaseEstimator, RegressorMixin, TransformerMixin):\n def __init__(self, base_models, meta_model, n_folds=5):\n self.base_models = base_models\n self.meta_model = meta_model\n self.n_folds = n_folds\n\n def fit(self, X, y):\n self.base_models_ = [[] for _ in self.base_models]\n self.meta_model_ = clone(self.meta_model)\n kfold = KFold(n_splits=self.n_folds, shuffle=True, random_state=156)\n out_of_fold_predictions = np.zeros((X.shape[0], len(self.base_models)))\n for i, model in enumerate(self.base_models):\n for train_index, holdout_index in kfold.split(X, y):\n instance = clone(model)\n self.base_models_[i].append(instance)\n instance.fit(X[train_index], y[train_index])\n y_pred = instance.predict(X[holdout_index])\n out_of_fold_predictions[holdout_index, i] = y_pred\n self.meta_model_.fit(out_of_fold_predictions, y)\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_modin-project__modin/stress_tests/kaggle/kaggle4.py_predict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle4.py_predict_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle4.py", "file_name": "kaggle4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 329, "end_line": 376, "span_ids": ["rmsle", "impl:206", "impl:201", "predict"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def predict(self, X):\n meta_features = np.column_stack(\n [\n np.column_stack([model.predict(X) for model in base_models]).mean(axis=1)\n for base_models in self.base_models_\n ]\n )\n return self.meta_model_.predict(meta_features)\n\n\nstacked_averaged_models = StackingAveragedModels(\n base_models=(ENet, GBoost, KRR), meta_model=lasso\n)\nscore = rmsle_cv(stacked_averaged_models)\nprint(\n \"Stacking Averaged models score: {:.4f} ({:.4f})\".format(score.mean(), score.std())\n)\n\n\ndef rmsle(y, y_pred):\n return np.sqrt(mean_squared_error(y, y_pred))\n\n\nstacked_averaged_models.fit(train.values, y_train)\nstacked_train_pred = stacked_averaged_models.predict(train.values)\nstacked_pred = np.expm1(stacked_averaged_models.predict(test.values))\nprint(rmsle(y_train, stacked_train_pred))\nmodel_xgb.fit(train, y_train)\nxgb_train_pred = model_xgb.predict(train)\nxgb_pred = np.expm1(model_xgb.predict(test))\nprint(rmsle(y_train, xgb_train_pred))\nmodel_lgb.fit(train, y_train)\nlgb_train_pred = model_lgb.predict(train)\nlgb_pred = np.expm1(model_lgb.predict(test.values))\nprint(rmsle(y_train, lgb_train_pred))\nprint(\"RMSLE score on train data:\")\nprint(\n rmsle(\n y_train,\n stacked_train_pred * 0.70 + xgb_train_pred * 0.15 + lgb_train_pred * 0.15,\n )\n)\nensemble = stacked_pred * 0.70 + xgb_pred * 0.15 + lgb_pred * 0.15\nsub = pd.DataFrame()\nsub[\"Id\"] = test_ID\nsub[\"SalePrice\"] = ensemble\nsub.to_csv(\"submission.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle5.py_matplotlib_None_1.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_matplotlib_None_1.None_3", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle5.py", "file_name": "kaggle5.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 78, "span_ids": ["imports", "impl:35"], "tokens": 776}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport modin.pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.svm import SVC, LinearSVC\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.linear_model import Perceptron\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.tree import DecisionTreeClassifier\n\ntrain_df = pd.read_csv(\"train.csv\")\ntest_df = pd.read_csv(\"test.csv\")\ncombine = [train_df, test_df]\nprint(train_df.columns.values)\ntrain_df.head()\ntrain_df.tail()\ntrain_df.info()\nprint(\"_\" * 40)\ntest_df.info()\ntrain_df.describe()\ntrain_df.describe(include=[\"O\"])\ntrain_df[[\"Pclass\", \"Survived\"]].groupby([\"Pclass\"], as_index=False).mean().sort_values(\n by=\"Survived\", ascending=False\n)\ntrain_df[[\"Sex\", \"Survived\"]].groupby([\"Sex\"], as_index=False).mean().sort_values(\n by=\"Survived\", ascending=False\n)\ntrain_df[[\"SibSp\", \"Survived\"]].groupby([\"SibSp\"], as_index=False).mean().sort_values(\n by=\"Survived\", ascending=False\n)\ntrain_df[[\"Parch\", \"Survived\"]].groupby([\"Parch\"], as_index=False).mean().sort_values(\n by=\"Survived\", ascending=False\n)\ngrid = sns.FacetGrid(train_df, col=\"Survived\", row=\"Pclass\", size=2.2, aspect=1.6)\ngrid.map(plt.hist, \"Age\", alpha=0.5, bins=20)\ngrid.add_legend()\ngrid = sns.FacetGrid(train_df, row=\"Embarked\", size=2.2, aspect=1.6)\ngrid.map(sns.pointplot, \"Pclass\", \"Survived\", \"Sex\", palette=\"deep\")\ngrid.add_legend()\ngrid = sns.FacetGrid(train_df, row=\"Embarked\", col=\"Survived\", size=2.2, aspect=1.6)\ngrid.map(sns.barplot, \"Sex\", \"Fare\", alpha=0.5, ci=None)\ngrid.add_legend()\nprint(\"Before\", train_df.shape, test_df.shape, combine[0].shape, combine[1].shape)\ntrain_df = train_df.drop([\"Ticket\", \"Cabin\"], axis=1)\ntest_df = test_df.drop([\"Ticket\", \"Cabin\"], axis=1)\ncombine = [train_df, test_df]\n\"After\", train_df.shape, test_df.shape, combine[0].shape, combine[1].shape\nfor dataset in combine:\n dataset[\"Title\"] = dataset.Name.str.extract(\n r\" ([A-Za-z]+)\\.\", expand=False\n ) # noqa: W605\npd.crosstab(train_df[\"Title\"], train_df[\"Sex\"])\nfor dataset in combine:\n dataset[\"Title\"] = dataset[\"Title\"].replace(\n [\n \"Lady\",\n \"Countess\",\n \"Capt\",\n \"Col\",\n \"Don\",\n \"Dr\",\n \"Major\",\n \"Rev\",\n \"Sir\",\n \"Jonkheer\",\n \"Dona\",\n ],\n \"Rare\",\n )\n dataset[\"Title\"] = dataset[\"Title\"].replace(\"Mlle\", \"Miss\")\n dataset[\"Title\"] = dataset[\"Title\"].replace(\"Ms\", \"Miss\")\n dataset[\"Title\"] = dataset[\"Title\"].replace(\"Mme\", \"Mrs\")\nfor dataset in combine:\n # ... other code\n\n\nfor dataset in combine:\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_modin-project__modin/stress_tests/kaggle/kaggle5.py_train_df_Title_Survi_train_df_FamilySize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_train_df_Title_Survi_train_df_FamilySize_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle5.py", "file_name": "kaggle5.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 147, "span_ids": ["impl:48", "impl:59", "gender_mapping", "impl:90", "title_mapping", "impl:35"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "train_df[[\"Title\", \"Survived\"]].groupby([\"Title\"], as_index=False).mean()\n\n\ndef title_mapping(string):\n return np.random.randint(1, high=6)\n\n\nfor dataset in combine:\n dataset[\"Title\"] = dataset[\"Title\"].map(title_mapping)\n dataset[\"Title\"] = dataset[\"Title\"].fillna(0)\ntrain_df.head()\ntrain_df = train_df.drop([\"Name\", \"PassengerId\"], axis=1)\ntest_df = test_df.drop([\"Name\"], axis=1)\ncombine = [train_df, test_df]\ntrain_df.shape, test_df.shape\n\n\ndef gender_mapping(string):\n return np.random.randint(0, high=2)\n\n\nfor dataset in combine:\n # dataset['Sex'] = dataset['Sex'].map( {'female': 1, 'male': 0} ).astype(int)\n dataset[\"Sex\"] = dataset[\"Sex\"].map(gender_mapping).astype(int)\ntrain_df.head()\ngrid = sns.FacetGrid(train_df, row=\"Pclass\", col=\"Sex\", size=2.2, aspect=1.6)\ngrid.map(plt.hist, \"Age\", alpha=0.5, bins=20)\ngrid.add_legend()\nguess_ages = np.zeros((2, 3))\nguess_ages\nfor dataset in combine:\n for i in range(0, 2):\n for j in range(0, 3):\n guess_df = dataset[(dataset[\"Sex\"] == i) & (dataset[\"Pclass\"] == j + 1)][\n \"Age\"\n ].dropna()\n# age_mean = guess_df.mean()\n# age_std = guess_df.std()\n# age_guess = rnd.uniform(age_mean - age_std, age_mean + age_std)\nage_guess = guess_df.median()\n# Convert random age float to nearest .5 age\nguess_ages[i, j] = int(age_guess / 0.5 + 0.5) * 0.5\nfor i in range(0, 2):\n for j in range(0, 3):\n dataset.loc[\n (dataset.Age.isnull()) & (dataset.Sex == i) & (dataset.Pclass == j + 1),\n \"Age\",\n ] = guess_ages[i, j]\ndataset[\"Age\"] = dataset[\"Age\"].astype(int)\ntrain_df.head()\ntrain_df[\"AgeBand\"] = pd.cut(train_df[\"Age\"], 5)\ntrain_df[[\"AgeBand\", \"Survived\"]].groupby(\n [\"AgeBand\"], as_index=False\n).mean().sort_values(by=\"AgeBand\", ascending=True)\nfor dataset in combine:\n dataset.loc[dataset[\"Age\"] <= 16, \"Age\"] = 0\n dataset.loc[(dataset[\"Age\"] > 16) & (dataset[\"Age\"] <= 32), \"Age\"] = 1\n dataset.loc[(dataset[\"Age\"] > 32) & (dataset[\"Age\"] <= 48), \"Age\"] = 2\n dataset.loc[(dataset[\"Age\"] > 48) & (dataset[\"Age\"] <= 64), \"Age\"] = 3\n dataset.loc[dataset[\"Age\"] > 64, \"Age\"]\ntrain_df.head()\ntrain_df = train_df.drop([\"AgeBand\"], axis=1)\ncombine = [train_df, test_df]\ntrain_df.head()\nfor dataset in combine:\n dataset[\"FamilySize\"] = dataset[\"SibSp\"] + dataset[\"Parch\"] + 1\ntrain_df[[\"FamilySize\", \"Survived\"]].groupby(\n [\"FamilySize\"], as_index=False\n).mean().sort_values(by=\"Survived\", ascending=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_modin-project__modin/stress_tests/kaggle/kaggle5.py_None_8_knn_fit_X_train_Y_train_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_None_8_knn_fit_X_train_Y_train_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle5.py", "file_name": "kaggle5.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 210, "span_ids": ["embarked_mapping", "impl:119", "impl:90"], "tokens": 781}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from sklearn.linear_model import Perceptron\nfrom sklearn.linear_model import SGDClassifier\nfor dataset in combine:\n dataset[\"IsAlone\"] = 0\n dataset.loc[dataset[\"FamilySize\"] == 1, \"IsAlone\"] = 1\ntrain_df[[\"IsAlone\", \"Survived\"]].groupby([\"IsAlone\"], as_index=False).mean()\ntrain_df = train_df.drop([\"Parch\", \"SibSp\", \"FamilySize\"], axis=1)\ntest_df = test_df.drop([\"Parch\", \"SibSp\", \"FamilySize\"], axis=1)\ncombine = [train_df, test_df]\ntrain_df.head()\nfor dataset in combine:\n dataset[\"Age*Class\"] = dataset.Age * dataset.Pclass\ntrain_df.loc[:, [\"Age*Class\", \"Age\", \"Pclass\"]].head(10)\nfreq_port = train_df.Embarked.dropna().mode()[0]\nfreq_port\nfor dataset in combine:\n dataset[\"Embarked\"] = dataset[\"Embarked\"].fillna(freq_port)\ntrain_df[[\"Embarked\", \"Survived\"]].groupby(\n [\"Embarked\"], as_index=False\n).mean().sort_values(by=\"Survived\", ascending=False)\n\n\ndef embarked_mapping(string):\n return np.random.randint(0, high=3)\n\n\nfor dataset in combine:\n dataset[\"Embarked\"] = dataset[\"Embarked\"].map({\"S\": 0, \"C\": 1, \"Q\": 2}).astype(int)\ntrain_df.head()\ntest_df[\"Fare\"].fillna(test_df[\"Fare\"].dropna().median(), inplace=True)\ntest_df.head()\ntrain_df[\"FareBand\"] = pd.qcut(train_df[\"Fare\"], 4)\ntrain_df[[\"FareBand\", \"Survived\"]].groupby(\n [\"FareBand\"], as_index=False\n).mean().sort_values(by=\"FareBand\", ascending=True)\nfor dataset in combine:\n dataset.loc[dataset[\"Fare\"] <= 7.91, \"Fare\"] = 0\n dataset.loc[(dataset[\"Fare\"] > 7.91) & (dataset[\"Fare\"] <= 14.454), \"Fare\"] = 1\n dataset.loc[(dataset[\"Fare\"] > 14.454) & (dataset[\"Fare\"] <= 31), \"Fare\"] = 2\n dataset.loc[dataset[\"Fare\"] > 31, \"Fare\"] = 3\n dataset[\"Fare\"] = dataset[\"Fare\"].astype(int)\ntrain_df = train_df.drop([\"FareBand\"], axis=1)\ncombine = [train_df, test_df]\ntrain_df.head(10)\ntest_df.head(10)\nX_train = train_df.drop(\"Survived\", axis=1)\nY_train = train_df[\"Survived\"]\nX_test = test_df.drop(\"PassengerId\", axis=1).copy()\nX_train.shape, Y_train.shape, X_test.shape\nlogreg = LogisticRegression()\nlogreg.fit(X_train, Y_train)\nY_pred = logreg.predict(X_test)\nacc_log = round(logreg.score(X_train, Y_train) * 100, 2)\nacc_log\ncoeff_df = pd.DataFrame(train_df.columns.delete(0))\ncoeff_df.columns = [\"Feature\"]\ncoeff_df[\"Correlation\"] = pd.Series(logreg.coef_[0])\ncoeff_df.sort_values(by=\"Correlation\", ascending=False)\nsvc = SVC()\nsvc.fit(X_train, Y_train)\nY_pred = svc.predict(X_test)\nacc_svc = round(svc.score(X_train, Y_train) * 100, 2)\nacc_svc\nknn = KNeighborsClassifier(n_neighbors=3)\nknn.fit(X_train, Y_train)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_Y_pred_35_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle5.py_Y_pred_35_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle5.py", "file_name": "kaggle5.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 273, "span_ids": ["impl:172", "impl:119"], "tokens": 512}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "Y_pred = knn.predict(X_test)\nacc_knn = round(knn.score(X_train, Y_train) * 100, 2)\nacc_knn\ngaussian = GaussianNB()\ngaussian.fit(X_train, Y_train)\nY_pred = gaussian.predict(X_test)\nacc_gaussian = round(gaussian.score(X_train, Y_train) * 100, 2)\nacc_gaussian\nperceptron = Perceptron()\nperceptron.fit(X_train, Y_train)\nY_pred = perceptron.predict(X_test)\nacc_perceptron = round(perceptron.score(X_train, Y_train) * 100, 2)\nacc_perceptron\nlinear_svc = LinearSVC()\nlinear_svc.fit(X_train, Y_train)\nY_pred = linear_svc.predict(X_test)\nacc_linear_svc = round(linear_svc.score(X_train, Y_train) * 100, 2)\nacc_linear_svc\nsgd = SGDClassifier()\nsgd.fit(X_train, Y_train)\nY_pred = sgd.predict(X_test)\nacc_sgd = round(sgd.score(X_train, Y_train) * 100, 2)\nacc_sgd\ndecision_tree = DecisionTreeClassifier()\ndecision_tree.fit(X_train, Y_train)\nY_pred = decision_tree.predict(X_test)\nacc_decision_tree = round(decision_tree.score(X_train, Y_train) * 100, 2)\nacc_decision_tree\nrandom_forest = RandomForestClassifier(n_estimators=1)\nrandom_forest.fit(X_train, Y_train)\nY_pred = random_forest.predict(X_test)\nrandom_forest.score(X_train, Y_train)\nacc_random_forest = round(random_forest.score(X_train, Y_train) * 100, 2)\nacc_random_forest\nmodels = pd.DataFrame(\n {\n \"Model\": [\n \"Support Vector Machines\",\n \"KNN\",\n \"Logistic Regression\",\n \"Random Forest\",\n \"Naive Bayes\",\n \"Perceptron\",\n \"Stochastic Gradient Decent\",\n \"Linear SVC\",\n \"Decision Tree\",\n ],\n \"Score\": [\n acc_svc,\n acc_knn,\n acc_log,\n acc_random_forest,\n acc_gaussian,\n acc_perceptron,\n acc_sgd,\n acc_linear_svc,\n acc_decision_tree,\n ],\n }\n)\nmodels.sort_values(by=\"Score\", ascending=False)\nsubmission = pd.DataFrame({\"PassengerId\": test_df[\"PassengerId\"], \"Survived\": Y_pred})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_matplotlib_batch_size.86": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_matplotlib_batch_size.86", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle6.py", "file_name": "kaggle6.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 69, "span_ids": ["imports", "impl:43"], "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": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nnp.random.seed(2)\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import confusion_matrix\nimport itertools\nfrom keras.utils.np_utils import to_categorical # convert to one-hot-encoding\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPool2D\nfrom keras.optimizers import RMSprop\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.callbacks import ReduceLROnPlateau\n\nsns.set(style=\"white\", context=\"notebook\", palette=\"deep\")\ntrain = pd.read_csv(\"train.csv\")\ntest = pd.read_csv(\"test.csv\")\nY_train = train[\"label\"]\nX_train = train.drop(labels=[\"label\"], axis=1)\ndel train\ng = sns.countplot(Y_train)\nY_train.value_counts()\nX_train.isnull().any().describe()\ntest.isnull().any().describe()\nX_train = X_train / 255.0\ntest = test / 255.0\nX_train = X_train.values.reshape(-1, 28, 28, 1)\ntest = test.values.reshape(-1, 28, 28, 1)\nY_train = to_categorical(Y_train, num_classes=10)\nrandom_seed = 2\nX_train, X_val, Y_train, Y_val = train_test_split(\n X_train, Y_train, test_size=0.1, random_state=random_seed\n)\ng = plt.imshow(X_train[0][:, :, 0])\nmodel = Sequential()\nmodel.add(\n Conv2D(\n filters=32,\n kernel_size=(5, 5),\n padding=\"Same\",\n activation=\"relu\",\n input_shape=(28, 28, 1),\n )\n)\nmodel.add(Conv2D(filters=32, kernel_size=(5, 5), padding=\"Same\", activation=\"relu\"))\nmodel.add(MaxPool2D(pool_size=(2, 2)))\nmodel.add(Dropout(0.25))\nmodel.add(Conv2D(filters=64, kernel_size=(3, 3), padding=\"Same\", activation=\"relu\"))\nmodel.add(Conv2D(filters=64, kernel_size=(3, 3), padding=\"Same\", activation=\"relu\"))\nmodel.add(MaxPool2D(pool_size=(2, 2), strides=(2, 2)))\nmodel.add(Dropout(0.25))\nmodel.add(Flatten())\nmodel.add(Dense(256, activation=\"relu\"))\nmodel.add(Dropout(0.5))\nmodel.add(Dense(10, activation=\"softmax\"))\noptimizer = RMSprop(lr=0.001, rho=0.9, epsilon=1e-08, decay=0.0)\nmodel.compile(\n optimizer=optimizer, loss=\"categorical_crossentropy\", metrics=[\"accuracy\"]\n)\nlearning_rate_reduction = ReduceLROnPlateau(\n monitor=\"val_acc\", patience=3, verbose=1, factor=0.5, min_lr=0.00001\n)\nepochs = 1 # Turn epochs to 30 to get 0.9967 accuracy\nbatch_size = 86", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_datagen_legend_20.ax_1_legend_loc_best_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_datagen_legend_20.ax_1_legend_loc_best_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle6.py", "file_name": "kaggle6.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 98, "span_ids": ["impl:67", "impl:43"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "datagen = ImageDataGenerator(\n featurewise_center=False, # set input mean to 0 over the dataset\n samplewise_center=False, # set each sample mean to 0\n featurewise_std_normalization=False, # divide inputs by std of the dataset\n samplewise_std_normalization=False, # divide each input by its std\n zca_whitening=False, # apply ZCA whitening\n rotation_range=10, # randomly rotate images in the range (degrees, 0 to 180)\n zoom_range=0.1, # Randomly zoom image\n width_shift_range=0.1, # randomly shift images horizontally (fraction of total width)\n height_shift_range=0.1, # randomly shift images vertically (fraction of total height)\n horizontal_flip=False, # randomly flip images\n vertical_flip=False,\n) # randomly flip images\ndatagen.fit(X_train)\nhistory = model.fit_generator(\n datagen.flow(X_train, Y_train, batch_size=batch_size),\n epochs=epochs,\n validation_data=(X_val, Y_val),\n verbose=2,\n steps_per_epoch=X_train.shape[0] // batch_size,\n callbacks=[learning_rate_reduction],\n)\nfig, ax = plt.subplots(2, 1)\nax[0].plot(history.history[\"loss\"], color=\"b\", label=\"Training loss\")\nax[0].plot(history.history[\"val_loss\"], color=\"r\", label=\"validation loss\", axes=ax[0])\nlegend = ax[0].legend(loc=\"best\", shadow=True)\nax[1].plot(history.history[\"acc\"], color=\"b\", label=\"Training accuracy\")\nax[1].plot(history.history[\"val_acc\"], color=\"r\", label=\"Validation accuracy\")\nlegend = ax[1].legend(loc=\"best\", shadow=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_modin-project__modin/stress_tests/kaggle/kaggle6.py_plot_confusion_matrix_plot_confusion_matrix.plt_xlabel_Predicted_lab": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_plot_confusion_matrix_plot_confusion_matrix.plt_xlabel_Predicted_lab", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle6.py", "file_name": "kaggle6.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 127, "span_ids": ["plot_confusion_matrix"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def plot_confusion_matrix(\n cm, classes, normalize=False, title=\"Confusion matrix\", cmap=plt.cm.Blues\n):\n \"\"\"\n This function prints and plots the confusion matrix.\n Normalization can be applied by setting `normalize=True`.\n \"\"\"\n plt.imshow(cm, interpolation=\"nearest\", cmap=cmap)\n plt.title(title)\n plt.colorbar()\n tick_marks = np.arange(len(classes))\n plt.xticks(tick_marks, classes, rotation=45)\n plt.yticks(tick_marks, classes)\n if normalize:\n cm = cm.astype(\"float\") / cm.sum(axis=1)[:, np.newaxis]\n thresh = cm.max() / 2.0\n for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):\n plt.text(\n j,\n i,\n cm[i, j],\n horizontalalignment=\"center\",\n color=\"white\" if cm[i, j] > thresh else \"black\",\n )\n plt.tight_layout()\n plt.ylabel(\"True label\")\n plt.xlabel(\"Predicted label\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_Y_pred_X_val_errors.X_val_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_Y_pred_X_val_errors.X_val_errors_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle6.py", "file_name": "kaggle6.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 139, "span_ids": ["impl:70"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "Y_pred = model.predict(X_val)\nY_pred_classes = np.argmax(Y_pred, axis=1)\nY_true = np.argmax(Y_val, axis=1)\nconfusion_mtx = confusion_matrix(Y_true, Y_pred_classes)\nplot_confusion_matrix(confusion_mtx, classes=range(10))\nerrors = Y_pred_classes - Y_true != 0\nY_pred_classes_errors = Y_pred_classes[errors]\nY_pred_errors = Y_pred[errors]\nY_true_errors = Y_true[errors]\nX_val_errors = X_val[errors]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_display_errors_display_errors.for_row_in_range_nrows_.for_col_in_range_ncols_.n_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_display_errors_display_errors.for_row_in_range_nrows_.for_col_in_range_ncols_.n_1", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle6.py", "file_name": "kaggle6.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 157, "span_ids": ["display_errors"], "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 display_errors(errors_index, img_errors, pred_errors, obs_errors):\n \"\"\" This function shows 6 images with their predicted and real labels\"\"\"\n n = 0\n nrows = 2\n ncols = 3\n fig, ax = plt.subplots(nrows, ncols, sharex=True, sharey=True)\n for row in range(nrows):\n for col in range(ncols):\n error = errors_index[n]\n ax[row, col].imshow((img_errors[error]).reshape((28, 28)))\n ax[row, col].set_title(\n \"Predicted label :{}\\nTrue label :{}\".format(\n pred_errors[error], obs_errors[error]\n )\n )\n n += 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_Y_pred_errors_prob_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle6.py_Y_pred_errors_prob_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle6.py", "file_name": "kaggle6.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 173, "span_ids": ["impl:89"], "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": "Y_pred_errors_prob = np.max(Y_pred_errors, axis=1)\ntrue_prob_errors = np.diagonal(np.take(Y_pred_errors, Y_true_errors, axis=1))\ndelta_pred_true_errors = Y_pred_errors_prob - true_prob_errors\nsorted_dela_errors = np.argsort(delta_pred_true_errors)\nmost_important_errors = sorted_dela_errors[-6:]\ndisplay_errors(\n most_important_errors, X_val_errors, Y_pred_classes_errors, Y_true_errors\n)\nresults = model.predict(test)\nresults = np.argmax(results, axis=1)\nresults = pd.Series(results, name=\"Label\")\nsubmission = pd.concat([pd.Series(range(1, 28001), name=\"ImageId\"), results], axis=1)\nsubmission.to_csv(\"cnn_mnist_datagen.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle7.py_matplotlib_app_train_TARGET_astyp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_matplotlib_app_train_TARGET_astyp", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "span_ids": ["imports"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport numpy as np\nimport modin.pandas as pd\nfrom sklearn.preprocessing import LabelEncoder\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\napp_train = pd.read_csv(\"application_train.csv\")\nprint(\"Training data shape: \", app_train.shape)\napp_train.head()\napp_test = pd.read_csv(\"application_test.csv\")\nprint(\"Testing data shape: \", app_test.shape)\napp_test.head()\napp_train[\"TARGET\"].value_counts()\napp_train[\"TARGET\"].astype(int).plot.hist()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_missing_values_table_missing_values_table.return.mis_val_table_ren_columns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_missing_values_table_missing_values_table.return.mis_val_table_ren_columns", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 23, "end_line": 42, "span_ids": ["missing_values_table"], "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 missing_values_table(df):\n # Total missing values\n mis_val = df.isnull().sum()\n mis_val_percent = 100 * df.isnull().sum() / len(df)\n mis_val_table = pd.concat([mis_val, mis_val_percent], axis=1)\n mis_val_table_ren_columns = mis_val_table.rename(\n columns={0: \"Missing Values\", 1: \"% of Total Values\"}\n )\n mis_val_table_ren_columns = (\n mis_val_table_ren_columns[mis_val_table_ren_columns.iloc[:, 1] != 0]\n .sort_values(\"% of Total Values\", ascending=False)\n .round(1)\n )\n print(\n \"Your selected dataframe has \" + str(df.shape[1]) + \" columns.\\n\"\n \"There are \"\n + str(mis_val_table_ren_columns.shape[0])\n + \" columns that have missing values.\"\n )\n return mis_val_table_ren_columns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_app_train_dtypes_value_co_age_data_YEARS_BIRTH_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_app_train_dtypes_value_co_age_data_YEARS_BIRTH_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 106, "span_ids": ["impl:55", "impl:13"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "app_train.dtypes.value_counts()\napp_train.select_dtypes(\"object\").apply(pd.Series.nunique, axis=0)\nle = LabelEncoder()\nle_count = 0\nfor col in app_train:\n if app_train[col].dtype == \"object\":\n # If 2 or fewer unique categories\n if len(list(app_train[col].unique())) <= 2:\n # Train on the training data\n le.fit(app_train[col])\n # Transform both training and testing data\n app_train[col] = le.transform(app_train[col])\n app_test[col] = le.transform(app_test[col])\n le_count += 1\nprint(\"%d columns were label encoded.\" % le_count)\napp_train = pd.get_dummies(app_train)\napp_test = pd.get_dummies(app_test)\nprint(\"Training Features shape: \", app_train.shape)\nprint(\"Testing Features shape: \", app_test.shape)\ntrain_labels = app_train[\"TARGET\"]\napp_train, app_test = app_train.align(app_test, join=\"inner\", axis=1)\napp_train[\"TARGET\"] = train_labels\nprint(\"Training Features shape: \", app_train.shape)\nprint(\"Testing Features shape: \", app_test.shape)\n(app_train[\"DAYS_BIRTH\"] / -365).describe()\napp_train[\"DAYS_EMPLOYED\"].describe()\napp_train[\"DAYS_EMPLOYED\"].plot.hist(title=\"Days Employment Histogram\")\nplt.xlabel(\"Days Employment\")\nanom = app_train[app_train[\"DAYS_EMPLOYED\"] == 3]\nnon_anom = app_train[app_train[\"DAYS_EMPLOYED\"] != 3]\nprint(\n \"The non-anomalies default on %0.2f%% of loans\" % (100 * non_anom[\"TARGET\"].mean())\n)\nprint(\"The anomalies default on %0.2f%% of loans\" % (100 * anom[\"TARGET\"].mean()))\nprint(\"There are %d anomalous days of employment\" % len(anom))\napp_train[\"DAYS_EMPLOYED_ANOM\"] = app_train[\"DAYS_EMPLOYED\"] == 3\napp_train[\"DAYS_EMPLOYED\"].replace({3: np.nan}, inplace=True)\napp_train[\"DAYS_EMPLOYED\"].plot.hist(title=\"Days Employment Histogram\")\nplt.xlabel(\"Days Employment\")\napp_test[\"DAYS_EMPLOYED_ANOM\"] = app_test[\"DAYS_EMPLOYED\"] == 3\napp_test[\"DAYS_EMPLOYED\"].replace({3: np.nan}, inplace=True)\nprint(\n \"There are %d anomalies in the test data out of %d entries\"\n % (app_test[\"DAYS_EMPLOYED_ANOM\"].sum(), len(app_test))\n)\ncorrelations = app_train.corr()[\"TARGET\"].sort_values()\nprint(\"Most Positive Correlations:\\n\", correlations.tail(15))\nprint(\"\\nMost Negative Correlations:\\n\", correlations.head(15))\napp_train[\"DAYS_BIRTH\"] = abs(app_train[\"DAYS_BIRTH\"])\napp_train[\"DAYS_BIRTH\"].corr(app_train[\"TARGET\"])\nplt.style.use(\"fivethirtyeight\")\nplt.hist(app_train[\"DAYS_BIRTH\"] / 365, edgecolor=\"k\", bins=25)\nplt.title(\"Age of Client\")\nplt.xlabel(\"Age (years)\")\nplt.ylabel(\"Count\")\nplt.figure(figsize=(10, 8))\n#\nplt.xlabel(\"Age (years)\")\nplt.ylabel(\"Density\")\nplt.title(\"Distribution of Ages\")\nage_data = app_train[[\"TARGET\", \"DAYS_BIRTH\"]]\nage_data[\"YEARS_BIRTH\"] = age_data[\"DAYS_BIRTH\"] / 365\napp_train_domain[\"CREDIT_TERM\"] = (\n app_train_domain[\"AMT_ANNUITY\"] / app_train_domain[\"AMT_CREDIT\"]\n)\nsubmit[\"TARGET\"] = predictions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_age_data_YEARS_BINNED__print_Training_data_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_age_data_YEARS_BINNED__print_Training_data_with", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 178, "span_ids": ["impl:93", "impl:55", "corr_func"], "tokens": 748}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "age_data[\"YEARS_BINNED\"] = pd.cut(\n age_data[\"YEARS_BIRTH\"], bins=np.linspace(20, 70, num=11)\n)\nage_data.head(10)\nage_groups = age_data.groupby(\"YEARS_BINNED\").mean()\nage_groups\next_data = app_train[\n [\"TARGET\", \"EXT_SOURCE_1\", \"EXT_SOURCE_2\", \"EXT_SOURCE_3\", \"DAYS_BIRTH\"]\n]\next_data_corrs = ext_data.corr()\next_data_corrs\nplt.figure(figsize=(8, 6))\nsns.heatmap(ext_data_corrs, cmap=plt.cm.RdYlBu_r, vmin=-0.25, annot=True, vmax=0.6)\nplt.title(\"Correlation Heatmap\")\nplot_data = ext_data.drop(columns=[\"DAYS_BIRTH\"]).copy()\nplot_data[\"YEARS_BIRTH\"] = age_data[\"YEARS_BIRTH\"]\nplot_data = plot_data.dropna().loc[:100000, :]\n\n\ndef corr_func(x, y, **kwargs):\n r = np.corrcoef(x, y)[0][1]\n ax = plt.gca()\n ax.annotate(\"r = {:.2f}\".format(r), xy=(0.2, 0.8), xycoords=ax.transAxes, size=20)\n\n\npoly_features = app_train[\n [\"EXT_SOURCE_1\", \"EXT_SOURCE_2\", \"EXT_SOURCE_3\", \"DAYS_BIRTH\", \"TARGET\"]\n]\npoly_features_test = app_test[\n [\"EXT_SOURCE_1\", \"EXT_SOURCE_2\", \"EXT_SOURCE_3\", \"DAYS_BIRTH\"]\n]\nfrom sklearn.preprocessing import Imputer\n\nimputer = Imputer(strategy=\"median\")\npoly_target = poly_features[\"TARGET\"]\npoly_features = poly_features.drop(columns=[\"TARGET\"])\npoly_features = imputer.fit_transform(poly_features)\npoly_features_test = imputer.transform(poly_features_test)\nfrom sklearn.preprocessing import PolynomialFeatures\n\npoly_transformer = PolynomialFeatures(degree=3)\npoly_transformer.fit(poly_features)\npoly_features = poly_transformer.transform(poly_features)\npoly_features_test = poly_transformer.transform(poly_features_test)\nprint(\"Polynomial Features shape: \", poly_features.shape)\npoly_transformer.get_feature_names(\n input_features=[\"EXT_SOURCE_1\", \"EXT_SOURCE_2\", \"EXT_SOURCE_3\", \"DAYS_BIRTH\"]\n)[:15]\npoly_features = pd.DataFrame(\n poly_features,\n columns=poly_transformer.get_feature_names(\n [\"EXT_SOURCE_1\", \"EXT_SOURCE_2\", \"EXT_SOURCE_3\", \"DAYS_BIRTH\"]\n ),\n)\npoly_features[\"TARGET\"] = poly_target\npoly_corrs = poly_features.corr()[\"TARGET\"].sort_values()\nprint(poly_corrs.head(10))\nprint(poly_corrs.tail(5))\npoly_features_test = pd.DataFrame(\n poly_features_test,\n columns=poly_transformer.get_feature_names(\n [\"EXT_SOURCE_1\", \"EXT_SOURCE_2\", \"EXT_SOURCE_3\", \"DAYS_BIRTH\"]\n ),\n)\npoly_features[\"SK_ID_CURR\"] = app_train[\"SK_ID_CURR\"]\napp_train_poly = app_train.merge(poly_features, on=\"SK_ID_CURR\", how=\"left\")\npoly_features_test[\"SK_ID_CURR\"] = app_test[\"SK_ID_CURR\"]\napp_test_poly = app_test.merge(poly_features_test, on=\"SK_ID_CURR\", how=\"left\")\napp_train_poly, app_test_poly = app_train_poly.align(\n app_test_poly, join=\"inner\", axis=1\n)\nprint(\"Training data with polynomial features shape: \", app_train_poly.shape)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_print_Testing_data_with__poly_features_test_55.scaler_transform_poly_fea": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_print_Testing_data_with__poly_features_test_55.scaler_transform_poly_fea", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 255, "span_ids": ["impl:93", "impl:138", "impl:186"], "tokens": 760}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "app_train[\"DAYS_EMPLOYED\"].plot.hist(title=\"Days Employment Histogram\")\nprint(\"Testing data with polynomial features shape: \", app_test_poly.shape)\napp_train_domain = app_train.copy()\napp_test_domain = app_test.copy()\napp_train_domain[\"CREDIT_INCOME_PERCENT\"] = (\n app_train_domain[\"AMT_CREDIT\"] / app_train_domain[\"AMT_INCOME_TOTAL\"]\n)\napp_train_domain[\"ANNUITY_INCOME_PERCENT\"] = (\n app_train_domain[\"AMT_ANNUITY\"] / app_train_domain[\"AMT_INCOME_TOTAL\"]\n)\napp_train_domain[\"CREDIT_TERM\"] = (\n app_train_domain[\"AMT_ANNUITY\"] / app_train_domain[\"AMT_CREDIT\"]\n)\napp_train_domain[\"DAYS_EMPLOYED_PERCENT\"] = (\n app_train_domain[\"DAYS_EMPLOYED\"] / app_train_domain[\"DAYS_BIRTH\"]\n)\napp_test_domain[\"CREDIT_INCOME_PERCENT\"] = (\n app_test_domain[\"AMT_CREDIT\"] / app_test_domain[\"AMT_INCOME_TOTAL\"]\n)\napp_test_domain[\"ANNUITY_INCOME_PERCENT\"] = (\n app_test_domain[\"AMT_ANNUITY\"] / app_test_domain[\"AMT_INCOME_TOTAL\"]\n)\napp_test_domain[\"CREDIT_TERM\"] = (\n app_test_domain[\"AMT_ANNUITY\"] / app_test_domain[\"AMT_CREDIT\"]\n)\napp_test_domain[\"DAYS_EMPLOYED_PERCENT\"] = (\n app_test_domain[\"DAYS_EMPLOYED\"] / app_test_domain[\"DAYS_BIRTH\"]\n)\nfrom sklearn.preprocessing import MinMaxScaler, Imputer\n\nif \"TARGET\" in app_train.columns:\n train = app_train.drop(columns=[\"TARGET\"])\n # TODO (williamma12): Not sure why this line is necessary but it is\n app_test = app_test.drop(columns=[\"TARGET\"])\nelse:\n train = app_train.copy()\nfeatures = list(train.columns)\ntest = app_test.copy()\nimputer = Imputer(strategy=\"median\")\nscaler = MinMaxScaler(feature_range=(0, 1))\nimputer.fit(train)\ntrain = imputer.transform(train)\ntest = imputer.transform(app_test)\nscaler.fit(train)\ntrain = scaler.transform(train)\ntest = scaler.transform(test)\nprint(\"Training data shape: \", train.shape)\nprint(\"Testing data shape: \", test.shape)\nfrom sklearn.linear_model import LogisticRegression\n\nlog_reg = LogisticRegression(C=0.0001)\nlog_reg.fit(train, train_labels)\nlog_reg_pred = log_reg.predict_proba(test)[:, 1]\nsubmit = app_test[[\"SK_ID_CURR\"]]\nsubmit[\"TARGET\"] = log_reg_pred\nsubmit.head()\nsubmit.to_csv(\"log_reg_baseline.csv\", index=False)\nfrom sklearn.ensemble import RandomForestClassifier\n\nrandom_forest = RandomForestClassifier(\n n_estimators=100, random_state=50, verbose=1, n_jobs=-1\n)\nrandom_forest.fit(train, train_labels)\nfeature_importance_values = random_forest.feature_importances_\nfeature_importances = pd.DataFrame(\n {\"feature\": features, \"importance\": feature_importance_values}\n)\npredictions = random_forest.predict_proba(test)[:, 1]\nsubmit = app_test[[\"SK_ID_CURR\"]]\nsubmit[\"TARGET\"] = predictions\nsubmit.to_csv(\"random_forest_baseline.csv\", index=False)\npoly_features_names = list(app_train_poly.columns)\nimputer = Imputer(strategy=\"median\")\npoly_features = imputer.fit_transform(app_train_poly)\npoly_features_test = imputer.transform(app_test_poly)\nscaler = MinMaxScaler(feature_range=(0, 1))\npoly_features = scaler.fit_transform(poly_features)\npoly_features_test = scaler.transform(poly_features_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_modin-project__modin/stress_tests/kaggle/kaggle7.py_random_forest_poly_None_61": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_random_forest_poly_None_61", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 284, "span_ids": ["impl:252", "impl:186"], "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": "print(\n \"There are %d anomalies in the test data out of %d entries\"\n % (app_test[\"DAYS_EMPLOYED_ANOM\"].sum(), len(app_test))\n)\nrandom_forest_poly = RandomForestClassifier(\n n_estimators=100, random_state=50, verbose=1, n_jobs=-1\n)\nrandom_forest_poly.fit(poly_features, train_labels)\npredictions = random_forest_poly.predict_proba(poly_features_test)[:, 1]\nsubmit = app_test[[\"SK_ID_CURR\"]]\nsubmit[\"TARGET\"] = predictions\nsubmit.to_csv(\"random_forest_baseline_engineered.csv\", index=False)\napp_train_domain = app_train_domain.drop(columns=\"TARGET\")\napp_test_domain = app_test_domain.drop(columns=\"TARGET\")\ndomain_features_names = list(app_train_domain.columns)\nimputer = Imputer(strategy=\"median\")\ndomain_features = imputer.fit_transform(app_train_domain)\ndomain_features_test = imputer.transform(app_test_domain)\nscaler = MinMaxScaler(feature_range=(0, 1))\ndomain_features = scaler.fit_transform(domain_features)\ndomain_features_test = scaler.transform(domain_features_test)\nrandom_forest_domain = RandomForestClassifier(\n n_estimators=100, random_state=50, verbose=1, n_jobs=-1\n)\nrandom_forest_domain.fit(domain_features, train_labels)\nfeature_importance_values_domain = random_forest_domain.feature_importances_\nfeature_importances_domain = pd.DataFrame(\n {\"feature\": domain_features_names, \"importance\": feature_importance_values_domain}\n)\npredictions = random_forest_domain.predict_proba(domain_features_test)[:, 1]\nsubmit = app_test[[\"SK_ID_CURR\"]]\nsubmit[\"TARGET\"] = predictions\nsubmit.to_csv(\"random_forest_baseline_domain.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle7.py_plot_feature_importances_gc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_plot_feature_importances_gc", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 310, "span_ids": ["impl:256", "plot_feature_importances"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def plot_feature_importances(df):\n df = df.sort_values(\"importance\", ascending=False).reset_index()\n df[\"importance_normalized\"] = df[\"importance\"] / df[\"importance\"].sum()\n plt.figure(figsize=(10, 6))\n ax = plt.subplot()\n ax.barh(\n list(reversed(list(df.index[:15]))),\n df[\"importance_normalized\"].head(15),\n align=\"center\",\n edgecolor=\"k\",\n )\n ax.set_yticks(list(reversed(list(df.index[:15]))))\n ax.set_yticklabels(df[\"feature\"].head(15))\n plt.xlabel(\"Normalized Importance\")\n plt.title(\"Feature Importances\")\n return df\n\n\nfeature_importances_sorted = plot_feature_importances(feature_importances)\nfeature_importances_domain_sorted = plot_feature_importances(feature_importances_domain)\nfrom sklearn.model_selection import KFold\nfrom sklearn.metrics import roc_auc_score\nimport lightgbm as lgb\nimport gc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_model_model.return.submission_feature_impor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_model_model.return.submission_feature_impor", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 313, "end_line": 400, "span_ids": ["model"], "tokens": 805}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def model(features, test_features, encoding=\"ohe\", n_folds=5):\n test_ids = test_features[\"SK_ID_CURR\"]\n labels = features[\"TARGET\"]\n features = features.drop(columns=[\"SK_ID_CURR\", \"TARGET\"])\n test_features = test_features.drop(columns=[\"SK_ID_CURR\"])\n if encoding == \"ohe\":\n features = pd.get_dummies(features)\n test_features = pd.get_dummies(test_features)\n features, test_features = features.align(test_features, join=\"inner\", axis=1)\n cat_indices = \"auto\"\n elif encoding == \"le\":\n label_encoder = LabelEncoder()\n cat_indices = []\n for i, col in enumerate(features):\n if features[col].dtype == \"object\":\n features[col] = label_encoder.fit_transform(\n np.array(features[col].astype(str)).reshape((-1,))\n )\n test_features[col] = label_encoder.transform(\n np.array(test_features[col].astype(str)).reshape((-1,))\n )\n cat_indices.append(i)\n else:\n raise ValueError(\"Encoding must be either 'ohe' or 'le'\")\n print(\"Training Data Shape: \", features.shape)\n print(\"Testing Data Shape: \", test_features.shape)\n feature_names = list(features.columns)\n features = np.array(features)\n test_features = np.array(test_features)\n k_fold = KFold(n_splits=n_folds, shuffle=True, random_state=50)\n feature_importance_values = np.zeros(len(feature_names))\n test_predictions = np.zeros(test_features.shape[0])\n out_of_fold = np.zeros(features.shape[0])\n valid_scores = []\n train_scores = []\n for train_indices, valid_indices in k_fold.split(features):\n train_features, train_labels = features[train_indices], labels[train_indices]\n valid_features, valid_labels = features[valid_indices], labels[valid_indices]\n model = lgb.LGBMClassifier(\n n_estimators=10000,\n objective=\"binary\",\n class_weight=\"balanced\",\n learning_rate=0.05,\n reg_alpha=0.1,\n reg_lambda=0.1,\n subsample=0.8,\n n_jobs=-1,\n random_state=50,\n )\n model.fit(\n train_features,\n train_labels,\n eval_metric=\"auc\",\n eval_set=[(valid_features, valid_labels), (train_features, train_labels)],\n eval_names=[\"valid\", \"train\"],\n categorical_feature=cat_indices,\n early_stopping_rounds=100,\n verbose=200,\n )\n best_iteration = model.best_iteration_\n feature_importance_values += model.feature_importances_ / k_fold.n_splits\n test_predictions += (\n model.predict_proba(test_features, num_iteration=best_iteration)[:, 1]\n / k_fold.n_splits\n )\n out_of_fold[valid_indices] = model.predict_proba(\n valid_features, num_iteration=best_iteration\n )[:, 1]\n valid_score = model.best_score_[\"valid\"][\"auc\"]\n train_score = model.best_score_[\"train\"][\"auc\"]\n valid_scores.append(valid_score)\n train_scores.append(train_score)\n gc.enable()\n del model, train_features, valid_features\n gc.collect()\n submission = pd.DataFrame({\"SK_ID_CURR\": test_ids, \"TARGET\": test_predictions})\n feature_importances = pd.DataFrame(\n {\"feature\": feature_names, \"importance\": feature_importance_values}\n )\n valid_auc = roc_auc_score(labels, out_of_fold)\n valid_scores.append(valid_auc)\n train_scores.append(np.mean(train_scores))\n fold_names = list(range(n_folds))\n fold_names.append(\"overall\")\n metrics = pd.DataFrame(\n {\"fold\": fold_names, \"train\": train_scores, \"valid\": valid_scores}\n )\n return submission, feature_importances, metrics", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_submission_fi_metrics__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle7.py_submission_fi_metrics__", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle7.py", "file_name": "kaggle7.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 414, "span_ids": ["impl:264"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "submission, fi, metrics = model(app_train, app_test)\nprint(\"Baseline metrics\")\nprint(metrics)\nfi_sorted = plot_feature_importances(fi)\nsubmission.to_csv(\"baseline_lgb.csv\", index=False)\napp_train_domain[\"TARGET\"] = train_labels\nsubmission_domain, fi_domain, metrics_domain = model(app_train_domain, app_test_domain)\nprint(\"Baseline with domain knowledge features metrics\")\nprint(metrics_domain)\nfi_sorted = plot_feature_importances(fi_domain)\nsubmission_domain.to_csv(\"baseline_lgb_domain_features.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle8.py_pd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle8.py_pd_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle8.py", "file_name": "kaggle8.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import modin.pandas as pd\nfrom sklearn.ensemble import RandomForestRegressor\n\ntrain = pd.read_csv(\"train.csv\")\ntrain_y = train.SalePrice\npredictor_cols = [\"LotArea\", \"OverallQual\", \"YearBuilt\", \"TotRmsAbvGrd\"]\ntrain_X = train[predictor_cols]\nmy_model = RandomForestRegressor()\nmy_model.fit(train_X, train_y)\ntest = pd.read_csv(\"test.csv\")\ntest_X = test[predictor_cols]\npredicted_prices = my_model.predict(test_X)\nprint(predicted_prices)\nmy_submission = pd.DataFrame({\"Id\": test.Id, \"SalePrice\": predicted_prices})\nmy_submission.to_csv(\"submission.csv\", index=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_modin-project__modin/stress_tests/kaggle/kaggle9.py_matplotlib_dtest.xgb_DMatrix_X_test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle9.py_matplotlib_dtest.xgb_DMatrix_X_test_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle9.py", "file_name": "kaggle9.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 77, "span_ids": ["imports", "rmse_cv", "impl:33"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import matplotlib\n\nmatplotlib.use(\"PS\")\nimport modin.pandas as pd\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom scipy.stats import skew\n\ntrain = pd.read_csv(\"train.csv\")\ntest = pd.read_csv(\"test.csv\")\ntrain.head()\nall_data = pd.concat(\n (\n train.loc[:, \"MSSubClass\":\"SaleCondition\"],\n test.loc[:, \"MSSubClass\":\"SaleCondition\"],\n )\n)\nmatplotlib.rcParams[\"figure.figsize\"] = (12.0, 6.0)\nprices = pd.DataFrame(\n {\"price\": train[\"SalePrice\"], \"log(price + 1)\": np.log1p(train[\"SalePrice\"])}\n)\nprices.hist()\ntrain[\"SalePrice\"] = np.log1p(train[\"SalePrice\"])\nnumeric_feats = all_data.dtypes[all_data.dtypes != \"object\"].index\nskewed_feats = train[numeric_feats].apply(\n lambda x: skew(x.dropna())\n) # compute skewness\nskewed_feats = skewed_feats[skewed_feats > 0.75]\nskewed_feats = skewed_feats.index\nall_data[skewed_feats] = np.log1p(all_data[skewed_feats])\nall_data = pd.get_dummies(all_data)\nall_data = all_data.fillna(all_data.mean())\nX_train = all_data[: train.shape[0]]\nX_test = all_data[train.shape[0] :]\ny = train.SalePrice\nfrom sklearn.linear_model import Ridge, LassoCV # RidgeCV, ElasticNet, LassoLarsCV\nfrom sklearn.model_selection import cross_val_score\n\n\ndef rmse_cv(model):\n rmse = np.sqrt(\n -cross_val_score(model, X_train, y, scoring=\"neg_mean_squared_error\", cv=5)\n )\n return rmse\n\n\nmodel_ridge = Ridge()\nalphas = [0.05, 0.1, 0.3, 1, 3, 5, 10, 15, 30, 50, 75]\ncv_ridge = [rmse_cv(Ridge(alpha=alpha)).mean() for alpha in alphas]\ncv_ridge = pd.Series(cv_ridge, index=alphas)\ncv_ridge.plot(title=\"Validation - Just Do It\")\nplt.xlabel(\"alpha\")\nplt.ylabel(\"rmse\")\ncv_ridge.min()\nmodel_lasso = LassoCV(alphas=[1, 0.1, 0.001, 0.0005]).fit(X_train, y)\nrmse_cv(model_lasso).mean()\ncoef = pd.Series(model_lasso.coef_, index=X_train.columns)\nprint(\n \"Lasso picked \"\n + str(sum(coef != 0))\n + \" variables and eliminated the other \"\n + str(sum(coef == 0))\n + \" variables\"\n)\nimp_coef = pd.concat([coef.sort_values().head(10), coef.sort_values().tail(10)])\nmatplotlib.rcParams[\"figure.figsize\"] = (8.0, 10.0)\nimp_coef.plot(kind=\"barh\")\nplt.title(\"Coefficients in the Lasso Model\")\nmatplotlib.rcParams[\"figure.figsize\"] = (6.0, 6.0)\npreds = pd.DataFrame({\"preds\": model_lasso.predict(X_train), \"true\": y})\npreds[\"residuals\"] = preds[\"true\"] - preds[\"preds\"]\npreds.plot(x=\"preds\", y=\"residuals\", kind=\"scatter\")\nimport xgboost as xgb\n\ndtrain = xgb.DMatrix(X_train, label=y)\ndtest = xgb.DMatrix(X_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_modin-project__modin/stress_tests/kaggle/kaggle9.py_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/kaggle/kaggle9.py_params_", "embedding": null, "metadata": {"file_path": "stress_tests/kaggle/kaggle9.py", "file_name": "kaggle9.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 108, "span_ids": ["impl:33", "impl:76"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "params = {\"max_depth\": 2, \"eta\": 0.1}\nmodel = xgb.cv(params, dtrain, num_boost_round=500, early_stopping_rounds=100)\nmodel.loc[30:, [\"test-rmse-mean\", \"train-rmse-mean\"]].plot()\nmodel_xgb = xgb.XGBRegressor(\n n_estimators=360, max_depth=2, learning_rate=0.1\n) # the params were tuned using xgb.cv\nmodel_xgb.fit(X_train, y)\nxgb_preds = np.expm1(model_xgb.predict(X_test))\nlasso_preds = np.expm1(model_lasso.predict(X_test))\npredictions = pd.DataFrame({\"xgb\": xgb_preds, \"lasso\": lasso_preds})\npredictions.plot(x=\"xgb\", y=\"lasso\", kind=\"scatter\")\npreds = 0.7 * lasso_preds + 0.3 * xgb_preds\nsolution = pd.DataFrame({\"id\": test.Id, \"SalePrice\": preds})\nsolution.to_csv(\"ridge_sol.csv\", index=False)\nfrom keras.layers import Dense\nfrom keras.models import Sequential\nfrom keras.regularizers import l1\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import train_test_split\n\nX_train = StandardScaler().fit_transform(X_train)\nX_tr, X_val, y_tr, y_val = train_test_split(X_train, y, random_state=3)\nX_tr.shape\nX_tr\nmodel = Sequential()\nmodel.add(Dense(1, input_dim=X_train.shape[1], W_regularizer=l1(0.001)))\nmodel.compile(loss=\"mse\", optimizer=\"adam\")\nmodel.summary()\nhist = model.fit(X_tr, y_tr, validation_data=(X_val, y_val))\npd.Series(model.predict(X_val)[:, 0]).hist()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_os_KAGGLE_DIR_PATH._kaggle_format_DIR_PA": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_os_KAGGLE_DIR_PATH._kaggle_format_DIR_PA", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 19, "span_ids": ["imports"], "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 os\nimport subprocess\n\nimport logging\nimport numpy as np\nimport pytest\n\n# import ray\n# ray.init(address=\"localhost:6379\")\n\nimport modin.pandas as pd\n\nlogger = logging.getLogger(__name__)\n\n# Size for synthetic datasets\nDF_SIZE = 1 * 2 ** 10 * 2 ** 10 # * 2**10 # 1 GiB dataframes\n# This file path\nDIR_PATH = os.path.dirname(os.path.realpath(__file__))\nKAGGLE_DIR_PATH = \"{}/kaggle\".format(DIR_PATH)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_create_dataframe_create_dataframe.return.pd_DataFrame_result_dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_create_dataframe_create_dataframe.return.pd_DataFrame_result_dict_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 22, "end_line": 43, "span_ids": ["create_dataframe"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_dataframe(columns, dtypes, size):\n def _num_to_str(x):\n letters = \"\"\n while x:\n mod = (x - 1) % 26\n letters += chr(mod + 65)\n x = (x - 1) // 26\n result = \"\".join(reversed(letters))\n if \"NA\" in result:\n return _num_to_str(x + 1)\n else:\n return result\n\n result_dict = {}\n for col, dtype in zip(columns, dtypes):\n if dtype is str:\n result_dict[col] = [_num_to_str(x + 1) for x in np.arange(size, dtype=int)]\n elif dtype is bool:\n result_dict[col] = [x % 2 == 0 for x in np.arange(size, dtype=int)]\n else:\n result_dict[col] = np.arange(size, dtype=dtype)\n return pd.DataFrame(result_dict)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_generate_dataset_generate_dataset.for_filename_in_filenames.if_os_path_exists_filenam.os_remove_filename_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_generate_dataset_generate_dataset.for_filename_in_filenames.if_os_path_exists_filenam.os_remove_filename_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 91, "span_ids": ["generate_dataset"], "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": "@pytest.fixture\ndef generate_dataset():\n \"\"\"Generates a synthetic dataset using the given arguments.\n\n Args:\n columns (list): Column names of the result\n dtypes (list): List of dtypes for the corresponding column\n size (int): Number of rows for result\n\n Returns:\n Modin dataframe of synthetic data following arguments.\n \"\"\"\n # Record of files generated for a test\n filenames = []\n\n def _dataset_builder(filename, columns, dtypes, size=DF_SIZE, files_to_remove=[]):\n # Add the files generated by the script to be removed\n for file in files_to_remove:\n filenames.append(\"{}/{}\".format(KAGGLE_DIR_PATH, file))\n\n # Update filename to include path\n filename = \"{}/{}\".format(KAGGLE_DIR_PATH, filename)\n\n # Check that the number of column names is the same as the nubmer of dtypes\n if len(columns) != len(dtypes):\n raise ValueError(\"len(columns) != len(dtypes)\")\n\n # Determine number of rows for synthetic dataset\n row_size = (\n create_dataframe(columns, dtypes, 1)\n .memory_usage(index=False, deep=True)\n .sum()\n )\n result = create_dataframe(columns, dtypes, np.ceil(size / row_size))\n\n result.to_csv(filename)\n filenames.append(filename)\n return result\n\n # Return dataset builder factory\n yield _dataset_builder\n\n # Delete files created\n for filename in filenames:\n if os.path.exists(filename):\n os.remove(filename)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle3_test_kaggle3.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle3_test_kaggle3.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 94, "end_line": 126, "span_ids": ["test_kaggle3"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle3(generate_dataset):\n pokemon_columns = [\n \"#\",\n \"Name\",\n \"Type 1\",\n \"Type 2\",\n \"HP\",\n \"Attack\",\n \"Defense\",\n \"Sp. Atk\",\n \"Sp. Def\",\n \"Speed\",\n \"Generation\",\n \"Legendary\",\n ]\n pokemon_dtypes = [int, str, str, str, int, int, int, int, int, int, int, bool]\n generate_dataset(\n \"pokemon.csv\", pokemon_columns, pokemon_dtypes, files_to_remove=[\"graph.png\"]\n )\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle3.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle3\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle4_test_kaggle4.columns._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle4_test_kaggle4.columns._", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 212, "span_ids": ["test_kaggle4"], "tokens": 515}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle4(generate_dataset):\n columns = [\n \"Id\",\n \"MSSubClass\",\n \"MSZoning\",\n \"LotFrontage\",\n \"LotArea\",\n \"Street\",\n \"Alley\",\n \"LotShape\",\n \"LandContour\",\n \"Utilities\",\n \"LotConfig\",\n \"LandSlope\",\n \"Neighborhood\",\n \"Condition1\",\n \"Condition2\",\n \"BldgType\",\n \"HouseStyle\",\n \"OverallQual\",\n \"OverallCond\",\n \"YearBuilt\",\n \"YearRemodAdd\",\n \"RoofStyle\",\n \"RoofMatl\",\n \"Exterior1st\",\n \"Exterior2nd\",\n \"MasVnrType\",\n \"MasVnrArea\",\n \"ExterQual\",\n \"ExterCond\",\n \"Foundation\",\n \"BsmtQual\",\n \"BsmtCond\",\n \"BsmtExposure\",\n \"BsmtFinType1\",\n \"BsmtFinSF1\",\n \"BsmtFinType2\",\n \"BsmtFinSF2\",\n \"BsmtUnfSF\",\n \"TotalBsmtSF\",\n \"Heating\",\n \"HeatingQC\",\n \"CentralAir\",\n \"Electrical\",\n \"1stFlrSF\",\n \"2ndFlrSF\",\n \"LowQualFinSF\",\n \"GrLivArea\",\n \"BsmtFullBath\",\n \"BsmtHalfBath\",\n \"FullBath\",\n \"HalfBath\",\n \"BedroomAbvGr\",\n \"KitchenAbvGr\",\n \"KitchenQual\",\n \"TotRmsAbvGrd\",\n \"Functional\",\n \"Fireplaces\",\n \"FireplaceQu\",\n \"GarageType\",\n \"GarageYrBlt\",\n \"GarageFinish\",\n \"GarageCars\",\n \"GarageArea\",\n \"GarageQual\",\n \"GarageCond\",\n \"PavedDrive\",\n \"WoodDeckSF\",\n \"OpenPorchSF\",\n \"EnclosedPorch\",\n \"3SsnPorch\",\n \"ScreenPorch\",\n \"PoolArea\",\n \"PoolQC\",\n \"Fence\",\n \"MiscFeature\",\n \"MiscVal\",\n \"MoSold\",\n \"YrSold\",\n \"SaleType\",\n \"SaleCondition\",\n \"SalePrice\",\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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle4.dtypes_test_kaggle4.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle4.dtypes_test_kaggle4.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 213, "end_line": 311, "span_ids": ["test_kaggle4"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle4(generate_dataset):\n # ... other code\n dtypes = [\n int,\n int,\n str,\n float,\n int,\n str,\n float,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n str,\n str,\n str,\n str,\n str,\n float,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n int,\n str,\n int,\n int,\n int,\n str,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n str,\n int,\n str,\n int,\n float,\n str,\n float,\n str,\n int,\n int,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n int,\n int,\n float,\n float,\n float,\n int,\n int,\n int,\n str,\n str,\n int,\n ]\n generate_dataset(\"train.csv\", columns, dtypes)\n generate_dataset(\"test.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle4.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle4\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle5_test_kaggle5.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle5_test_kaggle5.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 314, "end_line": 345, "span_ids": ["test_kaggle5"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle5(generate_dataset):\n columns = [\n \"PassengerId\",\n \"Survived\",\n \"Pclass\",\n \"Name\",\n \"Sex\",\n \"Age\",\n \"SibSp\",\n \"Parch\",\n \"Ticket\",\n \"Fare\",\n \"Cabin\",\n \"Embarked\",\n ]\n dtypes = [int, int, int, str, str, float, int, int, str, float, float, str]\n generate_dataset(\"train.csv\", columns, dtypes)\n generate_dataset(\"test.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle5.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle5\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle6_test_kaggle6.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle6_test_kaggle6.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 348, "end_line": 367, "span_ids": ["test_kaggle6"], "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": "@pytest.mark.skip(\"Missing Original Data Schema\")\ndef test_kaggle6(generate_dataset):\n columns = []\n dtypes = []\n generate_dataset(\"test.csv\", columns, dtypes)\n generate_dataset(\"train.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle6.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle6\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle7_test_kaggle7.columns._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle7_test_kaggle7.columns._", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 370, "end_line": 494, "span_ids": ["test_kaggle7"], "tokens": 1004}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle7(generate_dataset):\n columns = [\n \"SK_ID_CURR\",\n \"TARGET\",\n \"NAME_CONTRACT_TYPE\",\n \"CODE_GENDER\",\n \"FLAG_OWN_CAR\",\n \"FLAG_OWN_REALTY\",\n \"CNT_CHILDREN\",\n \"AMT_INCOME_TOTAL\",\n \"AMT_CREDIT\",\n \"AMT_ANNUITY\",\n \"AMT_GOODS_PRICE\",\n \"NAME_TYPE_SUITE\",\n \"NAME_INCOME_TYPE\",\n \"NAME_EDUCATION_TYPE\",\n \"NAME_FAMILY_STATUS\",\n \"NAME_HOUSING_TYPE\",\n \"REGION_POPULATION_RELATIVE\",\n \"DAYS_BIRTH\",\n \"DAYS_EMPLOYED\",\n \"DAYS_REGISTRATION\",\n \"DAYS_ID_PUBLISH\",\n \"OWN_CAR_AGE\",\n \"FLAG_MOBIL\",\n \"FLAG_EMP_PHONE\",\n \"FLAG_WORK_PHONE\",\n \"FLAG_CONT_MOBILE\",\n \"FLAG_PHONE\",\n \"FLAG_EMAIL\",\n \"OCCUPATION_TYPE\",\n \"CNT_FAM_MEMBERS\",\n \"REGION_RATING_CLIENT\",\n \"REGION_RATING_CLIENT_W_CITY\",\n \"WEEKDAY_APPR_PROCESS_START\",\n \"HOUR_APPR_PROCESS_START\",\n \"REG_REGION_NOT_LIVE_REGION\",\n \"REG_REGION_NOT_WORK_REGION\",\n \"LIVE_REGION_NOT_WORK_REGION\",\n \"REG_CITY_NOT_LIVE_CITY\",\n \"REG_CITY_NOT_WORK_CITY\",\n \"LIVE_CITY_NOT_WORK_CITY\",\n \"ORGANIZATION_TYPE\",\n \"EXT_SOURCE_1\",\n \"EXT_SOURCE_2\",\n \"EXT_SOURCE_3\",\n \"APARTMENTS_AVG\",\n \"BASEMENTAREA_AVG\",\n \"YEARS_BEGINEXPLUATATION_AVG\",\n \"YEARS_BUILD_AVG\",\n \"COMMONAREA_AVG\",\n \"ELEVATORS_AVG\",\n \"ENTRANCES_AVG\",\n \"FLOORSMAX_AVG\",\n \"FLOORSMIN_AVG\",\n \"LANDAREA_AVG\",\n \"LIVINGAPARTMENTS_AVG\",\n \"LIVINGAREA_AVG\",\n \"NONLIVINGAPARTMENTS_AVG\",\n \"NONLIVINGAREA_AVG\",\n \"APARTMENTS_MODE\",\n \"BASEMENTAREA_MODE\",\n \"YEARS_BEGINEXPLUATATION_MODE\",\n \"YEARS_BUILD_MODE\",\n \"COMMONAREA_MODE\",\n \"ELEVATORS_MODE\",\n \"ENTRANCES_MODE\",\n \"FLOORSMAX_MODE\",\n \"FLOORSMIN_MODE\",\n \"LANDAREA_MODE\",\n \"LIVINGAPARTMENTS_MODE\",\n \"LIVINGAREA_MODE\",\n \"NONLIVINGAPARTMENTS_MODE\",\n \"NONLIVINGAREA_MODE\",\n \"APARTMENTS_MEDI\",\n \"BASEMENTAREA_MEDI\",\n \"YEARS_BEGINEXPLUATATION_MEDI\",\n \"YEARS_BUILD_MEDI\",\n \"COMMONAREA_MEDI\",\n \"ELEVATORS_MEDI\",\n \"ENTRANCES_MEDI\",\n \"FLOORSMAX_MEDI\",\n \"FLOORSMIN_MEDI\",\n \"LANDAREA_MEDI\",\n \"LIVINGAPARTMENTS_MEDI\",\n \"LIVINGAREA_MEDI\",\n \"NONLIVINGAPARTMENTS_MEDI\",\n \"NONLIVINGAREA_MEDI\",\n \"FONDKAPREMONT_MODE\",\n \"HOUSETYPE_MODE\",\n \"TOTALAREA_MODE\",\n \"WALLSMATERIAL_MODE\",\n \"EMERGENCYSTATE_MODE\",\n \"OBS_30_CNT_SOCIAL_CIRCLE\",\n \"DEF_30_CNT_SOCIAL_CIRCLE\",\n \"OBS_60_CNT_SOCIAL_CIRCLE\",\n \"DEF_60_CNT_SOCIAL_CIRCLE\",\n \"DAYS_LAST_PHONE_CHANGE\",\n \"FLAG_DOCUMENT_2\",\n \"FLAG_DOCUMENT_3\",\n \"FLAG_DOCUMENT_4\",\n \"FLAG_DOCUMENT_5\",\n \"FLAG_DOCUMENT_6\",\n \"FLAG_DOCUMENT_7\",\n \"FLAG_DOCUMENT_8\",\n \"FLAG_DOCUMENT_9\",\n \"FLAG_DOCUMENT_10\",\n \"FLAG_DOCUMENT_11\",\n \"FLAG_DOCUMENT_12\",\n \"FLAG_DOCUMENT_13\",\n \"FLAG_DOCUMENT_14\",\n \"FLAG_DOCUMENT_15\",\n \"FLAG_DOCUMENT_16\",\n \"FLAG_DOCUMENT_17\",\n \"FLAG_DOCUMENT_18\",\n \"FLAG_DOCUMENT_19\",\n \"FLAG_DOCUMENT_20\",\n \"FLAG_DOCUMENT_21\",\n \"AMT_REQ_CREDIT_BUREAU_HOUR\",\n \"AMT_REQ_CREDIT_BUREAU_DAY\",\n \"AMT_REQ_CREDIT_BUREAU_WEEK\",\n \"AMT_REQ_CREDIT_BUREAU_MON\",\n \"AMT_REQ_CREDIT_BUREAU_QRT\",\n \"AMT_REQ_CREDIT_BUREAU_YEAR\",\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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle7.dtypes_test_kaggle7.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle7.dtypes_test_kaggle7.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 495, "end_line": 646, "span_ids": ["test_kaggle7"], "tokens": 577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle7(generate_dataset):\n # ... other code\n dtypes = [\n int,\n int,\n str,\n str,\n str,\n str,\n int,\n float,\n float,\n float,\n float,\n str,\n str,\n str,\n str,\n str,\n float,\n int,\n int,\n float,\n int,\n float,\n int,\n int,\n int,\n int,\n int,\n int,\n str,\n float,\n int,\n int,\n str,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n str,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n str,\n str,\n float,\n str,\n str,\n float,\n float,\n float,\n float,\n float,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n float,\n float,\n float,\n float,\n float,\n float,\n ]\n generate_dataset(\n \"application_train.csv\",\n columns,\n dtypes,\n files_to_remove=[\n \"log_reg_baseline.csv\",\n \"random_forest_baseline.csv\",\n \"random_forest_baseline_engineered.csv\",\n \"random_forest_baseline_domain.csv\",\n \"baseline_lgb.csv\",\n \"baseline_lgb_domain_features.csv\",\n ],\n )\n generate_dataset(\"application_test.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle7.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle7\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle8_test_kaggle8.columns._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle8_test_kaggle8.columns._", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 649, "end_line": 732, "span_ids": ["test_kaggle8"], "tokens": 515}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle8(generate_dataset):\n columns = [\n \"Id\",\n \"MSSubClass\",\n \"MSZoning\",\n \"LotFrontage\",\n \"LotArea\",\n \"Street\",\n \"Alley\",\n \"LotShape\",\n \"LandContour\",\n \"Utilities\",\n \"LotConfig\",\n \"LandSlope\",\n \"Neighborhood\",\n \"Condition1\",\n \"Condition2\",\n \"BldgType\",\n \"HouseStyle\",\n \"OverallQual\",\n \"OverallCond\",\n \"YearBuilt\",\n \"YearRemodAdd\",\n \"RoofStyle\",\n \"RoofMatl\",\n \"Exterior1st\",\n \"Exterior2nd\",\n \"MasVnrType\",\n \"MasVnrArea\",\n \"ExterQual\",\n \"ExterCond\",\n \"Foundation\",\n \"BsmtQual\",\n \"BsmtCond\",\n \"BsmtExposure\",\n \"BsmtFinType1\",\n \"BsmtFinSF1\",\n \"BsmtFinType2\",\n \"BsmtFinSF2\",\n \"BsmtUnfSF\",\n \"TotalBsmtSF\",\n \"Heating\",\n \"HeatingQC\",\n \"CentralAir\",\n \"Electrical\",\n \"1stFlrSF\",\n \"2ndFlrSF\",\n \"LowQualFinSF\",\n \"GrLivArea\",\n \"BsmtFullBath\",\n \"BsmtHalfBath\",\n \"FullBath\",\n \"HalfBath\",\n \"BedroomAbvGr\",\n \"KitchenAbvGr\",\n \"KitchenQual\",\n \"TotRmsAbvGrd\",\n \"Functional\",\n \"Fireplaces\",\n \"FireplaceQu\",\n \"GarageType\",\n \"GarageYrBlt\",\n \"GarageFinish\",\n \"GarageCars\",\n \"GarageArea\",\n \"GarageQual\",\n \"GarageCond\",\n \"PavedDrive\",\n \"WoodDeckSF\",\n \"OpenPorchSF\",\n \"EnclosedPorch\",\n \"3SsnPorch\",\n \"ScreenPorch\",\n \"PoolArea\",\n \"PoolQC\",\n \"Fence\",\n \"MiscFeature\",\n \"MiscVal\",\n \"MoSold\",\n \"YrSold\",\n \"SaleType\",\n \"SaleCondition\",\n \"SalePrice\",\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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle8.dtypes_test_kaggle8.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle8.dtypes_test_kaggle8.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 733, "end_line": 831, "span_ids": ["test_kaggle8"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle8(generate_dataset):\n # ... other code\n dtypes = [\n int,\n int,\n str,\n float,\n int,\n str,\n float,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n str,\n str,\n str,\n str,\n str,\n float,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n float,\n str,\n float,\n float,\n float,\n str,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n float,\n float,\n int,\n int,\n int,\n int,\n str,\n int,\n str,\n int,\n float,\n str,\n float,\n str,\n float,\n float,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n int,\n int,\n float,\n str,\n float,\n int,\n int,\n int,\n str,\n str,\n int,\n ]\n generate_dataset(\"test.csv\", columns, dtypes, files_to_remove=[\"submission.csv\"])\n generate_dataset(\"train.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle8.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle8\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle9_test_kaggle9.columns._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle9_test_kaggle9.columns._", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 834, "end_line": 917, "span_ids": ["test_kaggle9"], "tokens": 515}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle9(generate_dataset):\n columns = [\n \"Id\",\n \"MSSubClass\",\n \"MSZoning\",\n \"LotFrontage\",\n \"LotArea\",\n \"Street\",\n \"Alley\",\n \"LotShape\",\n \"LandContour\",\n \"Utilities\",\n \"LotConfig\",\n \"LandSlope\",\n \"Neighborhood\",\n \"Condition1\",\n \"Condition2\",\n \"BldgType\",\n \"HouseStyle\",\n \"OverallQual\",\n \"OverallCond\",\n \"YearBuilt\",\n \"YearRemodAdd\",\n \"RoofStyle\",\n \"RoofMatl\",\n \"Exterior1st\",\n \"Exterior2nd\",\n \"MasVnrType\",\n \"MasVnrArea\",\n \"ExterQual\",\n \"ExterCond\",\n \"Foundation\",\n \"BsmtQual\",\n \"BsmtCond\",\n \"BsmtExposure\",\n \"BsmtFinType1\",\n \"BsmtFinSF1\",\n \"BsmtFinType2\",\n \"BsmtFinSF2\",\n \"BsmtUnfSF\",\n \"TotalBsmtSF\",\n \"Heating\",\n \"HeatingQC\",\n \"CentralAir\",\n \"Electrical\",\n \"1stFlrSF\",\n \"2ndFlrSF\",\n \"LowQualFinSF\",\n \"GrLivArea\",\n \"BsmtFullBath\",\n \"BsmtHalfBath\",\n \"FullBath\",\n \"HalfBath\",\n \"BedroomAbvGr\",\n \"KitchenAbvGr\",\n \"KitchenQual\",\n \"TotRmsAbvGrd\",\n \"Functional\",\n \"Fireplaces\",\n \"FireplaceQu\",\n \"GarageType\",\n \"GarageYrBlt\",\n \"GarageFinish\",\n \"GarageCars\",\n \"GarageArea\",\n \"GarageQual\",\n \"GarageCond\",\n \"PavedDrive\",\n \"WoodDeckSF\",\n \"OpenPorchSF\",\n \"EnclosedPorch\",\n \"3SsnPorch\",\n \"ScreenPorch\",\n \"PoolArea\",\n \"PoolQC\",\n \"Fence\",\n \"MiscFeature\",\n \"MiscVal\",\n \"MoSold\",\n \"YrSold\",\n \"SaleType\",\n \"SaleCondition\",\n \"SalePrice\",\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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle9.dtypes_test_kaggle9.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle9.dtypes_test_kaggle9.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 918, "end_line": 1016, "span_ids": ["test_kaggle9"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle9(generate_dataset):\n # ... other code\n dtypes = [\n int,\n int,\n str,\n float,\n int,\n str,\n float,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n str,\n str,\n str,\n str,\n str,\n float,\n str,\n str,\n str,\n str,\n str,\n str,\n str,\n int,\n str,\n int,\n int,\n int,\n str,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n str,\n int,\n str,\n int,\n float,\n str,\n float,\n str,\n int,\n int,\n str,\n str,\n str,\n int,\n int,\n int,\n int,\n int,\n int,\n float,\n float,\n float,\n int,\n int,\n int,\n str,\n str,\n int,\n ]\n generate_dataset(\"test.csv\", columns, dtypes, files_to_remove=[\"ridge_sol.csv\"])\n generate_dataset(\"train.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle9.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle9\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle10_test_kaggle10.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle10_test_kaggle10.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1019, "end_line": 1046, "span_ids": ["test_kaggle10"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle10(generate_dataset):\n columns = [\n \"pelvic_incidence\",\n \"pelvic_tilt numeric\",\n \"lumbar_lordosis_angle\",\n \"sacral_slope\",\n \"pelvic_radius\",\n \"degree_spondylolisthesis\",\n \"class\",\n ]\n dtypes = [float, float, float, float, float, float, str]\n generate_dataset(\n \"column_2C_weka.csv\", columns, dtypes, files_to_remove=[\"graph.png\"]\n )\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle10.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle10\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle12_test_kaggle12.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle12_test_kaggle12.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1049, "end_line": 1082, "span_ids": ["test_kaggle12"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle12(generate_dataset):\n columns = [\n \"PassengerId\",\n \"Survived\",\n \"Pclass\",\n \"Name\",\n \"Sex\",\n \"Age\",\n \"SibSp\",\n \"Parch\",\n \"Ticket\",\n \"Fare\",\n \"Cabin\",\n \"Embarked\",\n ]\n dtypes = [int, int, int, str, str, float, int, int, str, float, float, str]\n generate_dataset(\n \"train.csv\", columns, dtypes, files_to_remove=[\"ensemble_python_voting.csv\"]\n )\n generate_dataset(\"test.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle12.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle12\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle13_test_kaggle13.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle13_test_kaggle13.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1085, "end_line": 1109, "span_ids": ["test_kaggle13"], "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": "def test_kaggle13(generate_dataset):\n columns = [\n \"Id\",\n \"SepalLengthCm\",\n \"SepalWidthCm\",\n \"PetalLengthCm\",\n \"PetalWidthCm\",\n \"Species\",\n ]\n dtypes = [int, float, float, float, float, str]\n generate_dataset(\"Iris.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle13.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle13\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle14_test_kaggle14.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle14_test_kaggle14.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1112, "end_line": 1143, "span_ids": ["test_kaggle14"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle14(generate_dataset):\n columns = [\n \"PassengerId\",\n \"Survived\",\n \"Pclass\",\n \"Name\",\n \"Sex\",\n \"Age\",\n \"SibSp\",\n \"Parch\",\n \"Ticket\",\n \"Fare\",\n \"Cabin\",\n \"Embarked\",\n ]\n dtypes = [int, int, int, str, str, float, int, int, str, float, float, str]\n generate_dataset(\"train.csv\", columns, dtypes)\n generate_dataset(\"test.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle14.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle14\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle17_test_kaggle17.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle17_test_kaggle17.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1146, "end_line": 1207, "span_ids": ["test_kaggle17"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle17(generate_dataset):\n columns = [\n \"Suburb\",\n \"Address\",\n \"Rooms\",\n \"Type\",\n \"Price\",\n \"Method\",\n \"SellerG\",\n \"Date\",\n \"Distance\",\n \"Postcode\",\n \"Bedroom2\",\n \"Bathroom\",\n \"Car\",\n \"Landsize\",\n \"BuildingArea\",\n \"YearBuilt\",\n \"CouncilArea\",\n \"Lattitude\",\n \"Longtitude\",\n \"Regionname\",\n \"Propertycount\",\n ]\n dtypes = [\n str,\n str,\n int,\n str,\n float,\n str,\n str,\n str,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n str,\n float,\n float,\n str,\n float,\n ]\n generate_dataset(\"melb_data.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle17.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle17\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle18_test_kaggle18.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle18_test_kaggle18.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1210, "end_line": 1239, "span_ids": ["test_kaggle18"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle18(generate_dataset):\n columns = [\n \"train_id\",\n \"name\",\n \"item_condition_id\",\n \"category_name\",\n \"brand_name\",\n \"price\",\n \"shipping\",\n \"item_description\",\n ]\n # TODO (williamma12): \"category_name\" should be strings but original data\n # that is not currently captured by the data generation\n dtypes = [int, str, int, int, float, float, int, str]\n generate_dataset(\"test.csv\", columns, dtypes)\n generate_dataset(\"train.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle18.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle18\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle19_test_kaggle19.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle19_test_kaggle19.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1242, "end_line": 1319, "span_ids": ["test_kaggle19"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle19(generate_dataset):\n columns = [\n \"Id\",\n \"groupId\",\n \"matchId\",\n \"assists\",\n \"boosts\",\n \"damageDealt\",\n \"DBNOs\",\n \"headshotKills\",\n \"heals\",\n \"killPlace\",\n \"killPoints\",\n \"kills\",\n \"killStreaks\",\n \"longestKill\",\n \"matchDuration\",\n \"matchType\",\n \"maxPlace\",\n \"numGroups\",\n \"rankPoints\",\n \"revives\",\n \"rideDistance\",\n \"roadKills\",\n \"swimDistance\",\n \"teamKills\",\n \"vehicleDestroys\",\n \"walkDistance\",\n \"weaponsAcquired\",\n \"winPoints\",\n \"winPlacePerc\",\n ]\n dtypes = [\n str,\n str,\n str,\n int,\n int,\n float,\n int,\n int,\n int,\n int,\n int,\n int,\n int,\n float,\n int,\n str,\n int,\n int,\n int,\n int,\n float,\n int,\n float,\n int,\n int,\n float,\n int,\n int,\n int,\n ]\n generate_dataset(\"train.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle19.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle19\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle20_test_kaggle20.assert_ipynb_returncode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle20_test_kaggle20.assert_ipynb_returncode_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1322, "end_line": 1407, "span_ids": ["test_kaggle20"], "tokens": 436}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_kaggle20(generate_dataset):\n columns = [\n \"id\",\n \"diagnosis\",\n \"radius_mean\",\n \"texture_mean\",\n \"perimeter_mean\",\n \"area_mean\",\n \"smoothness_mean\",\n \"compactness_mean\",\n \"concavity_mean\",\n \"concave points_mean\",\n \"symmetry_mean\",\n \"fractal_dimension_mean\",\n \"radius_se\",\n \"texture_se\",\n \"perimeter_se\",\n \"area_se\",\n \"smoothness_se\",\n \"compactness_se\",\n \"concavity_se\",\n \"concave points_se\",\n \"symmetry_se\",\n \"fractal_dimension_se\",\n \"radius_worst\",\n \"texture_worst\",\n \"perimeter_worst\",\n \"area_worst\",\n \"smoothness_worst\",\n \"compactness_worst\",\n \"concavity_worst\",\n \"concave points_worst\",\n \"symmetry_worst\",\n \"fractal_dimension_worst\",\n \"Unnamed: 32\",\n ]\n dtypes = [\n int,\n str,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n float,\n ]\n generate_dataset(\"data.csv\", columns, dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle20.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle20\")\n assert ipynb.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_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle22_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/stress_tests/test_kaggle_ipynb.py_test_kaggle22_", "embedding": null, "metadata": {"file_path": "stress_tests/test_kaggle_ipynb.py", "file_name": "test_kaggle_ipynb.py", "file_type": "text/x-python", "category": "test", "start_line": 1410, "end_line": 1453, "span_ids": ["test_kaggle22"], "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 test_kaggle22(generate_dataset):\n train_columns = [\n \"id\",\n \"comment_text\",\n \"toxic\",\n \"severe_toxic\",\n \"obscene\",\n \"threat\",\n \"insult\",\n \"identity_hate\",\n ]\n train_dtypes = [str, str, float, float, float, float, float, float]\n test_columns = [\"id\", \"comment_text\"]\n test_dtypes = [str, str]\n submission_columns = [\n \"id\",\n \"toxic\",\n \"severe_toxic\",\n \"obscene\",\n \"threat\",\n \"insult\",\n \"identity_hate\",\n ]\n submission_dtypes = [str, float, float, float, float, float, float]\n generate_dataset(\n \"train.csv\", train_columns, train_dtypes, files_to_remove=[\"submission.csv\"]\n )\n generate_dataset(\"test.csv\", test_columns, test_dtypes)\n generate_dataset(\"sample_submission.csv\", submission_columns, submission_dtypes)\n\n ipynb = subprocess.Popen(\n [\"python\", \"kaggle22.py\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=KAGGLE_DIR_PATH,\n )\n outs, errs = ipynb.communicate()\n\n if ipynb.returncode:\n logging.debug(\"Error message\\n-------------\\n %s\", errs.decode(\"utf-8\"))\n\n logging.info(\"Finished kaggle22\")\n assert ipynb.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_modin-project__modin/versioneer.py__Version_0_18_get_root.return.root": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py__Version_0_18_get_root.return.root", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2, "end_line": 332, "span_ids": ["VersioneerConfig", "imports", "get_root", "docstring"], "tokens": 519}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Version: 0.18\n\nfrom __future__ import print_function\ntry:\n import configparser\nexcept ImportError:\n import ConfigParser as configparser\nimport errno\nimport json\nimport os\nimport re\nimport subprocess\nimport sys\n\n\nclass VersioneerConfig:\n \"\"\"Container for Versioneer configuration parameters.\"\"\"\n\n\ndef get_root():\n \"\"\"Get the project root directory.\n\n We require that all commands are run from the project root, i.e. the\n directory that contains setup.py, setup.cfg, and versioneer.py .\n \"\"\"\n root = os.path.realpath(os.path.abspath(os.getcwd()))\n setup_py = os.path.join(root, \"setup.py\")\n versioneer_py = os.path.join(root, \"versioneer.py\")\n if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)):\n # allow 'python path/to/setup.py COMMAND'\n root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))\n setup_py = os.path.join(root, \"setup.py\")\n versioneer_py = os.path.join(root, \"versioneer.py\")\n if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)):\n err = (\"Versioneer was unable to run the project root directory. \"\n \"Versioneer requires setup.py to be executed from \"\n \"its immediate directory (like 'python setup.py COMMAND'), \"\n \"or in a way that lets it use sys.argv[0] to find the root \"\n \"(like 'python path/to/setup.py COMMAND').\")\n raise VersioneerBadRootError(err)\n try:\n # Certain runtime workflows (setup.py install/develop in a setuptools\n # tree) execute all dependencies in a single python process, so\n # \"versioneer\" may be imported multiple times, and python's shared\n # module-import table will cache the first one. So we can't use\n # os.path.dirname(__file__), as that will find whichever\n # versioneer.py was first imported, even in later projects.\n me = os.path.realpath(os.path.abspath(__file__))\n me_dir = os.path.normcase(os.path.splitext(me)[0])\n vsr_dir = os.path.normcase(os.path.splitext(versioneer_py)[0])\n if me_dir != vsr_dir:\n print(\"Warning: build in %s is using versioneer.py from %s\"\n % (os.path.dirname(me), versioneer_py))\n except NameError:\n pass\n return root", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_config_from_root_get_config_from_root.return.cfg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_config_from_root_get_config_from_root.return.cfg", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 361, "span_ids": ["get_config_from_root"], "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 get_config_from_root(root):\n \"\"\"Read the project setup.cfg file to determine Versioneer config.\"\"\"\n # This might raise EnvironmentError (if setup.cfg is missing), or\n # configparser.NoSectionError (if it lacks a [versioneer] section), or\n # configparser.NoOptionError (if it lacks \"VCS=\"). See the docstring at\n # the top of versioneer.py for instructions on writing your setup.cfg .\n setup_cfg = os.path.join(root, \"setup.cfg\")\n parser = configparser.SafeConfigParser()\n with open(setup_cfg, \"r\") as f:\n parser.readfp(f)\n VCS = parser.get(\"versioneer\", \"VCS\") # mandatory\n\n def get(parser, name):\n if parser.has_option(\"versioneer\", name):\n return parser.get(\"versioneer\", name)\n return None\n cfg = VersioneerConfig()\n cfg.VCS = VCS\n cfg.style = get(parser, \"style\") or \"\"\n cfg.versionfile_source = get(parser, \"versionfile_source\")\n cfg.versionfile_build = get(parser, \"versionfile_build\")\n cfg.tag_prefix = get(parser, \"tag_prefix\")\n if cfg.tag_prefix in (\"''\", '\"\"'):\n cfg.tag_prefix = \"\"\n cfg.parentdir_prefix = get(parser, \"parentdir_prefix\")\n cfg.verbose = get(parser, \"verbose\")\n return cfg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_NotThisMethod_register_vcs_handler.return.decorate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_NotThisMethod_register_vcs_handler.return.decorate", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 364, "end_line": 381, "span_ids": ["impl:3", "NotThisMethod", "register_vcs_handler"], "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 NotThisMethod(Exception):\n \"\"\"Exception raised if a method is not valid for the current scenario.\"\"\"\n\n\n# these dictionaries contain VCS-specific tools\nLONG_VERSION_PY = {}\nHANDLERS = {}\n\n\ndef register_vcs_handler(vcs, method): # decorator\n \"\"\"Decorator to mark a method as the handler for a particular VCS.\"\"\"\n def decorate(f):\n \"\"\"Store f in HANDLERS[vcs][method].\"\"\"\n if vcs not in HANDLERS:\n HANDLERS[vcs] = {}\n HANDLERS[vcs][method] = f\n return f\n return decorate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_run_command_run_command.return.stdout_p_returncode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_run_command_run_command.return.stdout_p_returncode", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 418, "span_ids": ["run_command"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,\n env=None):\n \"\"\"Call the given command(s).\"\"\"\n assert isinstance(commands, list)\n p = None\n for c in commands:\n try:\n dispcmd = str([c] + args)\n # remember shell=False, so use git.cmd on windows, not just git\n p = subprocess.Popen([c] + args, cwd=cwd, env=env,\n stdout=subprocess.PIPE,\n stderr=(subprocess.PIPE if hide_stderr\n else None))\n break\n except EnvironmentError:\n e = sys.exc_info()[1]\n if e.errno == errno.ENOENT:\n continue\n if verbose:\n print(\"unable to run %s\" % dispcmd)\n print(e)\n return None, None\n else:\n if verbose:\n print(\"unable to find command, tried %s\" % (commands,))\n return None, None\n stdout = p.communicate()[0].strip()\n if sys.version_info[0] >= 3:\n stdout = stdout.decode()\n if p.returncode != 0:\n if verbose:\n print(\"unable to run %s (error)\" % dispcmd)\n print(\"stdout was %s\" % stdout)\n return None, p.returncode\n return stdout, p.returncode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_get_keywords_git_get_keywords.return.keywords": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_get_keywords_git_get_keywords.return.keywords", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 944, "end_line": 970, "span_ids": ["git_get_keywords"], "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": "@register_vcs_handler(\"git\", \"get_keywords\")\ndef git_get_keywords(versionfile_abs):\n \"\"\"Extract version information from the given file.\"\"\"\n # the code embedded in _version.py can just fetch the value of these\n # keywords. When used from setup.py, we don't want to import _version.py,\n # so we do it with a regexp instead. This function is not used from\n # _version.py.\n keywords = {}\n try:\n f = open(versionfile_abs, \"r\")\n for line in f.readlines():\n if line.strip().startswith(\"git_refnames =\"):\n mo = re.search(r'=\\s*\"(.*)\"', line)\n if mo:\n keywords[\"refnames\"] = mo.group(1)\n if line.strip().startswith(\"git_full =\"):\n mo = re.search(r'=\\s*\"(.*)\"', line)\n if mo:\n keywords[\"full\"] = mo.group(1)\n if line.strip().startswith(\"git_date =\"):\n mo = re.search(r'=\\s*\"(.*)\"', line)\n if mo:\n keywords[\"date\"] = mo.group(1)\n f.close()\n except EnvironmentError:\n pass\n return keywords", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_versions_from_keywords_git_versions_from_keywords.return._version_0_unknown_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_versions_from_keywords_git_versions_from_keywords.return._version_0_unknown_", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 973, "end_line": 1025, "span_ids": ["git_versions_from_keywords"], "tokens": 714}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@register_vcs_handler(\"git\", \"keywords\")\ndef git_versions_from_keywords(keywords, tag_prefix, verbose):\n \"\"\"Get version information from git keywords.\"\"\"\n if not keywords:\n raise NotThisMethod(\"no keywords at all, weird\")\n date = keywords.get(\"date\")\n if date is not None:\n # git-2.2.0 added \"%cI\", which expands to an ISO-8601 -compliant\n # datestamp. However we prefer \"%ci\" (which expands to an \"ISO-8601\n # -like\" string, which we must then edit to make compliant), because\n # it's been around since git-1.5.3, and it's too difficult to\n # discover which version we're using, or to work around using an\n # older one.\n date = date.strip().replace(\" \", \"T\", 1).replace(\" \", \"\", 1)\n refnames = keywords[\"refnames\"].strip()\n if refnames.startswith(\"$Format\"):\n if verbose:\n print(\"keywords are unexpanded, not using\")\n raise NotThisMethod(\"unexpanded keywords, not a git-archive tarball\")\n refs = set([r.strip() for r in refnames.strip(\"()\").split(\",\")])\n # starting in git-1.8.3, tags are listed as \"tag: foo-1.0\" instead of\n # just \"foo-1.0\". If we see a \"tag: \" prefix, prefer those.\n TAG = \"tag: \"\n tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])\n if not tags:\n # Either we're using git < 1.8.3, or there really are no tags. We use\n # a heuristic: assume all version tags have a digit. The old git %d\n # expansion behaves like git log --decorate=short and strips out the\n # refs/heads/ and refs/tags/ prefixes that would let us distinguish\n # between branches and tags. By ignoring refnames without digits, we\n # filter out many common branch names like \"release\" and\n # \"stabilization\", as well as \"HEAD\" and \"master\".\n tags = set([r for r in refs if re.search(r'\\d', r)])\n if verbose:\n print(\"discarding '%s', no digits\" % \",\".join(refs - tags))\n if verbose:\n print(\"likely tags: %s\" % \",\".join(sorted(tags)))\n for ref in sorted(tags):\n # sorting will prefer e.g. \"2.0\" over \"2.0rc1\"\n if ref.startswith(tag_prefix):\n r = ref[len(tag_prefix):]\n if verbose:\n print(\"picking %s\" % r)\n return {\"version\": r,\n \"full-revisionid\": keywords[\"full\"].strip(),\n \"dirty\": False, \"error\": None,\n \"date\": date}\n # no suitable tags, so version is \"0+unknown\", but full hex is still there\n if verbose:\n print(\"no suitable tags, using unknown + full revision id\")\n return {\"version\": \"0+unknown\",\n \"full-revisionid\": keywords[\"full\"].strip(),\n \"dirty\": False, \"error\": \"no suitable tags\", \"date\": 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_modin-project__modin/versioneer.py_git_pieces_from_vcs_git_pieces_from_vcs.return.pieces": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_git_pieces_from_vcs_git_pieces_from_vcs.return.pieces", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1028, "end_line": 1117, "span_ids": ["git_pieces_from_vcs"], "tokens": 874}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@register_vcs_handler(\"git\", \"pieces_from_vcs\")\ndef git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):\n \"\"\"Get version from 'git describe' in the root of the source tree.\n\n This only gets called if the git-archive 'subst' keywords were *not*\n expanded, and _version.py hasn't already been rewritten with a short\n version string, meaning we're inside a checked out source tree.\n \"\"\"\n GITS = [\"git\"]\n if sys.platform == \"win32\":\n GITS = [\"git.cmd\", \"git.exe\"]\n\n out, rc = run_command(GITS, [\"rev-parse\", \"--git-dir\"], cwd=root,\n hide_stderr=True)\n if rc != 0:\n if verbose:\n print(\"Directory %s not under git control\" % root)\n raise NotThisMethod(\"'git rev-parse --git-dir' returned error\")\n\n # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]\n # if there isn't one, this yields HEX[-dirty] (no NUM)\n describe_out, rc = run_command(GITS, [\"describe\", \"--tags\", \"--dirty\",\n \"--always\", \"--long\",\n \"--match\", \"%s*\" % tag_prefix],\n cwd=root)\n # --long was added in git-1.5.5\n if describe_out is None:\n raise NotThisMethod(\"'git describe' failed\")\n describe_out = describe_out.strip()\n full_out, rc = run_command(GITS, [\"rev-parse\", \"HEAD\"], cwd=root)\n if full_out is None:\n raise NotThisMethod(\"'git rev-parse' failed\")\n full_out = full_out.strip()\n\n pieces = {}\n pieces[\"long\"] = full_out\n pieces[\"short\"] = full_out[:7] # maybe improved later\n pieces[\"error\"] = None\n\n # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]\n # TAG might have hyphens.\n git_describe = describe_out\n\n # look for -dirty suffix\n dirty = git_describe.endswith(\"-dirty\")\n pieces[\"dirty\"] = dirty\n if dirty:\n git_describe = git_describe[:git_describe.rindex(\"-dirty\")]\n\n # now we have TAG-NUM-gHEX or HEX\n\n if \"-\" in git_describe:\n # TAG-NUM-gHEX\n mo = re.search(r'^(.+)-(\\d+)-g([0-9a-f]+)$', git_describe)\n if not mo:\n # unparseable. Maybe git-describe is misbehaving?\n pieces[\"error\"] = (\"unable to parse git-describe output: '%s'\"\n % describe_out)\n return pieces\n\n # tag\n full_tag = mo.group(1)\n if not full_tag.startswith(tag_prefix):\n if verbose:\n fmt = \"tag '%s' doesn't start with prefix '%s'\"\n print(fmt % (full_tag, tag_prefix))\n pieces[\"error\"] = (\"tag '%s' doesn't start with prefix '%s'\"\n % (full_tag, tag_prefix))\n return pieces\n pieces[\"closest-tag\"] = full_tag[len(tag_prefix):]\n\n # distance: number of commits since tag\n pieces[\"distance\"] = int(mo.group(2))\n\n # commit: short hex revision ID\n pieces[\"short\"] = mo.group(3)\n\n else:\n # HEX: no tags\n pieces[\"closest-tag\"] = None\n count_out, rc = run_command(GITS, [\"rev-list\", \"HEAD\", \"--count\"],\n cwd=root)\n pieces[\"distance\"] = int(count_out) # total number of commits\n\n # commit date: see ISO-8601 comment in git_versions_from_keywords()\n date = run_command(GITS, [\"show\", \"-s\", \"--format=%ci\", \"HEAD\"],\n cwd=root)[0].strip()\n pieces[\"date\"] = date.strip().replace(\" \", \"T\", 1).replace(\" \", \"\", 1)\n\n return pieces", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_do_vcs_install_do_vcs_install.run_command_GITS_add_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_do_vcs_install_do_vcs_install.run_command_GITS_add_", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1120, "end_line": 1155, "span_ids": ["do_vcs_install"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def do_vcs_install(manifest_in, versionfile_source, ipy):\n \"\"\"Git-specific installation logic for Versioneer.\n\n For Git, this means creating/changing .gitattributes to mark _version.py\n for export-subst keyword substitution.\n \"\"\"\n GITS = [\"git\"]\n if sys.platform == \"win32\":\n GITS = [\"git.cmd\", \"git.exe\"]\n files = [manifest_in, versionfile_source]\n if ipy:\n files.append(ipy)\n try:\n me = __file__\n if me.endswith(\".pyc\") or me.endswith(\".pyo\"):\n me = os.path.splitext(me)[0] + \".py\"\n versioneer_file = os.path.relpath(me)\n except NameError:\n versioneer_file = \"versioneer.py\"\n files.append(versioneer_file)\n present = False\n try:\n f = open(\".gitattributes\", \"r\")\n for line in f.readlines():\n if line.strip().startswith(versionfile_source):\n if \"export-subst\" in line.strip().split()[1:]:\n present = True\n f.close()\n except EnvironmentError:\n pass\n if not present:\n f = open(\".gitattributes\", \"a+\")\n f.write(\"%s export-subst\\n\" % versionfile_source)\n f.close()\n files.append(\".gitattributes\")\n run_command(GITS, [\"add\", \"--\"] + 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_modin-project__modin/versioneer.py_versions_from_parentdir_versions_from_parentdir.raise_NotThisMethod_root": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_versions_from_parentdir_versions_from_parentdir.raise_NotThisMethod_root", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1158, "end_line": 1180, "span_ids": ["versions_from_parentdir"], "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 versions_from_parentdir(parentdir_prefix, root, verbose):\n \"\"\"Try to determine the version from the parent directory name.\n\n Source tarballs conventionally unpack into a directory that includes both\n the project name and a version string. We will also support searching up\n two directory levels for an appropriately named parent directory\n \"\"\"\n rootdirs = []\n\n for i in range(3):\n dirname = os.path.basename(root)\n if dirname.startswith(parentdir_prefix):\n return {\"version\": dirname[len(parentdir_prefix):],\n \"full-revisionid\": None,\n \"dirty\": False, \"error\": None, \"date\": None}\n else:\n rootdirs.append(root)\n root = os.path.dirname(root) # up a level\n\n if verbose:\n print(\"Tried directories %s but none started with prefix %s\" %\n (str(rootdirs), parentdir_prefix))\n raise NotThisMethod(\"rootdir doesn't start with parentdir_prefix\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_SHORT_VERSION_PY_versions_from_file.return.json_loads_mo_group_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_SHORT_VERSION_PY_versions_from_file.return.json_loads_mo_group_1_", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1183, "end_line": 1215, "span_ids": ["versions_from_file", "impl:8"], "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": "SHORT_VERSION_PY = \"\"\"\n# This file was generated by 'versioneer.py' (0.18) from\n# revision-control system data, or from the parent directory name of an\n# unpacked source archive. Distribution tarballs contain a pre-generated copy\n# of this file.\n\nimport json\n\nversion_json = '''\n%s\n''' # END VERSION_JSON\n\n\ndef get_versions():\n return json.loads(version_json)\n\"\"\"\n\n\ndef versions_from_file(filename):\n \"\"\"Try to determine the version from _version.py if present.\"\"\"\n try:\n with open(filename) as f:\n contents = f.read()\n except EnvironmentError:\n raise NotThisMethod(\"unable to read _version.py\")\n mo = re.search(r\"version_json = '''\\n(.*)''' # END VERSION_JSON\",\n contents, re.M | re.S)\n if not mo:\n mo = re.search(r\"version_json = '''\\r\\n(.*)''' # END VERSION_JSON\",\n contents, re.M | re.S)\n if not mo:\n raise NotThisMethod(\"no version_json in _version.py\")\n return json.loads(mo.group(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_modin-project__modin/versioneer.py_write_to_version_file_plus_or_dot.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_write_to_version_file_plus_or_dot.return._", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1218, "end_line": 1233, "span_ids": ["plus_or_dot", "write_to_version_file"], "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 write_to_version_file(filename, versions):\n \"\"\"Write the given version number to the given _version.py file.\"\"\"\n os.unlink(filename)\n contents = json.dumps(versions, sort_keys=True,\n indent=1, separators=(\",\", \": \"))\n with open(filename, \"w\") as f:\n f.write(SHORT_VERSION_PY % contents)\n\n print(\"set %s to '%s'\" % (filename, versions[\"version\"]))\n\n\ndef plus_or_dot(pieces):\n \"\"\"Return a + if we don't already have one, else return a .\"\"\"\n if \"+\" in pieces.get(\"closest-tag\", \"\"):\n return \".\"\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_modin-project__modin/versioneer.py_render_pep440_render_pep440_pre.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_render_pep440_pre.return.rendered", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1236, "end_line": 1274, "span_ids": ["render_pep440_pre", "render_pep440"], "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 render_pep440(pieces):\n \"\"\"Build up version string, with post-release \"local version identifier\".\n\n Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you\n get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty\n\n Exceptions:\n 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"] or pieces[\"dirty\"]:\n rendered += plus_or_dot(pieces)\n rendered += \"%d.g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n if pieces[\"dirty\"]:\n rendered += \".dirty\"\n else:\n # exception #1\n rendered = \"0+untagged.%d.g%s\" % (pieces[\"distance\"],\n pieces[\"short\"])\n if pieces[\"dirty\"]:\n rendered += \".dirty\"\n return rendered\n\n\ndef render_pep440_pre(pieces):\n \"\"\"TAG[.post.devDISTANCE] -- No -dirty.\n\n Exceptions:\n 1: no tags. 0.post.devDISTANCE\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"]:\n rendered += \".post.dev%d\" % pieces[\"distance\"]\n else:\n # exception #1\n rendered = \"0.post.dev%d\" % pieces[\"distance\"]\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_post_render_pep440_post.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_post_render_pep440_post.return.rendered", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1277, "end_line": 1301, "span_ids": ["render_pep440_post"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render_pep440_post(pieces):\n \"\"\"TAG[.postDISTANCE[.dev0]+gHEX] .\n\n The \".dev0\" means dirty. Note that .dev0 sorts backwards\n (a dirty tree will appear \"older\" than the corresponding clean one),\n but you shouldn't be releasing software with -dirty anyways.\n\n Exceptions:\n 1: no tags. 0.postDISTANCE[.dev0]\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"] or pieces[\"dirty\"]:\n rendered += \".post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n rendered += plus_or_dot(pieces)\n rendered += \"g%s\" % pieces[\"short\"]\n else:\n # exception #1\n rendered = \"0.post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n rendered += \"+g%s\" % pieces[\"short\"]\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_old_render_pep440_old.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_pep440_old_render_pep440_old.return.rendered", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1304, "end_line": 1323, "span_ids": ["render_pep440_old"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render_pep440_old(pieces):\n \"\"\"TAG[.postDISTANCE[.dev0]] .\n\n The \".dev0\" means dirty.\n\n Eexceptions:\n 1: no tags. 0.postDISTANCE[.dev0]\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"] or pieces[\"dirty\"]:\n rendered += \".post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n else:\n # exception #1\n rendered = \"0.post%d\" % pieces[\"distance\"]\n if pieces[\"dirty\"]:\n rendered += \".dev0\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_git_describe_render_git_describe.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_git_describe_render_git_describe.return.rendered", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1326, "end_line": 1343, "span_ids": ["render_git_describe"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render_git_describe(pieces):\n \"\"\"TAG[-DISTANCE-gHEX][-dirty].\n\n Like 'git describe --tags --dirty --always'.\n\n Exceptions:\n 1: no tags. HEX[-dirty] (note: no 'g' prefix)\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n if pieces[\"distance\"]:\n rendered += \"-%d-g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n else:\n # exception #1\n rendered = pieces[\"short\"]\n if pieces[\"dirty\"]:\n rendered += \"-dirty\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_git_describe_long_render_git_describe_long.return.rendered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_git_describe_long_render_git_describe_long.return.rendered", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1346, "end_line": 1363, "span_ids": ["render_git_describe_long"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render_git_describe_long(pieces):\n \"\"\"TAG-DISTANCE-gHEX[-dirty].\n\n Like 'git describe --tags --dirty --always -long'.\n The distance/hash is unconditional.\n\n Exceptions:\n 1: no tags. HEX[-dirty] (note: no 'g' prefix)\n \"\"\"\n if pieces[\"closest-tag\"]:\n rendered = pieces[\"closest-tag\"]\n rendered += \"-%d-g%s\" % (pieces[\"distance\"], pieces[\"short\"])\n else:\n # exception #1\n rendered = pieces[\"short\"]\n if pieces[\"dirty\"]:\n rendered += \"-dirty\"\n return rendered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_VersioneerBadRootError._The_project_root_direc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_render_VersioneerBadRootError._The_project_root_direc", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1366, "end_line": 1399, "span_ids": ["VersioneerBadRootError", "render"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def render(pieces, style):\n \"\"\"Render the given version pieces into the requested style.\"\"\"\n if pieces[\"error\"]:\n return {\"version\": \"unknown\",\n \"full-revisionid\": pieces.get(\"long\"),\n \"dirty\": None,\n \"error\": pieces[\"error\"],\n \"date\": None}\n\n if not style or style == \"default\":\n style = \"pep440\" # the default\n\n if style == \"pep440\":\n rendered = render_pep440(pieces)\n elif style == \"pep440-pre\":\n rendered = render_pep440_pre(pieces)\n elif style == \"pep440-post\":\n rendered = render_pep440_post(pieces)\n elif style == \"pep440-old\":\n rendered = render_pep440_old(pieces)\n elif style == \"git-describe\":\n rendered = render_git_describe(pieces)\n elif style == \"git-describe-long\":\n rendered = render_git_describe_long(pieces)\n else:\n raise ValueError(\"unknown style '%s'\" % style)\n\n return {\"version\": rendered, \"full-revisionid\": pieces[\"long\"],\n \"dirty\": pieces[\"dirty\"], \"error\": None,\n \"date\": pieces.get(\"date\")}\n\n\nclass VersioneerBadRootError(Exception):\n \"\"\"The project root directory is unknown or missing key 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_modin-project__modin/versioneer.py_get_versions_get_versions.return._version_0_unknown_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_versions_get_versions.return._version_0_unknown_", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1402, "end_line": 1475, "span_ids": ["get_versions"], "tokens": 615}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_versions(verbose=False):\n \"\"\"Get the project version from whatever source is available.\n\n Returns dict with two keys: 'version' and 'full'.\n \"\"\"\n if \"versioneer\" in sys.modules:\n # see the discussion in cmdclass.py:get_cmdclass()\n del sys.modules[\"versioneer\"]\n\n root = get_root()\n cfg = get_config_from_root(root)\n\n assert cfg.VCS is not None, \"please set [versioneer]VCS= in setup.cfg\"\n handlers = HANDLERS.get(cfg.VCS)\n assert handlers, \"unrecognized VCS '%s'\" % cfg.VCS\n verbose = verbose or cfg.verbose\n assert cfg.versionfile_source is not None, \\\n \"please set versioneer.versionfile_source\"\n assert cfg.tag_prefix is not None, \"please set versioneer.tag_prefix\"\n\n versionfile_abs = os.path.join(root, cfg.versionfile_source)\n\n # extract version from first of: _version.py, VCS command (e.g. 'git\n # describe'), parentdir. This is meant to work for developers using a\n # source checkout, for users of a tarball created by 'setup.py sdist',\n # and for users of a tarball/zipball created by 'git archive' or github's\n # download-from-tag feature or the equivalent in other VCSes.\n\n get_keywords_f = handlers.get(\"get_keywords\")\n from_keywords_f = handlers.get(\"keywords\")\n if get_keywords_f and from_keywords_f:\n try:\n keywords = get_keywords_f(versionfile_abs)\n ver = from_keywords_f(keywords, cfg.tag_prefix, verbose)\n if verbose:\n print(\"got version from expanded keyword %s\" % ver)\n return ver\n except NotThisMethod:\n pass\n\n try:\n ver = versions_from_file(versionfile_abs)\n if verbose:\n print(\"got version from file %s %s\" % (versionfile_abs, ver))\n return ver\n except NotThisMethod:\n pass\n\n from_vcs_f = handlers.get(\"pieces_from_vcs\")\n if from_vcs_f:\n try:\n pieces = from_vcs_f(cfg.tag_prefix, root, verbose)\n ver = render(pieces, cfg.style)\n if verbose:\n print(\"got version from VCS %s\" % ver)\n return ver\n except NotThisMethod:\n pass\n\n try:\n if cfg.parentdir_prefix:\n ver = versions_from_parentdir(cfg.parentdir_prefix, root, verbose)\n if verbose:\n print(\"got version from parentdir %s\" % ver)\n return ver\n except NotThisMethod:\n pass\n\n if verbose:\n print(\"unable to compute version\")\n\n return {\"version\": \"0+unknown\", \"full-revisionid\": None,\n \"dirty\": None, \"error\": \"unable to compute version\",\n \"date\": 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_modin-project__modin/versioneer.py_get_version_get_cmdclass.from_distutils_core_impor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_version_get_cmdclass.from_distutils_core_impor", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1478, "end_line": 1503, "span_ids": ["get_cmdclass", "get_version"], "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": "def get_version():\n \"\"\"Get the short version string for this project.\"\"\"\n return get_versions()[\"version\"]\n\n\ndef get_cmdclass():\n \"\"\"Get the custom setuptools/distutils subclasses used by Versioneer.\"\"\"\n if \"versioneer\" in sys.modules:\n del sys.modules[\"versioneer\"]\n # this fixes the \"python setup.py develop\" case (also 'install' and\n # 'easy_install .'), in which subdependencies of the main project are\n # built (using setup.py bdist_egg) in the same python process. Assume\n # a main project A and a dependency B, which use different versions\n # of Versioneer. A's setup.py imports A's Versioneer, leaving it in\n # sys.modules by the time B's setup.py is executed, causing B to run\n # with the wrong versioneer. Setuptools wraps the sub-dep builds in a\n # sandbox that restores sys.modules to it's pre-build state, so the\n # parent is protected against the child's \"import versioneer\". By\n # removing ourselves from sys.modules here, before the child build\n # happens, we protect the child from the parent's versioneer too.\n # Also see https://github.com/warner/python-versioneer/issues/52\n\n cmds = {}\n\n # we add \"version\" to both distutils and setuptools\n from distutils.core import Command\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_modin-project__modin/versioneer.py_get_cmdclass.cmd_version_get_cmdclass.cmd_version.run.if_vers_error_.print_error_s_vers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmd_version_get_cmdclass.cmd_version.run.if_vers_error_.print_error_s_vers", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1505, "end_line": 1523, "span_ids": ["get_cmdclass"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_cmdclass():\n # ... other code\n\n class cmd_version(Command):\n description = \"report generated version string\"\n user_options = []\n boolean_options = []\n\n def initialize_options(self):\n pass\n\n def finalize_options(self):\n pass\n\n def run(self):\n vers = get_versions(verbose=True)\n print(\"Version: %s\" % vers[\"version\"])\n print(\" full-revisionid: %s\" % vers.get(\"full-revisionid\"))\n print(\" dirty: %s\" % vers.get(\"dirty\"))\n print(\" date: %s\" % vers.get(\"date\"))\n if vers[\"error\"]:\n print(\" error: %s\" % vers[\"error\"])\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_modin-project__modin/versioneer.py_get_cmdclass.cmds_version_cmd_ver_get_cmdclass.if_setuptools_in_sys_mo.else_.from_distutils_command_bu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmds_version_cmd_ver_get_cmdclass.if_setuptools_in_sys_mo.else_.from_distutils_command_bu", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1524, "end_line": 1545, "span_ids": ["get_cmdclass"], "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": "def get_cmdclass():\n # ... other code\n cmds[\"version\"] = cmd_version\n\n # we override \"build_py\" in both distutils and setuptools\n #\n # most invocation pathways end up running build_py:\n # distutils/build -> build_py\n # distutils/install -> distutils/build ->..\n # setuptools/bdist_wheel -> distutils/install ->..\n # setuptools/bdist_egg -> distutils/install_lib -> build_py\n # setuptools/install -> bdist_egg ->..\n # setuptools/develop -> ?\n # pip install:\n # copies source tree to a tempdir before running egg_info/etc\n # if .git isn't copied too, 'git describe' will fail\n # then does setup.py bdist_wheel, or sometimes setup.py install\n # setup.py egg_info -> ?\n\n # we override different \"build_py\" commands for both environments\n if \"setuptools\" in sys.modules:\n from setuptools.command.build_py import build_py as _build_py\n else:\n from distutils.command.build_py import build_py as _build_py\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_modin-project__modin/versioneer.py_get_cmdclass.cmd_build_py_get_cmdclass.cmd_build_py.run.if_cfg_versionfile_build_.write_to_version_file_tar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmd_build_py_get_cmdclass.cmd_build_py.run.if_cfg_versionfile_build_.write_to_version_file_tar", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1547, "end_line": 1559, "span_ids": ["get_cmdclass"], "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 get_cmdclass():\n # ... other code\n\n class cmd_build_py(_build_py):\n def run(self):\n root = get_root()\n cfg = get_config_from_root(root)\n versions = get_versions()\n _build_py.run(self)\n # now locate _version.py in the new build/ directory and replace\n # it with an updated value\n if cfg.versionfile_build:\n target_versionfile = os.path.join(self.build_lib,\n cfg.versionfile_build)\n print(\"UPDATING %s\" % target_versionfile)\n write_to_version_file(target_versionfile, versions)\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_modin-project__modin/versioneer.py_get_cmdclass.cmds_build_py_cmd_bu_get_cmdclass.None_4.else_.from_distutils_command_sd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmds_build_py_cmd_bu_get_cmdclass.None_4.else_.from_distutils_command_sd", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1560, "end_line": 1626, "span_ids": ["get_cmdclass"], "tokens": 629}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_cmdclass():\n # ... other code\n cmds[\"build_py\"] = cmd_build_py\n\n if \"cx_Freeze\" in sys.modules: # cx_freeze enabled?\n from cx_Freeze.dist import build_exe as _build_exe\n # nczeczulin reports that py2exe won't like the pep440-style string\n # as FILEVERSION, but it can be used for PRODUCTVERSION, e.g.\n # setup(console=[{\n # \"version\": versioneer.get_version().split(\"+\", 1)[0], # FILEVERSION\n # \"product_version\": versioneer.get_version(),\n # ...\n\n class cmd_build_exe(_build_exe):\n def run(self):\n root = get_root()\n cfg = get_config_from_root(root)\n versions = get_versions()\n target_versionfile = cfg.versionfile_source\n print(\"UPDATING %s\" % target_versionfile)\n write_to_version_file(target_versionfile, versions)\n\n _build_exe.run(self)\n os.unlink(target_versionfile)\n with open(cfg.versionfile_source, \"w\") as f:\n LONG = LONG_VERSION_PY[cfg.VCS]\n f.write(LONG %\n {\"DOLLAR\": \"$\",\n \"STYLE\": cfg.style,\n \"TAG_PREFIX\": cfg.tag_prefix,\n \"PARENTDIR_PREFIX\": cfg.parentdir_prefix,\n \"VERSIONFILE_SOURCE\": cfg.versionfile_source,\n })\n cmds[\"build_exe\"] = cmd_build_exe\n del cmds[\"build_py\"]\n\n if 'py2exe' in sys.modules: # py2exe enabled?\n try:\n from py2exe.distutils_buildexe import py2exe as _py2exe # py3\n except ImportError:\n from py2exe.build_exe import py2exe as _py2exe # py2\n\n class cmd_py2exe(_py2exe):\n def run(self):\n root = get_root()\n cfg = get_config_from_root(root)\n versions = get_versions()\n target_versionfile = cfg.versionfile_source\n print(\"UPDATING %s\" % target_versionfile)\n write_to_version_file(target_versionfile, versions)\n\n _py2exe.run(self)\n os.unlink(target_versionfile)\n with open(cfg.versionfile_source, \"w\") as f:\n LONG = LONG_VERSION_PY[cfg.VCS]\n f.write(LONG %\n {\"DOLLAR\": \"$\",\n \"STYLE\": cfg.style,\n \"TAG_PREFIX\": cfg.tag_prefix,\n \"PARENTDIR_PREFIX\": cfg.parentdir_prefix,\n \"VERSIONFILE_SOURCE\": cfg.versionfile_source,\n })\n cmds[\"py2exe\"] = cmd_py2exe\n\n # we override different \"sdist\" commands for both environments\n if \"setuptools\" in sys.modules:\n from setuptools.command.sdist import sdist as _sdist\n else:\n from distutils.command.sdist import sdist as _sdist\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_modin-project__modin/versioneer.py_get_cmdclass.cmd_sdist_get_cmdclass.return.cmds": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_get_cmdclass.cmd_sdist_get_cmdclass.return.cmds", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1628, "end_line": 1650, "span_ids": ["get_cmdclass"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_cmdclass():\n # ... other code\n\n class cmd_sdist(_sdist):\n def run(self):\n versions = get_versions()\n self._versioneer_generated_versions = versions\n # unless we update this, the command will keep using the old\n # version\n self.distribution.metadata.version = versions[\"version\"]\n return _sdist.run(self)\n\n def make_release_tree(self, base_dir, files):\n root = get_root()\n cfg = get_config_from_root(root)\n _sdist.make_release_tree(self, base_dir, files)\n # now locate _version.py in the new base_dir directory\n # (remembering that it may be a hardlink) and replace it with an\n # updated value\n target_versionfile = os.path.join(base_dir, cfg.versionfile_source)\n print(\"UPDATING %s\" % target_versionfile)\n write_to_version_file(target_versionfile,\n self._versioneer_generated_versions)\n cmds[\"sdist\"] = cmd_sdist\n\n return cmds", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_CONFIG_ERROR_INIT_PY_SNIPPET._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_CONFIG_ERROR_INIT_PY_SNIPPET._", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1653, "end_line": 1694, "span_ids": ["impl:10"], "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": "CONFIG_ERROR = \"\"\"\nsetup.cfg is missing the necessary Versioneer configuration. You need\na section like:\n\n [versioneer]\n VCS = git\n style = pep440\n versionfile_source = src/myproject/_version.py\n versionfile_build = myproject/_version.py\n tag_prefix =\n parentdir_prefix = myproject-\n\nYou will also need to edit your setup.py to use the results:\n\n import versioneer\n setup(version=versioneer.get_version(),\n cmdclass=versioneer.get_cmdclass(), ...)\n\nPlease read the docstring in ./versioneer.py for configuration instructions,\nedit setup.cfg, and re-run the installer or 'python versioneer.py setup'.\n\"\"\"\n\nSAMPLE_CONFIG = \"\"\"\n# See the docstring in versioneer.py for instructions. Note that you must\n# re-run 'versioneer.py setup' after changing this section, and commit the\n# resulting files.\n\n[versioneer]\n#VCS = git\n#style = pep440\n#versionfile_source =\n#versionfile_build =\n#tag_prefix =\n#parentdir_prefix =\n\n\"\"\"\n\nINIT_PY_SNIPPET = \"\"\"\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_do_setup_do_setup.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_do_setup_do_setup.return.0", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1697, "end_line": 1776, "span_ids": ["do_setup"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def do_setup():\n \"\"\"Main VCS-independent setup function for installing Versioneer.\"\"\"\n root = get_root()\n try:\n cfg = get_config_from_root(root)\n except (EnvironmentError, configparser.NoSectionError,\n configparser.NoOptionError) as err:\n if isinstance(err, (EnvironmentError, configparser.NoSectionError)):\n print(\"Adding sample versioneer config to setup.cfg\",\n file=sys.stderr)\n with open(os.path.join(root, \"setup.cfg\"), \"a\") as f:\n f.write(SAMPLE_CONFIG)\n print(CONFIG_ERROR, file=sys.stderr)\n return 1\n\n print(\" creating %s\" % cfg.versionfile_source)\n with open(cfg.versionfile_source, \"w\") as f:\n LONG = LONG_VERSION_PY[cfg.VCS]\n f.write(LONG % {\"DOLLAR\": \"$\",\n \"STYLE\": cfg.style,\n \"TAG_PREFIX\": cfg.tag_prefix,\n \"PARENTDIR_PREFIX\": cfg.parentdir_prefix,\n \"VERSIONFILE_SOURCE\": cfg.versionfile_source,\n })\n\n ipy = os.path.join(os.path.dirname(cfg.versionfile_source),\n \"__init__.py\")\n if os.path.exists(ipy):\n try:\n with open(ipy, \"r\") as f:\n old = f.read()\n except EnvironmentError:\n old = \"\"\n if INIT_PY_SNIPPET not in old:\n print(\" appending to %s\" % ipy)\n with open(ipy, \"a\") as f:\n f.write(INIT_PY_SNIPPET)\n else:\n print(\" %s unmodified\" % ipy)\n else:\n print(\" %s doesn't exist, ok\" % ipy)\n ipy = None\n\n # Make sure both the top-level \"versioneer.py\" and versionfile_source\n # (PKG/_version.py, used by runtime code) are in MANIFEST.in, so\n # they'll be copied into source distributions. Pip won't be able to\n # install the package without this.\n manifest_in = os.path.join(root, \"MANIFEST.in\")\n simple_includes = set()\n try:\n with open(manifest_in, \"r\") as f:\n for line in f:\n if line.startswith(\"include \"):\n for include in line.split()[1:]:\n simple_includes.add(include)\n except EnvironmentError:\n pass\n # That doesn't cover everything MANIFEST.in can do\n # (http://docs.python.org/2/distutils/sourcedist.html#commands), so\n # it might give some false negatives. Appending redundant 'include'\n # lines is safe, though.\n if \"versioneer.py\" not in simple_includes:\n print(\" appending 'versioneer.py' to MANIFEST.in\")\n with open(manifest_in, \"a\") as f:\n f.write(\"include versioneer.py\\n\")\n else:\n print(\" 'versioneer.py' already in MANIFEST.in\")\n if cfg.versionfile_source not in simple_includes:\n print(\" appending versionfile_source ('%s') to MANIFEST.in\" %\n cfg.versionfile_source)\n with open(manifest_in, \"a\") as f:\n f.write(\"include %s\\n\" % cfg.versionfile_source)\n else:\n print(\" versionfile_source already in MANIFEST.in\")\n\n # Make VCS-specific changes. For git, this means creating/changing\n # .gitattributes to mark _version.py for export-subst keyword\n # substitution.\n do_vcs_install(manifest_in, cfg.versionfile_source, ipy)\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_modin-project__modin/versioneer.py_scan_setup_py_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/versioneer.py_scan_setup_py_", "embedding": null, "metadata": {"file_path": "versioneer.py", "file_name": "versioneer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1779, "end_line": 1823, "span_ids": ["scan_setup_py", "impl:16"], "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": "def scan_setup_py():\n \"\"\"Validate the contents of setup.py against Versioneer's expectations.\"\"\"\n found = set()\n setters = False\n errors = 0\n with open(\"setup.py\", \"r\") as f:\n for line in f.readlines():\n if \"import versioneer\" in line:\n found.add(\"import\")\n if \"versioneer.get_cmdclass()\" in line:\n found.add(\"cmdclass\")\n if \"versioneer.get_version()\" in line:\n found.add(\"get_version\")\n if \"versioneer.VCS\" in line:\n setters = True\n if \"versioneer.versionfile_source\" in line:\n setters = True\n if len(found) != 3:\n print(\"\")\n print(\"Your setup.py appears to be missing some important items\")\n print(\"(but I might be wrong). Please make sure it has something\")\n print(\"roughly like the following:\")\n print(\"\")\n print(\" import versioneer\")\n print(\" setup( version=versioneer.get_version(),\")\n print(\" cmdclass=versioneer.get_cmdclass(), ...)\")\n print(\"\")\n errors += 1\n if setters:\n print(\"You should remove lines like 'versioneer.VCS = ' and\")\n print(\"'versioneer.versionfile_source = ' . This configuration\")\n print(\"now lives in setup.cfg, and should be removed from setup.py\")\n print(\"\")\n errors += 1\n return errors\n\n\nif __name__ == \"__main__\":\n cmd = sys.argv[1]\n if cmd == \"setup\":\n errors = do_setup()\n errors += scan_setup_py()\n if errors:\n sys.exit(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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.reduce_GroupByReduce.reduce.return.result_if_finalizer_fn_is": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.reduce_GroupByReduce.reduce.return.result_if_finalizer_fn_is", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 282, "span_ids": ["GroupByReduce.reduce"], "tokens": 714}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def reduce(\n cls,\n df,\n reduce_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n partition_idx=0,\n drop=False,\n method=None,\n finalizer_fn=None,\n ):\n \"\"\"\n Execute Reduce phase of GroupByReduce.\n\n Combines groups from the Map phase and applies reduce function.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Serialized frame which contain groups to combine.\n reduce_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject`.\n axis : {0, 1}\n Axis to group and apply aggregation function along. 0 means index axis\n when 1 means column axis.\n groupby_kwargs : dict\n Dictionary which carries arguments for `pandas.DataFrame.groupby`.\n agg_args : list-like\n Positional arguments to pass to the aggregation functions.\n agg_kwargs : dict\n Keyword arguments to pass to the aggregation functions.\n partition_idx : int, default: 0\n Internal index of column partition to which this function is applied.\n drop : bool, default: False\n Indicates whether or not by-data came from the `self` frame.\n method : str, optional\n Name of the groupby function. This is a hint to be able to do special casing.\n finalizer_fn : callable(pandas.DataFrame) -> pandas.DataFrame, default: None\n A callable to execute at the end a groupby kernel against groupby result.\n\n Returns\n -------\n pandas.DataFrame\n GroupBy aggregation result.\n \"\"\"\n # Wrapping names into an Index should be unnecessary, however\n # there is a bug in pandas with intersection that forces us to do so:\n # https://github.com/pandas-dev/pandas/issues/39699\n by_part = pandas.Index(df.index.names)\n\n groupby_kwargs = groupby_kwargs.copy()\n as_index = groupby_kwargs.get(\"as_index\", True)\n\n # Set `as_index` to True to track the metadata of the grouping object\n groupby_kwargs[\"as_index\"] = True\n\n # since now index levels contain out 'by', in the reduce phace\n # we want to group on these levels\n groupby_kwargs[\"level\"] = list(range(len(df.index.names)))\n\n apply_func = cls.get_callable(reduce_func, df)\n result = apply_func(\n df.groupby(axis=axis, **groupby_kwargs), *agg_args, **agg_kwargs\n )\n\n if not as_index:\n idx = df.index\n GroupBy.handle_as_index_for_dataframe(\n result,\n by_part,\n by_cols_dtypes=(\n idx.dtypes.values\n if isinstance(idx, pandas.MultiIndex) and hasattr(idx, \"dtypes\")\n else (idx.dtype,)\n ),\n by_length=len(by_part),\n selection=reduce_func.keys() if isinstance(reduce_func, dict) else None,\n partition_idx=partition_idx,\n drop=drop,\n method=method,\n inplace=True,\n )\n # Result could not always be a frame, so wrapping it into DataFrame\n result = pandas.DataFrame(result)\n if result.index.name == MODIN_UNNAMED_SERIES_LABEL:\n result.index.name = None\n\n return result if finalizer_fn is None else finalizer_fn(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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.caller_GroupByReduce.caller.if_.return.default_to_pandas_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.caller_GroupByReduce.caller.if_.return.default_to_pandas_func_", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 372, "span_ids": ["GroupByReduce.caller"], "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": "class GroupByReduce(TreeReduce):\n\n @classmethod\n def caller(\n cls,\n query_compiler,\n by,\n map_func,\n reduce_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n method=None,\n default_to_pandas_func=None,\n finalizer_fn=None,\n ):\n \"\"\"\n Execute GroupBy aggregation with TreeReduce approach.\n\n Parameters\n ----------\n query_compiler : BaseQueryCompiler\n Frame to group.\n by : BaseQueryCompiler, column or index label, Grouper or list of such\n Object that determine groups.\n map_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject` at the Map phase.\n reduce_func : dict or callable(pandas.DataFrameGroupBy) -> pandas.DataFrame\n Function to apply to the `GroupByObject` at the Reduce phase.\n axis : {0, 1}\n Axis to group and apply aggregation function along. 0 means index axis\n when 1 means column axis.\n groupby_kwargs : dict\n Dictionary which carries arguments for pandas.DataFrame.groupby.\n agg_args : list-like\n Positional arguments to pass to the aggregation functions.\n agg_kwargs : dict\n Keyword arguments to pass to the aggregation functions.\n drop : bool, default: False\n Indicates whether or not by-data came from the `self` frame.\n method : str, optional\n Name of the GroupBy aggregation function. This is a hint to be able to do special casing.\n default_to_pandas_func : callable(pandas.DataFrameGroupBy) -> pandas.DataFrame, optional\n The pandas aggregation function equivalent to the `map_func + reduce_func`.\n Used in case of defaulting to pandas. If not specified `map_func` is used.\n finalizer_fn : callable(pandas.DataFrame) -> pandas.DataFrame, default: None\n A callable to execute at the end a groupby kernel against groupby result.\n\n Returns\n -------\n The same type as `query_compiler`\n QueryCompiler which carries the result of GroupBy aggregation.\n \"\"\"\n is_unsupported_axis = axis != 0\n # Defaulting to pandas in case of an empty frame as we can't process it properly.\n # Higher API level won't pass empty data here unless the frame has delayed\n # computations. So we apparently lose some laziness here (due to index access)\n # because of the inability to process empty groupby natively.\n is_empty_data = (\n len(query_compiler.columns) == 0 or len(query_compiler.index) == 0\n )\n is_grouping_using_by_arg = (\n groupby_kwargs.get(\"level\", None) is None and by is not None\n )\n is_unsupported_by_arg = isinstance(by, pandas.Grouper) or (\n not hashable(by) and not isinstance(by, type(query_compiler))\n )\n\n if (\n is_unsupported_axis\n or is_empty_data\n or (is_grouping_using_by_arg and is_unsupported_by_arg)\n ):\n if default_to_pandas_func is None:\n default_to_pandas_func = (\n (lambda grp: grp.agg(map_func))\n if isinstance(map_func, dict)\n else map_func\n )\n default_to_pandas_func = GroupByDefault.register(default_to_pandas_func)\n return default_to_pandas_func(\n query_compiler,\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\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_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.caller._The_bug_only_occurs_in__GroupByReduce.caller.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/dataframe/algebra/groupby.py_GroupByReduce.caller._The_bug_only_occurs_in__GroupByReduce.caller.return.result", "embedding": null, "metadata": {"file_path": "modin/core/dataframe/algebra/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 374, "end_line": 414, "span_ids": ["GroupByReduce.caller"], "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 GroupByReduce(TreeReduce):\n\n @classmethod\n def caller(\n cls,\n query_compiler,\n by,\n map_func,\n reduce_func,\n axis,\n groupby_kwargs,\n agg_args,\n agg_kwargs,\n drop=False,\n method=None,\n default_to_pandas_func=None,\n finalizer_fn=None,\n ):\n\n # The bug only occurs in the case of Categorical 'by', so we might want to check whether any of\n # the 'by' dtypes is Categorical before going into this branch, however triggering 'dtypes'\n # computation if they're not computed may take time, so we don't do it\n if not groupby_kwargs.get(\"sort\", True) and isinstance(\n by, type(query_compiler)\n ):\n ErrorMessage.missmatch_with_pandas(\n operation=\"df.groupby(categorical_by, sort=False)\",\n message=(\n \"the groupby keys will be sorted anyway, although the 'sort=False' was passed. \"\n + \"See the following issue for more details: \"\n + \"https://github.com/modin-project/modin/issues/3571\"\n ),\n )\n groupby_kwargs = groupby_kwargs.copy()\n groupby_kwargs[\"sort\"] = True\n\n map_fn, reduce_fn = cls.build_map_reduce_functions(\n by=by,\n axis=axis,\n groupby_kwargs=groupby_kwargs,\n map_func=map_func,\n reduce_func=reduce_func,\n agg_args=agg_args,\n agg_kwargs=agg_kwargs,\n drop=drop,\n method=method,\n finalizer_fn=finalizer_fn,\n )\n\n # If `by` is a ModinFrame, then its partitions will be broadcasted to every\n # `self` partition in a way determined by engine (modin_frame.groupby_reduce)\n # Otherwise `by` was already bound to the Map function in `build_map_reduce_functions`.\n broadcastable_by = getattr(by, \"_modin_frame\", None)\n apply_indices = list(map_func.keys()) if isinstance(map_func, dict) else None\n new_modin_frame = query_compiler._modin_frame.groupby_reduce(\n axis, broadcastable_by, map_fn, reduce_fn, apply_indices=apply_indices\n )\n\n result = query_compiler.__constructor__(new_modin_frame)\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_modin-project__modin/modin/core/io/sql/sql_dispatcher.py_SQLDispatcher._is_supported_sqlalchemy_object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/io/sql/sql_dispatcher.py_SQLDispatcher._is_supported_sqlalchemy_object_", "embedding": null, "metadata": {"file_path": "modin/core/io/sql/sql_dispatcher.py", "file_name": "sql_dispatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 178, "span_ids": ["SQLDispatcher._is_supported_sqlalchemy_object", "SQLDispatcher.write"], "tokens": 577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SQLDispatcher(FileDispatcher):\n\n @classmethod\n def _is_supported_sqlalchemy_object(cls, obj): # noqa: GL08\n supported = None\n try:\n import sqlalchemy as sa\n\n supported = isinstance(obj, (sa.engine.Engine, sa.engine.Connection))\n except ImportError:\n supported = False\n return supported\n\n @classmethod\n def write(cls, qc, **kwargs):\n \"\"\"\n Write records stored in the `qc` to a SQL database.\n\n Parameters\n ----------\n qc : BaseQueryCompiler\n The query compiler of the Modin dataframe that we want to run ``to_sql`` on.\n **kwargs : dict\n Parameters for ``pandas.to_sql(**kwargs)``.\n \"\"\"\n # we first insert an empty DF in order to create the full table in the database\n # This also helps to validate the input against pandas\n # we would like to_sql() to complete only when all rows have been inserted into the database\n # since the mapping operation is non-blocking, each partition will return an empty DF\n # so at the end, the blocking operation will be this empty DF to_pandas\n\n if not isinstance(\n kwargs[\"con\"], str\n ) and not cls._is_supported_sqlalchemy_object(kwargs[\"con\"]):\n return cls.base_io.to_sql(qc, **kwargs)\n\n # In the case that we are given a SQLAlchemy Connection or Engine, the objects\n # are not pickleable. We have to convert it to the URL string and connect from\n # each of the workers.\n if cls._is_supported_sqlalchemy_object(kwargs[\"con\"]):\n kwargs[\"con\"] = str(kwargs[\"con\"].engine.url)\n\n empty_df = qc.getitem_row_array([0]).to_pandas().head(0)\n empty_df.to_sql(**kwargs)\n # so each partition will append its respective DF\n kwargs[\"if_exists\"] = \"append\"\n columns = qc.columns\n\n def func(df): # pragma: no cover\n \"\"\"\n Override column names in the wrapped dataframe and convert it to SQL.\n\n Notes\n -----\n This function returns an empty ``pandas.DataFrame`` because ``apply_full_axis``\n expects a Frame object as a result of operation (and ``to_sql`` has no dataframe result).\n \"\"\"\n df.columns = columns\n df.to_sql(**kwargs)\n return pandas.DataFrame()\n\n # Ensure that the metadata is synchronized\n qc._modin_frame._propagate_index_objs(axis=None)\n result = qc._modin_frame.apply_full_axis(1, func, new_index=[], new_columns=[])\n cls.materialize(\n [part.list_of_blocks[0] for row in result._partitions for part in row]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.build_qc_method_GroupbyReduceImpl.build_qc_method.map_reduce_method.GroupByReduce_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.build_qc_method_GroupbyReduceImpl.build_qc_method.map_reduce_method.GroupByReduce_register_", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 93, "span_ids": ["GroupbyReduceImpl.build_qc_method"], "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 GroupbyReduceImpl:\n\n @classmethod\n def build_qc_method(cls, agg_name, finalizer_fn=None):\n \"\"\"\n Build a TreeReduce implemented query compiler method for the specified groupby aggregation.\n\n Parameters\n ----------\n agg_name : hashable\n finalizer_fn : callable(pandas.DataFrame) -> pandas.DataFrame, default: None\n A callable to execute at the end a groupby kernel against groupby result.\n\n Returns\n -------\n callable\n Function that takes query compiler and executes GroupBy aggregation\n with TreeReduce algorithm.\n \"\"\"\n map_fn, reduce_fn, d2p_fn = cls.get_impl(agg_name)\n map_reduce_method = GroupByReduce.register(\n map_fn, reduce_fn, default_to_pandas_func=d2p_fn, finalizer_fn=finalizer_fn\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_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.build_qc_method.method_GroupbyReduceImpl.build_qc_method.return.method": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/groupby.py_GroupbyReduceImpl.build_qc_method.method_GroupbyReduceImpl.build_qc_method.return.method", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/groupby.py", "file_name": "groupby.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 112, "span_ids": ["GroupbyReduceImpl.build_qc_method"], "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 GroupbyReduceImpl:\n\n @classmethod\n def build_qc_method(cls, agg_name, finalizer_fn=None):\n # ... other code\n\n def method(query_compiler, *args, **kwargs):\n if ExperimentalGroupbyImpl.get():\n try:\n if finalizer_fn is not None:\n raise NotImplementedError(\n \"Reshuffling groupby is not implemented yet when a finalizing function is specified.\"\n )\n return query_compiler._groupby_shuffle(\n *args, agg_func=agg_name, **kwargs\n )\n except NotImplementedError as e:\n ErrorMessage.warn(\n f\"Can't use experimental reshuffling groupby implementation because of: {e}\"\n + \"\\nFalling back to a TreeReduce implementation.\"\n )\n return map_reduce_method(query_compiler, *args, **kwargs)\n\n return method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._pivot_table_tree_reduce_PandasQueryCompiler._pivot_table_tree_reduce.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/core/storage_formats/pandas/query_compiler.py_PandasQueryCompiler._pivot_table_tree_reduce_PandasQueryCompiler._pivot_table_tree_reduce.return.result", "embedding": null, "metadata": {"file_path": "modin/core/storage_formats/pandas/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3798, "end_line": 3852, "span_ids": ["PandasQueryCompiler._pivot_table_tree_reduce"], "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": "@_inherit_docstrings(BaseQueryCompiler)\nclass PandasQueryCompiler(BaseQueryCompiler):\n\n def _pivot_table_tree_reduce(\n self, grouper, aggfunc, drop_column_level, fill_value, dropna, to_unstack=None\n ):\n \"\"\"\n Build a pivot table using TreeReduce implementation.\n\n Parameters\n ----------\n grouper : PandasQueryCompiler\n QueryCompiler holding columns to group on.\n aggfunc : str\n Aggregation to perform against the values of the pivot table. Note that ``GroupbyReduceImpl``\n has to be able to build implementation for this aggregation.\n drop_column_level : bool\n Whether to drop the top level of the columns.\n fill_value : object\n Fill value for None values in the result.\n dropna : bool\n Whether to drop NaN columns.\n to_unstack : list, optional\n A list of column names to pass to the `.unstack()` when building the pivot table.\n If `None` was passed perform regular transpose instead of unstacking.\n\n Returns\n -------\n PandasQueryCompiler\n A query compiler holding a pivot table.\n \"\"\"\n\n def make_pivot_table(df):\n if df.index.nlevels > 1 and to_unstack is not None:\n df = df.unstack(level=to_unstack)\n if drop_column_level and df.columns.nlevels > 1:\n df = df.droplevel(0, axis=1)\n if dropna:\n df = df.dropna(axis=1, how=\"all\")\n if fill_value is not None:\n df = df.fillna(fill_value, downcast=\"infer\")\n return df\n\n result = GroupbyReduceImpl.build_qc_method(\n aggfunc, finalizer_fn=make_pivot_table\n )(\n self,\n by=grouper,\n axis=0,\n groupby_kwargs={},\n agg_args=(),\n agg_kwargs={},\n drop=True,\n )\n\n if to_unstack is None:\n result = result.transpose()\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.join_HdkOnNativeDataframe.join._are_index_columns_in_th": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.join_HdkOnNativeDataframe.join._are_index_columns_in_th", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 964, "end_line": 1037, "span_ids": ["HdkOnNativeDataframe.join"], "tokens": 697}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def join(\n self,\n other: \"HdkOnNativeDataframe\",\n how: Optional[Union[str, JoinType]] = JoinType.INNER,\n left_on: Optional[List[str]] = None,\n right_on: Optional[List[str]] = None,\n sort: Optional[bool] = False,\n suffixes: Optional[Tuple[str]] = (\"_x\", \"_y\"),\n ):\n \"\"\"\n Join operation.\n\n Parameters\n ----------\n other : HdkOnNativeDataframe\n A frame to join with.\n how : str or modin.core.dataframe.base.utils.JoinType, default: JoinType.INNER\n A type of join.\n left_on : list of str, optional\n A list of columns for the left frame to join on.\n right_on : list of str, optional\n A list of columns for the right frame to join on.\n sort : bool, default: False\n Sort the result by join keys.\n suffixes : list-like of str, default: (\"_x\", \"_y\")\n A length-2 sequence of suffixes to add to overlapping column names\n of left and right operands respectively.\n\n Returns\n -------\n HdkOnNativeDataframe\n The new frame.\n \"\"\"\n check_join_supported(how)\n assert (\n left_on is not None and right_on is not None\n ), \"Merge with unspecified 'left_on' or 'right_on' parameter is not supported in the engine\"\n assert len(left_on) == len(\n right_on\n ), \"'left_on' and 'right_on' lengths don't match\"\n\n if other is self:\n # To avoid the self-join failure - #5891\n if isinstance(self._op, FrameNode):\n other = self.copy()\n else:\n exprs = OrderedDict((c, self.ref(c)) for c in self._table_cols)\n other = self.__constructor__(\n columns=self.columns,\n dtypes=self._dtypes_for_exprs(exprs),\n op=TransformNode(self, exprs),\n index_cols=self._index_cols,\n force_execution_mode=self._force_execution_mode,\n )\n\n orig_left_on = left_on\n orig_right_on = right_on\n left, left_on = check_cols_to_join(\"left_on\", self, left_on)\n right, right_on = check_cols_to_join(\"right_on\", other, right_on)\n for left_col, right_col in zip(left_on, right_on):\n left_dt = self._dtypes[left_col]\n right_dt = other._dtypes[right_col]\n if not (\n (is_any_int_dtype(left_dt) and is_any_int_dtype(right_dt))\n or (is_string_dtype(left_dt) and is_string_dtype(right_dt))\n or (is_datetime64_dtype(left_dt) and is_datetime64_dtype(right_dt))\n or (is_categorical_dtype(left_dt) and is_categorical_dtype(right_dt))\n ):\n raise NotImplementedError(\n f\"Join on columns of '{left_dt}' and '{right_dt}' dtypes\"\n )\n\n # If either left_on or right_on has been changed, it means that there\n # are index columns in the list. Joining by index in this case.\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.join.if_left_on_is_not_orig_l_HdkOnNativeDataframe.join.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe.join.if_left_on_is_not_orig_l_HdkOnNativeDataframe.join.return.res", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1038, "end_line": 1083, "span_ids": ["HdkOnNativeDataframe.join"], "tokens": 439}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def join(\n self,\n other: \"HdkOnNativeDataframe\",\n how: Optional[Union[str, JoinType]] = JoinType.INNER,\n left_on: Optional[List[str]] = None,\n right_on: Optional[List[str]] = None,\n sort: Optional[bool] = False,\n suffixes: Optional[Tuple[str]] = (\"_x\", \"_y\"),\n ):\n # ... other code\n if (left_on is not orig_left_on) or (right_on is not orig_right_on):\n index_cols, exprs, new_dtypes, new_columns = get_data_for_join_by_index(\n self, other, how, orig_left_on, orig_right_on, sort, suffixes\n )\n ignore_index = False\n else:\n ignore_index = True\n index_cols = None\n exprs = OrderedDict()\n new_dtypes = []\n\n new_columns, left_renamer, right_renamer = join_columns(\n left.columns, right.columns, left_on, right_on, suffixes\n )\n for old_c, new_c in left_renamer.items():\n new_dtypes.append(left._dtypes[old_c])\n exprs[new_c] = left.ref(old_c)\n\n for old_c, new_c in right_renamer.items():\n new_dtypes.append(right._dtypes[old_c])\n exprs[new_c] = right.ref(old_c)\n\n condition = left._build_equi_join_condition(right, left_on, right_on)\n\n op = JoinNode(\n left,\n right,\n how=how,\n exprs=exprs,\n condition=condition,\n )\n\n res = left.__constructor__(\n dtypes=new_dtypes,\n columns=new_columns,\n index_cols=index_cols,\n op=op,\n force_execution_mode=self._force_execution_mode,\n )\n\n if sort:\n res = res.sort_rows(\n left_on, ascending=True, ignore_index=ignore_index, na_position=\"last\"\n )\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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._build_index_cache_HdkOnNativeDataframe._build_index_cache.if_self__partitions_is_No.else_.if_isinstance_obj_pd_Da.else_.if_self__index_cols_is_No.else_.self_set_index_cache_idx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py_HdkOnNativeDataframe._build_index_cache_HdkOnNativeDataframe._build_index_cache.if_self__partitions_is_No.else_.if_isinstance_obj_pd_Da.else_.if_self__index_cols_is_No.else_.self_set_index_cache_idx_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/dataframe/dataframe.py", "file_name": "dataframe.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2053, "end_line": 2086, "span_ids": ["HdkOnNativeDataframe._build_index_cache"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframe(PandasDataframe):\n\n def _build_index_cache(self):\n \"\"\"\n Materialize index and store it in the cache.\n\n Can only be called for materialized frames.\n \"\"\"\n assert isinstance(self._op, FrameNode)\n\n if self._partitions is None:\n self.set_index_cache(Index.__new__(Index))\n else:\n obj = self._partitions[0][0].get()\n if isinstance(obj, (pd.DataFrame, pd.Series)):\n self.set_index_cache(obj.index)\n else:\n assert isinstance(obj, pyarrow.Table)\n if self._index_cols is None:\n self.set_index_cache(\n Index.__new__(RangeIndex, data=range(obj.num_rows))\n )\n else:\n # The index columns must be in the beginning of the list\n col_names = obj.column_names[len(self._index_cols) :]\n index_at = obj.drop(col_names)\n index_df = index_at.to_pandas()\n index_df.set_index(self._index_cols, inplace=True)\n idx = index_df.index\n idx.rename(demangle_index_names(self._index_cols), inplace=True)\n if (\n isinstance(idx, (pd.DatetimeIndex, pd.TimedeltaIndex))\n and len(idx) >= 3 # infer_freq() requires at least 3 values\n ):\n idx.freq = pd.infer_freq(idx)\n self.set_index_cache(idx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/db_worker.py_from_hdk_worker_import_H_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/db_worker.py_from_hdk_worker_import_H_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/db_worker.py", "file_name": "db_worker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 18, "span_ids": ["docstring"], "tokens": 21}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .hdk_worker import HdkWorker as DbWorker\n\n__all__ = [\"DbWorker\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode_FrameNode.can_execute_arrow.return.self_modin_frame__has_arr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py_FrameNode_FrameNode.can_execute_arrow.return.self_modin_frame__has_arr", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/df_algebra.py", "file_name": "df_algebra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 397, "end_line": 417, "span_ids": ["FrameNode", "FrameNode.__init__", "FrameNode.can_execute_arrow"], "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 FrameNode(DFAlgNode):\n \"\"\"\n A node to reference a materialized frame.\n\n Parameters\n ----------\n modin_frame : HdkOnNativeDataframe\n Referenced frame.\n\n Attributes\n ----------\n modin_frame : HdkOnNativeDataframe\n Referenced frame.\n \"\"\"\n\n def __init__(self, modin_frame: \"HdkOnNativeDataframe\"):\n self.modin_frame = modin_frame\n\n @_inherit_docstrings(DFAlgNode.can_execute_arrow)\n def can_execute_arrow(self) -> bool:\n return self.modin_frame._has_arrow_table()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition.py", "file_name": "partition.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 127, "span_ids": ["HdkOnNativeDataframePartition.get", "HdkOnNativeDataframePartition", "HdkOnNativeDataframePartition.__del__", "HdkOnNativeDataframePartition.to_pandas", "HdkOnNativeDataframePartition.__init__", "docstring", "HdkOnNativeDataframePartition.put", "HdkOnNativeDataframePartition.to_numpy"], "tokens": 600}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Union\n\nimport pandas\n\nimport pyarrow as pa\n\nfrom modin.core.dataframe.pandas.partitioning.partition import PandasDataframePartition\nfrom ..dataframe.utils import arrow_to_pandas\nfrom ..db_worker import DbWorker\n\n\nclass HdkOnNativeDataframePartition(PandasDataframePartition):\n \"\"\"\n A partition of ``HdkOnNativeDataframe`` frame.\n\n Class holds either a ``pandas.DataFrame`` or ``pyarrow.Table``.\n\n Parameters\n ----------\n data : pandas.DataFrame or pyarrow.Table\n Partition data in either pandas or PyArrow format.\n frame_id : str, optional\n A corresponding HDK table name or None.\n\n Attributes\n ----------\n _data : pandas.DataFrame or pyarrow.Table\n Partition data in either pandas or PyArrow format.\n frame_id : str\n A corresponding HDK table name if partition was imported\n into HDK. Otherwise None.\n _length_cache : int\n Length of the partition.\n _width_cache : int\n Width of the partition.\n \"\"\"\n\n def __init__(\n self,\n data: Union[pa.Table, pandas.DataFrame],\n frame_id: Optional[str] = None,\n ):\n self._data = data\n self.frame_id = frame_id\n if isinstance(data, pa.Table):\n self._length_cache = data.num_rows\n self._width_cache = data.num_columns\n else:\n assert isinstance(data, pandas.DataFrame)\n self._length_cache = len(data)\n self._width_cache = len(data.columns)\n\n def __del__(self):\n \"\"\"Deallocate HDK resources related to the partition.\"\"\"\n if self.frame_id is not None:\n DbWorker.dropTable(self.frame_id)\n\n def to_pandas(self):\n \"\"\"\n Transform to pandas format.\n\n Returns\n -------\n pandas.DataFrame\n \"\"\"\n obj = self.get()\n if isinstance(obj, pandas.DataFrame):\n return obj\n assert isinstance(obj, pa.Table)\n return arrow_to_pandas(obj)\n\n def to_numpy(self, **kwargs):\n \"\"\"\n Transform to NumPy format.\n\n Parameters\n ----------\n **kwargs : dict\n Additional keyword arguments to be passed in ``to_numpy``.\n\n Returns\n -------\n np.ndarray\n \"\"\"\n return self.to_pandas().to_numpy(**kwargs)\n\n def get(self):\n \"\"\"\n Get partition data.\n\n Returns\n -------\n pandas.DataFrame or pyarrow.Table\n \"\"\"\n return self._data\n\n @classmethod\n def put(cls, obj):\n \"\"\"\n Create partition from ``pandas.DataFrame`` or ``pyarrow.Table``.\n\n Parameters\n ----------\n obj : pandas.DataFrame or pyarrow.Table\n Source frame.\n\n Returns\n -------\n HdkOnNativeDataframePartition\n The new partition.\n \"\"\"\n return cls(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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager_HdkOnNativeDataframePartitionManager.from_pandas.if_len_unsupported_cols_.else_.return.cls_from_arrow_at_return": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py_HdkOnNativeDataframePartitionManager_HdkOnNativeDataframePartitionManager.from_pandas.if_len_unsupported_cols_.else_.return.cls_from_arrow_at_return", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/partitioning/partition_manager.py", "file_name": "partition_manager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 84, "span_ids": ["HdkOnNativeDataframePartitionManager.from_pandas", "HdkOnNativeDataframePartitionManager"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HdkOnNativeDataframePartitionManager(PandasDataframePartitionManager):\n \"\"\"\n Frame manager for ``HdkOnNativeDataframe``.\n\n This class handles several features of ``HdkOnNativeDataframe``:\n - frame always has a single partition\n - frame cannot process some data types\n - frame has to use mangling for index labels\n - frame uses HDK storage format for execution\n \"\"\"\n\n _partition_class = HdkOnNativeDataframePartition\n\n @classmethod\n def from_pandas(cls, df, return_dims=False, encode_col_names=True):\n \"\"\"\n Build partitions from a ``pandas.DataFrame``.\n\n Parameters\n ----------\n df : pandas.DataFrame\n Source frame.\n return_dims : bool, default: False\n Include resulting dimensions into the returned value.\n encode_col_names : bool, default: True\n Encode column names.\n\n Returns\n -------\n tuple\n Tuple holding array of partitions, list of columns with unsupported\n data and optionally partitions' dimensions.\n \"\"\"\n at, unsupported_cols = cls._get_unsupported_cols(df)\n\n if len(unsupported_cols) > 0:\n # Putting pandas frame into partitions instead of arrow table, because we know\n # that all of operations with this frame will be default to pandas and don't want\n # unnecessaries conversion pandas->arrow->pandas\n parts = [[cls._partition_class(df)]]\n if not return_dims:\n return np.array(parts), unsupported_cols\n else:\n row_lengths = [len(df)]\n col_widths = [len(df.columns)]\n return np.array(parts), row_lengths, col_widths, unsupported_cols\n else:\n # Since we already have arrow table, putting it into partitions instead\n # of pandas frame, to skip that phase when we will be putting our frame to HDK\n return cls.from_arrow(at, return_dims, unsupported_cols, encode_col_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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_left_right_on_TestMerge.test_merge_left_right_on.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_left_right_on_TestMerge.test_merge_left_right_on.None_1", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1590, "end_line": 1613, "span_ids": ["TestMerge.test_merge_left_right_on"], "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 TestMerge:\n\n @pytest.mark.parametrize(\"how\", how_values)\n @pytest.mark.parametrize(\n \"left_on, right_on\", [[\"a\", \"c\"], [[\"a\", \"b\"], [\"c\", \"b\"]]]\n )\n def test_merge_left_right_on(self, how, left_on, right_on):\n def merge(df1, df2, how, left_on, right_on, **kwargs):\n return df1.merge(df2, how=how, left_on=left_on, right_on=right_on)\n\n run_and_compare(\n merge,\n data=self.left_data,\n data2=self.right_data,\n how=how,\n left_on=left_on,\n right_on=right_on,\n )\n run_and_compare(\n merge,\n data=self.right_data,\n data2=self.left_data,\n how=how,\n left_on=right_on,\n right_on=left_on,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_self_merge_TestMerge.test_merge_float.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_self_merge_TestMerge.test_merge_float.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1615, "end_line": 1638, "span_ids": ["TestMerge.test_self_merge", "TestMerge.test_merge_float"], "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 TestMerge:\n\n def test_self_merge(self):\n def merge(df, lib, iterations, **kwargs):\n for _ in range(iterations):\n df = lib.merge(df, df)\n return df\n\n for i in range(1, 3):\n run_and_compare(\n merge,\n data={\"a\": [1]},\n iterations=i,\n )\n\n def test_merge_float(self):\n def merge(df, df2, on_columns, **kwargs):\n return df.merge(df2, on=on_columns)\n\n run_and_compare(\n merge,\n data={\"A\": [1, 2] * 1000},\n data2={\"A\": [1.0, 3.0] * 1000},\n on_columns=\"A\",\n force_lazy=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_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_categorical_TestMerge.test_merge_categorical.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_categorical_TestMerge.test_merge_categorical.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1640, "end_line": 1651, "span_ids": ["TestMerge.test_merge_categorical"], "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 TestMerge:\n\n def test_merge_categorical(self):\n def merge(df, df2, on_columns, **kwargs):\n return df.merge(df2, on=on_columns)\n\n run_and_compare(\n merge,\n data={\"A\": [1, 2] * 1000},\n data2={\"A\": [1.0, 3.0] * 1000},\n on_columns=\"A\",\n constructor_kwargs={\"dtype\": \"category\"},\n comparator=lambda df1, df2: df_equals(df1.astype(float), df2.astype(float)),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_date_TestMerge.test_merge_date.run_and_compare_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py_TestMerge.test_merge_date_TestMerge.test_merge_date.run_and_compare_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py", "file_name": "test_dataframe.py", "file_type": "text/x-python", "category": "test", "start_line": 1653, "end_line": 1672, "span_ids": ["TestMerge.test_merge_date"], "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 TestMerge:\n\n def test_merge_date(self):\n def merge(df, df2, on_columns, **kwargs):\n return df.merge(df2, on=on_columns)\n\n run_and_compare(\n merge,\n data={\n \"A\": [\n pd.Timestamp(\"2023-01-01\"),\n pd.Timestamp(\"2023-01-02\"),\n ]\n },\n data2={\n \"A\": [\n pd.Timestamp(\"2023-01-01\"),\n pd.Timestamp(\"2023-01-03\"),\n ]\n },\n on_columns=\"A\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler_DFAlgQueryCompiler.copy.return.self___constructor___self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler_DFAlgQueryCompiler.copy.return.self___constructor___self", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 223, "span_ids": ["DFAlgQueryCompiler.from_dataframe", "DFAlgQueryCompiler.copy", "DFAlgQueryCompiler.to_dataframe", "DFAlgQueryCompiler.from_pandas", "DFAlgQueryCompiler", "DFAlgQueryCompiler.__init__", "DFAlgQueryCompiler.from_arrow", "DFAlgQueryCompiler.to_pandas", "DFAlgQueryCompiler:5", "DFAlgQueryCompiler.finalize"], "tokens": 586}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n \"\"\"\n Query compiler for the HDK storage format.\n\n This class doesn't perform much processing and mostly forwards calls to\n :py:class:`~modin.experimental.core.execution.native.implementations.hdk_on_native.dataframe.dataframe.HdkOnNativeDataframe`\n for lazy execution trees build.\n\n Parameters\n ----------\n frame : HdkOnNativeDataframe\n Modin Frame to query with the compiled queries.\n shape_hint : {\"row\", \"column\", None}, default: None\n Shape hint for frames known to be a column or a row, otherwise None.\n\n Attributes\n ----------\n _modin_frame : HdkOnNativeDataframe\n Modin Frame to query with the compiled queries.\n _shape_hint : {\"row\", \"column\", None}\n Shape hint for frames known to be a column or a row, otherwise None.\n \"\"\"\n\n lazy_execution = True\n\n def __init__(self, frame, shape_hint=None):\n assert frame is not None\n self._modin_frame = frame\n if shape_hint is None and len(self._modin_frame.columns) == 1:\n shape_hint = \"column\"\n self._shape_hint = shape_hint\n\n def finalize(self):\n # TODO: implement this for HDK storage format\n raise NotImplementedError()\n\n def to_pandas(self):\n return self._modin_frame.to_pandas()\n\n @classmethod\n def from_pandas(cls, df, data_cls):\n if len(df.columns) == 1:\n shape_hint = \"column\"\n elif len(df) == 1:\n shape_hint = \"row\"\n else:\n shape_hint = None\n return cls(data_cls.from_pandas(df), shape_hint=shape_hint)\n\n @classmethod\n def from_arrow(cls, at, data_cls):\n if len(at.columns) == 1:\n shape_hint = \"column\"\n elif len(at) == 1:\n shape_hint = \"row\"\n else:\n shape_hint = None\n return cls(data_cls.from_arrow(at), shape_hint=shape_hint)\n\n # Dataframe exchange protocol\n\n def to_dataframe(self, nan_as_null: bool = False, allow_copy: bool = True):\n return self._modin_frame.__dataframe__(\n nan_as_null=nan_as_null, allow_copy=allow_copy\n )\n\n @classmethod\n def from_dataframe(cls, df, data_cls):\n return cls(data_cls.from_dataframe(df))\n\n # END Dataframe exchange protocol\n\n default_to_pandas = PandasQueryCompiler.default_to_pandas\n\n def copy(self):\n return self.__constructor__(self._modin_frame.copy(), self._shape_hint)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.getitem_column_array_DFAlgQueryCompiler.getitem_column_array.return.self___constructor___new_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_modin-project__modin/modin/experimental/core/storage_formats/hdk/query_compiler.py_DFAlgQueryCompiler.getitem_column_array_DFAlgQueryCompiler.getitem_column_array.return.self___constructor___new_", "embedding": null, "metadata": {"file_path": "modin/experimental/core/storage_formats/hdk/query_compiler.py", "file_name": "query_compiler.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 235, "span_ids": ["DFAlgQueryCompiler.getitem_column_array"], "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": "@bind_wrappers\n@_inherit_docstrings(BaseQueryCompiler)\nclass DFAlgQueryCompiler(BaseQueryCompiler):\n\n def getitem_column_array(self, key, numeric=False, ignore_order=False):\n shape_hint = \"column\" if len(key) == 1 else None\n if numeric:\n new_modin_frame = self._modin_frame.take_2d_labels_or_positional(\n col_positions=key\n )\n else:\n new_modin_frame = self._modin_frame.take_2d_labels_or_positional(\n col_labels=key\n )\n return self.__constructor__(new_modin_frame, shape_hint)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}}} \ No newline at end of file